{TEASER_EX} Replacement tag v1.90 - 10.1.2007

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
jareeq
Posts: 22
Joined: Wed 15. Feb 2006, 21:49
Contact:

Post by jareeq »

erich_k4 wrote:
jareeq wrote:
im writing about 1.61 downloaded from recomended link that line is missing and problem with sort order is back again...
could not verify this:

Version 1.61, 14.03.2006
for mysql.4
line 281 $sql .= $sqlorder;
line 298 $sql .= $sqlorder;

dont know what file you are talking about!!!!!???

or do you mean it should be before the "LIMIT" statement on line 293?
yes :-)
erich_k4
Posts: 160
Joined: Thu 31. Mar 2005, 10:29
Location: Austria

Post by erich_k4 »

jareeq,

you are right, it seems to work in the version for mysql 3, don't know what happened to mysql 4 version....strange, very strange (-> hobgoblins , maybe) :D

it will be corrected in the next version...
Erich
jareeq
Posts: 22
Joined: Wed 15. Feb 2006, 21:49
Contact:

Post by jareeq »

You found it some time ago :-)

http://www.phpwcms.de/forum/viewtopic.p ... &start=219

:-)

for me it is not a problem I know where insert the line :D
ff123
Posts: 172
Joined: Thu 9. Jun 2005, 20:03
Location: The Netherlands
Contact:

Post by ff123 »

Hi,

I am using the reptags {teaser_ex} and {show_content:xxx}.

Now I want to show a news archive with {teaser_ex}. So {teaser_ex} shows the news items, but only the summary of the articles.

Now I want to show certain news items on the front page. So I use {show_content:xxx}. But {show_content:xxx} shows the ful article not the summary.

My problem is that I have to enter the news twice: in the summary for {teaser_ex} and in the full article for {show_content:xxx}. My client won't like this.

Does anyone have a suggestion how to solve this?
-- Vuurvos --
erich_k4
Posts: 160
Joined: Thu 31. Mar 2005, 10:29
Location: Austria

Post by erich_k4 »

ff123 wrote:Hi,

I am using the reptags {teaser_ex} and {show_content:xxx}.

Now I want to show a news archive with {teaser_ex}. So {teaser_ex} shows the news items, but only the summary of the articles.

Now I want to show certain news items on the front page. So I use {show_content:xxx}. But {show_content:xxx} shows the ful article not the summary.

My problem is that I have to enter the news twice: in the summary for {teaser_ex} and in the full article for {show_content:xxx}. My client won't like this.

Does anyone have a suggestion how to solve this?
you want to show the summary text and an particular contentpart below the summary?

if so, try this modified version:

Code: Select all

