1
exbanious
Changing Format of Article in News 1.2
  • 2005/2/20 3:43

  • exbanious

  • Not too shy to talk

  • Posts: 113

  • Since: 2004/5/30


For a certain project I am doing, I need to change the format of the news article page. I need for all articles posted before a certain date to appear one way, and any articles posted after that to look another way.


Here is the code i want to change:

Quote:


if ( trim($bodytext) != '' ) {
$articletext = explode("[pagebreak]", $bodytext);
$story_pages = count($articletext);

if ($story_pages > 1) {
include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
$pagenav = new XoopsPageNav($story_pages, 1, $storypage, 'page', 'storyid='.$storyid);
$xoopsTpl->assign('pagenav', $pagenav->renderNav());
//$xoopsTpl->assign('pagenav', $pagenav->renderImageNav());

if ($storypage == 0) {
$story['text'] = $story['text'].'<br /><br />'.$articletext[$storypage];
} else {
$story['text'] = $articletext[$storypage];
}
} else {
$story['text'] = $story['text'].'<br /><br />'.$bodytext;
}}




I want all articles before a certain date to appear like the above.


I would like for all articles after a certain date to appear as:



Quote:


if ( trim($bodytext) != '' ) {
$articletext = explode("[pagebreak]", $bodytext);
$story_pages = count($articletext);

if ($story_pages > 1) {
include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
$pagenav = new XoopsPageNav($story_pages, 1, $storypage, 'page', 'storyid='.$storyid);
$xoopsTpl->assign('pagenav', $pagenav->renderNav());
//$xoopsTpl->assign('pagenav', $pagenav->renderImageNav());

if ($storypage == 0) {
$story['text'] = $articletext[$storypage];
} else {
$story['text'] = $articletext[$storypage];
}
} else {
$story['text'] = "<br />" .$bodytext;
}}



i'm not much of a programmer, but i'm assumming i need to
write this into an "if" "else" statement, but, i am having a problem defining a date and an "if" statement that will use a set date.
then again, i might be completely off in my assumption....

i hope this question is clear enough..

Login

Who's Online

181 user(s) are online (75 user(s) are browsing Support Forums)


Members: 0


Guests: 181


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits