11
fruki
Re: Cloning Module - XMSpotlight
  • 2006/3/22 20:01

  • fruki

  • Just popping in

  • Posts: 4

  • Since: 2006/2/22


Hi there, I've downloaded xmspotlight and I find it sweet! The only problem I've got is the same as some people, I want more topics. I've done what you said about the code but didnt work for me. I'm going to try and do it by copying and modifying the code itself but I would apreciate any help because I really want 8 topics to show on the frontpage.

-EDIT-
Ok, after a while I finally acomplished half of what I wanted to do

I placed this just before the return $block; line:

$sql "SELECT * FROM ".$xoopsDB->prefix('xmspotlight')." WHERE xmspotlight_id = 6";
    
$topic5 $xoopsDB->fetchArray($xoopsDB->query($sql));

    
$news6 = array();
    
$storyarray6 NewsStory::getByTopic(1,3);
    
$news6 '';
    foreach(
$storyarray6 as $article6)
    {
        if(!
in_array($article6->storyid(),$txt)){
            
$news6['newstitle'] = $article6->title();
            
$news6['storyid'] = $article6->storyid();
            
$xt = new XoopsTopic($xoopsDB->prefix('topics'), $article6->topicid());
            
$block['image5'] = $xt->topic_imgurl("S");
            
$block['imgpath5'] = XOOPS_URL."/modules/news/images/topics/";
            
$block['category5'] = $xt->topic_title();
            
$block['stories6'][] = $news6;
        }
    }


Then added this line at the end of the template:
<{foreach item=news6 from=$block.stories6}><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news6.storyid}>"><{$news6.newstitle}>a><br><br><{/foreach}>


And ended up with this:

Resized Image
http://www.counter-strike.es/images/news.JPG

As you can see, is the same news as it is above except for that there is no image and there is no title for it. I chose the same topic (topic 1 for me) so I could see if it was working.

Now I'll have to play around to make it show the title and the image. And when im done I will need to add 3 more topics for my web page.

Of course maybe someone knows how to do it, but as I get no response I'm doing my best to achieve it by my own ways. Hope this helps someone.

12
fruki
Re: Cloning Module - XMSpotlight
  • 2006/3/23 1:05

  • fruki

  • Just popping in

  • Posts: 4

  • Since: 2006/2/22


I HAVE MY OWN XMSPOTLIGHT WITH 8 TOPICS!

http://www.counter-strike.es/images/news2.JPG

What I have done:

-Added as many times the code for xmspotlight_block_news.php (got it in previous posts)
-On template searched for the last repeating bunch of code like this:
<tr>
<
td style="width: 50%; padding: 2px; border: 1px solid #999999; background-color: #EEEEEE; font-weight: bold"><{$block.category3}>td><td style="width: 50%; padding: 2px; border: 1px solid #999999; background-color: #EEEEEE; font-weight: bold;"><{$block.category4}>td>
tr>
<
tr>
<
td><img src="<{$block.imgpath3}>/<{$block.image3}>" align="left" style="margin: 8px;"><{foreach item=news4 from=$block.stories4}><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news4.storyid}>"><{$news4.newstitle}>a><br><br><{/foreach}>td>
<
td><img src="<{$block.imgpath4}>/<{$block.image4}>" align="left" style="margin: 8px;"><{foreach item=news5 from=$block.stories5}><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news5.storyid}>"><{$news5.newstitle}>a><br><br><{/foreach}>td>
tr>


Copyied and pasted just underneath.
*6 = your numbers!
Then change:
<tr>
<
td style="width: 50%; padding: 2px; border: 1px solid #999999; background-color: #EEEEEE; font-weight: bold">[color=CC0000]Title[/color]td><td style="width: 50%; padding: 2px; border: 1px solid #999999; background-color: #EEEEEE; font-weight: bold;">[color=CC0000]Title[/color]td>
tr>
<
tr>
<
td><img src="[color=CC0000]/modules/news/images/topics/topic.gif[/color]" align="left" style="margin: 8px;"><{foreach item=news[color=CC0000]6[/colorfrom=$block.stories[color=CC0000]6[/color]}><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news[color=CC0000]6[/color].storyid}>"><{$news[color=CC0000]6[/color].newstitle}>a><br><br><{/foreach}>td>
<
td><img src="[color=CC0000]/modules/news/images/topics/topic.gif[/color]" align="left" style="margin: 8px;"><{foreach item=news[color=CC0000]7[/colorfrom=$block.stories[color=CC0000]7[/color]}><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news[color=CC0000]7[/color].storyid}>"><{$news[color=CC0000]7[/color].newstitle}>a><br><br><{/foreach}>td>
tr>


Copy them and change the numbers for the number you want. I did this to get my 8 topics.

And thats it! I'ts not perfect, as for example if there are no news in a topic the image will still show but I'ts ok for me and hope that for someone else too.

Login

Who's Online

339 user(s) are online (270 user(s) are browsing Support Forums)


Members: 0


Guests: 339


more...

Donat-O-Meter

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

Latest GitHub Commits