Page 2 of 3

Posted: Sat Aug 19, 2006 10:09 pm
by carl_galloway
Hold off on reinstalling.

The comment form is created by calling the smarty {$COMMENTFORM} and in all cases this should work, I'm wondering if the config file is causing the problem. When I originally ported andreas08 I was pretty new to config files and I copied it from another template. Could you edit config.inc.php

Code: Select all

<?php # $Id: config.inc.php,v 1.3 2005/05/17 11:43:07 garvinhicking Exp $

$probelang = dirname(__FILE__) . '/lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
    include $probelang;
} else {
    include dirname(__FILE__) . '/lang_en.inc.php';
}

$serendipity['smarty']->assign('CONST', get_defined_constants());
?>
and delete the second to last line $serendipity['smarty']->assign('CONST', get_defined_constants());

Then reload/refresh andreas08. Not sure if that will work but I'd like to rule it out as a possible problem before we go too much further.

Posted: Sat Aug 19, 2006 10:16 pm
by dougburns
I've given that a try and don't think it worked ...
-bash-3.00$ pwd
/var/www/vhosts/oracledoug.com/httpdocs/serendipity/templates/andreas08
-bash-3.00$ ls -ltra config*
-rw-r--r-- 1 oracledoug psacln 276 Aug 19 21:13 config.inc.php
-bash-3.00$ cat config*
<?php # $Id: config.inc.php,v 1.1 2006/03/07 19:10:16 carl_galloway Exp $

$probelang = dirname(__FILE__) . '/lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
} else {
include dirname(__FILE__) . '/lang_en.inc.php';
}

?>

Posted: Sat Aug 19, 2006 10:27 pm
by carl_galloway
Doug I'm sorry I'm not much help, I've checked the code over and over, and itis exactly the same as every other template. The bit that drags in the comment form is located in entries.tpl, and should look like this

Code: Select all

<div class="serendipity_section_commentform">
<div class="serendipity_commentsTitle">{$CONST.ADD_COMMENT}</div>
	    {$COMMENTFORM}
</div>
When I view the source of your page everything is there but the {$COMMENTFORM} variable isn't dragging in the comment form. Could you double check that part of entries.tpl and make sure its the same? Otherwise we might need to scream for Garvin's help

Posted: Sat Aug 19, 2006 10:33 pm
by dougburns
Carl,

First, I really appreciate the template and your help, particularly on a weekend.

I've just looked in entries.tpl (from the templates/andreas08 directory) and it looks like this, with a bit of leading and trailing text included

Code: Select all

                <div class="serendipity_center serendipity_msg_important">{$CONST.COMMENTS_CLOSED}</div>

                {else}

                <br />
                <div class="serendipity_section_commentform">
                        <div class="serendipity_commentsTitle">{$CONST.ADD_COMMENT}</div>
                        {$COMMENTFORM}
                                </div>

                {/if}
            </div>
        {/if}

Garvin, your help is needed

Posted: Sat Aug 19, 2006 10:42 pm
by carl_galloway
That's what it should read, so to the best of my knowledge everything is ok with the template, however if it turns out that there is something amiss I will happily make the changes. I'm completely lost as to how to proceed from here, not being able to see the comment form and also getting the error in the rss feed is bizarre. Here's hoping Garvin can shed some light.

Thanks for being patient with me.

Posted: Sat Aug 19, 2006 10:46 pm
by dougburns
Carl,

Thanks - you're doing me the favour here and the likelihood is that I've messed up somewhere - trust me ;-)

I'll probably leave the problem in place for now, over the weekend, and put one of the working templates back in place if we can't find any root cause.

The truth is, I'd much rather stick with andreas08 because it's simply excellent and just what I've been looking for ;-)

Thanks again,

Doug

Posted: Mon Aug 21, 2006 11:43 am
by garvinhicking
Hi guys!

Sorry for not being around on the weekend to help on this issue :)

As it seems to me, the problem is that $COMMENTFORM variable is not populated. Can you check if you have a "commentform.tpl" file in place in your andreas08 directory? What does it look like?

If there is no such file, check if your "default" directory contains that file?

Best regards,
Garvin

