Previous Thread
Next Thread
Print Thread
Rate Thread
#220664 07/06/2002 9:48 AM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Mod Name / Version NoTextHack 1.0
Description This is a small hack that enters "NT = No text" into the body of the message if the subject ends with "NT", with or without surrounding [] or (), if the body is empty. It also won't allow posts without anything in the body unless NT is in the subject.
Working under UBB.threads 6.0.1
Any pre-requisites None
Author(s) Gardener
Credits The user who suggested it a long time a
Demo Not really necessary
Files Altered addpost.php languages/<language>/addpost.php
Database Altered No
New Files None
Any other info None
Attachments
51961-NoTextHack-1_0.txt (0 Bytes, 52 downloads)

Sponsored Links
c0bra #220665 08/18/2002 6:14 PM
Joined: Aug 2002
Posts: 109
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 109
Does this add *NT* in the sunject line automatically or just add the no text in the body IF the user puts NT at the end of their subject? If not, can it be modified to automatically tack *NT* on the end of a users subject (as well as put the no text in the body) if they in fact try to submit a post with no text in the body?

#220666 08/18/2002 6:59 PM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
It only adds the No Text text to the body of the message if it is empty and NT is in the subject. I made it this way because otherwise it would be very easy to post an empty message.

If you want NT added automatically to the subject of empty messages, you could do this in addpost.php:

Find this line (at line 90):
code:

if ( (ereg("^\s*$",$Subject)) || ($Body == "") || ($postername == "") ) {



Replace it with this:
code:

if ( (!preg_match("/^\s*$/",$Subject)) && (preg_match("/^\s*$/",$Body)) ) {
if (!preg_match("/\[NT\]$/",$Subject))
$Subject .= " [NT]";
$Body = "{$ubbt_lang['NOTEXT']} ";
}
if ( (ereg("^\s*$",$Subject)) || (preg_match("/^\s*$/",$Body)) || ($postername == "") ) {
$html -> not_right($ubbt_lang['ALL_FIELDS'],$Cat);
}



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
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
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-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)