vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Anyone Help (https://vborg.vbsupport.ru/showthread.php?t=207401)

Dingo14 03-05-2009 04:53 AM

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

TigerC10 03-05-2009 05:12 AM

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.

Dingo14 03-05-2009 05:25 AM

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;
    }
  }
}


?>


Lynne 03-05-2009 02:57 PM

You need to post for help with the plugin in the modification thread.

TigerC10 03-05-2009 10:46 PM

Quote:

Originally Posted by Lynne (Post 1761122)
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 ); }


Lynne 03-06-2009 12:57 AM

Quote:

Originally Posted by TigerC10 (Post 1761412)
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.

Dingo14 03-06-2009 06:58 AM

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

and thanks TigerC10 for all the help


All times are GMT. The time now is 02:17 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01275 seconds
  • Memory Usage 1,882KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete