Changeset 8847 for extensions/Piwecard/include/ecard.class.php
- Timestamp:
- Jan 23, 2011, 12:13:49 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Piwecard/include/ecard.class.php
r8771 r8847 350 350 351 351 352 if (($page['section']) == 'categories' AND !empty($page['category'])) // only on category page! 352 // if (($page['section']) == 'categories' AND !empty($page['category'])) // only on category page! 353 if (isset($page['section'])) 353 354 { 354 355 355 356 356 357 $upper_names = null; 357 // get all upper categories from the image category to test 358 // - if the parameter for "recursiv" is OK 359 // - if the upper category is activated for this function 360 $query = 'SELECT * 361 FROM '.CATEGORIES_TABLE.' 362 WHERE id = '.$page['category']['id'].' 363 ;'; 364 $cat = mysql_fetch_assoc(pwg_query($query)); 365 if (empty($cat)) 366 { 367 $upper_ids = null; 358 359 if ( !empty($page['category'])) 360 { 361 // get all upper categories from the image category to test 362 // - if the parameter for "recursiv" is OK 363 // - if the upper category is activated for this function 364 $query = 'SELECT * 365 FROM '.CATEGORIES_TABLE.' 366 WHERE id = '.$page['category']['id'].' 367 ;'; 368 $cat = mysql_fetch_assoc(pwg_query($query)); 369 if (empty($cat)) 370 { 371 $upper_ids = null; 372 } 373 else 374 { 375 foreach ($cat as $k => $v) 376 { 377 // If the field is true or false, the variable is transformed into a 378 // boolean value. 379 if ($cat[$k] == 'true' or $cat[$k] == 'false') 380 { 381 $cat[$k] = get_boolean( $cat[$k] ); 382 } 383 } 384 $upper_ids = explode(',', $cat['uppercats']); 385 } 368 386 } 369 else 370 { 371 foreach ($cat as $k => $v) 372 { 373 // If the field is true or false, the variable is transformed into a 374 // boolean value. 375 if ($cat[$k] == 'true' or $cat[$k] == 'false') 376 { 377 $cat[$k] = get_boolean( $cat[$k] ); 378 } 379 } 380 $upper_ids = explode(',', $cat['uppercats']); 381 } 382 387 383 388 if ($this->my_config['user_cat']) // !Function anly allowed on user image 384 389 { … … 432 437 // only on available cats 433 438 if ( $this->my_config['allcats'] // Available on all cats 434 OR ( in_array($page['category']['id'], $this->my_config['cats'])) // Available on specific cats439 OR ( !empty($page['category']) AND in_array($page['category']['id'], $this->my_config['cats'])) // Available on specific cats 435 440 OR ($this->my_config['recursive'] AND isset($upper_ids) AND // Available on upper cats this recursiv mode 436 441 (array_intersect($upper_ids, $this->my_config['cats']) != array())) … … 566 571 case 0 : // text 567 572 // Get the standard message (in admin param) and parse it with the informations 568 $messagemail = htmlspecialchars_decode($this->parse($this->my_config['message_link'], $_POST, $image_element));573 $messagemail = stripslashes(htmlspecialchars_decode($this->parse($this->my_config['message_link'], $_POST, $image_element))); 569 574 570 575 $mail_arg=array('from' => $_POST['votremail'], … … 577 582 break; 578 583 case 1 : // html 579 $messagemailHTML = htmlspecialchars_decode($this->parse($this->my_config['message_HTML'], $_POST, $image_element));584 $messagemailHTML = stripslashes(htmlspecialchars_decode($this->parse($this->my_config['message_HTML'], $_POST, $image_element))); 580 585 581 586 $mail_arg=array('from' => $_POST['votremail'],
Note: See TracChangeset
for help on using the changeset viewer.