PDA

View Full Version : Could someone help me with this pluhnews modification?


Weasel
06-23-2002, 09:09 AM
PluhNews is great, but it has one dissadvantage: It has to make a ton of calls to the MySQL database everytime a visitor goes to your homepage. In theory the number of calls could be reduced significantly if it just wrote a new data file each time a news record was posted.

So I re-wrore the pluhnews.php file to write everything to a standard TXT file. Now all I need is for pluhnews.php to execute every time a new thread is posted in the news forum.

So I was wondering if it would be possible to add something like this to the newthread.php file when a new thread is created:

if (forumid == whatever)
execute PluhNews.php

Can anyone offer any more insight?

Logician
06-23-2002, 01:09 PM
convert your pluhnews.php to a function add the function to admin/functions.php and call it anytime you need it.

By the way I'm sure you have already noticed that your function(PHP file) needs to handle post edits/deletes/moves etc which requires a lot of coding/hacking or you should post news very carefully, knowing that your further modifications can only performed by manually editing your text file.