Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Karma and Thread View Hack Details »»
Karma and Thread View Hack
Version: 1.00, by pgowder pgowder is offline
Developer Last Online: May 2013 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 04-04-2002 Last Update: Never Installs: 0
 
No support by the author.

This is my first "hack". (Not really a hack, just a combination of two.)

I wanted to be able to combine these two hacks, so here is what I did.

This will give you a table with the totals.

You need to make sure that al the fields in your storepoint table are not null and default 0.

Hope you enjoy.

PHP Code:
<html>
<head>
</head>
<body>
<table CELLSPACING=0 BORDER=1 WIDTH=70% align="center">
<tr BGCOLOR=#3300CC>
    <td align="center"><font color="white" size="+1"><b>Username</b></font></td><td align="center"><font color="white" size="+1"><b>Karma Points</b></font></td><td align="center"><font color="white" size="+1"><b>Views</b></font></td><td align="center"><font color="white" size="+1"><b>Total</b></font></td>
</tr>



<?

$hostname = "";
$username = "";
$password = "";
$dbName = "";
MYSQL_CONNECT($hostname,$username,$password) OR DIE("Unable to connect to database");
@mysql_select_db("$dbName") or die("Unable to select database");


$query = "select uid, newthread+reply+view+admin_mod+morereply+totalpenalty as total from storepoint order by total desc";



$my_q = mysql_query($query) or die(mysql_error());
$row_count = mysql_num_rows($my_q);
for ($i=0; $i<$row_count; $i++) {
     list($uid, $total) = mysql_fetch_row($my_q);
     $my_q2 = mysql_query("select username, views from user where userid='$uid'") or die(mysql_error());
     list($username, $views) = mysql_fetch_row($my_q2);
     $karmatotal = $total + $views;
     print "<tr><td BGCOLOR=#ffffcc>$username</td><td BGCOLOR=#ffffcc align=center>$total</td><td BGCOLOR=#ffffcc align=center>$views</td><td BGCOLOR=#ffffcc align=center>$karmatotal</td></tr>";
     mysql_free_result($my_q2);
}

mysql_free_result($my_q);


?>

</table>
</body>
</html>

Show Your Support

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

Comments
  #2  
Old 04-05-2002, 04:13 PM
MrLister's Avatar
MrLister MrLister is offline
 
Join Date: Oct 2001
Posts: 434
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Shouldn't this be a "upgrade" to a previous hack or something. Rather then just putting two hacks together and clicking on the new hack button?
Reply With Quote
  #3  
Old 04-05-2002, 05:08 PM
pgowder's Avatar
pgowder pgowder is offline
 
Join Date: Nov 2001
Location: West Columbia, SC
Posts: 537
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wasn't sure where it should go.

Mods, please move if needed.

Thanks
Reply With Quote
  #4  
Old 04-05-2002, 06:06 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How about some more detailed instructions? That might help
Reply With Quote
  #5  
Old 04-05-2002, 06:14 PM
pgowder's Avatar
pgowder pgowder is offline
 
Join Date: Nov 2001
Location: West Columbia, SC
Posts: 537
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you want to use the Karma hack and provide a way for members to get points for reading threads, this is how to do it.

This is a standalone script. You can create references to it from your vb.

Input your system settings, and upload to your site.
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 02:24 PM.


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.06605 seconds
  • Memory Usage 2,242KB
  • Queries Executed 18 (?)
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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)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