Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jan 2000
Posts: 114
Member
Member
Offline
Joined: Jan 2000
Posts: 114
If you're like any other webmaster, you hate spammers. Here's a simple hack I recently implemented on my board to limit my users to 1 new topic per every 48 hours in each forum in a certain category. For example, if you apply this hack to forums "A" and "B," posting in forum A will not affect your ability to post in forum B, but you will not be able to post a new topic in forum A until 2 days (adjustable) pass. Replies are unaffected, this only applies to new threads. Anyway, here's the hack:

In the DoPostTheTopic subroutine of postings.cgi find (around line 1340):
Code
code:
Right under that insert the following:
Code
code:
Replace YourCategoryNumber with the number of the category you want this to affect. (Open your forums.cgi file in the UBB CGI directory on your web server and look at the very first number of one of the lines that contains one of the forum names in that category. DON'T EDIT THE FILE!) Alternatively, you can change

$thisforum[0] == YourCategoryNumber
to
$number == YourForumNumber

and replace YourForumNumber with the number of the forum you want this to affect (look at the links to messages on your board if you don't know the numbers). To have it affect multiple forums, change

if ($number == YourForumNumber) {
to
if (($number == YourForumNumber1) | | ($number == YourForumNumber2)) {

Be sure to remove the spaces between the pipes "| |".

Finally, to change the time a user has to wait to post another new topic, change the value of $numDaysToWait to some other number of days.

That's it. May your fight against spam be a winning one. [Linked Image]

------------------
Leshrac
leshrac@magictraders.com
Founder, Owner - Magic Online Trading League (MOTL)
http://www.magictraders.com
MOTL Bulletin Board

Sponsored Links
Joined: Feb 1999
Posts: 1,379
cal Offline
Programmer
Programmer
Offline
Joined: Feb 1999
Posts: 1,379
Nice hack

Just a thought [Linked Image]

Joined: Jan 2000
Posts: 114
Member
Member
Offline
Joined: Jan 2000
Posts: 114
It seems there was a small error in the placement of this code, please check the first post in this thread for the correct placement. Sorry about that. [Linked Image]

Joined: Feb 2000
Posts: 27
Member
Member
Offline
Joined: Feb 2000
Posts: 27
great idea Leshrac (this thread is highly underrated, considering the usefulness of this hack)

ok, i understand that you can change the number of days before posting, and the forum it takes place in...but can you change the actual number of posts they can make? The way I see it, the limit is automatically set to one post per given time period. Even in the text, it says "Sorry, but you may only post one new topic..." How would I go about changing this to 2, 3, or 4?


"If i tell you a duck can pull a truck, just shut up and hook the duck to the truck" -Jerome from Martin
Joined: Jan 2000
Posts: 114
Member
Member
Offline
Joined: Jan 2000
Posts: 114
That's a little more complicated, you'd have to add a hash table to count the number of times the poster's UserName appears on the list.

Sponsored Links
Joined: Jan 2000
Posts: 114
Member
Member
Offline
Joined: Jan 2000
Posts: 114
FYI, I'll no longer be supporting this hack on this site because I don't have time go checking more than one UBB hacking site, so if you're looking for updates or have questions, please visit the thread located here .

Thanks.

------------------
Leshrac
leshrac@magictraders.com
Founder, Owner - Magic Online Trading League (MOTL)
http://www.magictraders.com
MOTL Bulletin Board

Joined: Jan 2001
Posts: 100
Member
Member
Offline
Joined: Jan 2001
Posts: 100
Anyone know if this works?? I did everything as says. But I kept it as original

With forum # than the category #

And for days I put 365, is that the problem??

anyone know the problem??

Joined: Jan 2001
Posts: 100
Member
Member
Offline
Joined: Jan 2001
Posts: 100
Anyone know if Leshrac still comes here?? Or does anyone have this hack??


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,575
Posts293,930
Members13,823
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)