<?php
//----------------------------------------------------------------------------------------------
// {SHOW_CONTENT}
// AUTHOR:          Jens Zetterström
// DESCRIPTION:    Shows the content of the article content part with the specified id.
// INSTALLATION:    Put the code in frontend_render (for example in a file called show_content.php)
//                  Note: If the article content part contains replacement tags (for example {SITE}),
//                  they will not be replaced because code in frontend_render is executed after those
//                  replacement tags already have been processed. To fix, put the code in
//                  content.article.inc.php instead.
// {SHOW_CONTENT:acontent_id:show_summary}
// where acontent_id is the id of the content part.
// and set show_summary to 1 if you want to show the summary, 0 to hide it    -> added by Erich Munz, erich_k4
//----------------------------------------------------------------------------------------------
function show_content($id, $showsummary, $db)
{
   $CNT_TMP = '';
   $template_default = $GLOBALS["template_default"];
   
   $sql =   "SELECT * " . 
            "FROM " . DB_PREPEND . "phpwcms_articlecontent " .
            "INNER JOIN " . DB_PREPEND . "phpwcms_article ON " . DB_PREPEND . "phpwcms_article.article_id = " . DB_PREPEND . "phpwcms_articlecontent.acontent_aid " .
            "WHERE acontent_id = " . $id . " " .
            "AND acontent_visible = 1 " .
            "AND acontent_trash = 0 " .
            "AND " . DB_PREPEND . "phpwcms_article.article_deleted=0 AND ".DB_PREPEND."phpwcms_article.article_begin < NOW() " .
            "AND " . DB_PREPEND . "phpwcms_article.article_end > NOW() ";
            "ORDER BY acontent_sorting, acontent_id;";
             
   if($cresult = mysql_query($sql, $db) or die("error retrieving article from database"))
   {
      if($crow = mysql_fetch_array($cresult))
      {
         if ($showsummary == 1) $CNT_TMP .= '<div class="articleSummary">'.$crow["article_summary"].'</div>'; // -> added by Erich Munz, erich_k4

         // Space before
         if($crow["acontent_before"])
         {
            $CNT_TMP .= '<div style="margin:' . $crow["acontent_before"] . 'px 0 0 0; padding:0 0 0 0; clear:both;"></div>';
         }

                  // include content part code section
         include("include/inc_front/content/cnt" . $crow["acontent_type"] . ".article.inc.php");

         //check if top link should be shown
         if($crow["acontent_top"])
         {
            if($template_default["article"]["top_sign_before"].$template_default["article"]["top_sign_after"])
            {
               $CNT_TMP .= $template_default["article"]["top_sign_before"];
               $CNT_TMP .= '<a href="#top">'.$template_default["article"]["top_sign"].'</a>';
               $CNT_TMP .= $template_default["article"]["top_sign_after"];
            }
            else
            {
               $CNT_TMP .= '<br /><a href="#top">' . $template_default["article"]["top_sign"] . '</a>';
            }
         }

         // Space after
         if($crow["acontent_after"])
         {
            $CNT_TMP .= '<div style="margin:0 0 ' . $crow["acontent_after"] . 'px 0; padding:0 0 0 0; clear:both;"></div>';
         }
      }
   }
   return $CNT_TMP;
}

if( ! ( strpos($content["all"],'{SHOW_CONTENT:')===false ) )
{
   $content["all"] = preg_replace('/\{SHOW_CONTENT:(.*?):(.*?)\}/ie', 'show_content("$1", "$2", $db);', $content["all"]);
}


?>
USAGE:
{SHOW_CONTENT:acontent_id:show_summary}
where acontent_id is the id of the content part.
and set show_summary to 1 if you want to show the summary, 0 to hide it

NOTE that this modified version only displays the htmlformatted summary text, without images or assigned templatesettings...
Erich
ff123
Posts: 172
Joined: Thu 9. Jun 2005, 20:03
Location: The Netherlands
Contact:

Post by ff123 »

Thanx for the fast reply and the enhanced reptag!! :D
One thing I wonder about if it is possible to show only the summary without having made an article. This is because I only write summaries, because the {teaser_ex} only shows summaries.
Of course I could ask the client to write a summary AND a full article, but that will be more work for him.
Last edited by ff123 on Mon 10. Apr 2006, 20:19, edited 1 time in total.
-- Vuurvos --
erich_k4
Posts: 160
Joined: Thu 31. Mar 2005, 10:29
Location: Austria

Post by erich_k4 »

ff123 wrote: Of course I could ask the client to write a summary AND a full article, but that will be more work for him.
but thats the normal way
Erich
ndm
Posts: 14
Joined: Thu 26. Jan 2006, 14:06
Location: Switzerland
Contact:

Post by ndm »

tach.

RT läuft prima.

http://www.lpv-sev.ch/index.php?de_pressespiegel

danke :!: :!: :!:

gruss andi
keep vintage alive ! use windows !
stjohannboys
Posts: 14
Joined: Sat 6. May 2006, 17:32
Location: Düsseldorf
Contact:

Post by stjohannboys »

Hi @ all:

hab mir das hier runtergeladen und wieder hochgeladen :wink:

