Answers to comments

Postby phunkphorce on Wed Apr 27, 2005 2:26 pm

updated version of the plugin, now all other plugins will work just fine too witih nested comments:

http://www.lifetype.net/blog.php/plog_ ... mments.zip

There is also a major optimization so now things should feel a tad faster. If the plugin works fine, I will make it available via sf.net so please let me know if you find some major issue with it.
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby vurt on Wed Apr 27, 2005 2:57 pm

Anonymous wrote:edit your templates/xx/postandcomments.template file


Any Examples?

*vurt
vurt
 
Posts: 45
Joined: Tue Mar 29, 2005 10:26 am
Location: Germany

error when there are no comments

Postby vurt on Thu Apr 28, 2005 6:17 am

When an article has no comments there is an error with the nested_comments plugin:
Exception message: Invalid argument supplied for foreach()
Error code: 2
-- Backtrace --
/home/13/vhvirtud/plog/plugins/nestedcomments/pluginnestedcomments.class.php(74): _nestcomments
/home/13/vhvirtud/plog/plugins/nestedcomments/pluginnestedcomments.class.php(105): pluginnestedcomments._nestcomments
/home/13/vhvirtud/plog/tmp/1/%%-16^%%-1663759078^postandcomments.template.php(31): pluginnestedcomments.getnestedcomments
/home/13/vhvirtud/plog/class/template/smarty/Smarty.class.php(1281): include
/home/13/vhvirtud/plog/class/template/cachedtemplate.class.php(48): smarty.fetch
/home/13/vhvirtud/plog/class/view/smartyview.class.php(190): cachedtemplate.fetch
/home/13/vhvirtud/plog/class/view/blogview.class.php(212): smartyview.render
/home/13/vhvirtud/plog/class/view/viewarticleview.class.php(73): blogview.render
/home/13/vhvirtud/plog/class/controller/controller.class.php(325): viewarticleview.render
/home/13/vhvirtud/plog/index.php(41): blogcontroller.process
/home/13/vhvirtud/plog/blog.php(38): include_once
/home/13/vhvirtud/plog/blog(8): include_once

Solved this by enclosing the foreach that outputs the comments by an if-statement:
Code: Select all
{if $post->getTotalComments() > 0}


*vurt
vurt
 
Posts: 45
Joined: Tue Mar 29, 2005 10:26 am
Location: Germany

Postby phunkphorce on Thu Apr 28, 2005 6:32 am

whoops :oops: I will fix this problem later on.
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Re: error when there are no comments

Postby Guest on Sat May 07, 2005 1:20 am

vurt wrote:Solved this by enclosing the foreach that outputs the comments by an if-statement:
Code: Select all
{if $post->getTotalComments() > 0}


*vurt


can u teach put this code to where?? because i got the same problem when installing the plugin
Guest
 

Postby Guest on Sat May 07, 2005 1:23 am

when i install i got this error
Parse error: parse error, unexpected T_ENDFOREACH in /home/twenty4/public_html/plog/tmp/1/%%-16^%%-1644784257^postandcomments.template.php on line 76
Guest
 

Re: error when there are no comments

Postby Guest on Sat May 07, 2005 4:27 am

Anonymous wrote:can u teach put this code to where?? because i got the same problem when installing the plugin


Code: Select all
{if $post->getTotalComments() > 0}
   {assign var=comments value=$nestedcomments->getNestedComments($post)}
   {foreach from=$comments item=comment}
{assign var=comments value=$nestedcomments->getNestedComments($post)}
   {foreach from=$comments item=comment}
     <div class="comment_{$comment->getValue("depth")}">
      {$comment->getTopic()}<br/>
      {$comment->getText()}<br/>
     </div>
   {/foreach}
{/if}
Guest
 

Postby augur on Sat May 07, 2005 4:04 pm

have you updated the files that phunkphorce mentioned earlier in this thread (check page one of this thread)
augur
 
Posts: 27
Joined: Tue Mar 15, 2005 7:41 am

Postby bairey on Tue Jan 10, 2006 9:26 pm

I've got this working in my test template (blueish) but I don't see how comments can be replied to. Is there a default template (I tried 'standard' but it's not there either) that has a 'reply to this comment' function?
bairey
 
Posts: 13
Joined: Sun Jan 08, 2006 4:51 pm

Postby jondaley on Wed Jan 11, 2006 10:06 am

There is not a default template, because the default templates don't depend on plugins. There is a standard-with-plugins template that uses some plugins, but I don't know if it uses this particular one.

There should be a readme included with the plugin to show you the template code you need.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby phunkphorce on Wed Jan 11, 2006 1:22 pm

I've implemented this in my own site, just look at the "reply" button next to each one of these comments:

http://www.renalias.net/blog/oscars_roa ... /paris_cdg

You can find the Smarty code to take care of this here:

http://www.renalias.net/templates/oskar ... s.template
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby bairey on Wed Jan 11, 2006 4:14 pm

Thank you! Also snagged the nextPost and previousPost links. Appreciate the help!
bairey
 
Posts: 13
Joined: Sun Jan 08, 2006 4:51 pm

Postby bairey on Sat Jan 14, 2006 5:30 pm

I've got a related question, sort of.. the 'reply to comments' url is this:

Code: Select all
$url->replyCommentLink($post,$comment)


..and that pulls up index.php with the appropriate variables, and displays commentform.template. However, in the template I'm using (water_play, highly hacked except for the index.template) the panel.template is not being called, and I have a blank sidebar.

I could tell you all the places I've looked to see what I can do, but since none panned out, I think I won't bore you. Is there a way to make replyCommentLink() point to a template I make, instead of index.template?

Thanks!

Example: http://www.stephbairey.com/index.php?op ... 3&blogId=1
Temp Login: guest/lifetype
bairey
 
Posts: 13
Joined: Sun Jan 08, 2006 4:51 pm

Postby phunkphorce on Sun Jan 15, 2006 10:46 am

"reply to comment" doesn't post to index.template but instead, postandcomments.template. When you're getting a blank sidebar, can you check what the contents of the generated page are by looking at its source?
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby bairey on Sun Jan 15, 2006 5:50 pm

Yup, it definitely only pulls header.template, commentform.template, and footer.template (possibly others, but NOT postandcomments.template). The ending source shows the form and then it's done:

Code: Select all
...

</form>
  <script src="http://www.stephbairey.com/plugins/remembercommentdata/js/remembercommentdata.js" language="JavaScript" type="text/javascript"></script>

     </div></div>
    </body>
</html>


The panel code goes at the bottom but isn't in there. postandcomments.template does call them all seperately:

Code: Select all
...

<h2>Add Comment</h2>
      {include file="$blogtemplate/commentform.template"}
   {/if}
   
{include file="$blogtemplate/panel.template"}
{include file="$blogtemplate/footer.template"}
bairey
 
Posts: 13
Joined: Sun Jan 08, 2006 4:51 pm

PreviousNext

Return to Templates

cron