News:

Wondering if this will always be free?  See why free is better.

Main Menu

Post Limit Options

Started by codenaught, July 06, 2006, 01:08:41 PM

Previous topic - Next topic

inthe80s

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.
Running SMF since May '04.  Started with YaBB on Oct 2001.

codenaught

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."
Dev Consultant
Former SMF Doc Coordinator

inthe80s

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.
Running SMF since May '04.  Started with YaBB on Oct 2001.

Kardinal

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.

codenaught

#24
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.
Dev Consultant
Former SMF Doc Coordinator

redactor007

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

karlbenson


codenaught

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. :)
Dev Consultant
Former SMF Doc Coordinator

Chipicao

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?

mattstan

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.

Eliana Tamerin

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?
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

codenaught

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. :(
Dev Consultant
Former SMF Doc Coordinator


codenaught

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.
Dev Consultant
Former SMF Doc Coordinator

raklet

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

codenaught

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. :)
Dev Consultant
Former SMF Doc Coordinator

raklet

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!

forum4ttt

#37
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.

forum4ttt

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

raklet

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:


Advertisement: