![]() |
Limited PHP scripts functionality for templates v1.0
Hello all !
Here is small funny hack (5 strings of new code only in one script :) That may help to bring more power to vb templates :) Features: - executing php scripts (with modified syntax) from templates. Changing\creating php variables from templates, conditional actions and database requests without editing scripts. It is all :) PS changes in 1.1 - normal php variables syntax (with $) - added example of database request from template - support for several PHP blocks in one template |
hey, looks nice :)
|
Indeed this looks very nice.
But what if a template is called by more than one file? - miSt |
then why not to use some condition checking #PHP_SELF in template code ?
|
he got u there mist ;)
Looking nice JohnWooo I will check it out when I get home |
Interesting, but for organizational methods I like to keep PHP separate from the templates :p
|
Organizational?
Well I would use this in a case of when I am lazy to add 3 lines of code that do 1 thing one 1 page. So it would be pretty useful in my caze :) |
hmm seems not to be working correctly :(
I was trying to pull out the the filesize attachments PHP Code:
|
It is "limited functionality". Remember? :) echo will not work - sorry :) Try to replace echo with return.
|
nice. we should release template mods with this(they might like this on www.vbulletintemplates.com to.
|
@Velo: yeh, but sometimes this can be usefull to, if you just want to calculate some values (ppd directly in the template instead of the code)
|
Hmm... The 1.1 zip seems to be empty...
|
Updated :)
It downloads fine for me (and before it was fine too) |
Quote:
|
But phpinclude will be executed on any page of forum, and think that it is not good :)
|
Acully no. for example this would only be ran on index.php, The query it exucutes will only be done on that page, its ignored on all others.
PHP Code:
|
Nice Idea;)
@Anime-loo - Wouldn't "$DB_site->query" be better? Satan |
Yes. It is another way. But what if you need to execute some code inside some loop ? :) Think that for example calculating something different for each post on showthread.php must be impossible using phpinclude only...
|
Quote:
$query=$DB_site->query_frist |
also it's not good to expand the phpinclude template such a lot.
rembember it's loaded on everypage, also if everything is in an if-clause it has to be loaded and so on. |
All times are GMT. The time now is 03:48 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|