hab den {TEASER_EX:news|-1:6:default|ASC:1:Seite:1::default:-1:Weiter:1:0::0} eingesetzt aber guckt selbst --> http://www.f95-fan.de.vu


Was ist falsch?

Hätte das gern wie der Andi/ndm vor mir nur mit 2 News nebeneinander!

Danke im voraus,

Alex
stjohannboys
Posts: 14
Joined: Sat 6. May 2006, 17:32
Location: Düsseldorf
Contact:

Post by stjohannboys »

Hi @ all:

schaut mal bitte --> http://www.f95-fan.de.vu

Wie kann ich vor jede Nachricht ein Bild machen?
ssyfrig
Posts: 364
Joined: Tue 2. Mar 2004, 17:01
Location: Zürich / Switzerland
Contact:

Post by ssyfrig »

poste mal Dein Template Code ..

Gruss Sven
stjohannboys
Posts: 14
Joined: Sat 6. May 2006, 17:32
Location: Düsseldorf
Contact:

Post by stjohannboys »

hab das standard-template (glaube ich)!
ssyfrig
Posts: 364
Joined: Tue 2. Mar 2004, 17:01
Location: Zürich / Switzerland
Contact:

Post by ssyfrig »

try

Code: Select all

<table width="300" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100" rowspan="2">[IMAGE]<a href="{ARTICLELINK}">{IMAGE}</a>[/IMAGE]</td>
    <td>[TITLE]{TITLE}[/TITLE]</td>
  </tr>
  <tr>
    <td>[SUMMARY]{SUMMARY}[/SUMMARY]</td>
  </tr>
</table>
save as test.tmpl and upload to /phpwcms_template/inc_cntpart/articlesummary/list/

change your RT ...
{TEASER_EX:news|-1:6:default|ASC:0:Seite:2::test.tmpl:200:Alle Seiten:0:0::0}

greez Sven
User avatar
albu
Posts: 22
Joined: Sat 31. Dec 2005, 18:06
Location: Germany
Contact:

Post by albu »

jetzt kommt mein "Problem" mit teaser - trotz generator und neuester Version kommt bei mir nur EIN Resultat...
folgende Seitenkonstruktion:
Level1
Level 1.1
Level 1.1.1
Artikel zu 1.1.1
Level 1.1.2
Artikel zu 1.1.2
Level 1.1.3
Artikel zu 1.1.3
Level 1.2
Level 2
Level 2.1
Level 3

usw.

Alle Artikel und Kategorien haben Schlagtext und -1 als Anzahl...

Ich möchte nun eine Übersuiht z.B. der neuen Artikel zu Level 1.1 - das sollten dann z.B. 3 Stück sein...

Was mache ich falsch? (es wird nur ein Artikel angezeigt, also WIE es geht weis ich schon :-) )

PHP 4.3.1
MySQL 4.1.10a
erich_k4
Posts: 160
Joined: Thu 31. Mar 2005, 10:29
Location: Austria

Post by erich_k4 »

albu wrote:jetzt kommt mein "Problem" mit teaser - trotz generator und neuester Version kommt bei mir nur EIN Resultat...
folgende Seitenkonstruktion:
Level1
Level 1.1
Level 1.1.1
Artikel zu 1.1.1
Level 1.1.2
Artikel zu 1.1.2
Level 1.1.3
Artikel zu 1.1.3
Level 1.2
Level 2
Level 2.1
Level 3

usw.

Alle Artikel und Kategorien haben Schlagtext und -1 als Anzahl...

Ich möchte nun eine Übersuiht z.B. der neuen Artikel zu Level 1.1 - das sollten dann z.B. 3 Stück sein...

Was mache ich falsch? (es wird nur ein Artikel angezeigt, also WIE es geht weis ich schon :-) )

PHP 4.3.1
MySQL 4.1.10a
wie schaut dein teaser_Ex RT aus? haben deine level einen alias?
Erich
Post Reply