vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Karma and Thread View Hack (https://vborg.vbsupport.ru/showthread.php?t=37022)

pgowder 04-04-2002 10:00 PM

Karma and Thread View Hack
 
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>


MrLister 04-05-2002 04:13 PM

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?

pgowder 04-05-2002 05:08 PM

Wasn't sure where it should go.

Mods, please move if needed.

Thanks

Velocd 04-05-2002 06:06 PM

How about some more detailed instructions? That might help ;)

pgowder 04-05-2002 06:14 PM

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.


All times are GMT. The time now is 12:16 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.00986 seconds
  • Memory Usage 1,723KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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