| Author |
Message |
snatch518
Joined: 07 Jun 2008 Posts: 8
|
|
Still won't work |
|
After enabling the script, my template still will not display PHP.
Here's the code I'm using:
 |  | <?php include("/home/wrestl76/public_html/news/latest_news.php"); ?> |
Any idea as to why this won't display?
|
|
| Mon Jun 23, 2008 6:02 pm |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
daves
Joined: 03 Sep 2008 Posts: 1
|
|
Php in Templates |
|
Hi
Does this plugin work with the latest version of Cutenews.RU cos I cannot get it to call a php function using
<php functionname(); ?>
Thanks for any help
|
|
| Wed Sep 03, 2008 8:58 am |
|
 |
flesh

Joined: 04 Mar 2006 Posts: 89 Location: Poland |
|
|
|
I am trying to use this code ...
 |  |
<?php
if ({phpbbname}=="Anonymous"){
?>
<iframe src="login.php" name="iframe" frameborder="0" scrolling="auto" width="100%" height="270px"></iframe>
<?php
return;
}
?>
|
why isn't it working ...
|
|
| Fri Sep 19, 2008 9:03 am |
|
 |
flesh

Joined: 04 Mar 2006 Posts: 89 Location: Poland |
|
|
|
or this :
 |  |
<?
if ({phpbbact}>0)
{
echo 'Comment form';
}
else
{
echo 'Login form';
}
?>
|
I've added this {phpbbact} and it is 1 when the user is active and 0 when it is not active ... but why is it not working ...
when I test it it shows
 |  | 0) { echo 'comment form'; } else { echo 'login form'; } ?> |
|
|
| Fri Sep 19, 2008 9:28 am |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2736 Location: Germany |
|
|
|
A quotation from the first page:
 |  | Make sure you use the full PHP tags: <?php echo 'blahblah'; ?>
This won't work: <? echo 'blahblah'; ?> |
|
|
| Thu Sep 25, 2008 5:52 pm |
|
 |
flesh

Joined: 04 Mar 2006 Posts: 89 Location: Poland |
|
|
|
 |  | A quotation from the first page:
 |  | Make sure you use the full PHP tags: <?php echo 'blahblah'; ?>
This won't work: <? echo 'blahblah'; ?> |
|
I actually did it this way:
 |  |
<?php
if ({phpbbact}==1)
{
echo "comment form";
}
else
{
echo "login form";
}
?>
|
it shows nothing ...
|
|
| Fri Sep 26, 2008 12:14 pm |
|
 |
flesh

Joined: 04 Mar 2006 Posts: 89 Location: Poland |
|
|
|
Do I have to do all this stuff http://www.xs4all.nl/~cvdtak/phpintemplates_1.2.htm
with replacing and adding code or I just have to add the php-in-templates.php file in the plugins folder and to activate it ?
for me is not working even
 |  | <?PHP echo "login form"; ?> |
|
|
| Fri Sep 26, 2008 12:34 pm |
|
 |
flesh

Joined: 04 Mar 2006 Posts: 89 Location: Poland |
|
|
|
Ok I did it this way
copy in inc/show.commentform.php:
$output = preg_replace_callback('/<\\?php(.*?)\\?>/is', 'phpTemplateEval', $output);
and now it is working ... sorry for bothering
|
|
| Fri Sep 26, 2008 1:20 pm |
|
 |
flesh

Joined: 04 Mar 2006 Posts: 89 Location: Poland |
|
|
|
OK now I can use PHP in the templates but it is not working this code:
 |  | <?PHP
if ({phpbbact}==1)
{ echo '<input type="hidden" id="name" type="text" size="20" name="name" tabindex="1" value="{phpbbname}" /><br /><label for="mail"><input type="hidden" id="mail" type="text" size="20" name="mail" tabindex="2" value="{phpbbavatar}" /></label><br />{smilies}<br /><textarea cols="50" rows="8" name="comments" tabindex="3"></textarea><br /><input class="input" type="submit" tabindex="4" name="submit" value="Leave a comment" /><br/>';}
else
{
echo '<form action="login2.php" method="post" style="margin: 0px;"><input type="hidden" name="redirect" value="indexsite" /><input type="hidden" name="redirect" value="../r.html" /><table border="0" style="font-size:12px;" width="130" cellspacing="0" cellpadding="0"><tr><td class="left" height="25"><b>User:</b></td></tr><tr>
<td class="left" height="25">
<input type="text" name="username" size="10" maxlength="25">
</td>
</tr>
<tr>
<td class="left" height="25">
<b>Password:</b>
</td>
</tr>
<tr>
<td class="left" height="25">
<input type="password" name="password" size="10" maxlength="25">
</td>
</tr>
<tr>
<td class="left" height="35">
<input type="submit" name="login" value="Login">
</td>
</tr>
</table>
</form>
';} ?> |
When I change the first echo with something else (for example echo "lala" it works ... so the problem I have is in the first echo ...
The first echo is with the comment form ... it is like this:
 |  | <input type="hidden" id="name" type="text" size="20" name="name" tabindex="1" value="{phpbbname}" /><br /><label for="mail"><input type="hidden" id="mail" type="text" size="20" name="mail" tabindex="2" value="{phpbbavatar}" /></label><br />{smilies}<br /><textarea cols="50" rows="8" name="comments" tabindex="3"></textarea><br /><input class="input" type="submit" tabindex="4" name="submit" value="Leave a comment" /><br/> |
it sows me this error:
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ',' or ';' in /php-in-templates.php(2 : eval()'d code on line 2
what is wrong with this comment form code ... do I have to add <form> tag and if I have to ... what to write in it ...
I don't have an idea 
|
|
| Sat Sep 27, 2008 8:53 am |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2736 Location: Germany |
|
|
|
 |  | When I change the first echo with something else (for example echo "lala" it works ... so the problem I have is in the first echo ... |
Then add your echo code word by word and check the result after each word. That way you will find out what's causing the error.
|
|
| Fri Oct 03, 2008 9:24 am |
|
 |
|