Here's the code I'm using:
- Code: Select all
<?php include("/home/wrestl76/public_html/news/latest_news.php"); ?>
Any idea as to why this won't display?
<?php include("/home/wrestl76/public_html/news/latest_news.php"); ?>
<?php
if ({phpbbname}=="Anonymous"){
?>
<iframe src="login.php" name="iframe" frameborder="0" scrolling="auto" width="100%" height="270px"></iframe>
<?php
return;
}
?>
<?
if ({phpbbact}>0)
{
echo 'Comment form';
}
else
{
echo 'Login form';
}
?>
0) { echo 'comment form'; } else { echo 'login form'; } ?>FI-DD wrote:A quotation from the first page:Make sure you use the full PHP tags: <?php echo 'blahblah'; ?>
This won't work: <? echo 'blahblah'; ?>
<?php
if ({phpbbact}==1)
{
echo "comment form";
}
else
{
echo "login form";
}
?>
<?PHP echo "login form"; ?><?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>
';} ?><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/>flesh wrote: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 ...
<?php
/*
Plugin Name: Eval
Plugin URI: http://www.xs4all.nl/~cvdtak/phpintemplates_1.2.htm
Description: Use PHP in templates.
Application: Cutenews
Author: cvdtak
Author URI: http://www.xs4all.nl/~cvdtak/
*/
add_filter('news-entry', 'php_in_template');
add_filter('news-comment', 'comment_in_template');
function php_in_template($output){
$output = preg_replace_callback('/<\\?php(.*?)\\?>/is', 'phpTemplateEval', $output);
return $output;
}
function comment_in_template($output){
$output = preg_replace_callback('/<\\?php(.*?)\\?>/is', 'phpTemplateEval2', $output);
return $output;
}
#-------------------------------------------------------------------------------
function phpTemplateEval($match){
$match[1] = replace_news('admin', $match[1]);
$match[1] = str_replace('<br />', '', $match[1]);
ob_start();
eval($match[1]);
return ob_get_clean();
}
function phpTemplateEval2($match){
$match[1] = replace_comment('admin', $match[1]);
$match[1] = str_replace('<br />', '', $match[1]);
ob_start();
eval($match[1]);
return ob_get_clean();
}
?>Return to Additional Downloads
Users browsing this forum: No registered users and 0 guests