View Full Version : Problems with PHP in templates with version 1.8.3
guynemer
09-14-2004, 05:23 AM
I've tried every methods i've seen on the forum , but it seems that none of them works for the version 1.8.3 of phpdig :no:
I just need to include a header , and 2 other files , contituting my 2 menus, nothing special.
Could anyone offer some help ?
Thx in advance.
guynemer
09-14-2004, 05:29 AM
I've tried every methods i've seen on the forum , but it seems that none of them works for the version 1.8.3 of phpdig
I just need to include a header , and 2 other files , contituting my 2 menus, nothing special.
Could anyone offer some help ?
Thx in advance.
guynemer
09-14-2004, 07:50 AM
I've created a template to use with phpdig.The first result page works fine using the template (except for the php part , but that should be solved soon), but if I try to go to the next page using the following tags :
<phpdig:previous_link src='./tpl_img/left.gif'/><phpdig:pages_bar/><phpdig:next_link src='./tpl_img/right.gif'/>
the customized template is no longer used and the next page (the n°2 actually) is displayed with the default template (phpdig.html by default).
How can I solve this ??
I've tried the demo versions , without changing anything , and the same thing occurs.Let's say you launch your search, then swap to the yellow.html template.Then let's say you have 2 resut pages , you want to go to the next one, then that's where ther's a problem : The page is displayed again with the phpdig.html template.
Thx in advance for any solutions.
Just in case , here's the code I'm using for my template:
<html>
<head>
<title><phpdig:title_message/></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<phpdig:js_for_clicks/>
<link href="templates/fr_styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="1" cellpadding="5">
<tr align="center">
<td> </td>
<td><phpdig:previous_link src='./tpl_img/left.gif'/><phpdig:pages_bar/><phpdig:next_link src='./tpl_img/right.gif'/></td>
<td> </td>
</tr>
<phpdig:results>
<tr>
<td width="30" align="center" valign="bottom" bgcolor="#F5F5F5"><b><img src="templates/puce_bleue.gif" width="17" height="16" align="absmiddle"><phpdig:n/></b></td>
<td bgcolor="#F5F5F5"><font color="#FFFFFF"><b><phpdig:page_link/></b></font></td>
<td align="right" bgcolor="#F5F5F5"><a href="<phpdig:complete_path/>" class=lire>>>>Lire</a> </td>
</tr>
<tr></tr>
<tr>
<td width="30" rowspan="2"> </td>
<td><phpdig:text/> </font> </td>
<td> </td>
</tr>
<tr>
<td><font size="1">[<phpdig:filesize/> kb] <i><phpdig:update_date/> <phpdig:complete_path/></i></font></td>
<td> </td>
</tr>
</phpdig:results>
<tr align="center">
<td bgcolor="#E0E0E0"> </td>
<td bgcolor="#E0E0E0"><phpdig:previous_link src='./tpl_img/left.gif'/><phpdig:pages_bar/><phpdig:next_link src='./tpl_img/right.gif'/></td>
<td bgcolor="#E0E0E0"> </td>
</tr>
</table>
</body>
</html>
guynemer
09-14-2004, 07:59 AM
Hey I4m kinda having the same problem.
The difference is that I'm not trying to include a html file , but a php.
include (../menu.php);
What changes should I do so that the above include works in my customized template html page ?
guynemer
09-14-2004, 08:09 AM
I've created a template to use with phpdig.The first result page works fine using the template (except for the php part , but that should be solved soon), but if I try to go to the next page using the following tags :
<phpdig:previous_link src='./tpl_img/left.gif'/><phpdig:pages_bar/><phpdig:next_link src='./tpl_img/right.gif'/>
the customized template is no longer used and the next page (the n°2 actually) is displayed with the default template (phpdig.html by default).
How can I solve this ??
I've tried the demo versions , without changing anything , and the same thing occurs.Let's say you launch your search, then swap to the yellow.html template.Then let's say you have 2 resut pages , you want to go to the next one, then that's where ther's a problem : The page is displayed again with the phpdig.html template.
Thx in advance for any solutions.
Just in case , here's the code I'm using for my template:
<html>
<head>
<title><phpdig:title_message/></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<phpdig:js_for_clicks/>
<link href="templates/fr_styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="1" cellpadding="5">
<tr align="center">
<td> </td>
<td><phpdig:previous_link src='./tpl_img/left.gif'/><phpdig:pages_bar/><phpdig:next_link src='./tpl_img/right.gif'/></td>
<td> </td>
</tr>
<phpdig:results>
<tr>
<td width="30" align="center" valign="bottom" bgcolor="#F5F5F5"><b><img src="templates/puce_bleue.gif" width="17" height="16" align="absmiddle"><phpdig:n/></b></td>
<td bgcolor="#F5F5F5"><font color="#FFFFFF"><b><phpdig:page_link/></b></font></td>
<td align="right" bgcolor="#F5F5F5"><a href="<phpdig:complete_path/>" class=lire>>>>Lire</a> </td>
</tr>
<tr></tr>
<tr>
<td width="30" rowspan="2"> </td>
<td><phpdig:text/> </font> </td>
<td> </td>
</tr>
<tr>
<td><font size="1">[<phpdig:filesize/> kb] <i><phpdig:update_date/> <phpdig:complete_path/></i></font></td>
<td> </td>
</tr>
</phpdig:results>
<tr align="center">
<td bgcolor="#E0E0E0"> </td>
<td bgcolor="#E0E0E0"><phpdig:previous_link src='./tpl_img/left.gif'/><phpdig:pages_bar/><phpdig:next_link src='./tpl_img/right.gif'/></td>
<td bgcolor="#E0E0E0"> </td>
</tr>
</table>
</body>
</html>
Charter
09-14-2004, 08:15 AM
Please quit posting this all over the forums. It is clear that you saw the posts were moved here, so just wait and see if someone comes by to answer your question.
vinyl-junkie
09-14-2004, 09:38 AM
guynemer,
Have you checked out this thread (http://www.phpdig.net/forum/showthread.php?t=680&highlight=template)? It really shouldn't matter whether you're using a template that has PHP or plain old HTML. The suggestions in that thread should work for making a custom template.
Hope this helps. :)
guynemerp
09-15-2004, 01:12 AM
Hi.I've got several problems with version 1.8.3. oh phpdig.
I have a problem with the result pages once the search has been done.When I have more than 10 results , it obviously shows the naviguating numbers and arrows to browse th other result pages.It works fine untill I don't use any template.For instance if I chsse the yellow.html template , it worjks fine for the first page , but when i click on page 2, the template is not used anymore , it just displays the results using the defautl template.
How can I solve this ?
Heres my customised template just in case:
<html>
<head>
<title><phpdig:title_message/></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<phpdig:js_for_clicks/>
<link href="templates/fr_styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="1" cellpadding="5">
<tr align="center">
<td> </td>
<td><phpdig:previous_link src='./tpl_img/left.gif'/><phpdig:pages_bar/><phpdig:next_link src='./tpl_img/right.gif'/></td>
<td> </td>
</tr>
<phpdig:results>
<tr>
<td width="30" align="center" valign="bottom" bgcolor="#F5F5F5"><b><img src="templates/puce_bleue.gif" width="17" height="16" align="absmiddle"><phpdig:n/></b></td>
<td bgcolor="#F5F5F5"><font color="#FFFFFF"><b><phpdig:page_link/></b></font></td>
<td align="right" bgcolor="#F5F5F5"><a href="<phpdig:complete_path/>" class=lire>>>>Lire</a> </td>
</tr>
<tr></tr>
<tr>
<td width="30" rowspan="2"> </td>
<td><phpdig:text/> </font> </td>
<td> </td>
</tr>
<tr>
<td><font size="1">[<phpdig:filesize/> kb] <i><phpdig:update_date/> <phpdig:complete_path/></i></font></td>
<td> </td>
</tr>
</phpdig:results>
<tr align="center">
<td bgcolor="#E0E0E0"> </td>
<td bgcolor="#E0E0E0"><phpdig:previous_link src='./tpl_img/left.gif'/><phpdig:pages_bar/><phpdig:next_link src='./tpl_img/right.gif'/></td>
<td bgcolor="#E0E0E0"> </td>
</tr>
</table>
</body>
</html>
guynemerp
09-15-2004, 01:16 AM
That's a start of help , but I've seen many methods , I don't know which one to try.
And furthermore , I'm not trying to include a header or a footer , just a file in the "regular" body.
I'm a newbie , and I'm not sure it works with many includes. :(
Charter
09-15-2004, 04:33 AM
In search_function.php find:
$url_bar = SEARCH_PAGE."?browse=1&query_string=".urlencode($my_query_string_link)."$refine_url&limite=$limite&option=$option&lim_start=";
And replace with the following:
if (!isset($_GET['template_demo'])) { $_GET['template_demo'] = ""; }
$url_bar = SEARCH_PAGE."?template_demo=".$_GET['template_demo']."&browse=1&query_string=".urlencode($my_query_string_link)."$refine_url&limite=$limite&option=$option&lim_start=";
And please quit posting this message in other forums.
guynemerp
09-15-2004, 05:15 AM
Thx a lot , and sorry for the multipost.
Maybe you can help me finding an ultimate solution for using php any way I want in the template file.I'm really lost within the different methods. :no:
vinyl-junkie
09-15-2004, 06:33 AM
In looking at what you're trying to accomplish, I steered you the wrong way initally. Sorry about that.
Did you try what Charter suggested? I've looked at the code in that section, and it's definitely where you need to make the change to get what you want. Try that and post back here to let us know how that worked for you.
guynemerp
09-15-2004, 07:20 AM
What Charter told me worked perfectly with the naviguating problem.
However now I'm facing another problem with the php code in the templates.
vinyl-junkie
09-15-2004, 08:05 AM
What Charter told me worked perfectly with the naviguating problem.
However now I'm facing another problem with the php code in the templates.Well, you gotta tell us what it is before we can help you. ;)
guynemerp
09-15-2004, 08:35 AM
:eek: Silly me...
Well , I need to include php files evrywhere in my customized template file.
For instance in my template.html , I need to include a fiel called menu.php , which itself contains in its code another include , like a cascade of incldues if you want.
I've tried a couple of methods I've seen on the forum , but so far in vain.
Would there be any generic method so that any php code is interpretated in the template file ?
vinyl-junkie
09-15-2004, 06:04 PM
If you want to include some PHP code, then you do need to have a look at that thread I referenced above. Forget about the fact that that particular example is for headers and footers on your customized template. That type of coding is good for any sort of include file which must be parsed. The code that utilizes it can be placed anywhere inside that template file.
Tell me what you want in your custom template and where you want it to go, and I'll write the code for you to show you what I'm talking about.
guynemerp
09-16-2004, 01:31 AM
Thx A LOT in advance !!
Here's the inital page , the one I have to use to keep the same layout
<?DEFINE('CTYPE', 'Page');?>
<?include("inc/header.inc.php");?>
<?$_GET['rub']=-1?>
<body onLoad="MM_preloadImages('img/menu/foot_f2.gif','img/puces/hautdepage_f2.gif')">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="2"><img src="img/x.gif" width="2" height="2"></td>
<!-- TD INCLUDE MENU -->
<td width="168" valign="top"><?include("inc/menu.inc.php");?></td>
<!-- TD CENTRALE -->
<td width="100%" valign="top" onMouseOver="hideitall();"><br>
<!-- TABLEAU TETIERE -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan="3" background="img/tetiere/continu3.gif"><img src="img/tetiere/general.gif" width="398" height="31"></td></tr>
<tr>
<td width="20"><img src="img/x.gif" width="20" height="20"></td>
<td width="100%"><a href="Home.php" class="cheminhome">Accueil RH Groupe</a> > <a href="Search.php" class="chemin">Recherche</a> <br>
<img src="img/titres/cetelemfrhgroupe.gif" width="376" height="39"><br>
<img src="img/titres/plandusite.gif" width="376" height="25"></td>
<td width="20"><img src="img/x.gif" width="20" height="20"></td>
</tr>
<tr>
<td><img src="img/x.gif" width="4" height="4"></td>
<td bgcolor="#CCCCCC"><img src="img/x.gif" width="4" height="4"></td>
<td><img src="img/x.gif" width="4" height="4"></td>
</tr>
</table>
<!-- FIN TABLEAU TETIERE -->
<img src="img/x.gif" width="10" height="10">
<!-- TABLEAU coeur de page -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"><img src="img/x.gif" width="20" height="20"></td>
<td width="100%" valign="top">
<!-- debut recherche -->
<p>#### PLACE WHERE I WANT SHOW THE RESULTS USING THE TEMPLATE #####</p>
<p> </p>
<p>THERE A 2 MENUS , ONCE AT LEFT , and ONCE at RIGHT</p>
<p>
<!-- haut de page -->
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="100%" align="right"><a href="#"><img src="img/puces/hautdepage.gif" width="80" height="21" border="0"></a></td></tr>
<tr><td bgcolor="#CCCCCC"><img src="img/x.gif" width="2" height="2"></td></tr>
<tr><td><img src="img/x.gif" width="15" height="15"></td></tr>
</table>
<!-- fin haut de page -->
<!-- fin recherche -->
</td>
<td width="20"><img src="img/x.gif" width="20" height="20"></td>
</tr>
</table>
<!-- FIN TABLEAU coeur de page -->
</td>
<!-- FIN DU TD CENTRALE -->
<!-- TD COLONNE DROITE -->
<td width="168" valign="top"><?include("inc/nav.inc.php");?></td>
<!-- FIN DU TD COLONNE DROITE -->
<td width="5"><img src="img/x.gif" width="5" height="5"></td>
</tr>
</table>
</body>
</html>
In the middle , I'll insert the HTML code of the template file I posted just above.
You'll see that there are many includes in the page I just posted.
Just in case , here's the code of the files to include :
HEADER.INC.PHP
<?
// -- Variables générales -- //
define('VAR_DEFAULT_LANGUE', 'FR'); // Langue par défaut
define('VAR_DEFAULT_SITE', 2); // Langue par défaut
define('ROOT_SITE', ''); // Root du site
define('PATH_SITE', '/usr/local/apache/htdocs/sites_rh/site_france/FR/'); // Chemin du site
if(!isset($_GET['rub'])) $_GET['rub'] = 0;
if(!isset($_GET['id'])) $_GET['id'] = 0;
$rub1_curr = 0;
$rub2_curr = 0;
$rub3_curr = 0;
$rub4_curr = 0;
$rub5_curr = 0;
/* Variable chemin de définition de liens relatifs */
$chemin = '../';
/* Inclusion du fichier de configuration */
require($chemin.'php-lib/Config.lib.php');
/* Inclusion des librairies mysql */
require($chemin.'php-lib/Mysql.lib.php');
/* Inclusion des librairies des permissions */
require($chemin.'php-lib/Perm.lib.php');
/* Inclusion des librairies générales */
require($chemin.'php-lib/Utils.lib.php');
/* Inclusion des librairies de navigation */
require($chemin.'php-lib/Nav.lib.php');
/* Inclusion du fichiers de langue */
require($chemin.'php-lib/Lg.'.VAR_DEFAULT_LANGUE.'.lib.php');
// Article et rubrique courante
if (!isset($_GET['id']))
$entity_curr = getEntity_id($_GET['rub']);
else
$entity_curr = $_GET['id'];
if ($entity_curr!=0) {
$rubrique_curr = mysql_one_data('SELECT Section FROM '.CTYPE .' WHERE Id='.$entity_curr.' AND Site='.VAR_DEFAULT_SITE.' AND Language="'.VAR_DEFAULT_LANGUE.'"');
if (!$rubrique_curr)
$rubrique_curr = $_GET['rub'];
} else {
$rubrique_curr = $_GET['rub'];
}
$rub1_curr = getRubNiv1($rubrique_curr);
$rub2_curr = getRubNiv2($rubrique_curr);
$rub3_curr = getRubNiv3($rubrique_curr);
$rub4_curr = getRubNiv4($rubrique_curr);
$rub5_curr = getRubNiv5($rubrique_curr);
$arbo = getRubArbo($rubrique_curr);
/* Mise à jour de l'état des publications*/
updt_etat('Page', 'State', 'Date_in', 'Date_out');
updt_etat('News', 'State', 'Date_in', 'Date_out');
/* Redirection pour les tricheurs */
if (($rubrique_curr!=0) && (!lecture_on_parent_rec($rubrique_curr, "Section"))) {
header('Location: '.ROOT_SITE.'Home.php');
exit();
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Cetelem RH</title>
<script language="JavaScript" src="./js/scripts.js"></script>
<link href="./css/fr_styles.css" rel="stylesheet" type="text/css">
</head>
MENU.INC.PHP
<table width="168" border="0" cellpadding="0" cellspacing="0" id="menubar00">
<?if ($_GET['rub']==0) {?>
<tr><td onMouseOver="hideitall();"><a href="Home.php"><img src="img/menu/logo_rh_fr.gif" width="168" height="73" border="0"></a><br>
<img src="img/menu/sslogo.gif" width="168" height="25"><br><img src="img/menu/recherche.gif" width="168" height="12"></td>
</tr>
<?} else {?>
<tr><td onMouseOver="hideitall();"><a href="Home.php"><img src="img/menu/logo_rh_fr_2.gif" width="168" height="98" border="0"></a><br>
<img src="img/menu/recherche.gif" width="168" height="12"></td>
</tr>
<?}?>
<FORM action=../../../phpdig/search.php method=get>
<tr><td width="168" align="right">
<INPUT type=hidden name=path> <INPUT
type=hidden value=1 name=refine> <INPUT type=hidden name=template_demo value=rh.html>
<INPUT type=hidden value=../../../phpdig/search.php name=result_page>
<INPUT class=phpdiginputtext maxLength=50 size=9 name=query_string>
<INPUT class=phpdiginputsubmit type=submit value=Go name=search>
<INPUT type=hidden name=limite value=10>
<INPUT type=hidden name=option value=start>
<INPUT type=hidden name=site value=2,sites_rh/site_groupe/FR/>
</tr></td>
</FORM>
<tr><td>
<?
// Rubriques de niveau 1
$niv1_query = get_RubChilds();
/* On boucle sur les fiches trouvées */
while ($niv1_row = mysql_fetch_array($niv1_query)) {
?>
<?if ($niv1_row['Id']==$rub1_curr) {?>
<div id="leftmenubar<?=$niv1_row['Id']?>" class="filetmenu"><ul class="uliste"><li class="liste"><span class="menu1actif"><?=stripslashes($niv1_row['Name'])?><span class="menu1actif"></li></ul></div>
<?
// Rubriques de niveau 2
$niv2_cumul = 0;
$niv2_query = get_RubChilds($niv1_row['Id']);
$niv2_nb = mysql_num_rows($niv2_query);
if (mysql_num_rows($niv2_query)!=0) {
?>
<!-- sous menu interne -->
<div class="filetmenu">
<table width="168" border="0" cellpadding="0" cellspacing="0">
<?
/* On boucle sur les fiches trouvées */
while ($niv2_row = mysql_fetch_array($niv2_query)) {
?>
<?if ($niv2_row['Id']==$rub2_curr) {?>
<tr><td width="15" bgcolor="#F5F5F5"><img src="img/x.gif" width="15" height="1"></td><td <?=((($niv2_cumul!=$niv2_nb-1) && ($niv2_cumul!=0))?'class="filetmenu"':'')?>><ul class="uliste2"><li class="liste2"><span class="ssmenu1actif"><?=stripslashes($niv2_row['Name'])?></span></li></ul></td></tr>
<?} else {?>
<tr><td width="15" bgcolor="#F5F5F5"><img src="img/x.gif" width="15" height="1"></td><td <?=((($niv2_cumul!=($niv2_nb-1)) && ($niv2_cumul!=0))?'class="filetmenu"':'')?>><ul class="uliste2"><li class="liste2"><a href="<?=get_RubURL($niv2_row['Id'])?>" class="ssmenu1" target="<?=get_Target($niv2_row['Id'])?>"><?=stripslashes($niv2_row['Name'])?></a></li></ul></td></tr>
<?}?>
<?
$niv2_cumul +=1;
}
?>
</table>
</div>
<!-- sous menu interne -->
<?
}
?>
<?} else {?>
<div id="leftmenubar<?=$niv1_row['Id']?>" class="filetmenu"><ul class="uliste"><li class="liste"><a href="<?=get_RubURL($niv1_row['Id'])?>" class="menu1" target="<?=get_Target($niv1_row['Id'])?>"><?=stripslashes($niv1_row['Name'])?></a></li></ul></div>
<?}?>
<?
}
?>
</td></tr>
<?if (!isset($_SESSION[VAR_SESSION])) {?>
<!--<tr><td onMouseOver="hideitall()"><img src="img/menu/ttfoot.gif" width="168" height="21"><br><a href="javascript:popup('Pop_identification.php', 'Identification', 575, 275, 'no');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('elios','','img/menu/foot_f2.gif',1)"><img src="img/menu/foot.gif" alt="Hélios Groupe" name="elios" width="168" height="45" border="0"></a></td></tr>-->
<tr><td onMouseOver="hideitall()"><img src="img/menu/ttfoot.gif" width="168" height="21"><br><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('elios','','img/menu/foot_f3.gif',1)"><img src="img/menu/foot.gif" alt="Hélios Groupe" name="elios" width="168" height="45" border="0"></a></td></tr>
<?} else {?>
<tr><td onMouseOver="hideitall()"><img src="img/menu/ttfoot.gif" width="168" height="21"><br><a href="Deco.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('elios','','img/menu/foot_deco_f2.gif',1)"><img src="img/menu/foot_deco.gif" alt="Hélios Groupe" name="elios" width="168" height="45" border="0"></a></td></tr>
<?}?>
<tr><td align="center"><img src="img/x.gif" width="15" height="15"><br><a href="Site_map.php">Plan du site</a> I <a href="mailto:inforh@cetelem.fr">Contact Info RH</a><br><img src="img/x.gif" width="100" height="25"></td></tr>
</table>
guynemerp
09-16-2004, 01:33 AM
NAVER.INC.PHP
<img src="img/colonne-droite/img2.gif" width="168" height="31"><br>
<?include("inc/header_nav.inc.php");?>
<!-- debut nav_vgn up -->
<?
$cumul=1;
while (file_exists(PATH_UPLOAD.'rubrique/nav_vgn/up_'.$rubrique_curr.'_'.$cumul.'.gif')) {?>
<?
$taille_Image = getimagesize(ROOT_UPLOAD.'rubrique/nav_vgn/up_'.$rubrique_curr.'_'.$cumul.'.gif');
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#999999" class="tableauencadre">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#E8F3EF">
<tr><td colspan="2"><img src="<?=ROOT_UPLOAD.'rubrique/nav_vgn/up_'.$rubrique_curr.'_'.$cumul.'.gif'?>" width="<?=$taille_Image[0]?>" height="<?=$taille_Image[1]?>"></td></tr>
</table></td>
</tr>
</table>
<img src="img/x.gif" width="10" height="10"><br>
<?$cumul++;?>
<?}?>
<!-- fint nav_vgn up -->
<?
// Rubriques de niveau 3
$niv3_query = get_RubChilds($rub2_curr);
$niv3_nb = mysql_num_rows($niv3_query);
?>
<?if ($niv3_nb!=0) {?>
<!-- debut nav -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#999999" class="tableauencadre">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#E8F3EF">
<?
/* On boucle sur les fiches trouvées */
while ($niv3_row = mysql_fetch_array($niv3_query)) {
$img_niv3 = mysql_one_data('SELECT Img_Name FROM Section WHERE Id='.$niv3_row['Id'].' AND Site='.VAR_DEFAULT_SITE.' AND Language="'.VAR_DEFAULT_LANGUE.'"');
?>
<?if (isset($niv3_row['Img_Name'])) {?>
<?
$taille_Image = getimagesize(ROOT_UPLOAD.stripslashes($niv3_row['Img_Name']));
?>
<tr><td colspan="2"><img src="<?=ROOT_UPLOAD.stripslashes($niv3_row['Img_Name'])?>" width="<?=$taille_Image[0]?>" height="<?=$taille_Image[1]?>"></td></tr>
<?} else {?>
<tr align="left"><td colspan="2" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="3"><tr><td bgcolor="#EBD6F5" background="img/colonne-droite/titres/puce-titre.gif"><img src="img/x.gif" width="11" height="15" border="0"></td><td bgcolor="#EBD6F5" class="txt11black" width="100%"><b><?=stripslashes($niv3_row['Name'])?></b></td></tr></table></td></tr>
<tr bgcolor="#FFFFFF"><td colspan="2"><img src="img/x.gif" width="155" height="1"></td></tr>
<?}?>
<?
// Vérification du niveau 3
$Entree = get_Entree($niv3_row['Id']);
$liste=true;
if ($Entree && $Entree!='') {
$liste=false;
}
// Rubriques de niveau 4
$niv4_cumul=0;
$niv4_query = get_RubChilds($niv3_row['Id']);
$niv4_nb = mysql_num_rows($niv4_query);
/* On boucle sur les fiches trouvées */
while ($niv4_row = mysql_fetch_array($niv4_query)) {
?>
<tr>
<td valign="top"><img src="img/colonne-droite/doublefleche_bleu.gif" width="20" height="18" align="absmiddle"></td>
<td width="155"><?if ($niv4_row['Id']!=$rub4_curr) {?><a href="<?=((!$liste)?get_RubURL($niv4_row['Id']):'#'.$niv4_row['Id'])?>" target="<?=get_Target($niv4_row['Id'])?>"><?=stripslashes($niv4_row['Name'])?></a><?} else {?><b class="txt11rose"><?=stripslashes($niv4_row['Name'])?></b><?}?>
<?
// Rubriques de niveau 5
$niv5_cumul=0;
$niv5_query = get_RubChilds($niv4_row['Id']);
$niv5_nb = mysql_num_rows($niv5_query);
if ($niv5_nb!=0) echo("<br>");
/* On boucle sur les fiches trouvées */
while ($niv5_row = mysql_fetch_array($niv5_query)) {
?>
<?if ($niv5_row['Id']!=$rub5_curr) {?>
<a href="<?=((!$liste)?get_RubURL($niv5_row['Id']):'#'.$niv5_row['Id'])?>" target="<?=get_Target($niv5_row['Id'])?>">• <?=stripslashes($niv5_row['Name'])?></a><br>
<?} else {?>
<span class="txt11rose">• <?=stripslashes($niv5_row['Name'])?></span><br>
<?}?>
<?}?>
</td>
</tr>
<?$niv4_cumul+=1;?>
<?if ($niv4_cumul!=$niv4_nb) {?>
<tr><td colspan="2"><img src="img/x.gif" width="3" height="6" align="middle"><img src="img/x_gris.gif" width="152" height="1"></td></tr>
<?}?>
<?}?>
<?}?>
</table>
</td>
</tr>
</table>
<!-- fin nav -->
<img src="img/x.gif" width="10" height="10"><br>
<?}?>
<?
//Construction des outils
$outils_array = array();
$outils_str = '';
//Construction en savoir +
$savoir_array = array();
$savoir_str = '';
// Rubriques de niveau 3
// Vérification du niveau 3
$Entree = get_Entree($rub3_curr);
$liste=false;
if ($Entree=='') {
$liste=true;
}
if ((!$liste) || ($rub3_curr==0)) {
$files_query = get_Files($entity_curr);
while ($files_row = mysql_fetch_array($files_query)) {
array_push($outils_array, '<tr><td width="17" valign="top"><img src="img/puces/puce_outils.gif" width="17" height="17"></td><td width="155"><a href="'.ROOT_UPLOAD.stripslashes($files_row['URL']).'" target="_blank">'.stripslashes($files_row['Title']).'</a></td></tr>');
}
$savoir_query = get_Savoir($entity_curr);
while ($savoir_row = mysql_fetch_array($savoir_query)) {
array_push($savoir_array, '<tr><td width="20" valign="top"><img src="img/colonne-droite/doublefleche_bleu.gif" width="20" height="18" align="absmiddle"></td><td width="155"><a href="'.ROOT_UPLOAD.stripslashes($savoir_row['URL']).'" target="_blank">'.stripslashes($savoir_row['Title']).'</a></td></tr>');
}
} else if ($rub1_curr!=RUBID_COMMMUNAUTERH) {
$niv3_query = get_RubChilds($rub2_curr);
/* On boucle sur les fiches trouvées */
while ($niv3_row = mysql_fetch_array($niv3_query)) {
// Rubriques de niveau 4
$niv4_query = get_RubChilds($niv3_row['Id']);
/* On boucle sur les fiches trouvées */
while ($niv4_row = mysql_fetch_array($niv4_query)) {
// Fichiers de niveau 4
$files_query = get_Files(getEntity_id($niv4_row['Id']));
while ($files_row = mysql_fetch_array($files_query)) {
array_push($outils_array, '<tr><td width="17" valign="top"><img src="img/puces/puce_outils.gif" width="17" height="17"></td><td width="155"><a href="'.ROOT_UPLOAD.stripslashes($files_row['URL']).'" target="_blank">'.stripslashes($files_row['Title']).'</a></td></tr>');
}
$savoir_query = get_Savoir(getEntity_id($niv4_row['Id']));
while ($savoir_row = mysql_fetch_array($savoir_query)) {
array_push($savoir_array, '<tr><td width="20" valign="top"><img src="img/colonne-droite/doublefleche_bleu.gif" width="20" height="18" align="absmiddle"></td><td width="155"><a href="'.ROOT_UPLOAD.stripslashes($savoir_row['URL']).'" target="_blank">'.stripslashes($savoir_row['Title']).'</a></td></tr>');
}
// Rubriques de niveau 5
$niv5_query = get_RubChilds($niv4_row['Id']);
/* On boucle sur les fiches trouvées */
while ($niv5_row = mysql_fetch_array($niv5_query)) {
// Fichiers de niveau 5
$files_query = get_Files(getEntity_id($niv5_row['Id']));
while ($files_row = mysql_fetch_array($files_query)) {
array_push($outils_array, '<tr><td width="17" valign="top"><img src="img/puces/puce_outils.gif" width="17" height="17"></td><td width="155"><a href="'.ROOT_UPLOAD.stripslashes($files_row['URL']).'" target="_blank">'.stripslashes($files_row['Title']).'</a></td></tr>');
}
$savoir_query = get_Savoir(getEntity_id($niv5_row['Id']));
while ($savoir_row = mysql_fetch_array($savoir_query)) {
array_push($savoir_array, '<tr><td width="20" valign="top"><img src="img/colonne-droite/doublefleche_bleu.gif" width="20" height="18" align="absmiddle"></td><td width="155"><a href="'.ROOT_UPLOAD.stripslashes($savoir_row['URL']).'" target="_blank">'.stripslashes($savoir_row['Title']).'</a></td></tr>');
}
}
}
}
}
$outils_str = join('<tr><td colspan="2"><img src="img/x.gif" width="3" height="6" align="middle"><img src="img/x_gris.gif" width="152" height="1"></td></tr>', $outils_array);
$savoir_str = join('<tr><td colspan="2"><img src="img/x.gif" width="3" height="6" align="middle"><img src="img/x_gris.gif" width="152" height="1"></td></tr>', $savoir_array);
?>
<?if ($outils_str!='') {?>
<!-- debut outils -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#999999" class="tableauencadre">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="2"><img src="img/colonne-droite/titres/outils.gif" width="160" height="31"></td>
</tr>
<?=$outils_str?>
<tr>
<td colspan="2"><img src="img/colonne-droite/fin_outils.gif" width="160" height="9"></td>
</tr>
</table></td>
</tr>
</table>
<!-- fin outils -->
<img src="img/x.gif" width="10" height="10"><br>
<?}?>
<?if ($savoir_str!='') {?>
<!-- debut en savoir plus -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#999999" class="tableauencadre">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#E8F3EF">
<tr>
<td colspan="2"><img src="img/colonne-droite/titres/savoir_plus.gif" width="160" height="17" border="0" alt=""></td>
</tr>
<?=$savoir_str?>
</table></td>
</tr>
</table>
<!-- fin en savoir plus -->
<img src="img/x.gif" width="10" height="10"><br>
<?}?>
<!-- debut nav_vgn down -->
<?
$cumul=1;
while (file_exists(PATH_UPLOAD.'rubrique/nav_vgn/down_'.$rubrique_curr.'_'.$cumul.'.gif')) {?>
<?
$taille_Image = getimagesize(ROOT_UPLOAD.'rubrique/nav_vgn/down_'.$rubrique_curr.'_'.$cumul.'.gif');
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#999999" class="tableauencadre">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#E8F3EF">
<tr><td colspan="2"><img src="<?=ROOT_UPLOAD.'rubrique/nav_vgn/down_'.$rubrique_curr.'_'.$cumul.'.gif'?>" width="<?=$taille_Image[0]?>" height="<?=$taille_Image[1]?>"></td></tr>
</table></td>
</tr>
</table>
<img src="img/x.gif" width="10" height="10"><br>
<?$cumul++;?>
<?}?>
<!-- fint nav_vgn down -->
</form>
OK , it was very long , sorry ...but I hope you'll get the picture
vinyl-junkie
09-19-2004, 04:51 PM
OK, here's one way of doing this.
In search_function.php, add the following code right after the function statement:
ob_start();
require("/path/to/header.inc.php");
$my_header_file = ob_get_contents();
ob_end_clean();
ob_start();
require("/path/to/menu.inc.php");
$my_menu_file = ob_get_contents();
ob_end_clean();
ob_start();
require("/path/to/nav.inc.php");
$my_nav_file = ob_get_contents();
ob_end_clean();
ob_start();
require("/path/to/naver.inc.php");
$my_naver_file = ob_get_contents();
ob_end_clean();
Also, find the following code in search_function.php:
$t_mstrings = compact('js_for_clicks','rss_feed_link','powered_by_link','title_message',' phpdig_version','result_message','nav_bar','ignore_message','ignore_commess ','pages_bar','previous_link','next_link','templates_links');
Replace it with the following code:
$t_mstrings = compact('my_header_file ','my_menu_file ','my_nav_file ','my_naver_file ','js_for_clicks','rss_feed_link','powered_by_link','title_message','phpdig _version','result_message','nav_bar','ignore_message','ignore_commess','pag es_bar','previous_link','next_link','templates_links');
In your template file, replace this:
<?include("inc/header.inc.php");?>
with this:
<phpdig:my_header_file/>
Replace this:
"<?include("inc/menu.inc.php");?>
with this:
<phpdig:my_menu_file/>
Replace this:
"<?include("inc/nav.inc.php");?>
with this:
<phpdig:my_nav_file/>
Replace this:
"<?include("inc/naver.inc.php");?>
with this:
<phpdig:my_naver_file/>
This should get you what you want. Let us know how it goes.
guynemerp
09-20-2004, 02:08 AM
So far it seems to work the way I wanted , thx a lot :banana:
Right now , I'm looking for the place I can customize the text message displayed when using the tag
<phpdig:result_message/> and <phpdig:nav_bar/>
vinyl-junkie
09-20-2004, 05:27 AM
The code for both those things is in search_function.php. What exactly do you want to do?
guynemerp
09-23-2004, 01:02 AM
Thx a lot , I managed to find the stuffs I wanted to change :yes:
vBulletin® v3.7.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.