PDA

View Full Version : Lates News Date Hack


Bharrabhaz
10-04-2005, 05:34 AM
Hi guys, i posted a problem here, and i self find the solution..hehehe

The Subdreamer default of Latest news Plugin is like:

A new notice in our site today
31/08/2005

I can change for this:
31/08/2005 - A new notice in our site today

Because i wanna make a Newspaper website...
Simple?
Was!!!

Letīs go:


In p3_latestnews folder, edit the file latestnews.php.
In the line 259, remove the </br> tag, like this:

&#036;subtitle = &#39;&#60;br /&#62;&#39; . iif&#40;&#036;article&#91;&#39;datestart&#39;&#93; &#33;= 0, DisplayDate&#40;&#036;article&#91;&#39;datestart&#39;&#93;&#41;, DisplayDate&#40;&#036;article&#91;&#39;datecreated&#39;&#93;&#41;&#41;;

will stay:

&#036;subtitle = &#39; &#39; . iif&#40;&#036;article&#91;&#39;datestart&#39;&#93; &#33;= 0, DisplayDate&#40;&#036;article&#91;&#39;datestart&#39;&#93;&#41;, DisplayDate&#40;&#036;article&#91;&#39;datecreated&#39;&#93;&#41;&#41;;

This is for dont have a break line in the news list.
Now will put the date in front of the news title:

In the line 297, search the code:
echo &#39;&#60;a href=&#34;&#39; . RewriteLink&#40;&#39;index.php?categoryid=&#39; . &#036;article&#91;&#39;categoryid&#39;&#93; . &#39;&p2_articleid=&#39; . &#036;article&#91;&#39;articleid&#39;&#93;&#41; . &#39;&#34;&#62;&#39; . &#036;boldtitlestart . &#036;article&#91;&#39;title&#39;&#93; . &#036;boldtitleend . &#39;&#60;/a&#62;&#39; . &#036;categoryname . &#036;subtitle . &#39;&#60;br /&#62;&#39; . &#036;printlink . &#036;emaillink;

and modify the position of the . &#036;subtitle TAG for BEFORE the &#036;boldtitlestart , if in this case, is the news title link. Lets go:

echo &#39;&#60;a href=&#34;&#39; . RewriteLink&#40;&#39;index.php?categoryid=&#39; . &#036;article&#91;&#39;categoryid&#39;&#93; . &#39;&p2_articleid=&#39; . &#036;article&#91;&#39;articleid&#39;&#93;&#41; . &#39;&#34;&#62;&#39; . &#036;subtitle .&#39; - &#39; . &#036;boldtitlestart . &#036;article&#91;&#39;title&#39;&#93; . &#036;boldtitleend . &#39;&#60;/a&#62;&#39; . &#39;&#60;br /&#62;&#39; . &#036;printlink . &#036;emaillink;

Note if i put the code .&#39; - &#39; in between the tags, for separate the date from the news title.

Now go to the CP, in the latest news panel control , and select the option to show the date in the latest news plugin (if you dont make this, the hack dont works &#33;&#33;&#33;)
Just this.

This hack works in Subdreamer 2.2 , but itīs easy change the others versions (i think).

PS: Iīm not a programmer, but i have many persistence :lol: ;) ;
PS2: Sorry for my poor english.

Bharrabhaz