Link to Mod (http://mods.simplemachines.org/index.php?mod=380)
This mod adds a theme setting that every user can change so they can view their own desired number of topics per page and posts per page as oppose to using the default limits set by the administrator.
Users can find these two settings (Topics per page and Posts per page) in their Profile / Look and Layout Settings where they will see a dropdown where they can pick the following options:
- Default (Uses forum default limit)
- 10
- 25
- 50
- 75
- 100
:'(
Can you put your archive in .zip please ??? :D
great, thanks!!
what's it matter if its not in .zip or not?
I try but it doesn't work for me ... :'(
Quote from: kezayah on July 06, 2006, 03:16:31 PM
I try but it doesn't work for me ... :'(
hmmm i wonder why.. it installed fine for me..
It's because Winrar doesn't open the file *tar.gz ... i don't know why ... ::)
You can put a link with this archive *.zip ...
Sorry for my english, I'm french ...
max. Topics per Page do not work.
The error is however fast repaired.
Replace in install.xml
This:
<file name="$sourcedir/MessageIndex.php">>
<operation>
<search position="after"><![CDATA[
// View all the topics, or just a few?
$maxindex = isset($_REQUEST['all']) && !empty($modSettings['enableAllMessages']) ? $board_info['num_topics'] : $modSettings['defaultMaxTopics'];
]]></search>
<add><![CDATA[
// If the user has inputted 0, it is the default and should be ignored.
if(!empty($options['num_topics_page']))
$modSettings['defaultMaxTopics'] = $options['num_topics_page'];
]]></add>
</operation>
with this:
<file name="$sourcedir/MessageIndex.php">>
<operation>
<search position="before"><![CDATA[
// View all the topics, or just a few?
$maxindex = isset($_REQUEST['all']) && !empty($modSettings['enableAllMessages']) ? $board_info['num_topics'] : $modSettings['defaultMaxTopics'];
]]></search>
<add><![CDATA[
// If the user has inputted 0, it is the default and should be ignored.
if(!empty($options['num_topics_page']))
$modSettings['defaultMaxTopics'] = $options['num_topics_page'];
]]></add>
</operation>
If the installations point is not after but before it, it goes also with the maximum announcement of the topics
Sorry my English not Perfekt, but I hope it am understandably which I mean.
I havent noticed any problems with it. Its a great mod. Thanks ;)
How can I add "15" as a choice for "The number of topics to show per page in a board:"
MartinB, I don't see how that would make it work as oppose to how it currently is. The search after means that it searches for that text after the text has been added. So then if the $modSettings['defaultMaxTopics'] gets updated after the $maxindex variable it would have no effect, as the constructPageIndex function passes the value of $maxindex and not $modSettings['defaultMaxTopics'].
SurfExcelerator.com, you can add 15 by doing the following:
Edit Themes/default/Profile.template.php:
Find:
<option value="10"', !empty
($context['member']['options']['num_topics_page']) && $context['member']['options']['num_topics_page'] == 10 ? ' selected="selected"' : '', '>10</option>
After add:
<option value="15"', !empty
($context['member']['options']['num_topics_page']) && $context['member']['options']['num_topics_page'] == 15 ? ' selected="selected"' : '', '>15</option>
And then:
Edit: Themes/default/Settings.template.php
and find:
array(
'id' => 'num_topics_page',
'label' => $txt['admin_num_topics'],
'options' => array(
'default' => '0',
10 => '10',
25 => '25',
50 => '50',
75 => '75',
100 => '100',
),
'default' => true,
),
And change it to this:
array(
'id' => 'num_topics_page',
'label' => $txt['admin_num_topics'],
'options' => array(
'default' => '0',
10 => '10',
15 => '15',
25 => '25',
50 => '50',
75 => '75',
100 => '100',
),
'default' => true,
),
Thanks.... changes were made and it works..... :D
any plans for SMf Version 1.0.7 ?
This mod is now compatable with the SMF 1.0 branch. I realized VERY few changes were needed to get this mod to work for 1.0. :) To use the mod for SMF 1.0x, download and install the "Post_Limit_SMF1.0.zip" package.
Quote from: ltdeta on July 14, 2006, 07:42:37 AM
any plans for SMf Version 1.0.7 ?
While this mod was tested on 1.0.8, I am almost sure it will work fine on 1.0.7. :) Though this post was made well before 1.0.8 was released, so you quite possibly may have upgraded to 1.0.8 already. ;)
SMF 1.1 RC3:
"The package you are trying to download or install is either corrupt or not compatible with this version of SMF."
Tried both the .tar.gz and .zip with the same results.
I just tried to open the .tar.gz file with WinRAR... it is corrupt. I also can't install it on the forum, as my previous post mentioned.
I just downloaded it, and it worked fine. Can you try downloading it again? Also are other mods on the mod site corrupt for you as well?
Odd. Based on your suggestion, I tried it again from another computer and it worked fine. Strange. I'm not sure why it was getting corrupted on my main computer.
how would I go about applying this to other themes than the default one? I have several themes installed on my boards.
I just started using this mod before I upgraded to 1.1.1
any plans on an update?
The mod works fine for me in 1.1.1. Are you having problems? If so what are they?
Quote from: akabugeyes on January 17, 2007, 05:03:19 PM
The mod works fine for me in 1.1.1. Are you having problems? If so what are they?
I'm having problems installing through the package manager, first it won't give me a download link when I browse for it, then if I upload it I get the following:
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.I'm assuming it's a version issue thing, but I didn't dig further than that.
Are you using the one designed for SMF 1.1x? The package is called "PostLimitOptions.tar.gz." The one that is for SMF 1.0 is called "Post_Limit_SMF1.0.zip."
Quote from: akabugeyes on January 17, 2007, 08:14:59 PM
Are you using the one designed for SMF 1.1x? The package is called "PostLimitOptions.tar.gz." The one that is for SMF 1.0 is called "Post_Limit_SMF1.0.zip."
That was the problem.
For some reason, when you use the browse package function, the link to the old version is the only one that shows up. There's also nothing in the description about the version differences.
Thanks for solving that for me. Works like a champ now.
Has anyone gotten this working with 1.1.3?
The error we're getting is:
QuoteThe package you are trying to download or install is either corrupt or not compatible with this version of SMF.
I tried installing this yesterday and it worked fine for me. Can you try downloading it again. Preferably with a different browser? IE can sometimes corrupt downloads, so if you are using that, that could be the cause.
Edit: Also make sure you are downloading "PostLimitOptions.tar.gz," the other package is for SMF 1.0.
Quote from: akabugeyes on August 03, 2007, 04:22:11 PM
I tried installing this yesterday and it worked fine for me. Can you try downloading it again. Preferably with a different browser? IE can sometimes corrupt downloads, so if you are using that, that could be the cause.
Edit: Also make sure you are downloading "PostLimitOptions.tar.gz," the other package is for SMF 1.0.
I'm with Kardinal, I'm actually the one hosting the site and yes, I had downloaded the one for SMF 1.0. I tried using the other one and it worked like a champ except for it only installed the options into the default theme. What do I have to do to get it into the other themes?
Thanks,
Oh and btw, I'm a programming n00b so detailed instructions would be VERY appreciated
-Red
Manual Installation of Mods
http://docs.simplemachines.org/index.php?topic=402
All, I have released an update to this mod.
The update has only one small change in it but it's a fairly critical fix. It was possible with the old version of the mod for a user to set it so they could view more than 100 topics and posts per page. This could cause problems with load times if someone views a topic with 100s of replies or a board with 100s of topics.
To update, just download package "PostLimitOptions1.0.1_SMF1.1.zip" and upload it to your package manager. You do not have to uninstall the original mod. I have included a upgrade file in it so it will just apply the small fix needed for the upgrade.
Two additional things:
I would like to use this moment to officially announce that I will no longer be patching the SMF 1.0 line of this mod. I really don't think many people are still using 1.0, and even fewer that are also using the mod as well. However I will point out how to manually patch this if you do use this mod and are currently using SMF 1.0. This also applies to those who have trouble getting the mod updated when using the mod package and are running SMF 1.1.
Open Sources/Profile.php:
Find:
// These are the theme changes...
$themeSetArray = array();
Add after:
// Don't allow anything over the maxiumum allowed posts or topics per page,
if (isset($_POST['default_options']['num_posts_page']) && $_POST['default_options']['num_posts_page'] > 100)
$_POST['default_options']['num_posts_page'] = $modSettings['defaultMaxMessages'];
if (isset($_POST['default_options']['num_posts_page']) && $_POST['default_options']['num_topics_page'] > 100)
$_POST['default_options']['num_topics_page'] = $modSettings['defaultMaxTopics'];
The second thing is, now that SMF 2.0 Beta 1 has been released to Charter Members, I think it is okay to say that the same functionality that is present in this mod is now a default feature of SMF 2.0. So this mod will not be updated for SMF 2.0 as it doesn't need to be. :)
When I go to index.php?action=unread , the pages are always calculated using the old default posts/page setting (20). I think I should just add this code
// If the user has inputted 0, it is the default and should be ignored.
if(!empty($options['num_posts_page']))
$modSettings['defaultMaxMessages'] = $options['num_posts_page'];
The problem is I can't find the php where these pages are calculated. Can someone help please?
QuoteAn Error Has Occurred!
The package you tried to upload either is not a valid package or has become corrupted.
I've confirmed that I downloaded the correct version (I'm running SMF 1.1.4, and this is PostLimitOptions1.0.1_SMF1.1.zip). If I try opening the Zip file locally, Filzip says, "Warning - Error in zip structure!" I've tried downloading from multiple computers, as suggested above. Linux unzip also spits out a lot of errors, and the resulting unpacked files are recognizably XML but very garbled.
I have received the same error. A shame, I had wanted this mod. Anybody have a copy on their computer they'd be willing to upload to a post?
Seems the package has become corrupted. I will try to upload a working package as soon as I can. It doesn't look like I have the package on the computer I am using right now. :(
Here's a copy of 1.0.1. (http://scottws.zapto.org/files/PostLimitOptions1.0.1_SMF1.1.zip)
Thanks scottws, appreciated. :)
Working package has been uploaded to the mod page. Also would like to let people know that this mod will work with the just released SMF 1.1.5.
Great module! My forum users love it. I found an oversight in the code. It does not take into account user preferences for "Show new replies to your posts" which is generated out of Recent.php. It uses the forum default settings for number of topics to display rather than the user chosen number of topics. I added the following code to install.xml to fix this issue. It works great.
<file name="$sourcedir/Recent.php">
<operation>
<search position="replace"><![CDATA[
function UnreadTopics()
{
global $board, $txt, $scripturl, $db_prefix, $sourcedir;
global $ID_MEMBER, $user_info, $context, $settings, $modSettings, $func;
]]></search>
<add><![CDATA[
function UnreadTopics()
{
global $board, $txt, $scripturl, $db_prefix, $sourcedir;
global $ID_MEMBER, $user_info, $context, $settings, $modSettings, $func, $options;
// Allow user topic and post settings to override defaults
if(!empty($options['num_topics_page']))
$modSettings['defaultMaxTopics'] = $options['num_topics_page'];
if(!empty($options['num_posts_page']))
$modSettings['defaultMaxMessages'] = $options['num_posts_page'];
]]></add>
</operation>
</file>
Just curious why MessageIndex and Recent.php have to be modified. Why can't all of this be consolidated into Load.php and then it will work anywhere that $modSettings['defaultMax...'] is called? I tried doing it but it didn't seem to pick up the user settings. I still don't thoroughly understand the program and maybe you could shed some light on its inner workings.
Thanks,
Raklet
Well I could just completely overwrite the variable. I think at the time what I was thinking was that there could be circumstances where a script makes use of these values in some kind of way that would want to get the overall forum default values rather than what the user may have picked. If I decided to overwrite the variable on every page then it would make it hard for a script to use the actual forum default if it wants to ignore the user preference for some reason.
That being said I suppose the Unread Posts page could respect the setting. I'll probably go ahead and include that in a future update to the mod. :)
Quote from: akabugeyes on May 01, 2008, 10:45:13 PM
Well I could just completely overwrite the variable. I think at the time what I was thinking was that there could be circumstances where a script makes use of these values in some kind of way that would want to get the overall forum default values rather than what the user may have picked. If I decided to overwrite the variable on every page then it would make it hard for a script to use the actual forum default if it wants to ignore the user preference for some reason.
That makes good sense. I can see the reason in that. Thanks for the clarification, and thanks for the quick response!
I installed PostLimitOptions into 1.1.6 and the Package Manager confirmed a successful install. However, I do not have a dropdown in Profile/Look and Layout from which to choose a setting.
Does the mod work in 1.1.6? I assumed it did as there was a manual installation file for download for 1.1.6.
Quote from: forum4ttt on September 17, 2008, 09:02:37 PM
I installed PostLimitOptions into 1.1.6 and the Package Manager confirmed a successful install. However, I do not have a dropdown in Profile/Look and Layout from which to choose a setting.
Does the mod work in 1.1.6? I assumed it did as there was a manual installation file for download for 1.1.6.
could someone please confirm running this mod in 1.1.6 successfully
thanks
I have it running in 1.1.6. I installed it sometime ago and it survived through the upgrades. Look for the options under Profile / Look and Layout:
The number of topics to show per page in a board:
The number of posts to show per page in a topic: