1
hawkeyegop
News module (2 questions)
  • 2004/9/30 5:35

  • hawkeyegop

  • Just popping in

  • Posts: 83

  • Since: 2004/9/18


Hello,

I am using what is I guess the generic news module. You can check it out here:

4thelittleguy.com

OK, what I'm wondering is 2 things:

1. Where it says : Posted by Chad Kent on 9/27/2004 0:00:00 (27 reads), how can I leave the date, but take out the time?

2. For the category/title, it says: Social Issues : If You Are Willing To Work, America Will Work For You, how can I get the category and the title to switch places?

Thanks

2
Bassman
Re: News module (2 questions)
  • 2004/9/30 6:07

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


OK, first you have to go to your admin section>templates, and clone the default template set.

Then open the list of templates for the news module in your cloned set, and click on "edit" for the news_item.html template. Once you've opened it, you can edit it:

Quote:

<div class="item">
<div class="itemHead"><span class="itemTitle"><{$story.title}></span></div>
<div class="itemInfo">
<span class="itemPoster"><{$lang_postedby}> <{$story.poster}></span> <span class="itemPostDate"><{$lang_on}> <{$story.posttime}></span> (<span class="itemStats"><{$story.hits}> <{$lang_reads}></span>)
</div>
<div class="itemBody">
<{$story.imglink}>
<p class="itemText"><{$story.text}></p>
</div>
<div class="itemFoot">
<span class="itemAdminLink"><{$story.adminlink}></span> <span class="itemPermaLink"><{$story.morelink}></span>
</div>
</div>

You'll have to rearrange / remove the variables to suit yourself

Don't forget to set your cloned templates as the default set once you're finished.

3
hawkeyegop
Re: News module (2 questions)
  • 2004/9/30 10:59

  • hawkeyegop

  • Just popping in

  • Posts: 83

  • Since: 2004/9/18


Bassman,

Thanks for the response. The problem I am running into now with this is that it seems to me that <{$story.posttime}> is both the date and the time, not just the time only. If I delete that, it just says "Posted by User on " and that's it. Also, the <{$story.title}> seems to be for both the category and title, so I can't figure out how to flip-flop those.

4
rowdie
Re: News module (2 questions)
  • 2004/9/30 13:49

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


For your problem with the time you need to find formatTimestamp() in the news php files and give it a second parameter of "s".

i.e. formatTimestamp($article->published(), "s");

That will make it use the _SHORTDATESTRING format you defined in the language/english/global.php file of Xoops.

Rowd

5
hawkeyegop
Re: News module (2 questions)
  • 2004/9/30 14:38

  • hawkeyegop

  • Just popping in

  • Posts: 83

  • Since: 2004/9/18


rowdie,

Thanks, that worked! Now if I could figure out this other thing. I have a feeling that will be a little more tricky.

6
rowdie
Re: News module (2 questions)
  • 2004/9/30 15:52

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


I had a quick look, doesn't look too difficult Still, make a backup of the files first in case you have problems.

in index.php find:

$story['title'] = $thisstory->textlink().'&nbsp;:&nbsp;'.$story['title'];

change it to this:

$story['title'] .= '&nbsp;:&nbsp;'.$thisstory->textlink();

If you want to change the article title the same way try this...

in article.php find:
$story['title'] = $article->textlink()."&nbsp;:&nbsp;".$article->title();

Change it to:
$story['title'] = $article->title()."&nbsp;:&nbsp;".$article->textlink();

Hope it's what you're after...
Rowd

7
hawkeyegop
Re: News module (2 questions)
  • 2004/9/30 20:16

  • hawkeyegop

  • Just popping in

  • Posts: 83

  • Since: 2004/9/18


The one in article.php worked, but in index.php, this is the only line that seems close to what you said:

$story['title'] = $sarray[$i]->textlink().'&nbsp;:&nbsp;'."<a href='".XOOPS_URL."/modules/news/article.php?storyid=".$sarray[$i]->storyid()."'>".$sarray[$i]->title()."</a>";

8
rowdie
Re: News module (2 questions)
  • 2004/9/30 23:50

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


Sorry, I forgot that I'm using a different version.

Try changing that line you posted to:
$story['title'] = "<a href='".XOOPS_URL."/modules/news/article.php?storyid=".$sarray[$i]->storyid()."'>".$sarray[$i]->title()."</a>".'&nbsp;:&nbsp;'.$sarray[$i]->textlink();

Rowd

9
hawkeyegop
Re: News module (2 questions)
  • 2004/10/1 0:09

  • hawkeyegop

  • Just popping in

  • Posts: 83

  • Since: 2004/9/18


Dude,

That is so awesome. Thank you very very much for your help.

Login

Who's Online

170 user(s) are online (115 user(s) are browsing Support Forums)


Members: 0


Guests: 170


more...

Donat-O-Meter

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

Latest GitHub Commits