This hack gives the user the option to select whether he wants to be sent to the forum after posting, or to the thread he posted in.
You can select this option in your profile, and also at the bottom of the new post screen.
In newreply.php replace
with
and also in the same file replace
with
and still in newreply.php replace
with
In newthread.php replace
with
and also in the same file replace
with
And in poll.php replace
with
Now, in your newreply and newthread templates, add this code
right after this code
In the modifyoptions template add this code
right after this code
In member.php replace
with
Also replace
with
and add
right after
And last but by no means least, run this SQL query:
(For more info about running SQL queries go here or here)
You can select this option in your profile, and also at the bottom of the new post screen.
In newreply.php replace
PHP Code:
// redirect
if ($prevpost[visible]) {
PHP Code:
// redirect
if ($prevpost[visible] && !$sendtoforum) {
PHP Code:
// redirect
if ($visible) {
PHP Code:
// redirect
if ($visible && !$sendtoforum) {
PHP Code:
if ($bbuserinfo[emailnotification]!=0) {
$emailchecked="checked";
}
PHP Code:
if ($bbuserinfo[emailnotification]) {
$emailchecked="checked";
}
if ($bbuserinfo[sendtoforumdef]!=0) {
$sendtoforumchecked="checked";
}
PHP Code:
} elseif ($visible) {
$goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";
PHP Code:
} elseif ($visible && !$sendtoforum) {
$goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";
PHP Code:
if ($bbuserinfo[emailnotification]) {
$emailchecked="checked";
}
PHP Code:
if ($bbuserinfo[emailnotification]) {
$emailchecked="checked";
}
if ($bbuserinfo[sendtoforumdef]!=0) {
$sendtoforumchecked="checked";
}
PHP Code:
// redirect
if ($threadinfo[visible]) {
PHP Code:
// redirect
if ($threadinfo[visible] && !$sendtoforum) {
Code:
<br><input type="checkbox" name="sendtoforum" value="yes" $sendtoforumchecked> <b>Go back to forum:</b> after posting would you like to return to the forum.
Code:
<br><input type="checkbox" name="signature" value="yes" $signaturechecked> <b>Show Signature:</b> include your profile signature. Only registered users may have signatures.
Code:
<tr> <td bgcolor="{secon[i][/i]daltcolor}"><normalfont><b>Use 'Send to forum' by default?</b></normalfont><br> <smallfont>Using this option will send you back to the forum after posting a new message.</smallfont></td> <td bgcolor="{secon[i][/i]daltcolor}"><normalfont> <input type="radio" name="sendtoforumdef" value="yes" $sendtoforumdefchecked> yes <input type="radio" name="sendtoforumdef" value="no" $sendtoforumdefnotchecked> no </normalfont></td> </tr>
Code:
<tr> <td bgcolor="{secon[i][/i]daltcolor}"><normalfont><b>Use 'Email Notification' by default?</b></normalfont><br> <smallfont>Using this option emails you whenever someone replies to a thread that you have participated in.</smallfont></td> <td bgcolor="{secon[i][/i]daltcolor}"><normalfont> <input type="radio" name="emailnotification" value="yes" $emailnotificationchecked> yes <input type="radio" name="emailnotification" value="no" $emailnotificationnotchecked> no </normalfont></td> </tr>
PHP Code:
$emailnotification=iif($emailnotification=="yes",1,0);
PHP Code:
$emailnotification=iif($emailnotification=="yes",1,0);
$sendtoforumdef=iif($sendtoforumdef=="yes",1,0);
PHP Code:
$DB_site->query("UPDATE user
SET ".$updatestyles."adminemail='$adminemail',
showemail='$showemail',invisible='$invisible',cookieuser='$cookieuser',
maxposts='".addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',
startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
emailonpm='$emailonpm',pmpopup='$pmpopup',usergroupid='$bbuserinfo[usergroupid]',
nosessionhash='$nosessionhash'
WHERE userid='$bbuserinfo[userid]'");
PHP Code:
$DB_site->query("UPDATE user
SET ".$updatestyles."adminemail='$adminemail',
showemail='$showemail',invisible='$invisible',cookieuser='$cookieuser',
maxposts='".addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',sendtoforumdef='$sendtoforumdef',
startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
emailonpm='$emailonpm',pmpopup='$pmpopup',usergroupid='$bbuserinfo[usergroupid]',
nosessionhash='$nosessionhash'
WHERE userid='$bbuserinfo[userid]'");
PHP Code:
if ($bbuserinfo[sendtoforumdef]) {
$sendtoforumdefchecked="checked";
$sendtoforumdefnotchecked="";
} else {
$sendtoforumdefchecked="";
$sendtoforumdefnotchecked="checked";
}
PHP Code:
if ($bbuserinfo[emailnotification]) {
$emailnotificationchecked="checked";
$emailnotificationnotchecked="";
} else {
$emailnotificationchecked="";
$emailnotificationnotchecked="checked";
}
Code:
ALTER TABLE user ADD sendtoforumdef SMALLINT(6) DEFAULT '0' not null AFTER emailnotification
Comment