Post Limit

Started by Suki, February 11, 2013, 07:30:41 PM

Previous topic - Next topic

Suki

Link to Mod

Post Limit mod
by: Suki

License

* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/


Description

This mod allows you to set a per user post limit, the limit is set per day. If the user is approaching his/her limit, there will be a message informing them about it, you can configure this message with some predefined vars: {username} {limit}.

You can set a permission for members to be able to set limits on other users, admins cannot be limited.

This mod needs PHP 5.2 or higher.


for SMF 2.0.x only

Laguage
-English


ChangeLog

-28/06/12
   Initial release
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

nattasan

#1
Could you please guide me how to use this mod.

i use SMF 2.0.4

i already install this mod, but i didnot see anything to set number post per day?

Best Regards,
Nattasan

nattasan

Could someone please guide me how to use this mod.

Suki

Could you please wait a little? you posted at 3am in my local time...
and bumping in 5 hours isn't gonna help either...

Go to this url:  action=admin;area=postlimit this is the admin page.

if you want to set a limit, go to the users profile and you will see another item in the menu:  action=profile;area=userlimit  thats where you set the per-user limit.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

rajupatel

Quote from: Suki on February 16, 2013, 09:26:37 AM
Could you please wait a little? you posted at 3am in my local time...
and bumping in 5 hours isn't gonna help either...

Go to this url:  action=admin;area=postlimit this is the admin page.

if you want to set a limit, go to the users profile and you will see another item in the menu:  action=profile;area=userlimit  thats where you set the per-user limit.
i got ur url ..but I have error.."Fatal error: Call to undefined method PostLimitTools::__ destruct() in /home/ u366554108/public_html/ Sources/PostLimit.php on line 408" how to set limit.

Suki

ugh, that somehow slipped up from the dev branch...

Open your Sourcesdir/PostLimit.php find this:

         /* Force a new instance */
         self::tools()->__destruct();

and remove.


Mod has been edited.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

Dave J

Hi Suki,

Thanks for this mod it installed perfectly and does exactly what I want it to do.

I have a question:

At the moment I can only add the ID's of 8 boards that I want to add limits too (see attachment). Is there anyway to increase that amount please?

I have 20 board ID numbers I want to add so an allowance, larger than that for additional new boards, would be ideal.

If it's just a case of a code change, that's fine I can do that.

Thanks for any help.

Dave
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Suki

#8
Never really thought about that field length to be honest but it is a simple code change.

On your Themes/default/PostLimit.template find this:

size="25" tabindex="1" maxlength="25"  and change both 25 to whatever number you need.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Dave J

If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

glennmckenna

could you use this mod for limiting the amout of posts a guest can do per day ?

Suki

No, guest do not have a unique ID and there is no reliable method to distinguish one guest from another.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Dave J

Quote from: Suki on February 18, 2013, 07:20:41 PM
Never really thought about that field length to be honest but it is a simple code change.

On your Themes/default/PostLimit.template find this:

size="25" tabindex="1" maxlength="25"  and change both 25 to whatever number you need.

That is perfect Suki thank you
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

glennmckenna

Quote from: Suki on February 19, 2013, 11:02:54 AM
No, guest do not have a unique ID and there is no reliable method to distinguish one guest from another.
ok thanks for the info

Suki

Mod has been updated, added code to remove the scheduled task when uninstalling, thanks to Bugo for the reminder.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

akbora

Very good mod. I need to see all member who limited messages? How can I do? Thanks
SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

hocs22


Shambles

Quote from: armando166 on July 24, 2019, 12:49:27 PM
is it per day?


Difficult to say, based on the mod description  ::)

Quote from: Suki on February 11, 2013, 07:30:41 PM.... the limit is set per day ...

KittyGalore

Would be nice to get this updated getting errors where guests get this error.

Call to a member function params() on null

8: Undefined property: PostLimit::$_dbApply Filter: Only show the errors from this fileFile: /****/****/public_html/Sources/PostLimit.php
SMF Curve 2.0x

Suki

Make sure you have this file: Subs-PostLimit.php  on your Sources folder, if not, download the mod, extract it and upload that file.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

KittyGalore

Quote from: Suki on January 06, 2020, 04:04:10 PM
Make sure you have this file: Subs-PostLimit.php  on your Sources folder, if not, download the mod, extract it and upload that file.
I had the mod uninstalled but i tried it again and all the files are there i tried on my main forum and test forum and the mod works fine but when i post in a topic as a guest i get the error however the post does post but the message appears and doesn't let me know if it posted or not i press back or the home button to goes back.

The first error shows from my previous post

8: Undefined property: PostLimit::$_dbApply Filter: Only show the errors from this fileFile: /****/****/public_html/Sources/PostLimit.php

This is the line from the PostLimit.php file for line 75

$this->_db->params($this->_paramsAll, $this->_data);

and another error in the same file.

Apply Filter: Only show the error messages of this URLhttp://***********/TestForum/index.php?action=post2;start=0;board=3Apply Filter: Only show the errors with the same message8: Undefined index: id_boardsApply Filter: Only show the errors from this fileFile: /*****/********/public_html/TestForum/Sources/PostLimit.php
Line: 132

return $result = $this->getValue($this->_rows['id_boards']);

Guests can see the board and reply in it fine when the mod is uninstalled. I even gave guests the permission to set post limits on members and the same error occurs.

The integration hooks report does show some errors from the mod when installed.
SMF Curve 2.0x

Suki

Thank you for the detailed explanation. It seems this is indeed a bug. I didn't took into account guest been able to post. Will look into that.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

KittyGalore

Quote from: Suki on January 08, 2020, 11:16:45 AM
Thank you for the detailed explanation. It seems this is indeed a bug. I didn't took into account guest been able to post. Will look into that.
Thank you hope you find the solution for the guests.
SMF Curve 2.0x

KittyGalore

Quote from: Suki on January 08, 2020, 11:16:45 AMThank you for the detailed explanation. It seems this is indeed a bug. I didn't took into account guest been able to post. Will look into that.
Has there been any update on this.
SMF Curve 2.0x

Suki

Unfortunately no :( I haven't had time to look at it, its on my radar but no promises.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

KittyGalore

Quote from: Suki on September 14, 2021, 08:48:39 AMUnfortunately no :( I haven't had time to look at it, its on my radar but no promises.
Ok thank you.
SMF Curve 2.0x

Marina3

Will Mod work on smf 2.1.2?

Doug Heffernan

Quote from: Marina3 on November 18, 2022, 10:04:14 AMWill Mod work on smf 2.1.2?

Most likely not without some changes.

Marina3

And what changes are needed to make this mod work on version 2.1.2?

Marina3

#29
Mod is installed but not working on 2.1.3.
 

Diego Andrés

Well it doesn't say it will work on 2.1.x
You could try the 1.1 version on github https://github.com/MissAllSunday/PostLimit/tree/1.1
I would suggest to test it somewhere else first, to make sure it works fine.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Advertisement: