Ignore:
Timestamp:
12/10/2008 04:45:22 PM (3 years ago)
Author:
Ernest0x
Message:

PHP 5.x fixes (mostly fixes for warnings and notices)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/pages/mynodes/mynodes.php

    r152 r187  
    307307                                unset($p); 
    308308                        } 
    309                         if ($table_photosview->data[$p]['view_point'] == $value) { 
     309                        if (isset($p) && ($table_photosview->data[$p]['view_point'] == $value)) { 
    310310                                $table_photosview->data[$p]['photo'] = $vars['folders']['photos'].'photo-'.$table_photosview->data[$p]['id'].'-s.jpg'; 
    311311                                $t[$i] = $table_photosview->data[$p]; 
     
    324324        function output() { 
    325325                if (get('subpage') != '') return $this->page->output(); 
    326                 if (strstr($_POST['form_name'], 'table_links_ap') !== FALSE) return $this->output_onpost_table_links_ap(); 
     326                if (isset($_POST['form_name']) && (strstr($_POST['form_name'], 'table_links_ap') !== FALSE)) return $this->output_onpost_table_links_ap(); 
    327327                if ($_SERVER['REQUEST_METHOD'] == 'POST' && method_exists($this, 'output_onpost_'.$_POST['form_name'])) return call_user_func(array($this, 'output_onpost_'.$_POST['form_name'])); 
    328328                global $construct, $main, $db; 
     
    539539        function output_onpost_table_photosview() { 
    540540                global $vars, $db, $main; 
    541                 foreach( (array) $_POST['id'] as $key => $value) { 
    542                         $db->del("photos", "id = '".$value."'"); 
    543                         $uploaddir = $vars['folders']['photos']; 
    544                         $filename = 'photo-'.$value.".*"; 
    545                         delfile(ROOT_PATH.$uploaddir.$filename); 
    546                         $filename = 'photo-'.$value."-*.*"; 
    547                         delfile(ROOT_PATH.$uploaddir.$filename); 
     541                if (isset($_POST['id'])) { 
     542                        foreach( (array) $_POST['id'] as $key => $value) { 
     543                                $db->del("photos", "id = '".$value."'"); 
     544                                $uploaddir = $vars['folders']['photos']; 
     545                                $filename = 'photo-'.$value.".*"; 
     546                                delfile(ROOT_PATH.$uploaddir.$filename); 
     547                                $filename = 'photo-'.$value."-*.*"; 
     548                                delfile(ROOT_PATH.$uploaddir.$filename); 
     549                        } 
    548550                } 
    549551                foreach( (array) array('N','NE','E','SE','S','SW','W','NW', 'PANORAMIC') as $value) { 
    550                         if ($_FILES[$value]['tmp_name'] != '') { 
    551                                 if (@!imagecreatefromjpeg($_FILES[$value]['tmp_name'])) continue; 
     552                        if (isset($_FILES[$value]['tmp_name'])) { 
     553                                if (!imagecreatefromjpeg($_FILES[$value]['tmp_name'])) continue; 
    552554                                $db->add("photos", array('node_id' => intval(get('node')), 'type' => 'view', 'view_point' => $value, 'info' => $_POST['info-'.$value])); 
    553555                                $ins_id = $db->insert_id; 
Note: See TracChangeset for help on using the changeset viewer.