aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/permalinks.php8
-rw-r--r--include/dblayer/functions_mysql.inc.php4
-rw-r--r--include/functions_category.inc.php4
-rw-r--r--install/piwigo_structure-pdo-sqlite.sql13
-rw-r--r--install/piwigo_structure-pgsql.sql15
-rw-r--r--install/piwigo_structure-sqlite.sql13
6 files changed, 51 insertions, 6 deletions
diff --git a/admin/permalinks.php b/admin/permalinks.php
index 342bf44d5..f12dbc7d0 100644
--- a/admin/permalinks.php
+++ b/admin/permalinks.php
@@ -98,8 +98,8 @@ elseif ( isset($_GET['delete_permanent']) and !is_adviser() )
DELETE FROM '.OLD_PERMALINKS_TABLE.'
WHERE permalink="'.$_GET['delete_permanent'].'"
LIMIT 1';
- pwg_query($query);
- if (pwg_db_affected_rows()==0)
+ $result = pwg_query($query);
+ if (pwg_db_changes($result)==0)
array_push($page['errors'], l10n('Cannot delete the old permalink !'));
}
@@ -108,8 +108,8 @@ $template->set_filename('permalinks', 'permalinks.tpl' );
$query = '
SELECT
- id,
- '.pwg_db_concat(array('id', '\' - \'', 'name', 'IF(permalink IS NULL, \'\', \' √\')')).' AS name,
+ id, permalink,
+ '.pwg_db_concat(array('id', '\' - \'', 'name')).' AS name,
uppercats, global_rank
FROM '.CATEGORIES_TABLE;
diff --git a/include/dblayer/functions_mysql.inc.php b/include/dblayer/functions_mysql.inc.php
index 8f757ac30..24b075f85 100644
--- a/include/dblayer/functions_mysql.inc.php
+++ b/include/dblayer/functions_mysql.inc.php
@@ -124,7 +124,7 @@ SELECT IF(MAX('.$column.')+1 IS NULL, 1, MAX('.$column.')+1)
function pwg_db_changes($result)
{
- return mysql_affected_rows($result);
+ return mysql_affected_rows();
}
function pwg_db_num_rows($result)
@@ -461,7 +461,7 @@ function do_maintenance_all_tables()
function pwg_db_concat($array)
{
$string = implode($array, ',');
- return 'CONCAT(\''. $string.'\')';
+ return 'CONCAT('. $string.')';
}
function pwg_db_concat_ws($array, $separator)
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php
index 4ce30a75a..187ecbe8f 100644
--- a/include/functions_category.inc.php
+++ b/include/functions_category.inc.php
@@ -311,6 +311,10 @@ function display_select_categories($categories,
$tpl_cats = array();
foreach ($categories as $category)
{
+ if (!empty($category['permalink']))
+ {
+ $category['name'] .= ' √';
+ }
if ($fullname)
{
$option = get_cat_display_name_cache($category['uppercats'],
diff --git a/install/piwigo_structure-pdo-sqlite.sql b/install/piwigo_structure-pdo-sqlite.sql
index 56022d66a..34d4fa0c4 100644
--- a/install/piwigo_structure-pdo-sqlite.sql
+++ b/install/piwigo_structure-pdo-sqlite.sql
@@ -341,6 +341,19 @@ CREATE TABLE piwigo_tags
CREATE INDEX "tags_i1" ON "piwigo_tags" ("url_name");
-----------------------------------------------------------------------------
+-- piwigo_themes
+-----------------------------------------------------------------------------
+
+DROP TABLE IF EXISTS "piwigo_themes" CASCADE;
+CREATE TABLE "piwigo_themes"
+(
+ "id" varchar(64) default '' NOT NULL,
+ "version" varchar(64) NOT NULL default '0',
+ "name" varchar(64) default NULL,
+ PRIMARY KEY ("id")
+);
+
+-----------------------------------------------------------------------------
-- piwigo_upgrade
-----------------------------------------------------------------------------
diff --git a/install/piwigo_structure-pgsql.sql b/install/piwigo_structure-pgsql.sql
index ae32d52d6..e3b830eb0 100644
--- a/install/piwigo_structure-pgsql.sql
+++ b/install/piwigo_structure-pgsql.sql
@@ -415,6 +415,21 @@ SET search_path TO public;
CREATE INDEX "tags_i1" ON "piwigo_tags" ("url_name");
-----------------------------------------------------------------------------
+-- piwigo_themes
+-----------------------------------------------------------------------------
+
+DROP TABLE IF EXISTS "piwigo_themes" CASCADE;
+CREATE TABLE "piwigo_themes"
+(
+ "id" varchar(64) default '' NOT NULL,
+ "version" varchar(64) NOT NULL default '0',
+ "name" varchar(64) default NULL,
+ PRIMARY KEY ("id")
+);
+
+COMMENT ON TABLE "piwigo_themes" IS '';
+
+-----------------------------------------------------------------------------
-- piwigo_upgrade
-----------------------------------------------------------------------------
diff --git a/install/piwigo_structure-sqlite.sql b/install/piwigo_structure-sqlite.sql
index 56022d66a..34d4fa0c4 100644
--- a/install/piwigo_structure-sqlite.sql
+++ b/install/piwigo_structure-sqlite.sql
@@ -341,6 +341,19 @@ CREATE TABLE piwigo_tags
CREATE INDEX "tags_i1" ON "piwigo_tags" ("url_name");
-----------------------------------------------------------------------------
+-- piwigo_themes
+-----------------------------------------------------------------------------
+
+DROP TABLE IF EXISTS "piwigo_themes" CASCADE;
+CREATE TABLE "piwigo_themes"
+(
+ "id" varchar(64) default '' NOT NULL,
+ "version" varchar(64) NOT NULL default '0',
+ "name" varchar(64) default NULL,
+ PRIMARY KEY ("id")
+);
+
+-----------------------------------------------------------------------------
-- piwigo_upgrade
-----------------------------------------------------------------------------