News MOD

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
tsl
Posts: 28
Joined: Sat 27. Aug 2005, 16:34

Post by tsl »

Hello and thanks for this MOD.

I'm just trying it out and have a few questions:

1. I get wierd dates on my news. They do always get set to 1999.11.30. Has anyone else had that problem?

2. Can I use some sort of REP TAG for this. I would like the news listings to go into a right block on the startpage.


TIA
-tsl-
tsl
Posts: 28
Joined: Sat 27. Aug 2005, 16:34

Post by tsl »

Ok, I see I have a major problem with dates with this MOD.
In table phwcms_news I get the following in the columns for every news I've added today:

news_datepublish article_begin article_end
-------------------- --------------- -------------
0000-00-00 00:00:00 2006-08-31 00:00:00 2006-08-31 00:00:00

When adding the news from within backend I have:
Published: 2006.08.31
Begins: 2006-08-31 00:00:00
Ends: 2006-09-14 00:00:00

After they are saved they all shows a date of 1999.11.30 in backend and as 1999/11/30 in frontend.

Please, if someone have a clue i'd be very happy.
I have tried to understand news.editcontent.inc.php but I'm lost.

Thanks
-tsl-
checco
Posts: 4
Joined: Fri 18. Aug 2006, 11:34
Location: Padova Italy

Post by checco »

Hi,
I have a question...
Does this work in 1.2.8 ?

Thanks for this mod
tsl
Posts: 28
Joined: Sat 27. Aug 2005, 16:34

Post by tsl »

I'm not sure...but I run 1.2.8 and have the above problems (with dates)
netsraC85
Posts: 1
Joined: Thu 7. Sep 2006, 22:41

Post by netsraC85 »

Hallo Zusammen,

ich komme mit der Installation nicht ganz mit. Ich habe mir den Mod von hier runtergeladen: http://www.swissalpine.ch/phpwcms/downloads.phtml

Dann habe ich das zip File entpackt.

Den Ordner include und somit den weiteren inhalt habe ich ins Hauptverzeichnis meiner phpwcms installation getan. Das Verzeichnis template in "phpwcms_template".

den Ordner MOD_News ? Wozu ist der überhaupt dabei.
In keinem Ordner ist was drin naja ich habe ihn erstmal dahin gepackt
"include\inc_module", weil dort der Ordner mod_graphical_text auch war.

So dann bin ich weiter nach der INSTALL.TXT vorgegangen.

Als ich damit fertig war, erschienen im Backend unter Module
3 Pfeile jedoch ohne Link. Mit der Änderung hier aus dem Forum in der
lang.inc.php wurde dann wenigstens schonmal ein link angezeigt.
Aber bei klick auf den Link passiert nichts.

In der Install.txt stand noch was von Anpassen der template sachen aber was soll ich dort anpassen? ich will ja erstmal was sehen.

Hat jemand eine Idee?
markoehl
Posts: 50
Joined: Thu 29. Dec 2005, 11:08
Location: Zürich
Contact:

Post by markoehl »

tsl wrote:
Please, if someone have a clue i'd be very happy.
I have tried to understand news.editcontent.inc.php but I'm lost.
I discoverd a bug in the sql_datetime function. Please replace existing code with:

function sql_datetime($datumtest) {
if ($_SESSION["wcs_user_lang"] == "de" AND !stristr('[/-]', $datumtest)) {
list($tag,$monat,$jahr)= split ('[.]', $datumtest);
if (strlen($jahr) > 4) {
list($jahr,$zeit)= split (' ', $jahr);
} else {
$zeit = "00:00:00";
}
if ((!$tag)and(!$monat)and(!$jahr)) {
$back = "0000-00-00 00:00:00";
return $back;
} else {
if (intval($jahr) <= intval(date("y"))) {
$jahr = $jahr + 2000;
} elseif (intval($jahr) > intval(date("y")) AND intval($jahr) < 100) {
$jahr = intval($jahr) + 1900;
}
if (($jahr>1799) and (checkdate($monat,$tag,$jahr))) {
if (($monat<10)and(substr($monat,0,1)!="0")) { $monat = "0".$monat; }
if (($tag<10)and(substr($tag,0,1)!="0")) { $tag = "0".$tag; }
$back = $jahr."-".$monat."-".$tag." ".$zeit ;
return $back;
} else {
$back = "0000-00-00 00:00:00";
return $back;
}
}
}
return $datumtest;
}
tsl
Posts: 28
Joined: Sat 27. Aug 2005, 16:34

