1
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!

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.



2
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
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.



3
fruki
Some Errors...
  • 2006/2/22 6:15

  • fruki

  • Just popping in

  • Posts: 4

  • Since: 2006/2/22


Hi there! I'm pretty new to xoops, but I recognise an error when I see it. This is what I did:
I installed XOOPS 2.2.3a FINAL on my server, then download the Community Pack from this web page and installed some modules. Everything was going ok until I decided to Un-install some of the modules and installing them again. I though this would have no change on my site but it did:
The Main Menu is BLANK, only the title will show. The next errors came in:


Notice [PHP]: Object of class XoopsUser could not be converted to int in file class/theme.php line 442
Notice [PHP]: Only variable references should be returned by reference in file kernel/blockinstance.php line 111
Warning [Xoops]: Smarty error: unable to read resource: "db:system_block_mainmenu.html" in file class/smarty/Smarty.class.php line 1084
Warning [Xoops]: Smarty error: unable to read resource: "db:system_block_mainmenu.html" in file class/smarty/Smarty.class.php line 1084


I need some help because I've just installed XOOPS so I dont mind reinstalling it, but I'm worried that this happens again.
Thanks in advance.



4
fruki
Re: Question about news module
  • 2006/2/22 5:13

  • fruki

  • Just popping in

  • Posts: 4

  • Since: 2006/2/22


Hi, I have News module 1.4 and tried to do what you said: I have created a block (Recent News) but it wont show at my index page. I've selected it to show in "All Frontside Pages". What am I doing wrong?

EDIT: FIXED. My problem was firstly that I had given permissions to all webmasters, but didnt gave viewing permissions to everyone. Secondly, I didnt know I had to select the topics I needed to use when installing the new "Recent News" block.




TopTop



Login

Who's Online

192 user(s) are online (141 user(s) are browsing Support Forums)


Members: 0


Guests: 192


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