News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Post Limit

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

Previous topic - Next topic

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.

KittyGalore

Can this mod be updated?
SMF Curve 2.0x

Suki

Sure, I just don't know when.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Suki

Just wanted to make an update If anyone is curious, I started to work on updating this mod: https://github.com/MissAllSunday/PostLimit/pull/1

progress is slow and re-estructure is ugly due to lack of time.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Suki

#34
Hi, does anyone wants to help out with QA for the new version?

heres the changelog:

- Add support for SMF 2.1
- Remove the global limit setting
- Add sending an alert when user is reaching his/her limit
- Re-write the logic to simplify the process of limiting an user
- Use the permissions hook to apply a limit
- All hooks, no code changes
- Add support for other mods using the integrate_after_create_post hook to make sure our check is applied after their logic


It has a completely new approach on how an user is limited, it makes use of a couple of permissions hooks to deny all posting related permissions for the user in question. This allow us to avoid having to deal with all places where an user can possible post something, plus theres an extra check on actual posting to cover mods or other external scripts.
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 December 13, 2024, 02:04:14 PMHi, does anyone wants to help out with QA for the new version?

heres the changelog:

- Add support for SMF 2.1
- Remove the global limit setting
- Add sending an alert when user is reaching his/her limit
- Re-write the logic to simplify the process of limiting an user
- Use the permissions hook to apply a limit
- All hooks, no code changes
- Add support for other mods using the integrate_after_create_post hook to make sure our check is applied after their logic


It has a completely new approach on how an user is limited, it makes use of a couple of permissions hooks to deny all posting related permissions for the user in question. This allow us to avoid having to deal with all places where an user can possible post something, plus theres an extra check on actual posting to cover mods or other external scripts.
What is QA?
SMF Curve 2.0x

TwitchisMental

Quote from: KittyGalore on December 13, 2024, 05:15:24 PM
Quote from: Suki on December 13, 2024, 02:04:14 PMHi, does anyone wants to help out with QA for the new version?

heres the changelog:

- Add support for SMF 2.1
- Remove the global limit setting
- Add sending an alert when user is reaching his/her limit
- Re-write the logic to simplify the process of limiting an user
- Use the permissions hook to apply a limit
- All hooks, no code changes
- Add support for other mods using the integrate_after_create_post hook to make sure our check is applied after their logic


It has a completely new approach on how an user is limited, it makes use of a couple of permissions hooks to deny all posting related permissions for the user in question. This allow us to avoid having to deal with all places where an user can possible post something, plus theres an extra check on actual posting to cover mods or other external scripts.
What is QA?
Quality assurance

Dave J

Hi Suki,

Only one hook is working. Mod is enabled and can be seen in Admin and settings can be changed, but it's not possible to set the member limit.

Tested on PHP7.4 and 8.2

This is on a fresh 2.1.4 install

Suki

Thank you for the report, it is indeed a weird one, will take a look on a fresh installation as well
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Suki

#39
I see what the error is, is not technically an error, just a weird set of coincidences.

SMF in ManageMaintenance uses a couple of functions to get all the hooks information. One of the fields is called absPath which refers to the path where the file  resides.

When declaring a hook, a modder can have the option to declare that path by using the "file" attribute in the  "hook" xml tag for including the file whenever a hook is about to be called.

SMF then takes that info and uses it to determinate if a file exits and has a function/method callable by a hook.

However, most of my mods depends on a different way to load files, a way that doesn't require to set the "file" attribute in their corresponding xml tag, which means all the hooks that this mod uses doesn't have a path and thus, SMF marks them as disable.

The only hook call that do has a file attribute is the "integrate_pre_include" which, as you can see, is the only one who correctly appears as enable.


So, in resume, the hooks appearing as disable doesn't really mean the mod is not working, it is, is just that due the way the mod loads its files and the way SMF detects loaded files, they appear as "the hook has not been found".

I sent a PR for SMF to detect hooks not using the file property:

https://github.com/SimpleMachines/SMF/pull/8372



I did found an issue with removing files that the mod do not use, this only affects uninstallation. I attached a recent version that fixes it.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Advertisement: