Support Forums

php function

This is a discussion on php function within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Is there any easy way to make a page in 68C which has the layout template and call a php ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 08-03-2008, 06:22 PM   #1
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,165
Rep Power: 78
seymourjames is a jewel in the rough
Default php function

Is there any easy way to make a page in 68C which has the layout template and call a php function from within it (include the contents of the php function output). Using admin to make a new page works but I cannot get it to run the function.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates and list your 68C site on ClassifiedCodes.com
seymourjames is online now   Reply With Quote
Old 08-04-2008, 08:41 AM   #2
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,165
Rep Power: 78
seymourjames is a jewel in the rough
Default

I found another way to get the desired effect. Create a blank page in admin with whatever name you like. Then in layout.tpl test for the title of this blank page by the $body include. If it is true then call the smarty function.

This presents interesting opportunities to create many dynamic pages to display your content in various ways.

What is the point? It becomes possible to write many pages and improve your chances. It is already a good thing to put random listings on empty search or category pages to avoid duplicate content. It is an extension of that idea.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates and list your 68C site on ClassifiedCodes.com
seymourjames is online now   Reply With Quote
Old 08-04-2008, 08:53 AM   #3
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 133
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Hi,

An easier way would be to use the page id that way you can change the title later. In administration under page editor each page has a unique id.

Then in your template just add an if like:
{if $smarty.get.page == 6}
do something
{/if}
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 08-04-2008, 11:43 AM   #4
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,165
Rep Power: 78
seymourjames is a jewel in the rough
Default

That seems to work also - a bit neater. Currently, I test in the header for this page and set a title tag etc. I then test again in the layout.tpl to call the function and deliver its output.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates and list your 68C site on ClassifiedCodes.com
seymourjames is online now   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can malicious user execute php code if html are allowed in fields or uploads j890432m Technical Support 1 06-25-2008 03:34 PM
Import & Bstore function tipud Technical Support 2 09-24-2007 10:37 AM
Is this for php pros only? spaceboy Pre Sales Questions 8 08-16-2006 05:21 PM


All times are GMT -4. The time now is 06:10 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0