Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Quick Help Details »»
Quick Help
Version: , by Bloodfist Bloodfist is offline
Developer Last Online: Dec 2003 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 09-22-2002 Last Update: Never Installs: 0
 
No support by the author.

Alright, I think this should be pretty easy for you PHP gurus. On my forum, I have the Karma hack installed.

The problem is guests. All I need to know is how to alter this code to not display error messages like this at the top of the page where a thread contains posts from guests:

Code:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/worldof/public_html/forums/admin/functions.php on line 182

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/worldof/public_html/forums/admin/functions.php on line 186

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/worldof/public_html/forums/admin/functions.php on line 197

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/worldof/public_html/forums/admin/functions.php on line 200

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/worldof/public_html/forums/admin/functions.php on line 226

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/worldof/public_html/forums/admin/functions.php on line 182

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/worldof/public_html/forums/admin/functions.php on line 186
This is this code in admin/functions.php
PHP Code:
//Karma
                            
$gettotalpoint=mysql_query("SELECT newthread, reply, view, admin_mod, morereply, totalpenalty, date, redeem_points from storepoint where uid=$post[userid]");
                            
$numrows_gettotal mysql_num_rows($gettotalpoint);

                            if (
$numrows_gettotal '0' || $numrows_gettotal != '0' || $numrows_gettotal != ''
                            {
                                list (
$newthread$reply$view$admin_mod$morereply$totalpenalty$date$redeem_points) = mysql_fetch_row($gettotalpoint);
                            }

                            
$gettotalpoint1=mysql_query("SELECT agreepoint, dispoint, imaword from point");
                            
$numrows_gettotal1 mysql_num_rows($gettotalpoint1);
                            if (
$numrows_gettotal1 0
                            {
                                list (
$agreepoint$dispoint$imaword) = mysql_fetch_row($gettotalpoint1);
                            }

                            
$getagree=mysql_query("SELECT * from adis where post_userid=$post[userid] and adis='a'");
                            
$numrows_getagree mysql_num_rows($getagree);
    
                            
$getdis=mysql_query("SELECT * from adis where post_userid=$post[userid] and adis='d'");
                            
$numrows_getdis mysql_num_rows($getdis);
    
                            
$adisagree = ($agreepoint) * ($numrows_getagree);
                            
$adisdis = ($dispoint) * ($numrows_getdis);
                            
$newadis = ($adisagree) + ($adisdis);
    
                            
$post[totalpoint] = (($newthread) + ($reply) + ($view) + ($admin_mod) + ($morereply) + ($newadis)) - ($redeem_points);
                            
$possible_total = ($newthread) + ($reply) + ($view) + ($admin_mod) + ($morereply) + ($newadis) + ($redeem_points);

                            if (
$possible_total == '0'
                            {
                                
$coverage "0";
                                
$coverage $coverage '%';
                                
$post[totalpoint] = "0";
                                
$possible_total "0";
                            }
                            else
                            {
                                
$coverage = ($post[totalpoint]/$possible_total) * 100;
                                
$coverage $coverage '%';
                            }
    
                           
//Checking Karma
                           
if ($bbuserinfo[userid] != $post[userid]) 
                           {
                                
$getkarma mysql_query("SELECT * FROM adis WHERE userid = $bbuserinfo[userid] AND post_userid = $post[userid] AND postid = $post[postid]");
                                
$resultkarma mysql_num_rows($getkarma);

                                if (
$resultkarma == 0
                                {
                                    
$post[flag] = 0;
                                }
                                else
                                {
                                    
$post[flag] = 1;
                                }
                            }
                            
//choose image/word/progress bar
                            
if ($imaword == '0'
                            {     
                                
$check_posneg substr($post[totalpoint], 01);
                                if (
$check_posneg != '-' && $post[totalpoint] != '0'
                                {
                                    
$post[imaword] = "<a href=\"java script:void(0);\" onclick=\"java script:alert('".addslashes($post[username])." has a total of $post[totalpoint] karma points.');\"";
                                    
$post[imaword].=" onMouseOver=\"window.status='".addslashes($post[username])." has a total of $post[totalpoint] karma points.'; return true;\" onMouseOut=\"window.status=''; return true;\"><img src=\"https://vborg.vbsupport.ru/images/kpos.gif\" border=\"0\" alt=\"Positive Karma\"></a><br>";
                                }
                                elseif (
$check_posneg == '-'
                                {
                                    
$post[imaword] = "<a href=\"java script:void(0);\" onclick=\"java script:alert('".addslashes($post[username])." has a total of $post[totalpoint] karma points.');\"";
                                    
$post[imaword].=" onMouseOver=\"window.status='".addslashes($post[username])." has a total of $post[totalpoint] karma points.'; return true;\" onMouseOut=\"window.status=''; return true;\"><img src=\"https://vborg.vbsupport.ru/images/kneg.gif\" border=\"0\" alt=\"Negative Karma\"></a><br>";
                                }
                                else
                                {
                                    
$post[imaword] = "<a href=\"java script:void(0);\" onclick=\"java script:alert('".addslashes($post[username])." has a total of $post[totalpoint] karma points.');\"";
                                    
$post[imaword].=" onMouseOver=\"window.status='".addslashes($post[username])." has a total of $post[totalpoint] karma points.'; return true;\" onMouseOut=\"window.status=''; return true;\"><img src=\"https://vborg.vbsupport.ru/images/kbalance.gif\" border=\"0\" alt=\"Balance Karma\"></a><br>";
                                }

                            }
                            elseif (
$imaword == '1'
                            {
                                
$post[imaword] = "<smallfont>$post[totalpoint]</smallfont><br>";
                            }
                            elseif (
$imaword == '2'
                            {
                                
$post[table] = "<TABLE border=1 cellPadding=0 cellSpacing=0 style=\"BORDER-BOTTOM: #104a7b 1px solid; BORDER-LEFT: #104a7b 1px solid; BORDER-RIGHT: #104a7b 1px solid; BORDER-TOP: #104a7b 1px solid; PADDING-BOTTOM: 1px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 1px\" width=\"60%\" height=\"10\"><tr>";
    
                                if (
$post[totalpoint] == '0' && $possible_total == '0'
                                {
                                    
$post[td] = "<td width=100% bgcolor='white'></td>";
                                }
                                elseif (
$redeem_points == '0' && $post[totalpoint] != '0'
                                {
                                    
$post[td] = "<td width=100% bgcolor='blue'></td>";
                                }
                                elseif (
$post[totalpoint] != '0' && $possible_total != '0'
                                {
                                    
$post[td] = "<td width='$coverage' bgcolor='blue'></td>";
                                }

                                
$post[td1] = "<td bgcolor='white'></td></tr></table>";
                                
$post[over] = "<smallfont><b>" $post[totalpoint] . "/" $possible_total "</b></smallfont>";

                                
$post[imaword] = $post[table] . $post[td] . $post[td1] . $post[over];
                            } 
Any help would be appriciated. Thanks.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 09-22-2002, 08:17 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

try this:
PHP Code:
if($post[userid]!=0) {
//Karma
                            
$gettotalpoint=mysql_query("SELECT newthread, reply, view, admin_mod, morereply, totalpenalty, date, redeem_points from storepoint where uid=$post[userid]");
                            
$numrows_gettotal mysql_num_rows($gettotalpoint);

                            if (
$numrows_gettotal '0' || $numrows_gettotal != '0' || $numrows_gettotal != ''
                            {
                                list (
$newthread$reply$view$admin_mod$morereply$totalpenalty$date$redeem_points) = mysql_fetch_row($gettotalpoint);
                            }

                            
$gettotalpoint1=mysql_query("SELECT agreepoint, dispoint, imaword from point");
                            
$numrows_gettotal1 mysql_num_rows($gettotalpoint1);
                            if (
$numrows_gettotal1 0
                            {
                                list (
$agreepoint$dispoint$imaword) = mysql_fetch_row($gettotalpoint1);
                            }

                            
$getagree=mysql_query("SELECT * from adis where post_userid=$post[userid] and adis='a'");
                            
$numrows_getagree mysql_num_rows($getagree);
    
                            
$getdis=mysql_query("SELECT * from adis where post_userid=$post[userid] and adis='d'");
                            
$numrows_getdis mysql_num_rows($getdis);
    
                            
$adisagree = ($agreepoint) * ($numrows_getagree);
                            
$adisdis = ($dispoint) * ($numrows_getdis);
                            
$newadis = ($adisagree) + ($adisdis);
    
                            
$post[totalpoint] = (($newthread) + ($reply) + ($view) + ($admin_mod) + ($morereply) + ($newadis)) - ($redeem_points);
                            
$possible_total = ($newthread) + ($reply) + ($view) + ($admin_mod) + ($morereply) + ($newadis) + ($redeem_points);

                            if (
$possible_total == '0'
                            {
                                
$coverage "0";
                                
$coverage $coverage '%';
                                
$post[totalpoint] = "0";
                                
$possible_total "0";
                            }
                            else
                            {
                                
$coverage = ($post[totalpoint]/$possible_total) * 100;
                                
$coverage $coverage '%';
                            }
    
                           
//Checking Karma
                           
if ($bbuserinfo[userid] != $post[userid]) 
                           {
                                
$getkarma mysql_query("SELECT * FROM adis WHERE userid = $bbuserinfo[userid] AND post_userid = $post[userid] AND postid = $post[postid]");
                                
$resultkarma mysql_num_rows($getkarma);

                                if (
$resultkarma == 0
                                {
                                    
$post[flag] = 0;
                                }
                                else
                                {
                                    
$post[flag] = 1;
                                }
                            }
                            
//choose image/word/progress bar
                            
if ($imaword == '0'
                            {     
                                
$check_posneg substr($post[totalpoint], 01);
                                if (
$check_posneg != '-' && $post[totalpoint] != '0'
                                {
                                    
$post[imaword] = "<a href=\"java script:void(0);\" onclick=\"java script:alert('".addslashes($post[username])." has a total of $post[totalpoint] karma points.');\"";
                                    
$post[imaword].=" onMouseOver=\"window.status='".addslashes($post[username])." has a total of $post[totalpoint] karma points.'; return true;\" onMouseOut=\"window.status=''; return true;\"><img src=\"https://vborg.vbsupport.ru/images/kpos.gif\" border=\"0\" alt=\"Positive Karma\"></a><br>";
                                }
                                elseif (
$check_posneg == '-'
                                {
                                    
$post[imaword] = "<a href=\"java script:void(0);\" onclick=\"java script:alert('".addslashes($post[username])." has a total of $post[totalpoint] karma points.');\"";
                                    
$post[imaword].=" onMouseOver=\"window.status='".addslashes($post[username])." has a total of $post[totalpoint] karma points.'; return true;\" onMouseOut=\"window.status=''; return true;\"><img src=\"https://vborg.vbsupport.ru/images/kneg.gif\" border=\"0\" alt=\"Negative Karma\"></a><br>";
                                }
                                else
                                {
                                    
$post[imaword] = "<a href=\"java script:void(0);\" onclick=\"java script:alert('".addslashes($post[username])." has a total of $post[totalpoint] karma points.');\"";
                                    
$post[imaword].=" onMouseOver=\"window.status='".addslashes($post[username])." has a total of $post[totalpoint] karma points.'; return true;\" onMouseOut=\"window.status=''; return true;\"><img src=\"https://vborg.vbsupport.ru/images/kbalance.gif\" border=\"0\" alt=\"Balance Karma\"></a><br>";
                                }

                            }
                            elseif (
$imaword == '1'
                            {
                                
$post[imaword] = "<smallfont>$post[totalpoint]</smallfont><br>";
                            }
                            elseif (
$imaword == '2'
                            {
                                
$post[table] = "<TABLE border=1 cellPadding=0 cellSpacing=0 style=\"BORDER-BOTTOM: #104a7b 1px solid; BORDER-LEFT: #104a7b 1px solid; BORDER-RIGHT: #104a7b 1px solid; BORDER-TOP: #104a7b 1px solid; PADDING-BOTTOM: 1px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 1px\" width=\"60%\" height=\"10\"><tr>";
    
                                if (
$post[totalpoint] == '0' && $possible_total == '0'
                                {
                                    
$post[td] = "<td width=100% bgcolor='white'></td>";
                                }
                                elseif (
$redeem_points == '0' && $post[totalpoint] != '0'
                                {
                                    
$post[td] = "<td width=100% bgcolor='blue'></td>";
                                }
                                elseif (
$post[totalpoint] != '0' && $possible_total != '0'
                                {
                                    
$post[td] = "<td width='$coverage' bgcolor='blue'></td>";
                                }

                                
$post[td1] = "<td bgcolor='white'></td></tr></table>";
                                
$post[over] = "<smallfont><b>" $post[totalpoint] . "/" $possible_total "</b></smallfont>";

                                
$post[imaword] = $post[table] . $post[td] . $post[td1] . $post[over];
                            }

Reply With Quote
  #3  
Old 09-22-2002, 08:37 PM
Bloodfist Bloodfist is offline
 
Join Date: Sep 2002
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome man, that worked!
Reply With Quote
  #4  
Old 09-22-2002, 08:40 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you're welcome
Reply With Quote
Reply


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 10:47 PM.


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.03701 seconds
  • Memory Usage 2,404KB
  • Queries Executed 17 (?)
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)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)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_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