collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 287
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Thanks for having an interest with our portal. If you have any requests for features, have a look at the Feature Requests board.

Author Topic: How can I increase the limit on the number of topics?  (Read 4291 times)

0 Members and 1 Guest are viewing this topic.

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
How can I increase the limit on the number of topics?
« on: December 08, 2010, 05:55:24 PM »
In this code...How can I increase the limit on the number of topics- posts at 10 or more?

Code: [Select]
global $txt;

$txt['recent_topics'] = 'Recent Topics';
$txt['recent_posts'] = 'Recent Posts';

$buttons = array(
   'recent_topics' => array(
      'text' => 'recent_topics',
      'image' => '',
      'lang' => true,
      'url' => '#recent_topics" id="b_rt" onclick="change_display(\'rp\'); return false;',
      'active' => true,
   ),
   'recent_posts' => array(
      'text' => 'recent_posts',
      'image' => '',
      'lang' => true,
      'url' => '#recent_posts" id="b_rp" onclick="change_display(\'rt\'); return false;',
   ),
);

echo '
<div style="overflow: auto;">
   ', template_button_strip($buttons), '
</div>
<div id="recent_topics">
   ', sp_recent(array('type' => 1, 'display' => 1), 0), '
</div>
<div id="recent_posts" style="display: none;">
   ', sp_recent(array('display' => 1), 0), '
