Ignore:
Timestamp:
Jan 23, 2011, 12:13:49 AM (13 years ago)
Author:
tiico
Message:

Version 1.0.2

  • Correct mail format error (slash)
  • Open function on specials pages (random items, best rates). For the moment, it's only possible if the plugin is active on all categories...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Piwecard/include/ecard.class.php

    r8771 r8847  
    350350
    351351               
    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']))
    353354                {
    354355               
    355356       
    356357                        $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                }
    368386                        }
    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           
    383388                        if ($this->my_config['user_cat'])       // !Function anly allowed on user image
    384389                        {
     
    432437                // only on available cats
    433438                        if ( $this->my_config['allcats']                // Available on all cats
    434                                 OR (in_array($page['category']['id'], $this->my_config['cats']))        // Available on specific cats
     439                                OR ( !empty($page['category']) AND in_array($page['category']['id'], $this->my_config['cats'])) // Available on specific cats
    435440                                OR ($this->my_config['recursive'] AND isset($upper_ids) AND                             // Available on upper cats this recursiv mode
    436441                                                (array_intersect($upper_ids, $this->my_config['cats']) != array()))
     
    566571                                                case 0 : // text
    567572                                                        // 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)));
    569574
    570575                                                        $mail_arg=array('from' => $_POST['votremail'],
     
    577582                                                        break;
    578583                                                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)));
    580585
    581586                                                        $mail_arg=array('from' => $_POST['votremail'],
Note: See TracChangeset for help on using the changeset viewer.