UBB.Dev
Posted By: Medar Adding php to template? - 03/31/2004 8:42 PM
Is there a way to comment out a portion of the UBBTPRINT stuff so that I can drop a quick PHP query into a template, or would have to edit the php script itself?

Basically I want to add something:

<!-- <? //UBBTREMARK -->
<!-- echo <<<UBBTPRINT -->

$tbopen
<tr>
<td class="tdheader">
{$ubbt_lang['PROF_FOR']} $profileuser
</td>
</tr>
$tbclose

$tbopen
<tr>
<td class="lighttable"><table border="0" width="100%" class="lighttable" cellpadding="0">
<tr>
<td width="10%" class="darktable">
{$ubbt_lang['TEXT_EMAIL']}
</td>
<td width="40%">
<a href="mailto:$Fakeemail">$Fakeemail</a>

</td>
<td align="right" valign="top" rowspan="12">
<img src="$Picture" alt="Picture" width="$width" height="$height" />

RIGHT HERE...but it would involve a query

</td>
</tr>
<tr>
<td class="darktable">
{$ubbt_lang['MEMBER_ID']}
</td>
<td>
$User
Posted By: scroungr Re: Adding php to template? - 03/31/2004 10:00 PM
I would personally do the query in the actual php script and then link to it in the template.
Posted By: Medar Re: Adding php to template? - 03/31/2004 10:38 PM
Aye, that is the easy way...but what I explained to the few people that want this, is I have to add the php code and modify the template each time I upgrade the boards.

Which is a pain in the arse!
Posted By: JoshPet Re: Adding php to template? - 03/31/2004 10:54 PM
Actually in any template - you can go back into php mode with this code:



UBBTPRINT; //UBBTREMARK

// put your php code here

echo <<<UBBTPRINT


Edit the file directly - don't use the online editor for doing PHP code.
Posted By: scroungr Re: Adding php to template? - 03/31/2004 10:58 PM
yeah but Josh would you put a db query in a template? or in the actually file that calls the template?
Posted By: JoshPet Re: Adding php to template? - 03/31/2004 11:03 PM
It's best in the script - but it's possible to put actual code and queries into the template. So it's "neater" not to have it in the template, but it works.
Posted By: Medar Re: Adding php to template? - 03/31/2004 11:15 PM
And for the one query "check" and link I will output...that will work well.

Thanks Josh...all that UBBTPRINT; //UBBTREMARK stuff makes my head hurt. I know php fairly well...but have not sat down to figure that stuff out yet.
© UBB.Developers