Forum Moderators: coopster

Message Too Old, No Replies

Efficient 'Plugins' with PHP

How to include 'plugins' to a application

         

Nick_W

9:06 am on Aug 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all,

Here's what I mean: I have a product DB that essentially looks at the url and takes what it needs to either show you the index or an individual product. Pretty straight forward...

What I need to do, is allow, for each section of the site (product categories), the page to display a link to an article, links page or whatever. Like this:

www.site.com/normalProductIndex/34
www.site.com/normalProductIndex/articles/

BUT, only if I actually have articles for that section!

So, I was thinking of setting up a directory to house these optional extras and using is_dir() to go find if there is anything to include....

Does that make sense?
Am I overcomplicating it?
Can anyone make some suggestions?

Many thanks...

Nick

hakre

2:53 pm on Aug 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi nick, what you're suggesting does not look that complicated. i would give it a try.

but i don't understand why you're calling this a plugin at all ;). it looks like one simple condition. ;)

Nick_W

2:54 pm on Aug 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>plugin

Well, the routines will only be actioned if a file/dir exists so the file/dir (i guess a file in a dir would work best) is the plugin....

I'm a bit vague on the details as you can see ;-)

Nick

lorax

6:13 pm on Aug 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



How are the articles getting added? If you're using a script, perhaps you could toggle a flag in the product record that indicates an article has been uploaded. Then, when you query for the product's info, check the flag. If it's TRUE, go get the file(s) from the dir.

There are a number of ways to execute this. I think you're headed in the right direction.