collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 383
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Author Topic: 8: Undefined index: id  (Read 8517 times)

0 Members and 1 Guest are viewing this topic.

Offline Tiribulus

  • Semi Newbie
  • *
  • Posts: 36
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
8: Undefined index: id
« on: January 24, 2009, 04:54:45 PM »
One of the guys over at the SMF forum helped me get rid of a cascade of errors (that didn't really seem to bother anything though), but once they cleared up these popped up and he suggested I ask you folks.

8: Undefined index: id
File: /srv/www/htdocs/Sources/SPortal1-1.php(1947) : eval()'d code
Line: 92

8: Undefined index: smileysEnabled
File: /srv/www/htdocs/Sources/SPortal1-1.php(1947) : eval()'d code
Line: 56

8: Undefined index: body
File: /srv/www/htdocs/Sources/SPortal1-1.php(1947) : eval()'d code
Line: 56
« Last Edit: February 11, 2009, 10:55:05 AM by Tiribulus »

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: 8: Undefined index: id
« Reply #1 on: February 04, 2009, 03:55:12 AM »
Sorry for late reply. Do you have any PHP blocks added? Can you paste the codes here?
And slowly, you come to realize... It's all as it should be...

Offline Tiribulus

  • Semi Newbie
  • *
  • Posts: 36
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: 8: Undefined index: id
« Reply #2 on: February 04, 2009, 09:47:24 AM »
No problem, I'm gathering how busy you folks are.

Do you mean like the html for an html block?

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: 8: Undefined index: id
« Reply #3 on: February 06, 2009, 02:02:31 AM »
No. I mean did you create any custom PHP blocks? What's your SimplePortal version?
And slowly, you come to realize... It's all as it should be...

Offline Tiribulus

  • Semi Newbie
  • *
  • Posts: 36
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: 8: Undefined index: id
« Reply #4 on: February 06, 2009, 10:03:23 AM »
I forgot about that one. SP v. 2.1.1

Code: [Select]
   
   // Limit the number of articles to show.
   $limit = 5;
   $start = 0;
   // An array of board ids to show.
   $boards = array(1, 4);
    // The length limit of each message shown.
   $length = 0;
    // 0 = don't show avatars, 1= show.
   $avatars = 0;   

    global $scripturl, $db_prefix, $txt, $settings, $modSettings, $context;
   global $func, $return;

   loadLanguage('Stats');

   $limit = max(0, $limit);
   $start = max(0, $start);

   // Load the message icons - the usual suspects.
   $stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
   $icon_sources = array();
   foreach ($stable_icons as $icon)
      $icon_sources[$icon] = 'images_url';

   // Find the post ids.
   $request = db_query("
      SELECT ID_FIRST_MSG
      FROM {$db_prefix}topics
      WHERE ID_BOARD IN (".implode(',',$boards).")
      ORDER BY ID_FIRST_MSG DESC
      LIMIT $start, $limit", __FILE__, __LINE__);
   $posts = array();
   while ($row = mysql_fetch_assoc($request))
      $posts[] = $row['ID_FIRST_MSG'];
   mysql_free_result($request);

   if (empty($posts))
      return array();

   // Find the posts.
   $request = db_query("
      SELECT
         m.icon, m.subject, IFNULL(mem.realName, m.posterName) AS posterName, m.posterTime,
         t.ID_TOPIC, m.ID_MEMBER, m.ID_MSG
      FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m)
         LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
      WHERE t.ID_FIRST_MSG IN (" . implode(', ', $posts) . ")
         AND m.ID_MSG = t.ID_FIRST_MSG
      ORDER BY t.ID_FIRST_MSG DESC
      LIMIT " . count($posts), __FILE__, __LINE__);
   $return = array();
   $colorids = array();
   while ($row = mysql_fetch_assoc($request))
   {

      $row['body'] = parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']);

      // Check if the topic icon exists.
      if (!isset($icon_sources[$row['icon']]))
         $icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

      // Check that this message icon is there...
      if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
         $icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

      censorText($row['subject']);
     
      //Collect the color ids :)
      $colorids[$row['ID_MEMBER']] = $row['ID_MEMBER'];

      $return[] = array(
         'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
         'subject' => $row['subject'],
         'time' => timeformat($row['posterTime']),
         'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0',
         'poster' => array(
            'link' => !empty($row['ID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>' : $row['posterName']
         ),
         'is_last' => false,
      );
   }
   mysql_free_result($request);

   if (empty($return))
      return $return;

   $return[count($return) - 1]['is_last'] = true;
   
   if(!empty($colorids)) {
      $color_profile = sp_loadColors($colorids);
      foreach($return as $k => $p) {
         if(!empty($color_profile[$p['poster']['id']])) {
            $profile = $color_profile[$p['poster']['id']];
            if(!empty($profile)) {
               $return[$k]['poster']['link'] = $profile['link'];
            }
         }
      }
   }

   echo '
      <br />
      <table cellpadding="0" cellspacing="0" border="0" width="100%" style="clear: both; table-layout: fixed;">';

   foreach ($return as $news)
   {
      echo '
         <tr>
            <td>
               <div>
                  <a href="', $news['href'], '">', $news['icon'], '</a> <b>', $news['subject'], '</b>
                  <div class="smaller">', $news['time'], ' ', $txt[525], ' ', $news['poster']['link'], '</div>
               </div>
            </td>
         </tr>';

      if (!$news['is_last'])
         echo '
         <tr>
            <td', $avatars == 1 ? ' colspan="2"' : '', '>
               <hr style="margin: 2ex 0;" width="100%" />
            </td>
         </tr>';
      }
   echo '
      </table>';

This is the only HP block I have.

Thanks again.
« Last Edit: February 06, 2009, 10:06:49 AM by Tiribulus »

Offline Tiribulus

  • Semi Newbie
  • *
  • Posts: 36
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: 8: Undefined index: id
« Reply #5 on: February 08, 2009, 01:05:29 PM »
I can't detect any problems these are causing, but they seem to only happen when I hit the home page.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: 8: Undefined index: id
« Reply #6 on: February 11, 2009, 06:30:10 AM »
Try this code instead:
Code: [Select]
   
   // Limit the number of articles to show.
   $limit = 5;
   $start = 0;
   // An array of board ids to show.
   $boards = array(1, 4);
    // The length limit of each message shown.
   $length = 0;
    // 0 = don't show avatars, 1= show.
   $avatars = 0;   

    global $scripturl, $db_prefix, $txt, $settings, $modSettings, $context;
   global $func, $return;

   loadLanguage('Stats');

   $limit = max(0, $limit);
   $start = max(0, $start);

   // Load the message icons - the usual suspects.
   $stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
   $icon_sources = array();
   foreach ($stable_icons as $icon)
      $icon_sources[$icon] = 'images_url';

   // Find the post ids.
   $request = db_query("
      SELECT ID_FIRST_MSG
      FROM {$db_prefix}topics
      WHERE ID_BOARD IN (".implode(',',$boards).")
      ORDER BY ID_FIRST_MSG DESC
      LIMIT $start, $limit", __FILE__, __LINE__);
   $posts = array();
   while ($row = mysql_fetch_assoc($request))
      $posts[] = $row['ID_FIRST_MSG'];
   mysql_free_result($request);

   if (empty($posts))
      return array();

   // Find the posts.
   $request = db_query("
      SELECT
         m.icon, m.subject, IFNULL(mem.realName, m.posterName) AS posterName, m.posterTime, m.smileysEnabled,
         t.ID_TOPIC, m.ID_MEMBER, m.ID_MSG
      FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m)
         LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
      WHERE t.ID_FIRST_MSG IN (" . implode(', ', $posts) . ")
         AND m.ID_MSG = t.ID_FIRST_MSG
      ORDER BY t.ID_FIRST_MSG DESC
      LIMIT " . count($posts), __FILE__, __LINE__);
   $return = array();
   $colorids = array();
   while ($row = mysql_fetch_assoc($request))
   {
      // Check if the topic icon exists.
      if (!isset($icon_sources[$row['icon']]))
         $icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

      // Check that this message icon is there...
      if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
         $icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

      censorText($row['subject']);
     
      //Collect the color ids :)
      $colorids[$row['ID_MEMBER']] = $row['ID_MEMBER'];

      $return[] = array(
         'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
         'subject' => $row['subject'],
         'time' => timeformat($row['posterTime']),
         'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0',
         'poster' => array(
            'id' => $row['ID_MEMBER'],
            'link' => !empty($row['ID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>' : $row['posterName']
         ),
         'is_last' => false,
      );
   }
   mysql_free_result($request);

   if (empty($return))
      return $return;

   $return[count($return) - 1]['is_last'] = true;
   
   if(!empty($colorids)) {
      $color_profile = sp_loadColors($colorids);
      foreach($return as $k => $p) {
         if(!empty($color_profile[$p['poster']['id']])) {
            $profile = $color_profile[$p['poster']['id']];
            if(!empty($profile)) {
               $return[$k]['poster']['link'] = $profile['link'];
            }
         }
      }
   }

   echo '
      <br />
      <table cellpadding="0" cellspacing="0" border="0" width="100%" style="clear: both; table-layout: fixed;">';

   foreach ($return as $news)
   {
      echo '
         <tr>
            <td>
               <div>
                  <a href="', $news['href'], '">', $news['icon'], '</a> <b>', $news['subject'], '</b>
                  <div class="smaller">', $news['time'], ' ', $txt[525], ' ', $news['poster']['link'], '</div>
               </div>
            </td>
         </tr>';

      if (!$news['is_last'])
         echo '
         <tr>
            <td', $avatars == 1 ? ' colspan="2"' : '', '>
               <hr style="margin: 2ex 0;" width="100%" />
            </td>
         </tr>';
      }
   echo '
      </table>';
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Tiribulus

  • Semi Newbie
  • *
  • Posts: 36
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: 8: Undefined index: id
« Reply #7 on: February 11, 2009, 10:53:46 AM »
I don't know how you guys know where to look for this stuff, but it looks like you added this m.smileysEnabled at the end of line 44 (in the file I created) removed this  $row['body'] = parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']); line and added this 'id' => $row['ID_MEMBER'], line as well further down.

In any case it worked!!!

Thank you very much.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: 8: Undefined index: id
« Reply #8 on: February 11, 2009, 04:50:45 PM »
The trick is to put the code into a text editor, and then do a search for the variables that are causing the issue 'id', 'body' and 'smileysEnabled'. Then you need to be able to understand the code and work out how to fix it. ;)

Anyway, Glad to help. Marked as solved. :)
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.