Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 03-05-2009, 04:53 AM
Dingo14 Dingo14 is offline
 
Join Date: Dec 2007
Posts: 182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Anyone Help

I get this message at the top of forum when I click on a post anyone know what it might be thanks in advance

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in [path]/includes/plugins_usercountd.php on line 190

Also get this if I click a thread

Unable to add cookies, header already sent.
File: /home/badboys/public_html/forum/includes/class_core.php
Line: 3243
Reply With Quote
  #2  
Old 03-05-2009, 05:12 AM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

plugins_usercountd.php is not a default vBulletin script - it belongs to one of your plugins. You should turn off that plugin and ask whoever wrote it to fix it.


That, or if you know how to program you should go to line 190 of that script and see why mysql_fetch_array() is failing. Either way, we can't help you without the source code.
Reply With Quote
  #3  
Old 03-05-2009, 05:25 AM
Dingo14 Dingo14 is offline
 
Join Date: Dec 2007
Posts: 182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

plugins_usercountd.php this is the php could you look at it thanks


PHP Code:
<?php

/* ====================================================================== *\
||                                                                        ||
||    User Countdown AddOn for vBulletin                                  ||
||    (c)2006 Michael "Hellcat" Hengstmann                                ||
||    [email]hellcat@hellcat.net[/email]                                                 ||
||  --------------------------------------------------------------------  ||
||    You may use this script for free, but not redistribute              ||
||    without giving the propper credits!                                 ||
||                                                                        ||
\* ====================================================================== */

//                                             \\
//  ========== Script Version: 1.10 ========== \\
//                                             \\

global $vbulletin$permissions;

if ( 
$THIS_HOOK == "profile_fetch_profilefields" )
{
  if ( ( 
$profilefield["title"] == "User Countdown" ) AND ( $permissions["hc_usercountdown"] & $vbulletin->bf_ugp["hc_usercountdown"]["canusecountdown"] ) )
  {
    
$profilefield["type"] = "";

    
$cdsettings               unserializestr_replace"&quot;"'"'$vbulletin->userinfo[$profilefieldname] ) );
    
$oprofilefieldtitle       $profilefield["title"];
    
$oprofilefieldname        $profilefieldname;
    
$oprofilefielddescription $profilefield["description"];

    
$radiobits "";
    
$options = array( "Yes" => $vbphrase["countdown_on"], "No" => $vbphrase["countdown_off"] );
    
$profilefield[title] = $vbphrase["countdown_enable"];
    
$profilefield[description] = $vbphrase["countdown_enable_desc"];
    
$profilefieldname $oprofilefieldname "_enable";
    foreach (
$options AS $vkey => $option)
    {
      
$key $vkey;
      
$val $option;
  
      if ( 
$key == $cdsettings["enabled"] ) { $checked 'checked = "checked"'; } else { $checked ""; }

      eval(
'$radiobits .= "' fetch_template('userfield_radio_option') . '";');
    }
    eval(
'$radio_enable = "' fetch_template('userfield_radio') . '";');

    
$selectbits "";
    
$profilefield["title"] = $vbphrase["day"];
    
$profilefield["description"] = "";
    
$profilefieldname $oprofilefieldname "_day";
    for ( 
$i 1$i <= 31$i++ )
    {
      
$key trimstrval$i ) );
      
$val $key;

      if ( 
$val == $cdsettings["day"] ) { $selected "selected"; } else { $selected ""; }
   
      eval(
'$selectbits .= "' fetch_template('userfield_select_option') . '";');
    }
    eval(
'$dayselect = "' fetch_template('userfield_select') . '";');

    
$selectbits "";
    
$profilefield["title"] = $vbphrase["month"];
    
$profilefield["description"] = "";
    
$profilefieldname $oprofilefieldname "_month";
    for ( 
$i 1$i <= 12$i++ )
    {
      
$key trimstrval$i ) );
      
$val $key;

      if ( 
$val == $cdsettings["month"] ) { $selected "selected"; } else { $selected ""; }
   
      eval(
'$selectbits .= "' fetch_template('userfield_select_option') . '";');
    }
    eval(
'$monthselect = "' fetch_template('userfield_select') . '";');

    
$selectbits ""
    
$profilefield["title"] = $vbphrase["year"];
    
$profilefield["description"] = "";
    
$profilefieldname $oprofilefieldname "_year";
    for ( 
$i date("Y"); $i <= 2020$i++ )
    {
      
$key trimstrval$i ) );
      
