| |||||||
| Register | Projects | FAQ | Members List | Mark Forums Read |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| ||||
|
I have found an intresting problem and hope some one could help. What im trying to achieve is inculde a varible from a custom field in the "detail_link.html" page. Why am i doing this? I what to add a custom html page to the link detail but i want it to be dynamic depending on the link displayed. Heres how i have been attepting to do it! I have created a custom field called <%$inculded%>, with text propeties. For the test link the data in the field has page.php?id=test to call the custom html page, called test.html. Within detail_link.html I am including the custom field like so <%php%> include("<%$included%>"); <%php%> Yep im using the correct smarty tag for php. What happens when I view the "detail_link.html" page? When i view the detail_link.html the page renders and prints the statment above like so include("page.php?id=test"); Checked the source code and something is removing the <%php%>. What I know and Tested The custom field is setup correctly, as it prints the correct string and works fine if i change the code to a link like so. <a href="<%$included%>" >Test</a> Page renders the correct link and works fine. I also thought it could be the xml filter so I checked lib/misc.lib.php at line 644 but found no refrence to the php tag? I commented the filter out anyway and tried again but still the same results? I hope this is a clear explaination of the problem lol Any help woud be appreciated Thanks
__________________ ____________________________ http://www.articleconveyer.com Give Your Articles Exposure |
| ||||
|
Thanks for spotting that The include is now doing somthing but im not sure if its working or if there is somthing else wrong with the syntax Warning: include(<%%>) []: failed to open stream: No such file or directory in /home/bathroom/public_html/templates_c/%%2C/2CF/2CF3B9F1%%detail_link.html.php on line 55 Warning: include(<%%>) []: failed to open stream: No such file or directory in /home/bathroom/public_html/templates_c/%%2C/2CF/2CF3B9F1%%detail_link.html.php on line 55 Warning: include() []: Failed opening '<%%>' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bathroom/public_html/templates_c/%%2C/2CF/2CF3B9F1%%detail_link.html.php on line 55 I have cleared out my page cache and template cache, I have also changed the path in the custom field to /home/bathroom/public_html/page.php?id=test any ideas what this might mean ? or is it still a path problem? I have mod-rewrite enabled and working,
__________________ ____________________________ http://www.articleconveyer.com Give Your Articles Exposure Last edited by echo@; 10-31-2008 at 01:46 PM. Reason: urls removed |
| ||||
|
Tested it without a custom field and it works like so <%php%> include("/home/bathroom/public_html/themes/kosmos/test.html"); <%/php%> looks like includes dosent work with custom fields?
__________________ ____________________________ http://www.articleconveyer.com Give Your Articles Exposure |
| ||||
|
That was my origional suspicion, because an include is to an actual (physical) page (or image or script etc) and while page.php is physical, the page you are calling is not in this sense (page.php?id=test) It's pretty much like calling an include with an include. You might need to find a different way to do it. Perhaps a hardcoded page? I know that defeats the purpose, but it might have to be that way. What if you created the Custom Template and just called "test" directly? Of course you'd need to edit "test" (which is actually test.html) and remove the header and footer from it. note that in order to do that, you need to disable the .htaccess file in your /themes/ directory.
__________________ |
| ||||
|
Ok Bruce thank you Ill do some digging about
__________________ ____________________________ http://www.articleconveyer.com Give Your Articles Exposure |
| ||||
|
Hi Bruce I went over to smarty community and asked , this is what they said Smarty :: View topic - Including smarty in php Wonder if you could help me out with the syntax apparentlly im supposed to use {include_php file=$path} if i want to execute the php file, so $path is my custom field. This is in the native smarty delimiters so how would that look on indexu. <%include_php file=<%$path%>%> Or <%include_php file=$path%> or <%php%> include_php file=$path <%/php%>
__________________ ____________________________ http://www.articleconveyer.com Give Your Articles Exposure |
| ||||
|
I have had some luck Here is the correct syntax <%include_php file=$included%> you have to drop the <% %> delimiters for the smarty tag. Its not perfect , whatever you do you cannot assign page.php?id=directory to the custom field, you have to put the relative path to the file. Its a shame because when you include a file using page.php, smarty tag paths and blocks all work from the included file. now i can only use images and these all have to be with relative urls. Zubby managed to get round it using <? $site_url = "http://www.yourindexudomain.com"; $header = file_get_contents("$site_url/page.php?id=header"); ob_start(); ?> This worked quite well in intergating vbulletin/indexu as a plugin. Maybe it could be used for this situation
__________________ ____________________________ http://www.articleconveyer.com Give Your Articles Exposure |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to include a [php] or [html] file in a [.tpl] file | althahabi | Website Development | 3 | 07-05-2006 12:21 AM |
| Premium detail_link.html | Baz@rr | v5.x | 4 | 05-04-2006 04:56 AM |
| <%category_path%> in detail.html or detail_link.html pages | pip | v5.x | 1 | 06-03-2004 09:03 AM |
| including event software threw mysql? | persut | v5.x | 1 | 05-26-2003 04:30 AM |
| including navigation bar | jcary | v5.x | 1 | 08-24-2002 03:53 PM |