The vB Geek

The vB Geek (http://www.thevbgeek.com/index.php)
-   Geek Article and Review System (http://www.thevbgeek.com/forumdisplay.php?f=26)
-   -   Warning message VbGeek or vB? (http://www.thevbgeek.com/showthread.php?t=1505)

kafi 05-26-2006 01:26 PM

Warning message VbGeek or vB?
 
I am getting this in one article thread:

Warning: Invalid argument supplied for foreach() in /includes/class_postbit.php(251) : eval()'d code on line 136

Warning: Invalid argument supplied for foreach() in /includes/class_postbit.php(251) : eval()'d code on line 146

and some users claims to see also:
Warning: Invalid argument supplied for foreach() in /includes/class_postbit.php(251) : eval()'d code on line 136


do you think it is GARS related or vBulletin related issue?

Thread is about 60 comments long.
Thank you
----------------------
note I am about to upadate so it might be previous bug?

The Geek 05-29-2006 08:25 AM

Tough to say. Easiest way to check is to diable GARS and see if the problem persists. My guess is that its another hack or a conflict?

kafi 05-30-2006 03:20 PM

Tested, disabled, error gone.

It probably means that problem is GARS related.

This problem is occuring on every page except of 1st page.
I have quite few articles but only this one is problematic.


Geek any suggestion?
Should I upgrade first berfore troubleshooting form your site?

Thank you!

The Geek 05-30-2006 04:53 PM

Im not too sure. I still suspect its another hack or a conflict. No gars plugin code is 136 or 146 lines long. Do you have any other plugins that use the postbit_display_start hook that are that long?

kafi 06-06-2006 06:59 AM

yes I found in plugin manager under postbit_display_start another hook:
Post Thank You hack

Here is the code:
PHP Code:

if ($_REQUEST['do'] == 'findthanks')
{

$bbuserinfo $vbulletin->userinfo;
$vboptions $vbulletin->options;

    
$vbulletin->input->clean_array_gpc('r', array(
        
'userid'    => TYPE_UINT,
    ));

    
// valid user id?
    
if (!$vbulletin->GPC['userid'])
    {
        eval(
standard_error(fetch_error('invalidid'$vbphrase['user'], $vbulletin->options['contactuslink'])));
    }

    
// get user info
    
if ($user $db->query_first("SELECT userid, username, posts FROM " TABLE_PREFIX "user WHERE userid = " $vbulletin->GPC['userid']))
    {
        
$searchuser =& $user['username'];
    }
    
// could not find specified user
    
else
    {
        eval(
standard_error(fetch_error('invalidid'$vbphrase['user'], $vbulletin->options['contactuslink'])));
    }

    
// #############################################################################
    // build search hash
    
$query '';
    
$searchuser $user['username'];
    
$exactname 1;
    
$starteronly 0;
    
$forumchoice $foruminfo['forumid'];
    
$childforums 1;
    
$titleonly 0;
    
$showposts 1;
    
$searchdate 0;
    
$beforeafter 'after';
    
$replyless 0;
    
$replylimit 0;
    
$searchthreadid 0;

    (
$hook vBulletinHook::fetch_hook('search_finduser_start')) ? eval($hook) : false;

    
$searchhash md5(TIMENOW "||" $vbulletin->userinfo['userid'] . "||" strtolower($searchuser) . "||$exactname||$starteronly||$forumchoice||$childforums||$titleonly||$showposts||$searchdate||$beforeafter||$replyless||$replylimit||$searchthreadid");

    
// check if search already done
    //if ($search = $db->query_first("SELECT searchid FROM " . TABLE_PREFIX . "search AS search WHERE searchhash = '" . $db->escape_string($searchhash) . "'"))
    //{
    //    $vbulletin->url = "search.php?" . $vbulletin->session->vars['sessionurl'] . "searchid=$search[searchid]";
    //    eval(print_standard_redirect('search'));
    //}

    // start search timer
    
$searchtime microtime();

    
// #############################################################################
    // check to see if we should be searching in a particular forum or forums
    
if ($forumids fetch_search_forumids($forumchoice$childforums))
    {
        
$forumids 'thread.forumid IN(' implode(','$forumids) . ')';
        
$showforums true;
    }
    else
    {
        
$forumids '0';
        foreach (
$vbulletin->forumcache AS $forumid => $forum)
        {
            
$fperms =& $vbulletin->userinfo['forumpermissions']["$forumid"];
            if ((
$fperms $vbulletin->bf_ugp_forumpermissions['canview']) AND ($fperms $vbulletin->bf_ugp_forumpermissions['canviewothers']))
            {
                
$forumids .= ",$forumid";
            }
        }
        
$forumids "thread.forumid IN($forumids)";
        
$showforums false;
    }

    
// query post ids in dateline DESC order...
    
$orderedids = array();
    
$posts $db->query_read("
        SELECT postid
        FROM " 
TABLE_PREFIX "post AS post " iif($forumids"
        INNER JOIN " 
TABLE_PREFIX "thread AS thread ON(thread.threadid = post.threadid)
        WHERE post.userid = $user[userid]
        AND post.post_thanks_amount != 0
        AND $forumids"
) . "
        ORDER BY post.dateline DESC
        LIMIT " 
. ($vbulletin->options['maxresults'] * 2) . "
    "
);
    while (
$post $db->fetch_array($posts))
    {
        
$orderedids[] = $post['postid'];
    }
    unset(
$post);
    
$db->free_result($posts);

    
// did we get some results?
    
if (empty($orderedids))
    {
        eval(
standard_error(fetch_error('searchnoresults'$displayCommon), ''false));
    }

    
// set display terms
    
$display = array(
        
'words' => array(),
        
'highlight' => array(),
        
'common' => array(),
        
'users' => array($user['userid'] => $user['username']),
        
'forums' => iif($showforums$display['forums'], 0),
        
'options' => array(
            
'starteronly' => 0,
            
'childforums' => 1,
            
'action' => 'process'
        
)
    );

    
// end search timer
    
$searchtime fetch_microtime_difference($searchtime);

    (
$hook vBulletinHook::fetch_hook('search_finduser_complete')) ? eval($hook) : false;

    
/*insert query*/
    
$db->query_write("
        REPLACE INTO " 
TABLE_PREFIX "search (userid, ipaddress, personal, searchuser, forumchoice, sortby, sortorder, searchtime, showposts, orderedids, dateline, displayterms, searchhash)
        VALUES (" 
$vbulletin->userinfo['userid'] . ", '" $db->escape_string(IPADDRESS) . "', 1, '" $db->escape_string($user['username']) . "', '" $db->escape_string($forumchoice) . "', 'post.dateline', 'DESC', $searchtime, 1, '" $db->escape_string(implode(','$orderedids)) . "', " TIMENOW ", '" $db->escape_string(serialize($display)) . "', '" $db->escape_string($searchhash) . "')
    "
);
    
$searchid $db->insert_id();

    
$vbulletin->url "search.php?" $vbulletin->session->vars['sessionurl'] . "searchid=$searchid";
    eval(
print_standard_redirect('search'));

}



// #############################################################################
if ($_REQUEST['do'] == 'findallthanks')
{

$bbuserinfo $vbulletin->userinfo;
$vboptions $vbulletin->options;

    
// #############################################################################
    // build search hash
    
$query '';
    
$searchuser $user['username'];
    
$exactname 1;
    
$starteronly 0;
    
$forumchoice $foruminfo['forumid'];
    
$childforums 1;
    
$titleonly 0;
    
$showposts 1;
    
$searchdate 0;
    
$beforeafter 'after';
    
$replyless 0;
    
$replylimit 0;
    
$searchthreadid 0;

    (
$hook vBulletinHook::fetch_hook('search_finduser_start')) ? eval($hook) : false;

    
$searchhash md5(TIMENOW "||" $vbulletin->userinfo['userid'] . "||" strtolower($searchuser) . "||$exactname||$starteronly||$forumchoice||$childforums||$titleonly||$showposts||$searchdate||$beforeafter||$replyless||$replylimit||$searchthreadid");

    
// check if search already done
    //if ($search = $db->query_first("SELECT searchid FROM " . TABLE_PREFIX . "search AS search WHERE searchhash = '" . $db->escape_string($searchhash) . "'"))
    //{
    //    $vbulletin->url = "search.php?" . $vbulletin->session->vars['sessionurl'] . "searchid=$search[searchid]";
    //    eval(print_standard_redirect('search'));
    //}

    // start search timer
    
$searchtime microtime();

    
// #############################################################################
    // check to see if we should be searching in a particular forum or forums
    
if ($forumids fetch_search_forumids($forumchoice$childforums))
    {
        
$forumids 'thread.forumid IN(' implode(','$forumids) . ')';
        
$showforums true;
    }
    else
    {
        
$forumids '0';
        foreach (
$vbulletin->forumcache AS $forumid => $forum)
        {
            
$fperms =& $vbulletin->userinfo['forumpermissions']["$forumid"];
            if ((
$fperms $vbulletin->bf_ugp_forumpermissions['canview']) AND ($fperms $vbulletin->bf_ugp_forumpermissions['canviewothers']))
            {
                
$forumids .= ",$forumid";
            }
        }
        
$forumids "thread.forumid IN($forumids)";
        
$showforums false;
    }

    
// query post ids in dateline DESC order...
    
$orderedids = array();
    
$posts $db->query_read("
        SELECT postid
        FROM " 
TABLE_PREFIX "post AS post " iif($forumids"
        INNER JOIN " 
TABLE_PREFIX "thread AS thread ON(thread.threadid = post.threadid)
        WHERE post.post_thanks_amount != 0
        AND $forumids"
) . "
        ORDER BY post.dateline DESC
        LIMIT " 
. ($vbulletin->options['maxresults'] * 2) . "
    "
);
    while (
$post $db->fetch_array($posts))
    {
        
$orderedids[] = $post['postid'];
    }
    unset(
$post);
    
$db->free_result($posts);

    
// did we get some results?
    
if (empty($orderedids))
    {
        eval(
standard_error(fetch_error('searchnoresults'$displayCommon), ''false));
    }

    
// set display terms
    
$display = array(
        
'words' => array(),
        
'highlight' => array(),
        
'common' => array(),
        
'forums' => iif($showforums$display['forums'], 0),
        
'options' => array(
            
'starteronly' => 0,
            
'childforums' => 1,
            
'action' => 'process'
        
)
    );

    
// end search timer
    
$searchtime fetch_microtime_difference($searchtime);

    (
$hook vBulletinHook::fetch_hook('search_finduser_complete')) ? eval($hook) : false;

    
/*insert query*/
    
$db->query_write("
        REPLACE INTO " 
TABLE_PREFIX "search (userid, ipaddress, personal, searchuser, forumchoice, sortby, sortorder, searchtime, showposts, orderedids, dateline, displayterms, searchhash)
        VALUES (" 
$vbulletin->userinfo['userid'] . ", '" $db->escape_string(IPADDRESS) . "', 1, '" $db->escape_string($user['username']) . "', '" $db->escape_string($forumchoice) . "', 'post.dateline', 'DESC', $searchtime, 1, '" $db->escape_string(implode(','$orderedids)) . "', " TIMENOW ", '" $db->escape_string(serialize($display)) . "', '" $db->escape_string($searchhash) . "')
    "
);
    
$searchid $db->insert_id();

    
$vbulletin->url "search.php?" $vbulletin->session->vars['sessionurl'] . "searchid=$searchid";
    eval(
print_standard_redirect('search'));




Does anythink ring a bell? I have no clue....
Thank you Geek

The Geek 06-06-2006 07:14 AM

Whos hack is it?

kafi 06-06-2006 01:02 PM

Abe1
http://www.vbulletin.org/forum/showthread.php?t=92410

The Geek 06-06-2006 05:22 PM

Have you tried asking him about it? Its a difficult call to comb through his code to see what the problem could be. Do you have his latest version?


All times are GMT. The time now is 11:23 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.