Posted: Mon Aug 21, 2006 11:46 am
by dougburns
Garvin,

Don't tell me you actually do other things at the weekend! ;-)

Unfortunately, I'm at work now and don't have server access, so will need to check this from home tonight.

Cheers,

Doug

Posted: Mon Aug 21, 2006 8:27 pm
by dougburns
Garvin,

There is a comments.tpl in the andreas08 subdirectory

Code: Select all

-bash-3.00$ pwd
/var/www/vhosts/oracledoug.com/httpdocs/serendipity/templates/andreas08_mod/andreas08_mod
-bash-3.00$ more comments.tpl
{foreach from=$comments item=comment name="comments"}
    <a id="c{$comment.id}"></a>
<div class="serendipity_comment serendipity_comment_author_{$comment.author|@makeFilename} {if $entry.author == $comment.auth
or}serendipity_comment_author_self{/if} {cycle values="oddbox, evenbox"}" style="padding-left: {$comment.depth*20}px">
                <p>{if $comment.url}
                <a href="#c{$comment.id}" title="{$CONST.LINK_TO_COMMENT|sprintf:$comment.trace}">#{$comment.trace}</a> - <a
href="{$comment.url}" target="_blank">{$comment.author|@default:$CONST.ANONYMOUS}</a> {$CONST.SAYS}:<br />
            {else}
                <a href="#c{$comment.id}" title="{$CONST.LINK_TO_COMMENT|sprintf:$comment.trace}">#{$comment.trace}</a> - {$c
omment.author|@default:$CONST.ANONYMOUS}
            {/if} {$comment.timestamp|@formatTime:$CONST.DATE_FORMAT_SHORT} - {if $entry.allow_comments}
                (<a href="#serendipity_CommentForm" onclick="document.getElementById('serendipity_replyTo').value='{$comment.
id}';">{$CONST.REPLY}</a>)             {/if}{if $entry.is_entry_owner}
                (<a href="{$comment.link_delete}" onclick="return confirm('{$CONST.COMMENT_DELETE_CONFIRM|@sprintf:$comment.i
d:$comment.author}');">{$CONST.DELETE}</a>)
            {/if}</p>
        <p>{$comment.body}</p>
        </div>
{foreachelse}
    <p class="nocomments">{$CONST.NO_COMMENTS}</p>
{/foreach}
I've switched the template back to andreas08 for now so that you can see what I'm talking about at http://oracledoug.com/serendipity/index ... ujah!.html

Cheers,

Doug

Posted: Mon Aug 21, 2006 8:30 pm
by garvinhicking
Hi!

What looks weird is this:

/templates/andreas08_mod/andreas08_mod

shouldn't this read:

emplates/andreas08_mod/

instead? Maybe this is all just a directory-messup?

Regards,
Garvin

Posted: Mon Aug 21, 2006 8:35 pm
by dougburns
I thought you might say that which is why I included the directory. I thought it might be that, but I have another (unmodified) andreas08 directory with the same problem.

Code: Select all

-bash-3.00$ pwd
/var/www/vhosts/oracledoug.com/httpdocs/serendipity/templates/test
-bash-3.00$ more comments.tpl
{foreach from=$comments item=comment name="comments"}
    <a id="c{$comment.id}"></a>
<div class="serendipity_comment serendipity_comment_author_{$comment.author|@makeFilename} {if $entry.author == $comment.auth
or}serendipity_comment_author_self{/if} {cycle values="oddbox, evenbox"}" style="padding-left: {$comment.depth*20}px">
                <p>{if $comment.url}
                <a href="#c{$comment.id}" title="{$CONST.LINK_TO_COMMENT|sprintf:$comment.trace}">#{$comment.trace}</a> - <a
href="{$comment.url}" target="_blank">{$comment.author|@default:$CONST.ANONYMOUS}</a> {$CONST.SAYS}:<br />
            {else}
                <a href="#c{$comment.id}" title="{$CONST.LINK_TO_COMMENT|sprintf:$comment.trace}">#{$comment.trace}</a> - {$c
