Changeset 10852 for extensions/Back2Front/maintain.inc.php
- Timestamp:
- May 11, 2011, 7:17:49 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Back2Front/maintain.inc.php
r10821 r10852 1 1 <?php 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 4 include_once(PHPWG_PLUGINS_PATH.'back2front/functions.inc.php'); 3 5 4 6 function plugin_install() { … … 34 36 /* config parameter */ 35 37 pwg_query("INSERT INTO `" . CONFIG_TABLE . "` 36 VALUES ('back2front', '".$versos_cat['id']." ', 'Configuration for Back2Front plugin');");38 VALUES ('back2front', '".$versos_cat['id'].",click,none', 'Configuration for Back2Front plugin');"); 37 39 } 38 40 … … 53 55 while ($item = pwg_db_fetch_assoc($images_versos)) 54 56 { 55 /* catch current verso categories */ 56 $versos_infos = pwg_query("SELECT category_id FROM ".IMAGE_CATEGORY_TABLE." WHERE image_id = ".$item['verso_id'].";"); 57 while (list($verso_cat) = pwg_db_fetch_row($versos_infos)) 58 { 59 $item['current_verso_cats'][] = $verso_cat; 60 } 61 62 /* if verso 'versos' cat only */ 63 if (count($item['current_verso_cats']) == 1 AND $item['current_verso_cats'][0] == $conf['back2front'][0]) 64 { 65 foreach (explode(',',$item['categories']) as $cat) 66 { 67 $datas[] = array( 68 'image_id' => $item['verso_id'], 69 'category_id' => $cat, 70 ); 71 } 72 } 73 74 pwg_query("DELETE FROM ".IMAGE_CATEGORY_TABLE." 75 WHERE image_id = ".$item['verso_id']." AND category_id = ".$conf['back2front'][0].";"); 76 } 77 78 if (isset($datas)) 79 { 80 mass_inserts( 81 IMAGE_CATEGORY_TABLE, 82 array('image_id', 'category_id'), 83 $datas 84 ); 57 back2front_restaure_categories($item); 85 58 } 86 59 87 60 pwg_query("DROP TABLE `" . $prefixeTable . "image_verso`;"); 88 61 pwg_query("DELETE FROM `" . CONFIG_TABLE . "` WHERE param = 'back2front';"); 89 62 pwg_query("DELETE FROM `" . CATEGORIES_TABLE ."`WHERE id = ".$conf['back2front'][0].";");
Note: See TracChangeset
for help on using the changeset viewer.