$val $key;

      if ( 
$val == $cdsettings["year"] ) { $selected "selected"; } else { $selected ""; }
   
      eval(
'$selectbits .= "' fetch_template('userfield_select_option') . '";');
    }
    eval(
'$yearselect = "' fetch_template('userfield_select') . '";');

    
$selectbits ""
    
$profilefield["title"] = $vbphrase["countdown_hour"];
    
$profilefield["description"] = "";
    
$profilefieldname $oprofilefieldname "_hour";
    for ( 
$i 0$i <= 23$i++ )
    {
      
$key trimstrval$i ) );
      
$val $key;

      if ( 
$val == $cdsettings["hour"] ) { $selected "selected"; } else { $selected ""; }
   
      eval(
'$selectbits .= "' fetch_template('userfield_select_option') . '";');
    }
    eval(
'$hourselect = "' fetch_template('userfield_select') . '";');

    
$selectbits ""
    
$profilefield["title"] = $vbphrase["countdown_minute"];
    
$profilefield["description"] = "";
    
$profilefieldname $oprofilefieldname "_minute";
    for ( 
$i 0$i <= 59$i++ )
    {
      
$key trimstrval$i ) );
      
$val $key;

      if ( 
$val == $cdsettings["minute"] ) { $selected "selected"; } else { $selected ""; }
   
      eval(
'$selectbits .= "' fetch_template('userfield_select_option') . '";');
    }
    eval(
'$minuteselect = "' fetch_template('userfield_select') . '";');

    
$profilefield["title"] = $vbphrase["countdown_event"];
    
$profilefield["description"] = $vbphrase["countdown_event_desc"];
    
$profilefieldname $oprofilefieldname "_event";
    
$bbuserinfo[$profilefieldname] = $cdsettings["event"];
    
$profilefield["size"] = "48";
    
$profilefield["maxlength"] = "128";
    eval(
'$text_event = "' fetch_template('userfield_textbox') . '";');
    
$text_event str_replace'value=""''value="' $cdsettings["event"] . '"'$text_event );

    
$profilefield["title"] = $vbphrase["countdown_overmsg"];
    
$profilefield["description"] = $vbphrase["countdown_overmsg_desc"];
    
$profilefieldname $oprofilefieldname "_overmsg";
    
$bbuserinfo[$profilefieldname] = $cdsettings["overmsg"];
    
$profilefield["size"] = "48";
    
$profilefield["maxlength"] = "128";
    eval(
'$text_overmsg = "' fetch_template('userfield_textbox') . '";');
    
$text_overmsg str_replace'value=""''value="' $cdsettings["overmsg"] . '"'$text_overmsg );

    
$profilefield["title"]       = $vbphrase["countdown_title"];
    
$profilefieldname            $oprofilefieldname;
    
$profilefield["description"] = $vbphrase["countdown_desc"];
    
    
$wrapper_template 'userfield_countdown';
    
$fields = array('radio_enable''text_event''text_overmsg''dayselect''monthselect''yearselect''hourselect''minuteselect');

foreach (
$fields AS $field)
{
    $
$field str_replace('userfield''cdsettings', $$field);
}  } if ( ( 
$profilefield["title"] == "User Countdown" ) AND !( $permissions["hc_usercountdown"] & $vbulletin->bf_ugp["hc_usercountdown"]["canusecountdown"] ) ) {
    
$profilefield["type"] = "";
    
$tempcustom "";
  }
}

// ********************************************************************** \\

if ( ( $THIS_HOOK == "profile_updateoptions" ) AND ( $permissions["hc_usercountdown"] & $vbulletin->bf_ugp["hc_usercountdown"]["canusecountdown"] ) )
{
  
$vbulletin->input->clean_array_gpc('p', array( "countdownuserfield" => TYPE_STR,
                                                 
"cdsettings"         => TYPE_ARRAY ));

  
$cdsettings     $vbulletin->GPC["cdsettings"];
  
$cdprofilefield $vbulletin->GPC["countdownuserfield"];

  
$cddata["enabled"] = $cdsettings[$cdprofilefield "_enable"];
  
$cddata["day"]     = $cdsettings[$cdprofilefield "_day"];
  
$cddata["month"]   = $cdsettings[$cdprofilefield "_month"];
  
$cddata["year"]    = $cdsettings[$cdprofilefield "_year"];
  
$cddata["hour"]    = $cdsettings[$cdprofilefield "_hour"];
  
$cddata["minute"]  = $cdsettings[$cdprofilefield "_minute"];
  
$cddata["event"]   = $cdsettings[$cdprofilefield "_event"];
  
$cddata["overmsg"] = $cdsettings[$cdprofilefield "_overmsg"];

  
$vbuserfields[$cdprofilefield] = serialize$cddata );
  