</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
   function change_display(block)
   {
      var current = block == \'rt\' ? 1 : 0;

      document.getElementById(\'recent_topics\').style.display = current ? \'none\' : \'\';
      document.getElementById(\'recent_posts\').style.display = current ? \'\' : \'none\';
      document.getElementById(\'b_rt\').className = current ? \'button_strip_recent_topics\' : \'button_strip_recent_topics active\';
      document.getElementById(\'b_rp\').className = current ? \'button_strip_recent_posts active\' : \'button_strip_recent_posts\';
   }
// ]]></script>';

Thank you
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: How can I increase the limit on the number of topics?
« Reply #1 on: December 09, 2010, 10:25:16 AM »
To learn about this, have a look at the code for the sp_recent function
 
You can see, when you look at it, that the parameters it uses are 'boards', 'limit', 'type', and 'display'.
If it is confusing what that all means, have a look at the block editor for a recent posts or topics block, to see which parameters you can put in there, and what they mean.
 
If you put the two sets of hints together -- you suddenly realize that limit is the only choice that makes sense for how many messages to display.
 
So, to change that limit for sp_recent, put 'limit' => 10, inside the parameter array that is used in the function call.
 
 
-------
A code snippet from PortalBlocks.php
 
Code: [Select]
function sp_recent($parameters, $id, $return_parameters = false)
{
 global $txt, $scripturl, $settings, $context, $color_profile;
 $block_parameters = array(
  'boards' => 'boards',
  'limit' => 'int',
  'type' => 'select',
  'display' => 'select',
 );
 if ($return_parameters)
  return $block_parameters;
 $boards = !empty($parameters['boards']) ? explode('|', $parameters['boards']) : null;
 $limit = !empty($parameters['limit']) ? (int) $parameters['limit'] : 5;
 $type = 'ssi_recent' . (empty($parameters['type']) ? 'Posts' : 'Topics');
 $display = empty($parameters['display']) ? 'compact' : 'full';
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: How can I increase the limit on the number of topics?
« Reply #2 on: December 09, 2010, 12:36:35 PM »
Thank you Angelina.....i've solved but....
to turn this block, in compact view   as I do?(is in the right column)

I tried so but it does not work....changed
Code: [Select]
echo '
<div style="overflow: auto;">
   ', template_button_strip($buttons), '
</div>
<div id="recent_topics">
   ', sp_recent(array('type' => 1, 'display' => 0), 0), '
</div>
<div id="recent_posts" style="display: none;">
   ', sp_recent(array('display' => 0), 0), '
</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
   function change_display(block)
   {
      var current = block == \'rt\' ? 1 : 0;

      document.getElementById(\'recent_topics\').style.display = current ? \'none\' : \'\';
      document.getElementById(\'recent_posts\').style.display = current ? \'\' : \'none\';
      document.getElementById(\'b_rt\').className = current ? \'button_strip_recent_topics\' : \'button_strip_recent_topics active\';
      document.getElementById(\'b_rp\').className = current ? \'button_strip_recent_posts active\' : \'button_strip_recent_posts\';
   }
// ]]></script>';

Thanks
« Last Edit: December 09, 2010, 12:41:08 PM by fdr77 »
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: How can I increase the limit on the number of topics?
« Reply #3 on: December 09, 2010, 01:06:10 PM »
I am not sure I understand this new question.
The "Recent Topics" looks OK, but "Recent Posts" looks too wide for the right column.
You need to use 'display' => 0 for both I think, which is what you posted, but it does not look like that on your site.
 
You can change the width of your right column, of course...
----
 
Also, you have a CSS problem.
Copy themes/default/css/portal.css to the css directory of your current theme
 
The reason is -- the use of these definitions in /default/css/portal.css seems to be causing the images for the left side of titlebars to be pulled from the default theme's images directory.
 
« Last Edit: December 09, 2010, 01:58:50 PM by AngelinaBelle »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: How can I increase the limit on the number of topics?
« Reply #4 on: December 09, 2010, 03:41:51 PM »
sorry for my english ....I will explain with pictures
Nathiel has given this code
Code: [Select]
global $txt;

$txt['recent_topics'] = 'Recent Topics';
$txt['recent_posts'] = 'Recent Posts';

$buttons = array(
   'recent_topics' => array(
      'text' => 'recent_topics',
      'image' => '',
      'lang' => true,
      'url' => '#recent_topics" id="b_rt" onclick="change_display(\'rp\'); return false;',
      'active' => true,
   ),
   'recent_posts' => array(
      'text' => 'recent_posts',
      'image' => '',
      'lang' => true,
      'url' => '#recent_posts" id="b_rp" onclick="change_display(\'rt\'); return false;',
   ),
);

echo '
<div style="overflow: auto;">
   ', template_button_strip($buttons), '
</div>
<div id="recent_topics">
   ', sp_recent(array('type' => 1, 'display' => 1), 0), '
</div>
<div id="recent_posts" style="display: none;">
   ', sp_recent(array('display' => 1), 0), '
</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
   function change_display(block)
   {
      var current = block == \'rt\' ? 1 : 0;

      document.getElementById(\'recent_topics\').style.display = current ? \'none\' : \'\';
      document.getElementById(\'recent_posts\').style.display = current ? \'\' : \'none\';
      document.getElementById(\'b_rt\').className = current ? \'button_strip_recent_topics\' : \'button_strip_recent_topics active\';
      document.getElementById(\'b_rp\').className = current ? \'button_strip_recent_posts active\' : \'button_strip_recent_posts\';
   }
// ]]></script>';

 the result of this code is (when you choose 'block recent post topic', you can choose show compact or complete)
« Last Edit: December 09, 2010, 03:52:55 PM by fdr77 »
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: How can I increase the limit on the number of topics?
« Reply #5 on: December 09, 2010, 03:47:24 PM »
if I change the code so
Code: [Select]
global $txt;

$txt['recent_topics'] = 'Recent Topics';
$txt['recent_posts'] = 'Recent Posts';

$buttons = array(
   'recent_topics' => array(
      'text' => 'recent_topics',
      'image' => '',
      'lang' => true,
      'url' => '#recent_topics" id="b_rt" onclick="change_display(\'rp\'); return false;',
      'active' => true,
   ),
   'recent_posts' => array(
      'text' => 'recent_posts',
      'image' => '',
      'lang' => true,
      'url' => '#recent_posts" id="b_rp" onclick="change_display(\'rt\'); return false;',
   ),
);

echo '
<div style="overflow: auto;">
   ', template_button_strip($buttons), '
</div>
<div id="recent_topics">
   ', sp_recent(array('type' => 1, 'display' => 0), 0), '
</div>
<div id="recent_posts" style="display: none;">
   ', sp_recent(array('display' => 1), 0), '
</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
   function change_display(block)
   {
      var current = block == \'rt\' ? 1 : 0;

      document.getElementById(\'recent_topics\').style.display = current ? \'none\' : \'\';
      document.getElementById(\'recent_posts\').style.display = current ? \'\' : \'none\';
      document.getElementById(\'b_rt\').className = current ? \'button_strip_recent_topics\' : \'button_strip_recent_topics active\';
      document.getElementById(\'b_rp\').className = current ? \'button_strip_recent_posts active\' : \'button_strip_recent_posts\';
   }
// ]]></script>';

I have this result in recent topics but not in recent posts






E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: How can I increase the limit on the number of topics?
« Reply #6 on: December 09, 2010, 03:56:03 PM »
I think this is because it says to choose show compact or complete...in this part of code
Code: [Select]
echo '
<div style="overflow: auto;">
   ', template_button_strip($buttons), '
</div>
<div id="recent_topics">
   ', sp_recent(array('type' => 1, 'display' => 1), 0), '
</div>
<div id="recent_posts" style="display: none;">
   ', sp_recent(array('display' => 1), 0), '
</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
   function change_display(block)
   {
      var current = block == \'rt\' ? 1 : 0;

P.S here my code
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: How can I increase the limit on the number of topics?
« Reply #7 on: December 09, 2010, 04:00:54 PM »
I would look like in this picture(both)

At the end of the code I added
Code: [Select]
echo "<br> <a href=\"recent\"><b>Post precedenti...</b></a><hr>";
« Last Edit: December 09, 2010, 04:03:48 PM by fdr77 »
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: How can I increase the limit on the number of topics?
« Reply #8 on: December 09, 2010, 04:36:20 PM »
Changed sò
Code: [Select]
global $txt;

$txt['recent_topics'] = 'Recent Topics';
$txt['recent_posts'] = 'Recent Posts';

$buttons = array(
   'recent_topics' => array(
      'text' => 'recent_topics',
      'image' => '',
      'lang' => true,
      'url' => '#recent_topics" id="b_rt" onclick="change_display(\'rp\'); return false;',
      'active' => true,
   ),
   'recent_posts' => array(
      'text' => 'recent_posts',
      'image' => '',
      'lang' => true,
      'url' => '#recent_posts" id="b_rp" onclick="change_display(\'rt\'); return false;',
   ),
);

echo '
<div style="overflow: auto;">
   ', template_button_strip($buttons), '
</div>
<div id="recent_topics">
   ', sp_recent(array('type' => 1, 'display' => 0), 0), '
</div>
<div id="recent_posts" style="display: none;">
   ', sp_recent(array('display' => 0), 0), '
</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
   function change_display(block)
   {
      var current = block == \'rt\' ? 1 : 0;

      document.getElementById(\'recent_topics\').style.display = current ? \'none\' : \'\';
      document.getElementById(\'recent_posts\').style.display = current ? \'\' : \'none\';
      document.getElementById(\'b_rt\').className = current ? \'button_strip_recent_topics\' : \'button_strip_recent_topics active\';
      document.getElementById(\'b_rp\').className = current ? \'button_strip_recent_posts active\' : \'button_strip_recent_posts\';
   }
// ]]></script>';

and works as I want but....
only in the main page of the forum and portal....in the topic, the recent post button don't work.
instead with the original code ,it's ok
« Last Edit: December 09, 2010, 06:04:51 PM by fdr77 »
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: How can I increase the limit on the number of topics?
« Reply #9 on: December 09, 2010, 05:26:23 PM »
look this link
http://www.discusrewind.net/foto-e-video-gallery/ed-alla-fine-e-arrivato/
right column.... code modified
in the bottom.... code original
« Last Edit: December 09, 2010, 05:37:43 PM by fdr77 »
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: How can I increase the limit on the number of topics?
« Reply #10 on: December 09, 2010, 07:18:14 PM »
You have two blocks which include a div with id=recent_topics (same for id=recent_posts).
This can certainly cause a problem for the javascript.
 
There should never be two things on the same page with the same id.
See what happens if you try with only one of those  blocks enabled at a time.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: How can I increase the limit on the number of topics?
« Reply #11 on: December 09, 2010, 09:31:26 PM »
Thank you ,
everything is fine now :)
regarding the portal css is all ok?
You are so patient and kind
Thanks
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: How can I increase the limit on the number of topics?
« Reply #12 on: December 09, 2010, 10:01:10 PM »
Did you copy portal.css into dsv4_20rc3/css/  It looks like you should also remove
H3.titlebg SPAN.left from dsv4_20rc3/css/portal.css
 
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: How can I increase the limit on the number of topics?
« Reply #13 on: December 10, 2010, 07:02:15 AM »
I had not copied portal.css, now be inserted.
I hope now, everything is ok.
Other files to be imported in the personalize  theme.
thanks
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain