Go Back   NiceCoder Community Forums > Nicecoder Products > IndexU > INDEXU DELUXE v1.x
Register Projects FAQ Members List Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-31-2008, 11:52 AM
echo@'s Avatar
Active Member
 
Join Date: Oct 2007
Location: UK Essex
Posts: 473
echo@ is on a distinguished road
Question Including within the detail_link.html file

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


Reply With Quote
  #2 (permalink)  
Old 10-31-2008, 01:07 PM
Bruceper's Avatar
Nicecoder Team
 
Join Date: Jun 2002
Location: Winnipeg Canada
Posts: 4,034
Bruceper is on a distinguished road
Default

You are way overthinking this one and why it doesn't work. I guess the simplest place to start is to ask why you are wrapping your include around two open tags?

<%php%>
include("<%$included%>");
<%php%>

should be

<%php%>
include("<%$included%>");
<%/php%>

As for the file name my bet is that you'll need to use the full path to page.php if you're using SEO friendly URL's, otherwise you'll be looking for yourdomain.com/cat1/subcat2/subcat3/page.php
Reply With Quote
  #3 (permalink)  
Old 10-31-2008, 01:44 PM
echo@'s Avatar
Active Member
 
Join Date: Oct 2007
Location: UK Essex
Posts: 473
echo@ is on a distinguished road
Default

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
Reply With Quote
  #4 (permalink)  
Old 10-31-2008, 02:02 PM
echo@'s Avatar
Active Member
 
Join Date: Oct 2007
Location: UK Essex
Posts: 473
echo@ is on a distinguished road
Default

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


Reply With Quote
  #5 (permalink)  
Old 10-31-2008, 02:35 PM
Bruceper's Avatar
Nicecoder Team
 
Join Date: Jun 2002
Location: Winnipeg Canada
Posts: 4,034
Bruceper is on a distinguished road
Default

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.
Reply With Quote
  #6 (permalink)  
Old 10-31-2008, 03:19 PM
echo@'s Avatar
Active Member
 
Join Date: Oct 2007
Location: UK Essex
Posts: 473
echo@ is on a distinguished road
Default

Ok Bruce thank you

Ill do some digging about
__________________
____________________________
http://www.articleconveyer.com
Give Your Articles Exposure


Reply With Quote
  #7 (permalink)  
Old 10-31-2008, 08:47 PM
echo@'s Avatar
Active Member
 
Join Date: Oct 2007
Location: UK Essex
Posts: 473
echo@ is on a distinguished road
Default

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


Reply With Quote
  #8 (permalink)  
Old 10-31-2008, 10:41 PM
Bruceper's Avatar
Nicecoder Team
 
Join Date: Jun 2002
Location: Winnipeg Canada
Posts: 4,034
Bruceper is on a distinguished road
Default

indexu uses <%php%> and <%/php%>

so if you see { replace that with <%php%>
Reply With Quote
  #9 (permalink)  
Old 10-31-2008, 11:08 PM
echo@'s Avatar
Active Member
 
Join Date: Oct 2007
Location: UK Essex
Posts: 473
echo@ is on a distinguished road
Default

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


Reply With Quote
Reply

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

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

HACKER SAFE certified sites prevent over 99.9% of hacker crime.

All times are GMT -5. The time now is 07:13 PM.


Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO
SSL Certificate