The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#4
|
|||
|
|||
![]()
I'm not sure exactly what you are trying to do but here's my take on your problem.
If you just want to show a sorted list of the users that have more than 5 posts then log into your admin control panel, create a new widget of type 'PHP Direct Execution' and insert the following code: $host = '<your host here>'; $user = '<your database userid here>'; $pass = '<your database password here'; $database = '<your database name here>'; $linkID = mysql_connect($host, $user, $pass) or die('Could not connect to host.'); mysql_select_db($database, $linkID) or die('Could not find database.'); $query = "select username, posts from user where posts>5 order by posts desc limit 0,10"; $resultID = mysql_query($query, $linkID) or die('Data not found.'); $output .= '<p>These users will be entered into the draw!</p>'; $output .= '<table>'; for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){ $row = mysql_fetch_assoc($resultID); $szUsername = $row['username']; $szPosts = $row['posts']; $output .= "<tr>"; $output .= "<td>$szUsername</td>"; $output .= "<td>$szPosts</td>"; $output .= "</tr>"; } $output .= '</table>'; After that just add the widget to whatever page you would like. I'm not saying the code is bullet-proof but it should give you a start. In this example I am only returning the top 10. You can play around with the table to show all 500 if you prefer. If I was going to code it up myself then I might either create a new table (or add a column to the user table if that's allowed) holding the baseline of everyone's post-count at the time you start the contest. Then if you wanted to see who has 5 new posts then you would simply subtract their baseline post count from their current post count. Hope it helps... now if anyone wants to help me with my problem then it would be very much appreciated! -fab |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|