Ignore:
Timestamp:
May 11, 2011, 7:17:49 PM (13 years ago)
Author:
mistic100
Message:

improve process, add options for link effect

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Back2Front/maintain.inc.php

    r10821 r10852  
    11<?php
    22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     3
     4include_once(PHPWG_PLUGINS_PATH.'back2front/functions.inc.php');
    35
    46function plugin_install() {
     
    3436  /* config parameter */
    3537  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');");
    3739}
    3840
     
    5355  while ($item = pwg_db_fetch_assoc($images_versos))
    5456  {
    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);
    8558  }
    8659
    87         pwg_query("DROP TABLE `" . $prefixeTable . "image_verso`;");
     60  pwg_query("DROP TABLE `" . $prefixeTable . "image_verso`;");
    8861  pwg_query("DELETE FROM `" . CONFIG_TABLE . "` WHERE param = 'back2front';");
    8962  pwg_query("DELETE FROM `" . CATEGORIES_TABLE ."`WHERE id = ".$conf['back2front'][0].";");
Note: See TracChangeset for help on using the changeset viewer.