Have a debugg, found problem but how to fix it ?

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

Have a debugg, found problem but how to fix it ?

Postby Leon » Tue Dec 12, 2006 8:23 pm

As you can see here:
http://www.volunteerforum.se/website.php?id=64

Could not obtain user/day information

DEBUG MODE

SELECT user_id, username, user_allow_viewonline, user_level, user_session_time FROM phpbb_users WHERE user_id > 0 ORDER BY IF(user_level=1,3,user_level) DESC, username ASC

Line : 341
File : page_header.php



message_die() was called multiple times. This isn't supposed to happen. Was message_die() used in page_tail.php?



What has happened ? :?
Last edited by Leon on Tue Dec 12, 2006 9:45 pm, edited 2 times in total.
Talk, discuss or debate everything about Volunteer 'ing at this forum!
Volunteer Forum Community
User avatar
Leon
Know-It-All
Know-It-All
 
Posts: 282
Joined: Tue Feb 07, 2006 11:09 am

Postby Leon » Tue Dec 12, 2006 8:25 pm

Line 350-352 in page_header.php:


{
message_die(GENERAL_ERROR, 'Could not obtain user/day information', '', __LINE__, __FILE__, $sql);
}
Talk, discuss or debate everything about Volunteer 'ing at this forum!
Volunteer Forum Community
User avatar
Leon
Know-It-All
Know-It-All
 
Posts: 282
Joined: Tue Feb 07, 2006 11:09 am

Postby Leon » Tue Dec 12, 2006 8:32 pm

Edited
Last edited by Leon on Tue Dec 12, 2006 9:02 pm, edited 1 time in total.
Talk, discuss or debate everything about Volunteer 'ing at this forum!
Volunteer Forum Community
User avatar
Leon
Know-It-All
Know-It-All
 
Posts: 282
Joined: Tue Feb 07, 2006 11:09 am

Postby Leon » Tue Dec 12, 2006 8:50 pm

I found the problem but i don't know what to do to fix it because i
need that code:

It was the "Users of the day MOD" that caused it:

includes/page_header.php
Code: Select all
//
// Users of the day MOD
//

// ############ Edit below ############
// #
$display_not_day_userlist = 0;   // change to 1 here if you also want the list of the users who didn't visit to be displayed
$users_list_delay = 168;      // change here to the number of hours wanted for the list
// #
// ############ Edit above ############

$sql = "SELECT user_id, username, user_allow_viewonline, user_level, user_session_time
   FROM ".USERS_TABLE."
   WHERE user_id > 0
   ORDER BY IF(user_level=1,3,user_level) DESC, username ASC";
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not obtain user/day information', '', __LINE__, __FILE__, $sql);
}

$day_userlist = '';
$day_users = 0;
$not_day_userlist = '';
$not_day_users = 0;

while( $row = $db->sql_fetchrow($result) )
{
   $style_color = '';
   if ( $row['user_level'] == ADMIN )
   {
      $row['username'] = '<b>' . $row['username'] . '</b>';
      $style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
   }
   else if ( $row['user_level'] == MOD )
   {
      $row['username'] = '<b>' . $row['username'] . '</b>';
      $style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
   }
   if ( $row['user_allow_viewonline'] )
   {
      $user_day_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
   }
   else
   {
      $user_day_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
   }
   if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
   {
      if ( $row['user_session_time'] >= ( time() - $users_list_delay * 3600 ) )
      {
         $day_userlist .= ( $day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;
         $day_users++;
      }
      else
      {
         $not_day_userlist .= ( $not_day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;
         $not_day_users++;
      }
   }
}

$day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Day_users'], $day_users, $users_list_delay) ) . ' ' . $day_userlist;

$not_day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Not_day_users'], $not_day_users, $users_list_delay) ) . ' ' . $not_day_userlist;

if ( $display_not_day_userlist )
{
   $day_userlist .= '<br />' . $not_day_userlist;
}

//
// End of MOD
//
Talk, discuss or debate everything about Volunteer 'ing at this forum!
Volunteer Forum Community
User avatar
Leon
Know-It-All
Know-It-All
 
Posts: 282
Joined: Tue Feb 07, 2006 11:09 am

Postby battye » Wed Dec 13, 2006 3:03 am

I'm not genius with SQL, but try changing:

Code: Select all
ORDER BY IF(user_level=1,3,user_level) DESC


To

Code: Select all
ORDER BY user_level DESC
CricketMX.com.. home of bat's, rat's and other farmyard animals...
My articles: view all articles by battye

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
User avatar
battye
Site Admin
Site Admin
 
Posts: 14264
Joined: Sun Jan 11, 2004 8:26 am
Location: Victoria Falls, Zimbabwe

Postby Leon » Wed Dec 13, 2006 6:21 pm

Well then the Junior Admin made it cracked up...
You know i just changed back the:
website.php file to the original
(Without the header and footer now as before)

Seems like that was alot easier with all this problems. ](*,)

But i really loved it when that worked. But well time changes i suppose. :?
Talk, discuss or debate everything about Volunteer 'ing at this forum!
Volunteer Forum Community
User avatar
Leon
Know-It-All
Know-It-All
 
Posts: 282
Joined: Tue Feb 07, 2006 11:09 am


Return to Web Design

Who is online

Users browsing this forum: No registered users and 1 guest

cron