{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.
Kvist
Posts: 87
Joined: Sat 30. Oct 2004, 04:19
Location: Denmark
Contact:

Any news on code problem?

Post by Kvist »

Hi Erich

I saw that you were back on the board and wanted to ask you if you noticed the problem with the rendering of code such as , [PHP] etc.?

If that problem could be fixed it would really make my day - or year even! :)

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

Re: Any news on code problem?

Post by StudioZ »

Hello Kvist
Erich as posted the solution at page 10 of this thread.
Check for Erich's post at the bottom: Tue Nov 22, 2005 05:55 :wink:
It solves the parsing of different formating tags but not sure about th PHP tag... :roll: 8)
Kvist wrote:Hi Erich

I saw that you were back on the board and wanted to ask you if you noticed the problem with the rendering of code such as , [PHP] etc.?

If that problem could be fixed it would really make my day - or year even! :)

/Kvist
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
Kvist
Posts: 87
Joined: Sat 30. Oct 2004, 04:19
Location: Denmark
Contact:

Oooh

Post by Kvist »

Oh, so you actually have to have your eyes open on this board?? Thanks! :oops:
Replace line 482 (v1.0.6) with

Kode:
return str_replace("<br /><br />", "<br />", html_parser(render_PHPcode($listing)));
Am I being stupid if I ask whicht file he's referring to and that the text in line 482 originally is? (Never comprehended the line numbers - I guess you have to have a special editor whereas I use notepad.)

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

Post by StudioZ »

I added the file here for you, to be able to download the latest :wink:
http://www.malouin.ws/design/downloads-phpwcms.phtml

Cheers,
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
Kvist
Posts: 87
Joined: Sat 30. Oct 2004, 04:19
Location: Denmark
Contact:

Merci

Post by Kvist »

Merci bien mec, C très gentile! :D
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Re: Oooh

Post by DeXXus »

Kvist wrote:I guess you have to have a special editor whereas I use notepad.)

/Kvist
In notepad:

CTRL + G = goto line :wink:
Kvist
Posts: 87
Joined: Sat 30. Oct 2004, 04:19
Location: Denmark
Contact:

Re: Oooh

Post by Kvist »

DeXXus wrote:
Kvist wrote:I guess you have to have a special editor whereas I use notepad.)

/Kvist
In notepad:

CTRL + G = goto line :wink:
VERY handy information - thanks! :D
ssyfrig
Posts: 364
Joined: Tue 2. Mar 2004, 17:01
Location: Zürich / Switzerland
Contact:

Post by ssyfrig »

Hi

Is it possibly to show just one page.... in place of several?

Example.
I have a news section on my site witch contains 20 news article.
on my Homepage I just want to show the teasers from the last 2 Article.

at the moment I use the tag like this:
{TEASER_EX:news:2:article_tstamp|DESC:0:Seite:1:159}

Thanks, Sven
kobos
Posts: 52
Joined: Mon 21. Nov 2005, 21:50

Post by kobos »

Hi

it would look something like this

{TEASER_EX:news|2:2:article_created|DESC:0:Page:1:}

then put a link on the bottom directing the user too http://yourdomain/?news
kobos
Posts: 52
Joined: Mon 21. Nov 2005, 21:50

Post by kobos »

What is the difference between Page and Seite? As in what effect do they have.
ssyfrig
Posts: 364
Joined: Tue 2. Mar 2004, 17:01
Location: Zürich / Switzerland
Contact:

Post by ssyfrig »

Seite is page in German ...

@kobos

thanks it works ... :D :D

greez Sven
JensZ
Posts: 136
Joined: Wed 16. Feb 2005, 12:18
Location: Stockholm, Sweden
Contact:

Post by JensZ »

Hi All,

If you don't want the updated version of the reptag_teaser_ex file to cause your old reptags to crash then ADD this line

Code: Select all

$content["all"] = preg_replace('/\{TEASER_EX:(.*?):(.*?):(.*?):(.*?):(.*?):(.*?):(.*?)\}/ie', 'get_teaser_ex_content("$1", "$2", "$3", "$4", "$5", "$6", "$7", "", -1, "", $db);', $content["all"]);
AFTER the following

Code: Select all

$content["all"] = preg_replace('/\{TEASER_EX:(.*?):(.*?):(.*?):(.*?):(.*?):(.*?):(.*?):(.*?):(.*?):(.*?)\}/ie', 'get_teaser_ex_content("$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", "$10", $db);', $content["all"]);
Erich, correct me if I'm wrong.

Here's another enhancement to allow you to show the article creation date in the article listing:

in reptag_teaser_ex ADD:

Code: Select all

$tmpl = render_cnt_date($tmpl, $article_list[$key]["article_created"], "CREATEDATE");


BELOW this line:

Code: Select all

$tmpl = render_cnt_date($tmpl, $article_list[$key]["article_date"]);
You'll also need to REPLACE the function render_cnt_date() in include/inc_front/front.func.inc.php with this:

Code: Select all

function render_cnt_date($text='', $date, $tag='DATE') {   
	// render date by replacing placeholder tags by value
	//$language="EN", $format="Y/m/d", $date_now=0
	$text = preg_replace('/\{'.$tag.':(.*?):(.*)\}/ie', 'international_date_format("$2","$1","'.$date.'")', $text);
	$text = preg_replace('/\{'.$tag.':(.*?)\}/ie', 'date("$1",'.$date.')', $text);
	return $text;
}

Great work, Erich, and good idea with the generator! This reptag is really awesome, a little tricky to set up, but the generator takes care of that I hope.

A suggestion for next release: Maybe make it backwards compatible with previous versions. Seems like this thread gets flooded with formatting issues...

Cheers,

Jens
ssyfrig
Posts: 364
Joined: Tue 2. Mar 2004, 17:01
Location: Zürich / Switzerland
Contact:

Post by ssyfrig »

Hi

I update the RT to V 1.5. it works all fine except the template usage.

Do I understand right? If I define a template (temp.tmpl) the teaser should use this template for listing the article not the one that was defined in the article. Because if I change the Art. List. Temp. to temp.tmpl it works fine...

{TEASER_EX:news|2:2:article_tstamp|ASC:0:seite:1::temp.tmpl:150:}

Ich habe auf die aktuelle Version 1.5 upgedatet, alles funktioniert. Ausser das der Teaser nicht das Template verwendet welches ich angeben. Zum Beispiel temp.tmpl. Verstehe ich das richtig, der Teaser sollte das Template verwenden welches im RT angeben ist und nicht das im Artikel selber.

Wenn ich es im Artikel umstelle funktioniert es....


{TEASER_EX:news|2:2:article_tstamp|ASC:0:seite:1::temp.tmpl:150:}

thanks for help, Sven
erich_k4
Posts: 160
Joined: Thu 31. Mar 2005, 10:29
Location: Austria

Post by erich_k4 »

Hi Sven!

Fixed in ver 1.51!

Att.: now we have three possible values for the parameter "listtemplate":

default: to render all articles with the default-template settings
system: to render the articles with the template set in the backend
or the Templatename of the template you want to use for rendering, regardless of which template is set in the backend

Erich
ssyfrig
Posts: 364
Joined: Tue 2. Mar 2004, 17:01
Location: Zürich / Switzerland
Contact:

Post by ssyfrig »

Hi Erich

rock & roll :D :D cool, it works. thanks man!

Gruss Sven
Post Reply