The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Latest threads hack
Hello,
I have seen a lengthy discussion and praise of some hacks that allow the display of x number of most recent posts on a non-VB web page. Am I missing something by oversimplying what is involved. My view on life is that it is inefficient to query the underlying database for the last 10 posts each time someone visits your homepage. In addition, searches are a drain on server resources. My approach would be to set up a text file on my server and write each new post to it and delete the 11th post. I would then have my homepage (index.php) read the text file each time a visitor arrives and present the necessary information accordingly. Data in the text file would be held in 10 rows, an array would be created on reading it, and this would be read out in index.php. Where new posts require moderator approval, a similar script to update the text file could be installed (writing to the text file when the post was approved). Is this common sense or am I missing something big? Willie |
#2
|
||||
|
||||
Both approaches have their own pros and cons:
It's true that reading from a text/html file as a include will not put a burden to your server but disadvantages of this structure would be: 1- You need to hack vb more. Dynamic SQL query does not require any hacking in vb, but so as to create a text file, you have to hack newreply.php and newthread.php. Besides you have to hack other vb files if you want a perfect system (like editpost.php or postings.php). What if users edit their posts, or a Mod deletes it/moves it? So as to keep your text files updated you have to cover all gaps which means you'll do a lot of modifications in your vb code. In Db query method you don't touch your vb files in anyway. 2- You can not get detailed data with a text file include: For example you can not easily display how much that post has been read, replied, rated, subscribed. You just display the post itself. however by dynamically querying the server you can get all data you need from any table you need and the entire data will be very uptodate. IMO SQL method is much better if you want a handy, functional and uptodate info in your non-vb page. Besides it's not so server intensive as you think if you know what you are doing. For example you can query the database according to the table fields that are indexed or you can create new indexes in your db to increase respond time. To get some recent posts to your main page will require around 5-10 SQL queries in your main page which is quite bearable. Please notice that unhacked vb (ver 2) has around 18 queries in main forum page so your site forum page will create half the query load your forum main page creates in your server. But if you have a busy/slow MYSQL server or a huge post database, you can consider include method over SQL.. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|