The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need a real simple custom page, can you help?
We ran a promotion where the first 500 members, IF they had at least 5 posts each would be entered in a drawing. I am sure this is super simple, but I know nothing about it. How can I make a custom page, showing a list of users who are member 1-500, and have at least 5 posts?
Thanks in advance!!!! |
#2
|
||||
|
||||
the simple stuff is often the most complex
|
#3
|
|||
|
|||
It's not complex at all... i've talked to several people about it. lol
|
#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 |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|