omment.author|@default:$CONST.ANONYMOUS}
            {/if} {$comment.timestamp|@formatTime:$CONST.DATE_FORMAT_SHORT} - {if $entry.allow_comments}
                (<a href="#serendipity_CommentForm" onclick="document.getElementById('serendipity_replyTo').value='{$comment.
id}';">{$CONST.REPLY}</a>)             {/if}{if $entry.is_entry_owner}
                (<a href="{$comment.link_delete}" onclick="return confirm('{$CONST.COMMENT_DELETE_CONFIRM|@sprintf:$comment.i
d:$comment.author}');">{$CONST.DELETE}</a>)
            {/if}</p>
        <p>{$comment.body}</p>
        </div>
{foreachelse}
    <p class="nocomments">{$CONST.NO_COMMENTS}</p>
{/foreach}
I've set the template to this 'test' directory now.

Posted: Mon Aug 21, 2006 8:39 pm
by garvinhicking
Hm.

Could you edit your include/functions_comments.inc.php file. There you should find "function serendipity_displayCommentForm()".

Before this line:

Code: Select all

serendipity_smarty_fetch('COMMENTFORM', 'commentform.tpl');
you could add an

Code: Select all

die('FETCHING COMMENTFORM');
And see if that will be executed. Something in this function seems to either not be called, or to not properly render the file.

If you care to get your hands dirty, you could grep around to see where the displayCommentForm() function gets called, and you might want to check where serendipitx_smarty_fetch (declared in functions_smarty.inc.php) gets the full path to the commentform.tpl...?

HTH,
Garvin

Posted: Mon Aug 21, 2006 8:54 pm
by dougburns
garvinhicking wrote: you could add an

Code: Select all

die('FETCHING COMMENTFORM');
It looks like that was executed. I got a single HTML page with just "FETCHING COMMENTFORM" in the top left corner.
If you care to get your hands dirty, you could grep around to see where the displayCommentForm() function gets called, and you might want to check where serendipitx_smarty_fetch (declared in functions_smarty.inc.php) gets the full path to the commentform.tpl...?

Code: Select all

-bash-3.00$ find . -name "*" -exec grep -il displayCommentForm {} \;
./comment.php
grep: ./serendipity_config_local.inc.php: Permission denied
./include/functions_comments.inc.php
./include/functions_entries.inc.php
./include/admin/comments.inc.php
./docs/CHANGED_FILES
I'm not sure about the last bit ...

Code: Select all

function &serendipity_smarty_fetch($block, $file, $echo = false) {
    global $serendipity;

    $output = $serendipity['smarty']->fetch('file:'. serendipity_getTemplateFile($file, 'serendipityPath'), null, null, ($echo === true && $serendipity['smarty_raw_mode']));
    $serendipity['smarty']->assign($block, $output);

    return $output;
}
The bit I can't work out is why one template will work apparently perfectly, but other templates have comment form problems and/or RSS problems. Baffling ...

Oh, and just in case this is any help (although I suspect not), the template shows smileys in Firefox but not IE?!

Posted: Mon Aug 21, 2006 9:08 pm
by garvinhicking
Hi!

You could try to modify the smarty function:

Code: Select all

function &serendipity_smarty_fetch($block, $file, $echo = false) {
    global $serendipity;

    $f = serendipity_getTemplateFile($file, 'serendipityPath');
    echo 'Fetching ' . $block . ' FROM: "' . $f . '"<br />';
    $output = $serendipity['smarty']->fetch('file:'. $f, null, null, ($echo === true && $serendipity['smarty_raw_mode']));
    $serendipity['smarty']->assign($block, $output);

    return $output;
} 
This should give you some raw output at the end of your blogpage?

Regards
,Garvin

Posted: Mon Aug 21, 2006 9:12 pm
by dougburns
Thanks for all your help. Apologies for my utter lack of PHP skills :-(

That's a useful debugging tool, though! This is what comes back ...

Fetching COMMENTFORM FROM: ""
Fetching ENTRIES FROM: "/var/www/vhosts/oracledoug.com/httpdocs/serendipity/templates/test/entries.tpl"
Fetching CONTENT FROM: "/var/www/vhosts/oracledoug.com/httpdocs/serendipity/templates/test/content.tpl"