Replacement Tag: Comments

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
FeldeMathi
Posts: 58
Joined: Fri 15. Jul 2005, 11:04

Post by FeldeMathi »

yes I did, if I use the replacement tag {COMMENTS:8:5} it works.

Looks like an error with the auto detect function of the article id.
Cassiel
Posts: 24
Joined: Tue 22. Jun 2004, 13:52
Location: Friedrichshafen, Germany
Contact:

Post by Cassiel »

What kind of hacks? -Please tell me more...
Also please post the complete code of the template for your article listing here.
FeldeMathi
Posts: 58
Joined: Fri 15. Jul 2005, 11:04

Post by FeldeMathi »

OK, I'm using Erichs teaser EX tag to show the newspart.

the whole code for the article listing is:

Code: Select all

<!-- 
sample template for article summary listing
===========================================

TITLE       = article title
SUB         = article subtitle
SUMMARY     = article summary text
IMAGE       = summary image (only the <img src="..."> tag)
ZOOMIMAGE   = if the image is click-zoomable (<a href...><img...></a>)
CAPTION     = summary image caption
ARTICLELINK = url to full article
MORE        = the "more..." text/image like defined in template_defaults
BEFORE      = show before listing entry
AFTER       = show after listing entry
SPACE       = show this between listings
DATE        = show article date {DATE:FORMAT:LANG} or {DATE:FORMAT}
EDITOR      = name of editor
ARTICLEID   = ID of list entry

//-->
		<div style="padding-bottom:10px;" width="100%">


<div style="padding:5px; margin:0px; background-color:#F5F5F5; border:1px solid #CCCCCC;">
  <table cellspacing="0" cellpadding="0" border="0">
  <tr>
    <td width="150px" valign="top">
      <div><a href="{ARTICLELINK}">{IMAGE}</a></div>
      <div class="image_caption" style="padding:3px 0px 3px 0px;">[CAPTION]<div align="center">{CAPTION}</div>[/CAPTION]</div>
    </td>
    <td width="10px"><img src="img/leer.gif" border="0" width="10px" height="1px" alt=""></td>
    <td width="330px" valign="top">
      <div class="articleHead" style="margin-bottom:3px;"><a href="{ARTICLELINK}">[TITLE]<h1 style="margin:0 0 5px 0;">{TITLE}</h1>[/TITLE]</a></div>
      <div class="articleSubHead" style="margin-bottom:3px;">[SUB]<h3 style="margin:0 0 5px 0;">{SUB}</h3>[/SUB]</div>
      <div class="articleText" style="padding:0; margin-top:10px;">[SUMMARY]<p style="margin:0">{SUMMARY}</p>[/SUMMARY]</div>
   
       </td>
  </tr>
  </table>
<div style="clear:both;"></div>
</div>
<div class="datum" style="margin-bottom:5px; text-align: left;">erstellt von: {EDITOR} am {DATE:d.m.Y}</div>
[PHP] 
 
$my_article_id = "{ARTICLEID}"; 
$my_article_cid = $GLOBALS['content']['articles'][$my_article_id]['article_cid']; 

echo('{COMMENTS:' . $my_article_id . ':' . $my_article_cid . '}') 
[/PHP]
<div class="news_readmore" align="right" style="margin-top:3px;">[MORE]<a href="{ARTICLELINK}">{MORE}</a>[/MORE]</div>
</div>

<center>----------------------------------------------------------------------------------------------</center>
<p>
<p>
I havent done any other hacks.

is this helpful ?
erich_k4
Posts: 160
Joined: Thu 31. Mar 2005, 10:29
Location: Austria

Post by erich_k4 »

OK, I'm using Erichs teaser EX tag to show the newspart.
Are you using the latest version of teaser_ex (1.51)? Because earlier versions than 1.5 did not render PHP and other RT's

Erich
FeldeMathi
Posts: 58
Joined: Fri 15. Jul 2005, 11:04

Post by FeldeMathi »

another interesting idea, I will update the teaser tag at first, thanks erich !
Cassiel
Posts: 24
Joined: Tue 22. Jun 2004, 13:52
Location: Friedrichshafen, Germany
Contact:

Post by Cassiel »

Yes, this is maybe the problem...
FeldeMathi
Posts: 58
Joined: Fri 15. Jul 2005, 11:04

Post by FeldeMathi »

I just updated the teaser EX replacement tag to the new version.

Now it looks a bit better. The result I see at my homepage is: {COMMENT:188:}
Thats it, it looks like its still not reading out the article cid.

I tried it with an running 1.2.3 and 1.2.5 version, same thing.

PS: If I change the article cid in my sample.tmpl to a number, e.g. if i paste in the code

Code: Select all

<div class="datum" style="margin-bottom:5px; text-align: left;">erstellt von: {EDITOR} am {DATE:d.m.Y}</div>
[PHP] 
// Strange hack, but it works 
$my_article_id = "{ARTICLEID}"; 
$my_article_cid = $GLOBALS['content']['articles'][$my_article_id]['article_cid']; 

echo('{COMMENTS:' . $my_article_id . ':' . 1 . '}') 
[/PHP]

I get the text "Write comment". Even if I have 3 comments in there.
Cassiel
Posts: 24
Joined: Tue 22. Jun 2004, 13:52
Location: Friedrichshafen, Germany
Contact:

Post by Cassiel »

I think the problem is that you're using TEASER_EX and not the standard phpwcms article listing engine. Sorry dude, but I don't know how to fix that because I'm not using TEASER_EX...

Hint: Try do to a var_dump on the following section of the array: $GLOBALS['content']['articles']. If you get any dumped information, try to get one level deeper into the array: $GLOBALS['content']['articles'][$my_article_id] Now dump that stuff. If you don't get anything dumped so far: Seems like TEASER_EX is not processing the $GLOBALS array.

Another idea: Maybe is TEASER_EX processing the PHP after replacing the replacement tags (e.g. {ARTICLEID}). Then try the following:

Code: Select all

[PHP] 
// Strange hack, but it works 
$my_article_id = "{ARTICLEID}"; 
$my_article_cid = $GLOBALS['content']['articles'][{ARTICLEID}]['article_cid']; 

echo('{COMMENTS:' . $my_article_id . ':' . $my_article_cid . '}') 
[/PHP]
FeldeMathi
Posts: 58
Joined: Fri 15. Jul 2005, 11:04

Post by FeldeMathi »

Hallo cassiel,

just for my understanding, the comment function below your article is just a content part "guestbook/comment" with another template then the guestbook ? is that right ?
Cassiel
Posts: 24
Joined: Tue 22. Jun 2004, 13:52
Location: Friedrichshafen, Germany
Contact:

Post by Cassiel »

Yes, thats right :)
velo
Posts: 38
Joined: Sun 29. May 2005, 14:48

Post by velo »

Anyone knows if this mod still excists? Cassiels site seems offline....:(
Where can i find it?

Velo
FeldeMathi
Posts: 58
Joined: Fri 15. Jul 2005, 11:04

Post by FeldeMathi »

Diese Sache scheint nicht mit einer dev Version von phpwcms zu funktionieren. Hat jemand eine Ahnung was man ändern könnte, damit das klappt ?


Looks like a problem with the dev-version. its working with the stable version. anybody an idea how to change it that it works fine with 1.2.3 dev ?
Post Reply