[7015] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Extended Description |
---|
[12554] | 4 | Version: auto |
---|
[7015] | 5 | Description: Add multilinguale descriptions, banner, NMB, category name, etc... |
---|
| 6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=175 |
---|
| 7 | Author: P@t & Grum |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 11 | define('EXTENDED_DESC_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); |
---|
| 12 | load_language('plugin.lang', EXTENDED_DESC_PATH); |
---|
| 13 | |
---|
| 14 | global $conf; |
---|
| 15 | |
---|
| 16 | $extdesc_conf = array( |
---|
| 17 | 'more' => '<!--more-->', |
---|
| 18 | 'complete' => '<!--complete-->', |
---|
| 19 | 'up-down' => '<!--up-down-->', |
---|
| 20 | 'not_visible' => '<!--hidden-->', |
---|
| 21 | 'mb_not_visible' => '<!--mb-hidden-->' |
---|
| 22 | ); |
---|
| 23 | |
---|
| 24 | $conf['ExtendedDescription'] = isset($conf['ExtendedDescription']) ? |
---|
| 25 | array_merge($extdesc_conf, $conf['ExtendedDescription']) : |
---|
| 26 | $extdesc_conf; |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | // Traite les balises [lang=xx] |
---|
[12554] | 30 | function get_user_language_desc($desc, $user_lang=null) |
---|
[7015] | 31 | { |
---|
[12554] | 32 | if (is_null($user_lang)) |
---|
| 33 | { |
---|
| 34 | global $user; |
---|
| 35 | $user_lang = substr($user['language'], 0, 2); |
---|
| 36 | } |
---|
[7015] | 37 | |
---|
| 38 | if (!substr_count(strtolower($desc), '[lang=' . $user_lang . ']')) |
---|
| 39 | { |
---|
| 40 | $user_lang = 'default'; |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | if (substr_count(strtolower($desc), '[lang=' . $user_lang . ']')) |
---|
| 44 | { |
---|
| 45 | // la balise avec la langue de l'utilisateur a été trouvée |
---|
| 46 | $patterns[] = '#(^|\[/lang\])(.*?)(\[lang=(' . $user_lang . '|all)\]|$)#is'; |
---|
| 47 | $replacements[] = ''; |
---|
| 48 | $patterns[] = '#\[lang=(' . $user_lang . '|all)\](.*?)\[/lang\]#is'; |
---|
| 49 | $replacements[] = '\\1'; |
---|
| 50 | } |
---|
| 51 | else |
---|
| 52 | { |
---|
| 53 | // la balise avec la langue de l'utilisateur n'a pas été trouvée |
---|
| 54 | // On prend tout ce qui est hors balise |
---|
| 55 | $patterns[] = '#\[lang=all\](.*?)\[/lang\]#is'; |
---|
| 56 | $replacements[] = '\\1'; |
---|
| 57 | $patterns[] = '#\[lang=.*\].*\[/lang\]#is'; |
---|
| 58 | $replacements[] = ''; |
---|
| 59 | } |
---|
| 60 | return preg_replace($patterns, $replacements, $desc); |
---|
| 61 | } |
---|
| 62 | |
---|
[12554] | 63 | function get_user_language_tag_url($tag) |
---|
| 64 | { |
---|
| 65 | return get_user_language_desc($tag, get_default_language()); |
---|
| 66 | } |
---|
| 67 | |
---|
[7015] | 68 | // Traite les autres balises |
---|
| 69 | function get_extended_desc($desc, $param='') |
---|
| 70 | { |
---|
[8314] | 71 | global $conf, $page; |
---|
[7015] | 72 | |
---|
[12400] | 73 | if ($param == 'main_page_category_description' and isset($page['category']) and !isset($page['image_id']) and preg_match('#\[redirect (.*?)\]#i', $desc, $m1)) |
---|
[8314] | 74 | { |
---|
| 75 | if (preg_match('#^(img|cat|search)=(\d*)\.?(\d*|)$#i', $m1[1], $m2)) |
---|
| 76 | { |
---|
| 77 | switch ($m2[1]) |
---|
| 78 | { |
---|
| 79 | case 'img': |
---|
| 80 | $url_params = array('image_id' => $m2[2]); |
---|
| 81 | if (!empty($m2[3])) |
---|
| 82 | { |
---|
| 83 | $url_params['category'] = array('id' => $m2[3], 'name' => '', 'permalink' => ''); |
---|
| 84 | } |
---|
[9437] | 85 | $url = rtrim(make_picture_url($url_params), '-'); |
---|
[8314] | 86 | break; |
---|
| 87 | |
---|
| 88 | case 'cat': |
---|
| 89 | $url_params = array('category' => array('id' => $m2[2], 'name' => '', 'permalink' => '')); |
---|
[9437] | 90 | $url = rtrim(make_index_url($url_params), '-'); |
---|
[8314] | 91 | break; |
---|
| 92 | |
---|
| 93 | case 'search': |
---|
[9437] | 94 | $url = make_index_url(array('section' => 'search', 'search' => $m2[2])); |
---|
[8314] | 95 | } |
---|
| 96 | } |
---|
| 97 | else |
---|
| 98 | { |
---|
| 99 | $url = $m1[1]; |
---|
| 100 | } |
---|
| 101 | if (is_admin()) |
---|
| 102 | { |
---|
| 103 | global $header_notes; |
---|
| 104 | $header_notes[] = sprintf(l10n('This category is redirected to %s'), '<a href="'.$url.'">'.$url.'</a>'); |
---|
| 105 | } |
---|
| 106 | else |
---|
| 107 | { |
---|
| 108 | redirect($url); |
---|
| 109 | } |
---|
| 110 | } |
---|
| 111 | |
---|
[7015] | 112 | $desc = get_user_language_desc($desc); |
---|
| 113 | |
---|
[8314] | 114 | // Remove redirect tags for subcatify_category_description |
---|
| 115 | $patterns[] = '#\[redirect .*?\]#i'; |
---|
| 116 | $replacements[] = ''; |
---|
| 117 | |
---|
[7015] | 118 | // Balises [cat=xx] |
---|
| 119 | $patterns[] = '#\[cat=(\d*)\]#ie'; |
---|
| 120 | $replacements[] = ($param == 'subcatify_category_description') ? '' : 'get_cat_thumb("$1")'; |
---|
| 121 | |
---|
[16120] | 122 | // Balises [img=xx.yy,xx.yy,xx.yy;left|right|;name|titleName|] |
---|
[7015] | 123 | //$patterns[] = '#\[img=(\d*)\.?(\d*|);?(left|right|);?(name|titleName|)\]#ie'; |
---|
| 124 | $patterns[] = '#\[img=([\d\s\.]*);?(left|right|);?(name|titleName|)\]#ie'; |
---|
| 125 | $replacements[] = ($param == 'subcatify_category_description') ? '' : 'get_img_thumb("$1", "$2", "$3")'; |
---|
[16120] | 126 | |
---|
| 127 | // Balises [photo=xx.yy;SQ|TH|XXS|XS|S|M|L|XL|XXL] |
---|
| 128 | $patterns[] = '#\[photo=([\d\.]*);?(SQ|TH|XXS|XS|S|M|L|XL|XXL|)\]#ie'; |
---|
| 129 | $replacements[] = ($param == 'subcatify_category_description') ? '' : 'get_photo_sized("$1", "$2")'; |
---|
[7015] | 130 | |
---|
[16120] | 131 | // [random album=xx] |
---|
| 132 | $patterns[] = '#\[random\s+(?:album|cat)=\s*?(\d+)\s*?\]#ie'; |
---|
| 133 | $replacements[] = 'extdesc_get_random_photo("$1")'; |
---|
[7015] | 134 | |
---|
| 135 | // Balises <!--complete-->, <!--more--> et <!--up-down--> |
---|
| 136 | switch ($param) |
---|
| 137 | { |
---|
| 138 | case 'subcatify_category_description' : |
---|
| 139 | $patterns[] = '#^(.*?)('. preg_quote($conf['ExtendedDescription']['complete']) . '|' . preg_quote($conf['ExtendedDescription']['more']) . '|' . preg_quote($conf['ExtendedDescription']['up-down']) . ').*$#is'; |
---|
| 140 | $replacements[] = '$1'; |
---|
| 141 | $desc = preg_replace($patterns, $replacements, $desc); |
---|
| 142 | break; |
---|
| 143 | |
---|
| 144 | case 'main_page_category_description' : |
---|
| 145 | $patterns[] = '#^.*' . preg_quote($conf['ExtendedDescription']['complete']) . '|' . preg_quote($conf['ExtendedDescription']['more']) . '#is'; |
---|
| 146 | $replacements[] = ''; |
---|
| 147 | $desc = preg_replace($patterns, $replacements, $desc); |
---|
| 148 | if (substr_count($desc, $conf['ExtendedDescription']['up-down'])) |
---|
| 149 | { |
---|
[10754] | 150 | list($desc, $conf['ExtendedDescription']['bottom_comment']) = explode($conf['ExtendedDescription']['up-down'], $desc); |
---|
| 151 | add_event_handler('loc_end_index', 'add_bottom_description'); |
---|
[7015] | 152 | } |
---|
| 153 | break; |
---|
| 154 | |
---|
| 155 | default: |
---|
| 156 | $desc = preg_replace($patterns, $replacements, $desc); |
---|
| 157 | } |
---|
| 158 | |
---|
| 159 | return $desc; |
---|
| 160 | } |
---|
| 161 | |
---|
| 162 | function extended_desc_mail_group_assign_vars($assign_vars) |
---|
| 163 | { |
---|
| 164 | if (isset($assign_vars['CPL_CONTENT'])) |
---|
| 165 | { |
---|
| 166 | $assign_vars['CPL_CONTENT'] = get_extended_desc($assign_vars['CPL_CONTENT']); |
---|
| 167 | } |
---|
| 168 | return $assign_vars; |
---|
| 169 | } |
---|
| 170 | |
---|
[10754] | 171 | // Add bottom description |
---|
| 172 | function add_bottom_description() |
---|
[7015] | 173 | { |
---|
| 174 | global $template, $conf; |
---|
[10754] | 175 | $template->concat('PLUGIN_INDEX_CONTENT_END', ' |
---|
[7015] | 176 | <div class="additional_info"> |
---|
[10754] | 177 | ' . $conf['ExtendedDescription']['bottom_comment'] . ' |
---|
[7015] | 178 | </div>'); |
---|
| 179 | } |
---|
| 180 | |
---|
| 181 | // Remove a category |
---|
| 182 | function ext_remove_cat($tpl_var, $categories) |
---|
| 183 | { |
---|
| 184 | global $conf; |
---|
| 185 | |
---|
| 186 | $i=0; |
---|
| 187 | while($i<count($tpl_var)) |
---|
| 188 | { |
---|
| 189 | if (substr_count($tpl_var[$i]['NAME'], $conf['ExtendedDescription']['not_visible'])) |
---|
| 190 | { |
---|
| 191 | array_splice($tpl_var, $i, 1); |
---|
| 192 | } |
---|
| 193 | else |
---|
| 194 | { |
---|
| 195 | $i++; |
---|
| 196 | } |
---|
| 197 | } |
---|
| 198 | |
---|
| 199 | return $tpl_var; |
---|
| 200 | } |
---|
| 201 | |
---|
| 202 | // Remove a category from menubar |
---|
| 203 | function ext_remove_menubar_cats($where) |
---|
| 204 | { |
---|
| 205 | global $conf; |
---|
| 206 | |
---|
| 207 | $query = 'SELECT id, uppercats |
---|
| 208 | FROM '.CATEGORIES_TABLE.' |
---|
| 209 | WHERE name LIKE "%'.$conf['ExtendedDescription']['mb_not_visible'].'%"'; |
---|
| 210 | |
---|
| 211 | $result = pwg_query($query); |
---|
| 212 | while ($row = mysql_fetch_assoc($result)) |
---|
| 213 | { |
---|
| 214 | $ids[] = $row['id']; |
---|
| 215 | $where .= ' |
---|
| 216 | AND uppercats NOT LIKE "'.$row['uppercats'].',%"'; |
---|
| 217 | } |
---|
| 218 | if (!empty($ids)) |
---|
| 219 | { |
---|
| 220 | $where .= ' |
---|
| 221 | AND id NOT IN ('.implode(',', $ids).')'; |
---|
| 222 | } |
---|
| 223 | return $where; |
---|
| 224 | } |
---|
| 225 | |
---|
| 226 | // Remove an image |
---|
| 227 | function ext_remove_image($tpl_var, $pictures) |
---|
| 228 | { |
---|
| 229 | global $conf; |
---|
| 230 | |
---|
| 231 | $i=0; |
---|
| 232 | while($i<count($tpl_var)) |
---|
| 233 | { |
---|
| 234 | if (substr_count($pictures[$i]['name'], $conf['ExtendedDescription']['not_visible'])) |
---|
| 235 | { |
---|
| 236 | array_splice($tpl_var, $i, 1); |
---|
| 237 | array_splice($pictures, $i, 1); |
---|
| 238 | } |
---|
| 239 | else |
---|
| 240 | { |
---|
| 241 | $i++; |
---|
| 242 | } |
---|
| 243 | } |
---|
| 244 | |
---|
| 245 | return $tpl_var; |
---|
| 246 | } |
---|
| 247 | |
---|
| 248 | // Return html code for caterogy thumb |
---|
| 249 | function get_cat_thumb($elem_id) |
---|
| 250 | { |
---|
[12400] | 251 | global $template, $user; |
---|
[7015] | 252 | |
---|
[16119] | 253 | $query = ' |
---|
| 254 | SELECT |
---|
| 255 | cat.id, |
---|
| 256 | cat.name, |
---|
| 257 | cat.comment, |
---|
| 258 | cat.representative_picture_id, |
---|
| 259 | cat.permalink, |
---|
| 260 | uc.nb_images, |
---|
| 261 | uc.count_images, |
---|
| 262 | uc.count_categories, |
---|
| 263 | img.path |
---|
[12400] | 264 | FROM ' . CATEGORIES_TABLE . ' AS cat |
---|
[16119] | 265 | INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' as uc |
---|
| 266 | ON cat.id = uc.cat_id AND uc.user_id = '.$user['id'].' |
---|
| 267 | INNER JOIN ' . IMAGES_TABLE . ' AS img |
---|
| 268 | ON img.id = uc.user_representative_picture_id |
---|
[12400] | 269 | WHERE cat.id = ' . $elem_id . ';'; |
---|
[7015] | 270 | $result = pwg_query($query); |
---|
| 271 | |
---|
[12400] | 272 | if($result and $category = mysql_fetch_array($result)) |
---|
[7015] | 273 | { |
---|
| 274 | $template->set_filename('extended_description_content', dirname(__FILE__) . '/template/cat.tpl'); |
---|
[12400] | 275 | |
---|
| 276 | $template->assign( |
---|
| 277 | array( |
---|
| 278 | 'ID' => $category['id'], |
---|
[16119] | 279 | 'TN_SRC' => DerivativeImage::thumb_url(array( |
---|
| 280 | 'id' => $category['representative_picture_id'], |
---|
| 281 | 'path' => $category['path'], |
---|
| 282 | )), |
---|
[12400] | 283 | 'TN_ALT' => strip_tags($category['name']), |
---|
| 284 | 'URL' => make_index_url(array('category' => $category)), |
---|
| 285 | 'CAPTION_NB_IMAGES' => get_display_images_count |
---|
| 286 | ( |
---|
| 287 | $category['nb_images'], |
---|
| 288 | $category['count_images'], |
---|
| 289 | $category['count_categories'], |
---|
| 290 | true, |
---|
| 291 | '<br />' |
---|
| 292 | ), |
---|
| 293 | 'DESCRIPTION' => |
---|
| 294 | trigger_event('render_category_literal_description', |
---|
| 295 | trigger_event('render_category_description', |
---|
| 296 | @$category['comment'], |
---|
| 297 | 'subcatify_category_description')), |
---|
| 298 | 'NAME' => trigger_event( |
---|
| 299 | 'render_category_name', |
---|
| 300 | $category['name'], |
---|
| 301 | 'subcatify_category_name' |
---|
| 302 | ), |
---|
| 303 | ) |
---|
| 304 | ); |
---|
| 305 | |
---|
[7015] | 306 | return $template->parse('extended_description_content', true); |
---|
| 307 | } |
---|
| 308 | return ''; |
---|
| 309 | } |
---|
| 310 | |
---|
| 311 | // Return html code for img thumb |
---|
| 312 | //function get_img_thumb($elem_id, $cat_id='', $align='', $name='') |
---|
| 313 | function get_img_thumb($elem_ids, $align='', $name='') |
---|
| 314 | { |
---|
| 315 | global $template; |
---|
| 316 | |
---|
| 317 | $ids=explode(" ",$elem_ids); |
---|
| 318 | $assoc = array(); |
---|
| 319 | foreach($ids as $key=>$val) |
---|
| 320 | { |
---|
| 321 | list($a,$b)=array_pad(explode(".",$val),2,""); |
---|
[16119] | 322 | $assoc[$a] = $b; |
---|
[7015] | 323 | } |
---|
| 324 | |
---|
[16119] | 325 | $query = 'SELECT * FROM ' . IMAGES_TABLE . ' WHERE id in (' . implode(',', array_keys($assoc)) . ');'; |
---|
[7015] | 326 | $result = pwg_query($query); |
---|
| 327 | |
---|
| 328 | if($result) |
---|
| 329 | { |
---|
| 330 | $template->set_filename('extended_description_content', dirname(__FILE__) . '/template/img.tpl'); |
---|
| 331 | |
---|
| 332 | $imglist=array(); |
---|
| 333 | while ($picture = mysql_fetch_array($result)) |
---|
| 334 | { |
---|
| 335 | $imglist[$picture["id"]]=$picture; |
---|
| 336 | } |
---|
| 337 | |
---|
| 338 | $img=array(); |
---|
[16119] | 339 | foreach ($imglist as $id => $picture) |
---|
[7015] | 340 | { |
---|
[16119] | 341 | if (!empty($assoc[$id])) |
---|
[7015] | 342 | { |
---|
| 343 | $url = make_picture_url(array( |
---|
[16119] | 344 | 'image_id' => $picture['id'], |
---|
[7015] | 345 | 'category' => array( |
---|
[16119] | 346 | 'id' => $assoc[$id], |
---|
[7015] | 347 | 'name' => '', |
---|
| 348 | 'permalink' => ''))); |
---|
| 349 | } |
---|
| 350 | else |
---|
| 351 | { |
---|
[16119] | 352 | $url = make_picture_url(array('image_id' => $picture['id'])); |
---|
[7015] | 353 | } |
---|
[16119] | 354 | |
---|
[7015] | 355 | $img[]=array( |
---|
[16119] | 356 | 'ID' => $picture['id'], |
---|
| 357 | 'IMAGE' => DerivativeImage::thumb_url($picture), |
---|
| 358 | 'IMAGE_ALT' => $picture['file'], |
---|
| 359 | 'IMG_TITLE' => ($name=="titleName")?htmlspecialchars($picture['name'], ENT_QUOTES):get_thumbnail_title($picture, $picture['name'], null), |
---|
[7015] | 360 | 'U_IMG_LINK' => $url, |
---|
[16119] | 361 | 'LEGEND' => ($name=="name")?$picture['name']:"", |
---|
| 362 | 'COMMENT' => $picture['file'], |
---|
| 363 | ); |
---|
[7015] | 364 | } |
---|
[16119] | 365 | |
---|
| 366 | $template->assign('img', $img); |
---|
| 367 | $template->assign('FLOAT', !empty($align) ? 'float: ' . $align . ';' : ''); |
---|
[7015] | 368 | return $template->parse('extended_description_content', true); |
---|
| 369 | } |
---|
| 370 | return ''; |
---|
| 371 | } |
---|
| 372 | |
---|
[16120] | 373 | // Return html code for a photo |
---|
| 374 | function get_photo_sized($elem_id, $size) |
---|
| 375 | { |
---|
| 376 | global $template; |
---|
[7015] | 377 | |
---|
[16120] | 378 | list($image_id, $cat_id) = array_pad(explode(".",$elem_id), 2, ""); |
---|
| 379 | |
---|
| 380 | $size_map = array( |
---|
| 381 | 'SQ' => IMG_SQUARE, |
---|
| 382 | 'TH' => IMG_THUMB, |
---|
| 383 | 'XXS' => IMG_XXSMALL, |
---|
| 384 | 'XS' => IMG_XSMALL, |
---|
| 385 | 'S' => IMG_SMALL, |
---|
| 386 | 'M' => IMG_MEDIUM, |
---|
| 387 | 'L' => IMG_LARGE, |
---|
| 388 | 'XL' => IMG_XLARGE, |
---|
| 389 | 'XXL' => IMG_XXLARGE, |
---|
| 390 | ); |
---|
| 391 | |
---|
| 392 | if (empty($size)) $size = 'M'; |
---|
| 393 | $deriv_type = $size_map[ strtoupper($size) ]; |
---|
| 394 | |
---|
| 395 | $query = 'SELECT * FROM ' . IMAGES_TABLE . ' WHERE id = '.$image_id.';'; |
---|
| 396 | $result = pwg_query($query); |
---|
| 397 | |
---|
| 398 | if ($result) |
---|
| 399 | { |
---|
| 400 | $template->set_filename('extended_description_content', 'picture_content.tpl'); |
---|
| 401 | |
---|
| 402 | $picture = mysql_fetch_assoc($result); |
---|
| 403 | |
---|
| 404 | // url |
---|
| 405 | if (!empty($cat_id)) |
---|
| 406 | { |
---|
| 407 | $url = make_picture_url(array( |
---|
| 408 | 'image_id' => $picture['id'], |
---|
| 409 | 'category' => array( |
---|
| 410 | 'id' => $cat_id, |
---|
| 411 | 'name' => '', |
---|
| 412 | 'permalink' => ''))); |
---|
| 413 | } |
---|
| 414 | else |
---|
| 415 | { |
---|
| 416 | $url = make_picture_url(array('image_id' => $picture['id'])); |
---|
| 417 | } |
---|
| 418 | |
---|
| 419 | // image |
---|
| 420 | $src_image = new SrcImage($picture); |
---|
| 421 | $derivatives = DerivativeImage::get_all($src_image); |
---|
| 422 | $selected_derivative = $derivatives[$deriv_type]; |
---|
| 423 | |
---|
| 424 | $template->assign(array( |
---|
| 425 | 'current' => array( |
---|
| 426 | 'selected_derivative' => $selected_derivative, |
---|
| 427 | 'TITLE' => $picture['name'], |
---|
| 428 | ), |
---|
| 429 | 'ALT_IMG' => $picture['file'], |
---|
| 430 | )); |
---|
| 431 | if (!empty($picture['comment'])) |
---|
| 432 | { |
---|
| 433 | $template-assign('COMMENT_IMG', trigger_event('render_element_description', $picture['comment'])); |
---|
| 434 | } |
---|
| 435 | |
---|
| 436 | return '<a href="'.$url.'">'.$template->parse('extended_description_content', true).'</a>'; |
---|
| 437 | } |
---|
| 438 | |
---|
| 439 | return ''; |
---|
| 440 | } |
---|
| 441 | |
---|
| 442 | |
---|
| 443 | |
---|
[12400] | 444 | function extdesc_get_random_photo($category_id) |
---|
| 445 | { |
---|
| 446 | include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); |
---|
| 447 | |
---|
| 448 | $query = ' |
---|
| 449 | SELECT |
---|
| 450 | id, |
---|
| 451 | path |
---|
| 452 | FROM '.IMAGES_TABLE.' |
---|
| 453 | JOIN '.IMAGE_CATEGORY_TABLE.' ON image_id = id |
---|
| 454 | WHERE category_id = '.$category_id.' |
---|
| 455 | ORDER BY '.DB_RANDOM_FUNCTION.'() |
---|
| 456 | LIMIT 1 |
---|
| 457 | ;'; |
---|
| 458 | $result = pwg_query($query); |
---|
| 459 | while ($row = pwg_db_fetch_assoc($result)) |
---|
| 460 | { |
---|
| 461 | return '<img src="'.get_element_url($row).'">'; |
---|
| 462 | } |
---|
| 463 | |
---|
| 464 | return ''; |
---|
| 465 | } |
---|
| 466 | |
---|
[7015] | 467 | if (script_basename() == 'admin' or script_basename() == 'popuphelp') |
---|
| 468 | { |
---|
| 469 | include(EXTENDED_DESC_PATH . 'admin.inc.php'); |
---|
| 470 | } |
---|
| 471 | |
---|
| 472 | add_event_handler ('render_page_banner', 'get_user_language_desc'); |
---|
| 473 | add_event_handler ('render_category_name', 'get_user_language_desc'); |
---|
| 474 | add_event_handler ('render_category_description', 'get_extended_desc', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
[12260] | 475 | add_event_handler ('render_tag_name', 'get_user_language_desc'); |
---|
[12554] | 476 | add_event_handler ('render_tag_url', 'get_user_language_tag_url', 40); |
---|
[7015] | 477 | add_event_handler ('render_element_description', 'get_extended_desc'); |
---|
| 478 | add_event_handler ('nbm_render_user_customize_mail_content', 'get_extended_desc'); |
---|
| 479 | add_event_handler ('mail_group_assign_vars', 'extended_desc_mail_group_assign_vars'); |
---|
| 480 | add_event_handler ('loc_end_index_category_thumbnails', 'ext_remove_cat', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
| 481 | add_event_handler ('loc_end_index_thumbnails', 'ext_remove_image', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
| 482 | add_event_handler ('get_categories_menu_sql_where', 'ext_remove_menubar_cats'); |
---|
| 483 | ?> |
---|