Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 09 Aug 2008, 21:35
kingMOB kingMOB is offline
 
Join Date: Nov 2007
Load content from file

Hi,

I'm trying to create a simple command line to load the content of a txt file into a template.

The idea is host a lot of txt files in the server that are named as the id of each forum (255.txt, 235.txt...) and when a user, for example, enters http://forum.forum.com/forumdisplay.php?f=221 this command will insert the content of the 221.txt file somewhere in the template.

Any ideas? =)

Thanks.
Reply With Quote
  #2  
Old 10 Aug 2008, 13:20
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Including External Files
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
  #3  
Old 12 Aug 2008, 00:11
kingMOB kingMOB is offline
 
Join Date: Nov 2007
Thank you Marco, I tried this simple plugin, hooked it to "global_start", execution order 5:

$incluirads = implode('', file('images/{$foruminfo[forumid]}.txt'));

In the hope that when activated the plugin could get the $foruminfo[forumid] number from the forum from which it was been loaded and complete the command line like:

$incluirads = implode('', file('images/{221.txt'));

And, load the 221.txt file for that forum. But, I just could make it works without the $foruminfo[forumid] variable, which is essential to me.

Is there a way to put the $foruminfo[forumid] variable in the plugin, so it load the correct txt file for each forum?

Thanks
Reply With Quote
  #4  
Old 12 Aug 2008, 07:57
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
I don't think global_start is the correct hook location to use. It is executed on each page, even if no forum info available.
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 18:09.

Layout Options | Width: Wide Color: