Options

Odd Error

Munkus BeaverMunkus Beaver You don't have to attend every argument you are invited to.Philosophy: Stoicism. Politics: Democratic SocialistRegistered User, ClubPA regular
Got this screen when accessing the last page of the AC chat thread for a few minutes, then someone posted.

141326error.JPG

Humor can be dissected as a frog can, but dies in the process.
Munkus Beaver on

Posts

  • Options
    ObbiObbi Registered User, ClubPA regular
    edited April 2004
    That happened to me too an hour ago.

    Obbi on
  • Options
    Stupid Mr Whoopsie NameStupid Mr Whoopsie Name Registered User, ClubPA regular
    edited April 2004
    Were you listening to Andrew Lloyd Webber musicals when it happened too?

    Stupid Mr Whoopsie Name on
  • Options
    Munkus BeaverMunkus Beaver You don't have to attend every argument you are invited to. Philosophy: Stoicism. Politics: Democratic SocialistRegistered User, ClubPA regular
    edited April 2004
    Were you listening to Andrew Lloyd Webber musicals when it happened too?

    *shakes fist*

    Curses!

    Munkus Beaver on
    Humor can be dissected as a frog can, but dies in the process.
  • Options
    ÄlphämönkëyÄlphämönkëy Registered User regular
    edited April 2004
    I fixed it. For the curious the speed hack looks something like this :
    // The *new* viewtopic pulls data in two stages
    // Thanks to Lanzer for this hack!
    // Added Alpha 4-29-04
    // Modified to fit old criteria
    // -Added count () to make sure posts exist for that page\thread
    // Based on : [url]http://www.phpbb.com/phpBB/viewtopic.php?t=135383[/url] (First Post)
    
    // Phase One : Grab a list of post_ids
    $sql = "SELECT p.post_id FROM " . POSTS_TABLE . " p WHERE p.topic_id = $topic_id $limit_posts_time LIMIT $start, " . $board_config['posts_per_page'];
    if ( !($result = $db->sql_query($sql)) )
    {
       message_die(GENERAL_ERROR, "Could not obtain post index information.", '', __LINE__, __FILE__, $sql);
    }
    
    $p_array = array ();
    while (list($p_id) = $db->sql_fetchrow($result)) 
    {
        $p_array[] = $p_id;
    }
    
    if ( count($p_array) == 0 )
    { 
       include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); 
       sync('topic', $topic_id); 
    
       message_die(GENERAL_MESSAGE, $lang['No_posts_topic']); 
    } 
    
    $post_index = implode(", " , $p_array); 
    
    // Phase Two : The whole 9-yards - this gets all the info using the post_ids
    $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_occ, u.user_website, u.user_email, 
    		u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, 
    		u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, 
    		u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_allow_viewonline, 
    		u.user_session_time, u.user_level, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid
    	FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
    	WHERE p.post_id IN ($post_index)
    		AND pt.post_id = p.post_id
    		AND u.user_id = p.poster_id
    	ORDER BY p.post_id $post_time_order"; 
    
    if ( !($result = $db->sql_query($sql)) )
    {
    	message_die(GENERAL_ERROR, "Could not obtain post/user information.", '', __LINE__, __FILE__, $sql);
    }
    
    $postrow = array();
    if ($row = $db->sql_fetchrow($result))
    {
    	do
    	{
    		$postrow[] = $row;
    	}
    	while ($row = $db->sql_fetchrow($result));
    	$db->sql_freeresult($result);
    
    	$total_posts = count($postrow);
    }
    
    The error was I was not running anything to check the size of the $p_array, adding the conditional count in there fixed that right up.

    A special thanks to the AC folk for letting me steal their chat thread (my test url)

    Älphämönkëy on
  • Options
    BogeyBogey I'm back, baby! Santa Monica, CAModerator Mod Emeritus
    edited April 2004
    Yeah, I got that error screen twice today in different forums when somebody would delete the first (and only) post on a new page.

    Bogey on
    Fitocracy: Join us in the SE++ group!
    XBox LIVE: Bogestrom | Destiny
    PSN: Bogestrom
Sign In or Register to comment.