PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > How-to Forum

Reply
 
Thread Tools
Old 08-20-2004, 01:39 PM   #1
claudiomet
Green Mole
 
claudiomet's Avatar
 
Join Date: Aug 2004
Location: Chile
Posts: 13
A simple include in my php template doesn't appear

I made a custom template in php based on gaagle.html template... works fine.

But, I put a simple include (with <? include("linksites.php") ?> ) in my template but the include doesn't appear...
¿what's wrong?
claudiomet is offline   Reply With Quote
Old 08-20-2004, 01:47 PM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
http://www.phpdig.net/showthread.php?threadid=348
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 08-20-2004, 02:03 PM   #3
claudiomet
Green Mole
 
claudiomet's Avatar
 
Join Date: Aug 2004
Location: Chile
Posts: 13
I do that, but doesn't work. The content of the include is:

<? include('config.php');
$rs=mysql_db_query($db,"select * from recomendados order by id asc limit 50");
while($row=mysql_fetch_array($rs)){
echo'<p align="right"><a href="'.$row["direccion"].'" target="_blank">'.substr($row["titulo"],0,17).'</a></p>';
}
mysql_close($conectar);
?>


That shows a list of links stored in a database, but doesn't shows the links, only shows a partial and literal include code.
claudiomet is offline   Reply With Quote
Old 08-20-2004, 02:26 PM   #4
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Did you make the custom search page like in this post?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 08-23-2004, 06:35 AM   #5
claudiomet
Green Mole
 
claudiomet's Avatar
 
Join Date: Aug 2004
Location: Chile
Posts: 13
Thanks!

Finally I found the solution:
In search_function.php, add the following code right after the function statement:

ob_start();
require("my_include.php");
$my_include = ob_get_contents();
ob_end_clean();

then, add my_include to array:

$t_mstrings = compact('my_include','powered_by_link','title_message','phpdig_version','re sult_message' ,'nav_bar','ignore_message','ignore_commess','pages_bar','previous_link','n ext_link','templates_links');

and insert <phpdig:my_include/> in the template file ... that's all.

Thanks a lot for your time Charter!
claudiomet is offline   Reply With Quote
Reply


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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
show results in an include (php) vuurvos How-to Forum 1 10-05-2005 06:44 AM
include search.php OceanSurf How-to Forum 1 09-08-2004 09:58 AM
How to use PHP include to include the Google result pages? sid Coding & Tutorials 1 01-07-2004 04:53 AM
Newbie : How to include PHP file (.php) frostbyte How-to Forum 1 01-04-2004 11:42 AM
Using PHP include in templates sid How-to Forum 3 11-23-2003 06:06 AM


All times are GMT -8. The time now is 08:43 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.