Previous Thread
Next Thread
Print Thread
Rate Thread
c0bra #215815 05/11/2002 8:06 AM
Joined: Oct 2000
Posts: 49
Member
Member
Offline
Joined: Oct 2000
Posts: 49
The code im using to do that i cant really share because its not even actually ASP, Its wscript code being run as a schedulded task that recreates the top 10 posts etc every 30 mins, i figured that was more efficient because its being used on my sites homepage.

But heres how i did it. Im very new to PHP and MySQL, so it cant be that hard.
Goto PHP.net and install the ADO thingymebob.
Set up an ADO connection on your server to the MySQL database.
Use PHP my Admin or look in createtables.php to find the field names.
The perform an SQL query as you normally would but connecting to the MySQL forum ADO connection.
Volla!

Heres my SQL query for the top threads, ive hard coded a few bits like the board

SELECT B_Number, B_Subject, B_Board FROM w3t_Posts WHERE B_Number = B_Main AND B_Last_Post > " & DATEDIFF("s", "01/01/1970", DATEADD("s", -(7*86400), NOW())) & " AND B_Board='UBB2' ORDER BY B_Replies DESC LIMIT 10

This pulls the top 10 posts from board UBB2 that are more recent than a week sorted by replies descending

Kristian

Sponsored Links
Entire Thread
Subject Posted By Posted
So many bugs kristian 05/01/2002 7:03 PM
a beta is a beta is a beta caymuc 05/01/2002 8:40 PM
Re: a beta is a beta is a beta kristian 05/01/2002 9:03 PM
Re: So many bugs Rick 05/02/2002 12:55 AM
Re: So many bugs kristian 05/02/2002 2:39 AM
Re: So many bugs Gardener 05/02/2002 2:56 AM
Re: So many bugs hatter 05/02/2002 6:46 AM
Re: So many bugs Gardener 05/02/2002 9:00 PM
Re: So many bugs kristian 05/11/2002 3:06 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
• Shock Hosting
• Stable Host
• bluehost
• InterServer
Visit us on Facebook
Member Spotlight
Ruben Rocha
Ruben Rocha
Lutz,FL,USA
Posts: 253
Joined: January 2000
Forum Statistics
Forums63
Topics37,583
Posts293,957
Members13,826
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 4219
Topics Created 0
Posts Made 0
Users Online 1
Birthdays 27
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
isaac 2
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20261026)