Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

September 24, 2022, 04:22:37 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 193513
  • Total Topics: 21092
  • Online today: 38
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 0
Guests: 31
Total: 31

Author Topic: How to increase "Show forum-posts on front page from" option ?  (Read 12671 times)

0 Members and 1 Guest are viewing this topic.

folkevil

  • Guest
How to increase "Show forum-posts on front page from" option ?
« on: February 07, 2007, 02:45:30 PM »
 By default, this option has only 5 choicebox



How to increase this option to 10?

Offline Lesmond

  • Do what you have to!
  • Administrator
  • *
  • Posts: 3169
    • Tiny Pix... Free Image Hosting and Sharing.
Re: How to increase "Show forum-posts on front page from" option ?
« Reply #1 on: February 07, 2007, 02:52:14 PM »
You could try this code, it will show the top ten, I used it in a center php block, near the top you will see $what=ssi_recentTopics('10', NULL, 'array'); you can change the 10 to what ever number you like :)

Code: [Select]
global $scripturl;
$what=ssi_recentTopics('10', NULL, 'array');

echo '<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">';
echo '<tr class="catbg3"><td valign="middle" align="left">Subject</td><td valign="middle" align="left">Board</td><td valign="middle" align="center">Last Post by</td><td valign="middle" align="left">Time</td></tr>';

foreach ($what as $topic)
  {
    echo '<tr><td class="windowbg" valign="middle" align="left">', $topic['link'];
    // Is this topic new? (assuming they are logged in!)
    if (!$topic['new'] && $context['user']['is_logged'])
      echo '<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
      echo '</td><td class="windowbg2" valign="middle" align="left">', $topic['board']['link'], '</td>';
      echo '</td><td class="windowbg2" valign="middle" align="left">', $topic['poster']['link'], '</td><td class="windowbg2" valign="middle" align="left">';
      if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
      echo '<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
      echo '<span class="smalltext">', $topic['time'], '</span></td></tr>';
  }

echo '</table>';
Please don't PM me for support without an invitation.


folkevil

  • Guest
Re: How to increase "Show forum-posts on front page from" option ?
« Reply #2 on: February 07, 2007, 03:00:43 PM »
Thank you, but i think i don't need this code . I need know how to increase "choicebox", i have too many boards and childboards ( > 10 boards) , and i want display newest posts from these boards on frontpage.  ;D

Offline Lesmond

  • Do what you have to!
  • Administrator
  • *
  • Posts: 3169
    • Tiny Pix... Free Image Hosting and Sharing.
Re: How to increase "Show forum-posts on front page from" option ?
« Reply #3 on: February 07, 2007, 03:13:10 PM »
I see, That I am not to sure as I am not good with code but hopefully someone will come along and help us/me :)
Please don't PM me for support without an invitation.


Offline IchBin

  • Friends
  • *
  • Posts: 16231
Re: How to increase "Show forum-posts on front page from" option ?
« Reply #4 on: February 07, 2007, 03:17:28 PM »
$what=ssi_recentTopics('10'NULL'array');

You can change NULL to exclude boards.

Something like this:

$what=ssi_recentTopics('10', array(2,4,5), 'array');

The above code will not take recent topics from the boards 2,4, and 5.

--edit--
Oops.... sorry. I didn't read the first post. I clicked on new post and only saw Lesmonds code. Didn't realize you were talking about the TP Settings. Let me review. :D
« Last Edit: February 07, 2007, 03:19:02 PM by IchBinâ„¢ »

basis

  • Guest
Re: How to increase "Show forum-posts on front page from" option ?
« Reply #5 on: April 11, 2007, 11:09:47 PM »
hi, i too am looking for a way to increase the number of choice boxes. does anyone have a possible solution?

Offline Thurnok

  • Friends
  • *
  • Posts: 784
Re: How to increase "Show forum-posts on front page from" option ?
« Reply #6 on: April 12, 2007, 12:44:06 AM »
This question has already been asked previously, and the answer posted.  Here's the post!

basis

  • Guest
Re: How to increase "Show forum-posts on front page from" option ?
« Reply #7 on: April 12, 2007, 01:17:20 AM »
Hi Thurnok, thanks for replying but I get this error when I follow the link.

Quote
The topic or board you are looking for appears to be either missing or off limits to you.

No idea why that occurs.

Offline G6Cad

  • Friends
  • *
  • Posts: 12643
    • FamiljeGodis
Re: How to increase "Show forum-posts on front page from" option ?
« Reply #8 on: April 12, 2007, 04:18:09 AM »
The thread is archived by Bloc, thats why it's off limits
Dont know why it's in the archive.
But the code Bloc pointed out was this.

Open TPortalAdmin.php and look for thsi code:
Code: [Select]
// divide the SSI board into 5 boards
$sib=explode(',',$context['TPortal']['SSI_board']);
for($i=0 ; $i<5 ; $i++){
if(isset($sib[$i]))
$context['TPortal']['SSI_board'.($i+1)]=$sib[$i];
else
$context['TPortal']['SSI_board'.($i+1)]='';
}

Correct the number 5 there, to your own.

JPDeni

  • Guest
Re: How to increase "Show forum-posts on front page from" option ?
« Reply #9 on: April 12, 2007, 07:52:37 AM »
It needs more than that.

In TPortalAdmin.template.php, find

Code: [Select]
// board 5
echo '
<select size="1" name="tp_ssiboard5"><option value="0">',$txt['tp-none-'],'</option>';
$tn=sizeof($context['TPortal']['boards']);
for($n=0 ; $n<$tn; $n++){
echo '
<option value="'.$context['TPortal']['boards'][$n]['id'].'" ' ,$context['TPortal']['boards'][$n]['id']==$context['TPortal']['SSI_board5'] ? 'selected' : '' , '>'.$context['TPortal']['boards'][$n]['name'].'</option>';
}

echo '


and add the following for each board you want to add, changing the numbers for each one

Code: [Select]
</select> ';

// board 6
echo '
<select size="1" name="tp_ssiboard6"><option value="0">',$txt['tp-none-'],'</option>';
$tn=sizeof($context['TPortal']['boards']);
for($n=0 ; $n<$tn; $n++){
echo '
<option value="'.$context['TPortal']['boards'][$n]['id'].'" ' ,$context['TPortal']['boards'][$n]['id']==$context['TPortal']['SSI_board6'] ? 'selected' : '' , '>'.$context['TPortal']['boards'][$n]['name'].'</option>';
}
echo '


This will actually add the dropdowns to your form.

In TPortalAdmin.php, find

Code: [Select]

                   elseif($what=='tp_ssiboard1'){
$bo=array();
$bo[0]=$_POST['tp_ssiboard1'];
$bo[1]=$_POST['tp_ssiboard2'];
$bo[2]=$_POST['tp_ssiboard3'];
$bo[3]=$_POST['tp_ssiboard4'];
$bo[4]=$_POST['tp_ssiboard5'];

Add more lines like above to account for the number of boards you want to add. Note that the number of the array is one less than the number of the board, so that the code to add for a 6th board is

Code: [Select]
$bo[5]=$_POST['tp_ssiboard6'];

And add the code that G6 posted.