UBB.Dev
Posted By: Prince Look at this Code! - 06/05/2001 11:13 PM
Why won't this hack work on 5.47 ???

################################################################
# EDIT SUBJECT HACK FOR UBB #
# Last Updated: 7/17/00 at 000 hours #
# Version 1.00 #
# #
# Created By: Jason Axelrod *Jaxel* ([email protected]) #
# http://bbs.upnetwork.com/ #
################################################################
# Changes Log: #
# #
# 07/17/00 - Finalized the script, found out what was wrong... #
################################################################

A working demo of this script can be seen here:
http://bbs.upnetwork.com/

This hack works perfectly in 5.45 at later versions.

##########################
Hacking in ubb_library2.pl
##########################

Find code:
----------------------------------------------
$DeleteOption = qq(Delete Topic);
----------------------------------------------

Add AFTER code above:
----------------------------------------------
$SubjectOption = qq(Edit Subject);
----------------------------------------------
Find code:
Near text "Administrative Options:"
----------------------------------------------
$ArchiveOption
----------------------------------------------

Add AFTER $ArchiveOption:
This is BEFORE $DeleteOption:
----------------------------------------------
$SubjectOption
----------------------------------------------


###################
Hacking in edit.cgi
###################

Find code:
----------------------------------------------
if ($in{'EditFunction'} eq "DoDeleteThread") {
&DoDeleteThread;
}
----------------------------------------------

Add AFTER code above:
----------------------------------------------
if ($in{'EditFunction'} eq "GetEditSubject") {
&GetEditSubject;
}
----------------------------------------------
Find subroutine "GetEditThreads", ends with:
----------------------------------------------
&BOTTOMHTML;
} ## END GetEditThreads sr
----------------------------------------------

Add AFTER subroutine "GetEditThreads":
This is BEFORE subroutine "AdminEditForum":
----------------------------------------------
###########################################################
# BEGIN EDIT SUBJECT HACK FOR UBB (v1.00) #
# Created By: Jason Axelrod *Jaxel* ([email protected]) #
# http://bbs.upnetwork.com/ #
###########################################################

sub GetEditSubject {
my ($topic,$junk) = split(/./,$in{topic});
&CheckBadChars($topic);
@thisforum = &GetForumRecord($number);

$TopicNumber = substr($in{'topic'}, 0, 6);
($junk, $number) = split(/orum/, $in{'forum'});

@message = &OpenThread($in{'topic'});
@stats = split(/||/, $message[0]);

$ThreadSubject = $stats[4];
chomp($ThreadSubject);
$ThreadSubject =~ s/"/"/g;

print<$Header



$BBName - Edit Subject Topic





E D I T T O P I C




Only forum leaders (Administrator, Moderator) may perform this function.













Edit the subject, re-enter your UserName & Password, and then click Submit button!
Topic Subject:
Your User Name
Your Password










$Footer
otherHTML

} ## End GetEditSubject Message
----------------------------------------------
Posted By: BassTeQ Re: Look at this Code! - 06/06/2001 1:02 AM
It works fine on my 5.47d board!
You need to click on the first post in the thread to be able to edit the topic.
Posted By: Lord Dexter Re: Look at this Code! - 06/06/2001 11:00 AM
Works on my 5.45b too..:p
Posted By: Prince Re: Look at this Code! - 06/06/2001 6:11 PM
hmmmm....can one of you guys send me the code? I have tried adding this 3 times, and when I click the edit topic link I get a "no output from edit.cgi" error. :rolleyes:

I know I'm adding the hack correctly, it's obviously very simple, and I've installed around 45 hacks on board to date.
Posted By: CT Re: Look at this Code! - 06/06/2001 9:57 PM
No output from edit.cgi? That's a weird error...

Is this line still intact in edit.cgi:

Code
code:

(at the beginning of edit.cgi...)
Posted By: Prince Re: Look at this Code! - 06/06/2001 10:50 PM
Code
quote:</font><HR>Originally posted by CT:
No output from edit.cgi? That's a weird error...

Is this line still intact in edit.cgi:

<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, Arial">code:

(at the beginning of edit.cgi...)


Yes it is.
Posted By: BassTeQ Re: Look at this Code! - 06/07/2001 12:56 AM
There are a few different releases of this hack. I got mine from Arlo.net, the hack released by Dave
Posted By: Prince Re: Look at this Code! - 06/07/2001 6:39 PM
Here is the one that works!:)##############################################################
# Edit Topic Subject
# Created By: Dave Downin ([email protected])
# http://www.arlo.net
#
# Last Updated: 07/04/00
##############################################################

What does it do?
* Allows the original poster, forum administrator or moderator
to change the subject of a message (by editing the first/original
message of a topic).
Tested on:
* This hack was created for UBB 5.45x
Make Backups of:
* postings.cgi

Install Instructions:


Open up postings.cgi and find:
----------------------------------------------------
if ($Name eq "TopicSubject") {
$TopicSubject = $Value;
$TopicSubject =~ s/<.+?>//g;
$TopicSubject = &UNHTMLIFY($TopicSubject);
}
----------------------------------------------------

Right AFTER it, add:
----------------------------------------------------
if ($Name eq "NewTopicSubject") {
$NewTopicSubject = $Value;
$NewTopicSubject =~ s/<.+?>//g;
$NewTopicSubject = &UNHTMLIFY($NewTopicSubject);
}
----------------------------------------------------

Next, find:
----------------------------------------------------
&Lock("lock.file");
open (POST, ">$ForumsPath/$ExactPath/$topic");
foreach $thisone(@revised) {
chomp($thisone);
print POST ("$thisonen");
}
close(POST);
&Unlock("lock.file");
----------------------------------------------------

REPLACE that with:
----------------------------------------------------
if ($NewTopicSubject ne $TopicSubject && $NewTopicSubject && $in{'ReplyNum'} eq "000000") {
$NewTopicSubject = &CensorCheck("$NewTopicSubject");
@stats = split(/||/,$revised[0]);
$stats[4] = $NewTopicSubject;
$revised[0] = "$stats[0]||$stats[1]||$stats[2]||$stats[3]||$stats[4]||$stats[5]||$stats[6]||$stats[7]";
}

&Lock("lock.file");
open (POST, ">$ForumsPath/$ExactPath/$topic");
foreach $thisone(@revised) {
chomp($thisone);
print POST ("$thisonen");
}
close(POST);
&Unlock("lock.file");

if ($NewTopicSubject ne $TopicSubject && $NewTopicSubject && $in{'ReplyNum'} eq "000000") {
&UpdateForumSummary($number, $topic);
}
----------------------------------------------------

Next, find:
----------------------------------------------------
print <----------------------------------------------------

Right BEFORE that, add:
----------------------------------------------------
if ($in{'ReplyNum'} eq "000000") {
$SubjectEdit = qq(

Subject:


);
}
----------------------------------------------------

Next, find:
----------------------------------------------------
Delete? To delete this post, check this box.
$WarningWords

----------------------------------------------------

Right AFTER it, add:
----------------------------------------------------
$SubjectEdit
----------------------------------------------------

Save the file and you are done!

Enjoy!
© UBB.Developers