Post by tsl »

Thanks a bunch!
I will give it a shoot...

-tsl-
zed
Posts: 25
Joined: Sun 5. Jun 2005, 17:25
Location: Basel/Zürich, Switzerland
Contact:

Post by zed »

hi all

I have a problem with the dateformat.

What's the syntax for {DATEPUBLISH:FORMAT} var in the templates?
I tested several "php date" syntaxes but none of them worked.

Any ideas?

thx for help
webflo
Posts: 5
Joined: Tue 22. Aug 2006, 18:48

Post by webflo »

zed wrote:hi all

I have a problem with the dateformat.

What's the syntax for {DATEPUBLISH:FORMAT} var in the templates?
I tested several "php date" syntaxes but none of them worked.

Any ideas?

thx for help
Ich hab das selbe Problem.. Wie kann man das formatieren. Nach phpSyntax funktioniert das auf keinen Fal...
jmansa
Posts: 11
Joined: Tue 11. Jul 2006, 22:48

Post by jmansa »

I'm not so good at german, but I get this error...
error while updating or inserting news: INSERT INTO test_phpwcms_news SET news_title='fgdg dfg dfg dfg', news_text='dfg fdg dfg dfg df gdf g', news_datepublish='08-10-2006', news_day='', news_linktext='', news_alink='', news_calink=0, cimage_name='', cimage_id=0, news_cid='0', news_aid='0', article_begin='2014-03-29 00:00:00', set_begin=1, article_end='2028-03-28 00:00:00', set_end=1, news_type=1 ;
Did you have a soulution for this???
markoehl
Posts: 50
Joined: Thu 29. Dec 2005, 11:08
Location: Zürich
Contact:

Post by markoehl »

zed wrote:What's the syntax for {DATEPUBLISH:FORMAT} var in the templates? I tested several "php date" syntaxes but none of them worked.
This function is beta. I have planed to implement that. Will do that soon ;-)
markoehl
Posts: 50
Joined: Thu 29. Dec 2005, 11:08
Location: Zürich
Contact:

Post by markoehl »

jmansa wrote:I'm not so good at german, but I get this error...
error while updating or inserting news: INSERT INTO test_phpwcms_news SET news_title='fgdg dfg dfg dfg', news_text='dfg fdg dfg dfg df gdf g', news_datepublish='08-10-2006', news_day='', news_linktext='', news_alink='', news_calink=0, cimage_name='', cimage_id=0, news_cid='0', news_aid='0', article_begin='2014-03-29 00:00:00', set_begin=1, article_end='2028-03-28 00:00:00', set_end=1, news_type=1 ;
Did you have a soulution for this???
Check your date of publishing: "news_datepublish='08-10-2006'". you have entered a invalid date '09-10-2006'. Try '2006-10-08'
markoehl
Posts: 50
Joined: Thu 29. Dec 2005, 11:08
Location: Zürich
Contact:

Post by markoehl »

checco wrote:Hi,
I have a question...
Does this work in 1.2.8 ?

Thanks for this mod
It should work. Please let me know if not...
markoehl
Posts: 50
Joined: Thu 29. Dec 2005, 11:08
Location: Zürich
Contact:

Post by markoehl »

tsl wrote:Ok, I see I have a major problem with dates with this MOD.
In table phwcms_news I get the following in the columns for every news
Wrong dateformat:

Published: 2006.08.31

Use 2006-08-31 or 31.8.2006
markoehl
Posts: 50
Joined: Thu 29. Dec 2005, 11:08
Location: Zürich
Contact:

Post by markoehl »

tsl wrote: 2. Can I use some sort of REP TAG for this. I would like the news listings to go into a right block on the startpage.
try this: http://www.swissalpine.ch/phpwcms/newsmod.phtml
Post Reply