1
dokks
How do you select less than five articles for news?
  • 2004/6/22 14:00

  • dokks

  • Just popping in

  • Posts: 4

  • Since: 2004/5/13


I've searched, but can't seem to find an answer. I am trying to setup my site to only display one news item at a time on the main page.

I took a look at modules/news/index.php and changed

for ( $i 5$i <= 30$i $i ) {
       
$sel '';
        if (
$i == $xoopsOption['storynum']) {
            
$sel ' selected="selected"';
        }
        
$storynum_options .= '.$i.'"'.$sel.'>'.$i.'';

    }


to

// Changed to allow for only one story to be selected
//   for ( $i = 5; $i <= 30; $i = $i + 5 ) {
   
for ( $i 1$i <= 30$i $i ) {
       
$sel '';
        if (
$i == $xoopsOption['storynum']) {
            
$sel ' selected="selected"';
        }
        
$storynum_options .= '.$i.'"'.$sel.'>'.$i.'';

    }


I then cleared the cache on my browser and the website and went to admin, but still only have the option to select to display news items in increments of 5, starting at 5.

I also tried brute force:

// Test to see if this alters selection ability
// for ( $i = 1; $i <= 30; $i = $i + 5 ) {
//       $sel = '';
//        if ($i == $xoopsOption['storynum']) {
//            $sel = ' selected="selected"';
//        }
                
$i 1;
                
$sel '1';
        
$storynum_options .= '.$i.'"'.$sel.'>'.$i.'';

//    }


No luck though.

Any hints?

2
jlm69
Re: How do you select less than five articles for news?
  • 2004/6/22 14:24

  • jlm69

  • Module Developer

  • Posts: 719

  • Since: 2002/7/19


This is one I'm not sure of but maybe you could look at

news/templates/news_index.html
Maybe edit these lines.



<{section name=i loop=$stories}>
<{include file="db:news_item.html" story=$stories[i]}>


<{/section}>


Hope that helps.

3
dokks
Re: How do you select less than five articles for news?
  • 2004/6/22 15:18

  • dokks

  • Just popping in

  • Posts: 4

  • Since: 2004/5/13


Thanks for the information. I took a look at that and I believe that is just the template for the selection of the topic catagory and the number to show of that catagory.

I'm well and truly stumped on this one. LOL.

4
tl
Re: How do you select less than five articles for news?
  • 2004/6/22 16:37

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


in news/xoops_version.php file, find the following config items (the numbering may vary depends which version you are using)

$modversion['config'][1]['formtype'] = 'select';

$modversion['config'][9]['name'] = 'storycountadmin';

add
('1' => 1, '5' => 5, ...

When you are done, update the module then select 1 as your default value.

Login

Who's Online

344 user(s) are online (188 user(s) are browsing Support Forums)


Members: 0


Guests: 344


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