$vbuserfields[$cdprofilefield "_set"] = "1";
  
$vbuserfields[$cdprofilefield "_opt"] = "";

  
$userdata->set_userfields$vbuserfields );
}

// ********************************************************************** \\

if ( $THIS_HOOK == "postbit_display_complete" )
{
  if ( 
strlen($post["signature"]) > )
  {
    
$cdfield "field" $vbulletin->options["countdownfield"];
    
$query $vbulletin->db->query_read"SELECT $cdfield FROM " TABLE_PREFIX "userfield WHERE userid='" $post["userid"] . "';" );
    
$result mysql_fetch_array$query );
  
    
$cddata unserializestr_replace"&quot;"'"'$result[$cdfield] ) );
  
    if ( 
$cddata["enabled"] == "Yes" )
    {
      require_once( 
"./includes/class_bbcode.php" );
      require_once( 
"./includes/functions_newpost.php" );
      
$vbulletin->cdbbcode_parse =& new vB_BbCodeParser($vbulletinfetch_tag_list());
      
      
$eta mktime intval$cddata["hour"] ), intval$cddata["minute"] ), 0intval$cddata["month"] ), intval$cddata["day"] ), intval$cddata["year"] ) );
      
$tremain $eta time();
      if ( 
$tremain )
      {
        
$t $tremain;
        
$remain["days"] = intval $t 86400 );
        
$t $t - ( $remain["days"] * 86400 );
        
$remain["hours"] = intval $t 3600 );
        
$t $t - ( $remain["hours"] * 3600 );
        
$remain["minutes"] = intval $t 60 );
        
        
$counter $remain["minutes"] . $vbphrase["countdown_minutes"];
        
        if ( ( 
$remain["hours"] != ) OR ( $remain["days"] != ) )
        {
          
$counter $remain["hours"] . $vbphrase["countdown_hours"] . " " $counter;
        }
        
        if ( 
$remain["days"] != )
        {
          
$counter $remain["days"] . $vbphrase["countdown_days"] . " " $counter;
        }
      } else {
        
$counter $vbulletin->cdbbcode_parse->parse(convert_url_to_bbcode($cddata["overmsg"]), 'nonforum');
      }
      
$event $vbulletin->cdbbcode_parse->parse(convert_url_to_bbcode($cddata["event"]), 'nonforum');
      
      eval(
'$counterhtml = "' fetch_template('usercountdown_display') . '";');
      
      
$sig $post['signature'] . $counterhtml;
      
$post['signature'] = $sig;
    }
  }
}


?>
Reply With Quote
  #4  
Old 03-05-2009, 02:57 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to post for help with the plugin in the modification thread.
Reply With Quote
  #5  
Old 03-05-2009, 10:46 PM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
You need to post for help with the plugin in the modification thread.
Hellcat hasn't logged in for like 2 years... It won't do any good.



@Dingo14, here's the problem...

Code:
    $query = $vbulletin->db->query_read( "SELECT $cdfield FROM " . TABLE_PREFIX . "userfield WHERE userid='" . $post["userid"] . "';" );
    $result = mysql_fetch_array( $query );
Change that code in the php file to...

Code:
    $query = $vbulletin->db->query_read( "SELECT $cdfield FROM " . TABLE_PREFIX . "userfield WHERE userid='" . $post["userid"] . "';" );
    if( !empty($query) ) { $result = mysql_fetch_array( $query ); }
Reply With Quote
  #6  
Old 03-06-2009, 12:57 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TigerC10 View Post
Hellcat hasn't logged in for like 2 years... It won't do any good.
In many modification threads, other users will help out. So, one should first post in the modification thread for help - or read the modification thread to see if the issue has already been brought up and a fix posted.
Reply With Quote
  #7  
Old 03-06-2009, 06:58 AM
Dingo14 Dingo14 is offline
 
Join Date: Dec 2007
Posts: 182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry Lynne wasn't sure where to put this will be more careful in future

and thanks TigerC10 for all the help
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:50 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06829 seconds
  • Memory Usage 2,348KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete