1
moods
news block with a quote of post
  • 2004/5/24 14:41

  • moods

  • Just popping in

  • Posts: 10

  • Since: 2004/5/24


Hi all,
I needed a block whick displayed my recent news with the first part of the article instead of only the title and the date. So i tried to create a custom block copying the code from the original one and adding some lines

the new code is like that

<ul>
<{foreach item=news from=$block.stories}>
<li><a
href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.title}></a>
(<{$news.date}>)<BR>
<{$story.text}>
</li>
<{/foreach}>
</ul>

I just added a

<BR>

to have a carriage return between the title and the article, and

<{$story.text}>

to display the first part of the text

It doesn't work (cause I'm very bad ). I tried to format it as a Script php, as HTML, and auto without smilies.
The only result is to see the code i wrote, exactly repeated in the block.

Can anione help me? The task is to have a righ-side block looking like "news-flash"

Thank you and sorry my english

Simone

2
Herko
Re: news block with a quote of post
  • 2004/5/24 14:47

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Have you tried the Spotlight module? This module has a block that does what you want!

Herko

3
ladon
Re: news block with a quote of post
  • 2004/5/24 14:58

  • ladon

  • Quite a regular

  • Posts: 284

  • Since: 2003/10/31


This can't work because the smarty variables are not defined troughout the system. Only on news or in news blocks.

Try making these edits in the news templates (clone default template to be able to make changes). Edit the recent block. But in order to make this actually work you'll alkso need to make some changes to news/blocks/news_top.php. <{$story.text}> has to be defined. In the sql you'll have to add "hometext" to the select. assign the smarty variable:

$hometext= $myts->makeTboxData4Show($myrow["hometext"]);
$news['text'] = $hometext;

I'm not sure everything is correct, but it i'll get you a bit further.

[edit]
err, yup Herko's idea might be easier
[/edit]

4
moods
Re: news block with a quote of post
  • 2004/5/24 15:07

  • moods

  • Just popping in

  • Posts: 10

  • Since: 2004/5/24


Oh, W-O-W!!!
tnx

Simone

5
moods
Re: news block with a quote of post
  • 2004/5/24 15:41

  • moods

  • Just popping in

  • Posts: 10

  • Since: 2004/5/24


mhhh... actually I didn't understand the hard ethod (not for a fault of yours, as you can easily guess). The first and newbie-friendly method fit well (so far).

Theonly problem is that I have to guess what function a button activate in the admin page, cause the menu item are displaied like this "AM_SOMETHING_ETC".

Anyway, thank you all

Problem solved very fast

Simone

6
ladon
Re: news block with a quote of post
  • 2004/5/24 17:51

  • ladon

  • Quite a regular

  • Posts: 284

  • Since: 2003/10/31


When you get things like: "AM_SOMETHING_ETC". That means that the module does not supply the same language as you have set for your Xoops. If there aren't any language files of your language for the module. just go to the module dir and make a new directory within the language directory. It should have the same name as your language. Then copy the english language files to your new directory. Everything should be in english instead of "AM_SOMETHING_ETC". You can now easyly translate the module by altering the files you just copyd.

7
moods
Re: news block with a quote of post
  • 2004/5/24 21:52

  • moods

  • Just popping in

  • Posts: 10

  • Since: 2004/5/24


Oh, yes. I'm a bit rusty cause I leave phpnuke some months ago and i didnn't use CMS anymore. But now i start to remember


Login

Who's Online

88 user(s) are online (65 user(s) are browsing Support Forums)


Members: 0


Guests: 88


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