{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.
volkman
Posts: 179
Joined: Wed 13. Jul 2005, 12:52
Location: Hamburg, Germany

Post by volkman »

uuuups, it is the character ' in the categorie title "It's a God..." and "Christine's"...?

I renamed them and it works!!!!!

Is there a way to keep the ' , like commenting out or so???

volkman
tinoo
Posts: 311
Joined: Thu 16. Jun 2005, 11:16
Location: Zürich, Switzerland
Contact:

Post by tinoo »

could be - just try it...
Greetz, tinoo
erich_k4
Posts: 160
Joined: Thu 31. Mar 2005, 10:29
Location: Austria

Post by erich_k4 »

Hello volkman!
to keep the '
For a quick workaround replace
#118 with this one

Code: Select all

$sql .= "SELECT *, \"".$alias[0]['acat_name']."\" AS catname, UNIX_TIMESTAMP(article_tstamp) AS article_date FROM ".DB_PREPEND."phpwcms_article ";
and #130 with this one

Code: Select all

$sql .= "( SELECT *, \"".$alias[$i]['acat_name']."\" AS catname, UNIX_TIMESTAMP(article_tstamp) AS article_date FROM ".DB_PREPEND."phpwcms_article ";
Erich
volkman
Posts: 179
Joined: Wed 13. Jul 2005, 12:52
Location: Hamburg, Germany

Post by volkman »

Hi Erich,
works now perfect. Had to solve some more problems but now works like a charm.
The teaser_tag is great!!!!!
thx for your help

volkman
Last edited by volkman on Tue 30. Aug 2005, 17:00, edited 1 time in total.
volkman
Posts: 179
Joined: Wed 13. Jul 2005, 12:52
Location: Hamburg, Germany

Post by volkman »

sorry, double-post
cbmr777
Posts: 11
Joined: Thu 25. Aug 2005, 21:25
Location: U.S.
Contact:

Post by cbmr777 »

Thank you!!!!

Thank you Erich for the fix, and
Thank you Volkman for sticking with it and not giving up!
You are awesome!!!!!!!!!!!

All I gotta do is mess with the templates to get it looking pretty! LOL

Now off to try my hand at the Ionrock's calendar mod! :wink:

(P.S. Sorry Yves (StudioZ) for commandeering the thread with my problem!!)
Christine
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Post by StudioZ »

cbmr777 wrote:...
Now off to try my hand at the Ionrock's calendar mod! :wink:
(P.S. Sorry Yves (StudioZ) for commandeering the thread with my problem!!)
He! No problems Christine :wink:
Regarding the Calendar...
I prefer waiting for an integrated solid OG's solution :roll:
Would be much less hasle to deal with :D
Also... I read today that WebCalendar now have a mini calendar in the CVs:
A new minical.php file is available in v1.1-CVS to play around with. It defaults
to __public__, but can be configured to display events from NUC calendars that
are marked public.

The size and font-size are configurable from within the file as well.

Let me know how it works.

-Ray
Cheers,
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
rtilghman
Posts: 107
Joined: Tue 1. Mar 2005, 17:22

Post by rtilghman »

Very cool replacement tag, and the latest version seems to work well on my 1.2.3 install. Definite plus for PHPwcms.

However, I have one request for the next version. Can you possibly incorporate another variable into the tag that allows the us to specify a summary list template to use for the teaser list being formed?

Basically a big shortcoming of PHPwcms right now is that you can only specify a single summary list for a given article across the site. For example, I have news pieces that appear one way in the home page, another in the news main page, and yet another in the news archive page. However, I can only specify one summary format in the article page of the news pieces at present.

What would be great is if, in the TEASER_EX tag I use on each of those pages I could specify the summary list .TMPL file to be used. This would let me just create a new TMPL for a certain type of display.

I would do it myself but my PHP isn't that solid, and I had a little trouble figuring out how the variables get parsed from the tag to grab the setting and use it to set the template name.

Thanks,
Rick

UPDATE:

I hadn't really looked to closely at this... just a little lazy I guess. I added this into my teaser ex RT. Basically you just add on a digit in the RT parser, give it a name in the function init, and then put in some logic in the template parser down below. I basically had mine use the default logic if the variable is blank, but use the specified TMPL if its present.

Usage:

Code: Select all

{TEASER_EX2:newsarchive|3;eventarchive|3:-1:article_created|asc:0::1:22,23:summary_NewsList.tmpl}
The following is the actual code in the modified RT:

Code: Select all

<?php
    // TEASER_EX replacementtag (by Erich Munz, 2005)
    //
    // Version 1.06
    //
    // Tested with phpwcms ver 1.2.3 DEV
    //
    // copy this file to phpwcms_template\inc_script\frontend_render
    //
    // Syntax: {TEASER_EX:category_alias|count[;category_aliasx|countx]:articles_per_page:sortfield|sortdir:show_cat_name:pagelink_text:columns:exclude_articles}
    //
    //         category_alias    Name of the category to get the articles from
    //         count             Number of articles to show from this category, -1 for all articles
    //         ------------------
    //         articles_per_page Number of articles on one page, -1 all articles on one page
    //         ------------------
    //         sortfield         VALUES default, article_created, article_tstamp, article_begin, article_end, article_title
    //         sortdir           sort direction VALUES - ASC (ascending) or DESC (descending)
    //         ------------------
    //         show_cat_name     Show the categroy name VALUES - 0 = no, 1= Yes
    //         ------------------
    //         pagelink_text     Pagelinktext e.g. Page or Seite
    //         ------------------
    //         columns           Number of columns VALUES >= 1
    //                           To format the Table and the Tablecells you can use the CSS-Values teaserTable, teaserTableLeftCell and teaserTableRightCell
    //                           in the "default css"-section of the backend
    //                           e.g.
    //                           #teaserTable {border:1px solid #FFFFFF; border-collapse:collapse;}
    //                           #teaserTableLeftCell {border-left:1px solid #C4C4C4; padding:4px;}
    //                           #teaserTableRightCell {border-left:1px solid #C4C4C4; padding:4px;}
    //         ------------------
    //         exclude_articles  List of article id's
    //                           VALUES  e.g. 10,15,23 or empty
    //                           These articles are not visible in the result list
    //                           useful if your "TEASER_EX Article" is in the same category as the articles
    //
    // example: {TEASER_EX:en_general|3;en_fairs|-1;en_jobs|-1:3:article_begin|DESC:1:Page:1:10,15,23}
    //          {TEASER_EX:en_general|3:6:default:0:Seite:2:}


    //----------------------------------------------
    // Mainpart
    //
    //----------------------------------------------
    function get_teaser_ex_content2 ($c_reqdata, $c_displaycount = -1, $c_sort, $c_showcat_name = 0 , $c_pagelinktext, $c_columns = 1, $c_article_id, $c_listemp_id, $db)
    {
        global $template_default, $phpwcms;
         
        if ($c_reqdata)
        {
            $c_displaycount = intval($c_displaycount);
            if ($c_displaycount <= 0) $c_displaycount = 100000; // All news on one page
            $c_columns = intval($c_columns);
            if ($c_columns <= 0) $c_columns = 1;

            $articles_per_column = round($c_displaycount/$c_columns);
            $colwidth = round(100/$c_columns);
            $recordcount = 0;
            $array_sort = explode("|", $c_sort);

            $show_news_from = intval($_GET['f']);
            
            $catalias = $GLOBALS['content']['struct'][$GLOBALS['content']['cat_id']]['acat_alias'];
            if(!$phpwcms["rewrite_url"])
              $refurl = $_SERVER['PHP_SELF']."?".$catalias;
            else
              $refurl = $catalias;

            $array_alias = explode(";", $c_reqdata);

            $sqlwhere = "";
            for ($i = 0; $i <= count($array_alias)-1; $i++)
            {
                $aliasdata = explode("|", $array_alias[$i]);
                $alias[$i] = array('cat_alias' => $aliasdata[0],
                                   'topcount' => $aliasdata[1],
                                   'acat_id' => '',
                                   'acat_name' => '');
                $sqlwhere .= "'".aporeplace($alias[$i]['cat_alias'])."',";
            }
            $sqlwhere = substr($sqlwhere, 0, -1);
            $sql = "SELECT acat_id, acat_name FROM ".DB_PREPEND."phpwcms_articlecat WHERE acat_alias IN (".$sqlwhere.");";
             
            if ($result = mysql_query($sql, $db))
            {
                for ($i = 0; $i <= mysql_num_rows($result)-1; $i++)
                {
                    mysql_data_seek($result, $i);
                    $row = mysql_fetch_array ($result);
                    $alias[$i]['acat_id'] = $row[0];
                    $alias[$i]['acat_name'] = $row[1];
                }
                mysql_free_result($result);
                 
                $article_list = array();
                 
                // VISIBLE_MODE: 0 = frontend (all) mode, 1 = article user mode, 2 = admin user mode
                switch(VISIBLE_MODE)
                {
                    case 0:
                     $sql_VISIBLE_MODE = " AND article_public=1 AND article_aktiv=1";
                    break;
                    case 1:
                     $sql_VISIBLE_MODE = " AND article_uid=".$_SESSION["wcs_user_id"];
                    break;
                    //case 2: admin mode no additional neccessary
                    default:
                     $sql_VISIBLE_MODE = "";
                }
                 
                $sql = "";

                if (!$array_sort[0] or $array_sort[0] == 'default') $array_sort[0] = 'article_sort ';
                $sqlorder = " ORDER BY ".$array_sort[0]." ".$array_sort[1];

                if (count($array_alias) == 1)
                {
                    $sql .= "SELECT *, '".$alias[0]['acat_name']."' AS catname, UNIX_TIMESTAMP(article_tstamp) AS article_date FROM ".DB_PREPEND."phpwcms_article ";
                    $sql .= " WHERE article_cid = '".$alias[0]['acat_id']."'";
                    $sql .= $sql_VISIBLE_MODE;
                    $sql .= " AND article_deleted=0 AND article_begin < NOW() AND article_end > NOW() ";
                    if ($c_article_id) $sql .= " AND article_id NOT IN ($c_article_id) ";
                    $sql .= $sqlorder;
                    if ($alias[0]['topcount'] >= 1) $sql .= " LIMIT  ".$alias[0]['topcount'];
                }
                else
                {
                  for ($i = 0; $i <= count($array_alias)-1; $i++)
                  {
                      $sql .= "( SELECT *, '".$alias[$i]['acat_name']."' AS catname, UNIX_TIMESTAMP(article_tstamp) AS article_date FROM ".DB_PREPEND."phpwcms_article ";
                      $sql .= " WHERE article_cid = '".$alias[$i]['acat_id']."'";
                      $sql .= $sql_VISIBLE_MODE;
                      $sql .= " AND article_deleted=0 AND article_begin < NOW() AND article_end > NOW() ";
                      if ($c_article_id) $sql .= " AND article_id NOT IN ($c_article_id) ";
                      if ($alias[$i]['topcount'] >= 1) $sql .= " LIMIT  ".$alias[$i]['topcount'];
                      $sql .= " ) ";
                      $sql .= " UNION ";
                  }
                  $sql = substr($sql, 0, -6);
                  $sql .= $sqlorder;
                }

                $result = mysql_query($sql, $db);

                $recordcount = mysql_num_rows($result);

                #PageLinks
                $pages = ceil($recordcount/$c_displaycount);

                if ($pages > 1) 
                {
                    $pagelinks = '<div id="teaserPageNav">'.$c_pagelinktext."&nbsp;";
                    for ($i = 1; $i <= $pages; $i++)
                    {
                        $nextitem = $i * $c_displaycount-$c_displaycount;
                        $page = $show_news_from/$c_displaycount+1;
                        if ($i == $page)
                            {
                            $pagelinks = $pagelinks."&nbsp;<span id=\"teaserPageNavItems\">".$i."</span>&nbsp;";
                        }
                        else
                            {
                                if(!$phpwcms["rewrite_url"])
                                {
                                  $pagelinks = $pagelinks.'&nbsp;<a id="teaserPageNavItems" href="'.$refurl.'&f='.$nextitem.'">'.$i.'</a>&nbsp;';
                                }
                                else
                                {
                                  if (strpos($refurl, '&f=') === true)
                                  {
                                  	$a_refurl = explode("&", $refurl);
                                    $refurl = $a_refurl[0];
                                  }
                                  else
                                  {
                                  	$a_refurl = explode(".", $refurl);
                                    $refurl = $a_refurl[0];
                                  }
                                  $pagelinks = $pagelinks.'&nbsp;<a id="teaserPageNavItems" href="'.$refurl.'&f='.$nextitem.'.phtml">'.$i.'</a>&nbsp;';
                                }
                        }
                    }
                    $pagelinks .= '</div>';
                }
                else
                {
                  $pagelinks = '';
                }


                if ($show_news_from + $c_displaycount > $recordcount )
                    {
                    $lastrow = $recordcount;
                }
                else
                    {
                    $lastrow = $show_news_from+$c_displaycount;
                }

                if ($result)
                {
                    for ($i = $show_news_from; $i <= $lastrow-1; $i++)
                    {
                        mysql_data_seek($result, $i);
                        $row = mysql_fetch_array ($result);
                        $article_list[$row["article_id"]] = array(
                        "article_id" => $row["article_id"],
                            "article_cid" => $row["article_cid"],
                            "article_title" => $row["article_title"],
                            "article_subtitle" => $row["article_subtitle"],
                            "article_keyword" => $row["article_keyword"],
                            "article_summary" => $row["article_summary"],
                            "article_redirect" => $row["article_redirect"],
                            "article_date" => $row["article_date"],
                            "article_username" => $row["article_username"],
                            "article_sort" => $row["article_sort"],
                            "article_notitle" => $row["article_notitle"],
                            "article_created" => $row["article_created"],
                            "article_image" => unserialize($row["article_image"]),
                            "article_timeout" => $row["article_cache"],
                            "article_nosearch" => $row["article_nosearch"],
                            "article_nositemap" => $row["article_nositemap"],
                            "article_catname" => $row["catname"] );
                    }
                    mysql_free_result($result);
                }

                //print_r ($article_list);

                $listing = '';
                if ($template_default["space_top"]) //start with space at top
                   $listing .= '<img src="img/leer.gif" border="0" width="20" height="'.$template_default["space_top"].'" alt="" /><br>';
                
                $listing .= "\n<!-- START NEWS TABLE -->\n<table id=\"teaserTable\"><tr><td id=\"teaserTableLeftCell\" valign=\"top\" width=\"$colwidth%\">";

                $tmpllist = array(); //temporary array for storing templates to minimize load

                $articlecount = 0;
                foreach($article_list as $key => $value)
                {
                    if ($articlecount >= $articles_per_column)
                    {
                            $listing .= "</td><td id=\"teaserTableRightCell\" valign=\"top\" width=\"$colwidth%\">";
                            $articlecount = 0;
                    }

                    //$article_link  = $link_to."?id=".$cat_id.",".$article_list[$key]["article_id"].",0,0,1,0";
                    $article_link = "index.php?id=".$article_list[$key]["article_cid"].",".$article_list[$key]["article_id"].",0,0,1,0";

                    //add available keywords to page wide keyword field
                    $GLOBALS['content']['all_keywords'] .= $article_list[$key]["article_keyword"].',';

                    // build image/image link
                    $article_list[$key]["article_image"]["poplink"] = '';
                    $thumb_image = false;
                    $thumb_img = '';

                    if (!empty($article_list[$key]["article_image"]["caption"]))
                    {
                        $caption = explode('|', $article_list[$key]["article_image"]["caption"]);
                    }
                    else
                        {
                        $caption[0] = '';
                    }

                    $article_list[$key]["article_image"]["caption"] = $caption[0]; //$caption[0]

                    if (!empty($article_list[$key]["article_image"]["hash"]))
                    {
                        $thumb_image = get_cached_image(array("target_ext" => $article_list[$key]["article_image"]['ext'],
                            "image_name" => $article_list[$key]["article_image"]['hash'] . '.' . $article_list[$key]["article_image"]['ext'],
                            "max_width" => $article_list[$key]["article_image"]['width'],
                            "max_height" => $article_list[$key]["article_image"]['height'],
                            "thumb_name" => md5($article_list[$key]["article_image"]['hash'].$article_list[$key]["article_image"]['width'].$article_list[$key]["article_image"]['height'].$GLOBALS['phpwcms']["sharpen_level"])
                        ));
                         
                        if ($thumb_image != false)
                        {
                            $caption[1] = (!isset($caption[1])) ? '' :
                             html_specialchars($caption[1]);
                            if (!isset($caption[2]))
                            {
                                $caption[2] = array('', ' target="_blank"');
                            }
                            else
                            {
                                //proof target of link
                                $caption[2] = explode(' ', trim($caption[2]));
                                $caption[2][1] = (!isset($caption[2][1])) ? '' :
                                 ' target="'.$caption[2][1].'"';
                            }
                             
                            $thumb_img = '<img src="'.PHPWCMS_IMAGES . $thumb_image[0] .'" border="0" '.$thumb_image[3].' alt="'.$caption[1].'" title="'.$caption[1].'">';
                             
                            if ($article_list[$key]["article_image"]["zoom"])
                            {
                                $zoominfo = get_cached_image(array("target_ext" => $article_list[$key]["article_image"]['ext'],
                                    "image_name" => $article_list[$key]["article_image"]['hash'] . '.' . $article_list[$key]["article_image"]['ext'],
                                    "max_width" => $GLOBALS['phpwcms']["img_prev_width"],
                                    "max_height" => $GLOBALS['phpwcms']["img_prev_height"],
                                    "thumb_name" => md5($article_list[$key]["article_image"]['hash'].$GLOBALS['phpwcms']["img_prev_width"].$GLOBALS['phpwcms']["img_prev_height"].$GLOBALS['phpwcms']["sharpen_level"])
                                )
                                );
                                 
                                if ($zoominfo != false)
                                {
                                     
                                    $article_list[$key]["article_image"]["poplink"] = 'image_zoom.php?show='.base64_encode($zoominfo[0].'?'.$zoominfo[3]);
                                     
                                    if (!empty($caption[2][0]))
                                    {
                                        $open_link = $caption[2][0];
                                        $return_false = '';
                                    }
                                    else
                                    {
                                        $open_link = $article_list[$key]["article_image"]["poplink"];
                                        $return_false = 'return false;';
                                    }
                                     
                                    $article_list[$key]["article_image"]["poplink"] = '<a href="'.$article_list[$key]["article_image"]["poplink"].'" '. 'onClick="window.open(\''.$open_link. "','previewpic','width=".$zoominfo[1]. ",height=".$zoominfo[2]."');".$return_false. '"'.$caption[2][1].'>'.$thumb_img.'</a>';
                                }
                                 
                                unset($caption);
                            }
                        }
                    }
                     
                    // article list based template check
                    if (!empty($article_list[$key]["article_image"]['tmpllist']) && $article_list[$key]["article_image"]['tmpllist'] != 'default')
                    {
                        // try to read the template files
                        // 1. try to check if template was read
                        if (!isset($tmpllist[ $article_list[$key]["article_image"]['tmpllist'] ]))
                        {
							[color=red]// RT EDIT: added template variable
							if ($c_listemp_id == '') {
								$tmpllist[ $article_list[$key]["article_image"]['tmpllist'] ] = include_ext_php(PHPWCMS_ROOT.$GLOBALS['phpwcms']['templates'].'inc_cntpart/articlesummary/list/'.$article_list[$key]["article_image"]['tmpllist'], 1);
							}
							else {
                            	$tmpllist[ $article_list[$key]["article_image"]['tmpllist'] ] = include_ext_php(PHPWCMS_ROOT.$GLOBALS['phpwcms']['templates'].'inc_cntpart/articlesummary/list/'.$c_listemp_id, 1);[/color]
							}
                        }
                        if ($tmpllist[ $article_list[$key]["article_image"]['tmpllist'] ])
                        {
                            //rendering
                            $tmpl = $tmpllist[ $article_list[$key]["article_image"]['tmpllist'] ];
                             
                            if ($c_showcat_name == 1)
                            {
                                $tmpl = render_cnt_template($tmpl, 'TITLE', html_specialchars($article_list[$key]["article_catname"]." - ".$article_list[$key]["article_title"]));
                            }
                            else
                            {
                                $tmpl = render_cnt_template($tmpl, 'TITLE', html_specialchars($article_list[$key]["article_title"]));
                            }
                            $tmpl = render_cnt_template($tmpl, 'SUB', html_specialchars($article_list[$key]["article_subtitle"]));
                            $tmpl = render_cnt_template($tmpl, 'SUMMARY', $article_list[$key]["article_summary"]);
                            $tmpl = render_cnt_template($tmpl, 'IMAGE', $thumb_img);
                            $tmpl = render_cnt_template($tmpl, 'ZOOMIMAGE', $article_list[$key]["article_image"]["poplink"]);
                            $tmpl = render_cnt_template($tmpl, 'CAPTION', nl2br(html_specialchars($article_list[$key]["article_image"]["caption"])));
                            $tmpl = render_cnt_template($tmpl, 'ARTICLELINK', $article_link);
                            $tmpl = render_cnt_template($tmpl, 'EDITOR', $article_list[$key]["article_username"]);
                            $tmpl = render_cnt_template($tmpl, 'ARTICLEID', $article_list[$key]["article_id"]);
                            $tmpl = render_cnt_template($tmpl, 'MORE', $template_default["top_readmore_link"]);
                            $tmpl = render_cnt_template($tmpl, 'BEFORE', '<!--before//-->');
                            $tmpl = render_cnt_template($tmpl, 'AFTER', '<!--after//-->');
                            $tmpl = render_cnt_date($tmpl, $article_list[$key]["article_date"]);
                            if ($articlecount > 0)
                            {
                                $tmpl = render_cnt_template($tmpl, 'SPACE', '<!--space//-->');
                            }
                            else
                            {
                                $tmpl = render_cnt_template($tmpl, 'SPACE', '');
                            }
                            $listing .= $tmpl;
                            $article_list[$key]["article_image"]['tmpllist'] = 1;
                        }
                        else
                        {
                            $article_list[$key]["article_image"]['tmpllist'] = 0;
                        }
                    }
                    else  // do the standard template redering
                    {
                        $listing .= $template_default["top_listentry_before"];

                        // space between summary listings
                        if ($articlecount > 0)
                        {
                            $listing .= $template_default["space_between_sum"];
                        }
                         
                        if ($article_list[$key]["article_title"] && !$article_list[$key]["article_notitle"])
                        {
                            //$listing .= get_html_part($article_list[$key]["article_title"], $template_default["top_headline_class"], $article_link);
                            $listing .= $template_default["top_headline_before"];
                            $listing .= '<a href="'.$article_link.'">';
                            if ($c_showcat_name == 1)
                                {
                                $listing .= html_specialchars($article_list[$key]["article_catname"]." - ".$article_list[$key]["article_title"]);
                            }
                            else
                                {
                                $listing .= html_specialchars($article_list[$key]["article_title"]);
                            }
                            $listing .= '</a>';
                            $listing .= $template_default["top_headline_after"];
                            $listing .= $template_default["top_headline_space"];
                        }
                        if ($article_list[$key]["article_subtitle"])
                        {
                            //$listing .= get_html_part($article_list[$key]["article_subtitle"], $template_default["top_subheadline_class"], $article_link);
                            $listing .= $template_default["top_subheadline_before"];
                            $listing .= '<a href="'.$article_link.'">';
                            $listing .= html_specialchars($article_list[$key]["article_subtitle"]);
                            $listing .= '</a>';
                            $listing .= $template_default["top_subheadline_after"];
                            $listing .= $template_default["top_subheadline_space"];
                        }
                        if ($article_list[$key]["article_summary"] || !empty($article_list[$key]["article_image"]['cname']))
                        {
                            //$listing .= "<span class=\"".$template_default["top_text_class"]."\">";
                            $listing .= $template_default["top_text_before"];
                             
                            //build image table when image available
                            if (!empty($thumb_img))
                            {
                                $listing .= '<table width="1%" cellspacing="0" border="0" cellpadding="0" align="left" ';
                                if ($template_default["article"]["image_table_bgcolor"])
                                {
                                    $listing .= 'bgcolor="'.$template_default["article"]["image_table_bgcolor"].'" ';
                                }
                                $listing .= 'style="float:left;margin:2px 5px 3px 0;">';
                                $listing .= "\n<tr><td>".'<a href="'.$article_link.'">';
                                $listing .= $thumb_img."</a></td></tr>\n";
                                 
                                if ($article_list[$key]["article_image"]["caption"])
                                {
                                    $listing .= '<tr><td><img src="img/leer.gif" alt="" width="1" height="3"></td></tr>';
                                    $listing .= "\n<tr><td";
                                    if ($template_default["article"]["image_caption_class"])
                                    {
                                        $listing .= ' class="'.$template_default["article"]["image_caption_class"].'"';
                                    }
                                    if ($template_default["article"]["image_caption_bgcolor"])
                                    {
                                        $listing .= ' bgcolor="'.$template_default["article"]["image_caption_bgcolor"].'"';
                                    }
                                    if ($template_default["article"]["image_caption_valign"])
                                    {
                                        $listing .= ' valign="'.$template_default["article"]["image_caption_valign"].'"';
                                    }
                                    if ($template_default["article"]["image_caption_align"])
                                    {
                                        $listing .= ' align="'.$template_default["article"]["image_caption_align"].'"';
                                    }
                                    $listing .= '>';
                                    $listing .= $template_default["article"]["image_caption_before"];
                                    $listing .= nl2br(html_specialchars($article_list[$key]["article_image"]["caption"]));
                                    $listing .= $template_default["article"]["image_caption_after"];
                                    $listing .= "</td></tr>\n";
                                }
                                $listing .= '</table>';
                            }
                            $listing .= $article_list[$key]["article_summary"];
                            $listing .= $template_default["top_readmore_before"];
                            $listing .= '<a href="'.$article_link.'">';
                            $listing .= $template_default["top_readmore_link"];
                            //$listing .= "</a>".$template_default["top_readmore_after"]."</span>";
                            $listing .= '</a>'.$template_default["top_readmore_after"];
                            $listing .= $template_default["top_text_after"];
                        }
                        $listing .= $template_default["top_listentry_after"];
                    }
                    $articlecount++;
                }

                $listing .= "</td></tr></table>\n<!-- END NEWS TABLE -->\n";

                if ($c_displaycount < 100000) $listing .= "<p>$pagelinks</p>\n";

                if ($template_default["space_bottom"]) //ends with space at bottom
                   $listing .= '<img src="img/leer.gif" border="0" width="20" height="'.$template_default["space_bottom"].'" alt="" /><br>';

                return str_replace("<br /><br />", "<br />", $listing);
            }
            return '';
        }
        return '';
    }
     
    // -------------------------------------------------------------
    $content["all"] = preg_replace('/\{TEASER_EX2:(.*?):(.*?):(.*?):(.*?):(.*?):(.*?):(.*?):(.*?)\}/ie', 'get_teaser_ex_content2("$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", $db);', $content["all"]);
    // -------------------------------------------------------------
?>

User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Post by StudioZ »

Hi Erich,

UPDATED:

We would very much like to see
for this great {TEASER_EX} replacement tag:

01 : The possibility to have the category name isolated
on it's own line and styled by the css. (Would be cool 8))

02 : The integration (1.2.5) of the new tweak/feature,
that Oliver brought to the articles:
When you now deselect the "more" option, it really turns it OFF.
Both for the image, Title and Subtitle. (A must :wink: )
In Refs:
include/inc_act/act_articlecontent.php
http://cvs.sourceforge.net/viewcvs.py/p ... 2&view=log
include/inc_lib/article.editcontent.inc.php
http://cvs.sourceforge.net/viewcvs.py/p ... e&view=log
include/inc_tmpl/article.editsummary.tmpl.php
http://cvs.sourceforge.net/viewcvs.py/p ... e&view=log
include/inc_tmpl/article.new.tmpl.php
http://cvs.sourceforge.net/viewcvs.py/p ... e&view=log

03 : rtilghman proposition for
assigning a template variable. (A must :wink: )

04 : Tinoo's proposition : I'm waiting for an automatic summary-cutting... Summary text
contains sometimes quite a lot of informations, but on some places the
teaser can be only a few words long. So i'm looking for an option which
counts the words and puts a "..." after, for example, 10 words followed by
the [MORE] tag... So the option "10 Words" is what i'm looking for....

Cheers,

Yves
Last edited by StudioZ on Fri 9. Sep 2005, 16:34, edited 2 times in total.
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
tinoo
Posts: 311
Joined: Thu 16. Jun 2005, 11:16
Location: Zürich, Switzerland
Contact:

Post by tinoo »

StudioZ wrote: 01 : The possibility to have the category name isolated
on it's own line and styled by the css. (Would be cool 8))

02 : The integration (1.2.5) of the new tweak/feature,
that Oliver brought to the articles:
When you now deselect the "more" option, it really turns it OFF.
Both for the image, Title and Subtitle. (A must :wink: )
In Refs:
include/inc_act/act_articlecontent.php
http://cvs.sourceforge.net/viewcvs.py/p ... 2&view=log
include/inc_lib/article.editcontent.inc.php
http://cvs.sourceforge.net/viewcvs.py/p ... e&view=log
include/inc_tmpl/article.editsummary.tmpl.php
http://cvs.sourceforge.net/viewcvs.py/p ... e&view=log
include/inc_tmpl/article.new.tmpl.php
http://cvs.sourceforge.net/viewcvs.py/p ... e&view=log

03 : rtilghman proposition for
assigning a template variable. (A must :wink: )
04 I'm waiting for an automatic summary-cutting... Summary text
contains sometimes quite a lot of informations, but on some places the
teaser can be only a few words long. So i'm looking for an option which
counts the words and puts a "..." after, for example, 10 words followed by
the [MORE] tag... So the option "10 Words" is what i'm looking for....
Greetz, tinoo
User avatar
anthony.abraira
Posts: 99
Joined: Sun 11. Sep 2005, 07:42
Location: Mars Hill, NC
Contact:

Just the darn title...

Post by anthony.abraira »

:shock:
Alright, I have given it a good two hours and I still can't get the damn {teaser} tag to display the category title by itself. Does anybody have this simple code?

I tried this:

Code: Select all

{TEASER_EX:about|0;1}
This did nothing but show that code in the header. Check it out:

http://riverside.abraira.com

I await anxiously :?
nomukaiki
Posts: 7
Joined: Sun 11. Sep 2005, 15:57

bug?

Post by nomukaiki »

The TEASER doesn't replace the regular phpwcms tags on the summary text.
It means that if there is a tag inside the summary text, it will show up the tag and not the replaced code.
Example (inside the summary text): [ID 3]click here[/ID]
nomukaiki
Posts: 7
Joined: Sun 11. Sep 2005, 15:57

Post by nomukaiki »

Columns

If I have only 2 articles to show, and use 2 columns on the TEASER, it will show up the 2 articles summary on 2 rows and not 2 columns.

Code: Select all

{TEASER_EX:promotions|5:-1::0::2:}
Is this a feature or a bug?[/b]
nomukaiki
Posts: 7
Joined: Sun 11. Sep 2005, 15:57

Post by nomukaiki »

anthony.abraira

You should always use all the parameters of the TEASER_EX, even if you don't need them you can leave them blank.
Your

Code: Select all

{TEASER_EX:about|0;1}
will never work. It should be at least:

Code: Select all

{TEASER_EX:about|-1:1::0:::}
To show only the TITLE, like you need, you MUST use another template (at this version of the teaser_ex: 1.06). Maybe on a future version you can use diferent template from the one saved on the articles.[/b]
1996 328ti
Posts: 317
Joined: Mon 19. Apr 2004, 06:10
Location: Greenville, SC USA
Contact:

request

Post by 1996 328ti »

Would it be possible instead of
Page 1 2 3
to have
Page 1 2 3 all whereas all would be a hyperlink.
Post Reply