Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-27-2001 Last Update: Never Installs: 31
 
No support by the author.

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
PHP Code:
// redirect
      
if ($prevpost[visible]) { 
with
PHP Code:
// redirect
      
if ($prevpost[visible] && !$sendtoforum) { 
and also in the same file replace
PHP Code:
// redirect
      
if ($visible) { 
with
PHP Code:
// redirect
      
if ($visible && !$sendtoforum) { 
and still in newreply.php replace
PHP Code:
    if ($bbuserinfo[emailnotification]!=0) {
      
$emailchecked="checked";
    } 
with
PHP Code:
    if ($bbuserinfo[emailnotification]) {
      
$emailchecked="checked";
    }
    if (
$bbuserinfo[sendtoforumdef]!=0) {
      
$sendtoforumchecked="checked";
    } 
In newthread.php replace
PHP Code:
} elseif ($visible) {
        
$goto="showthread.php?s=$session[sessionhash]&threadid=$threadid"
with
PHP Code:
} elseif ($visible && !$sendtoforum) {
        
$goto="showthread.php?s=$session[sessionhash]&threadid=$threadid"
and also in the same file replace
PHP Code:
    if ($bbuserinfo[emailnotification]) {
      
$emailchecked="checked";
    } 
with
PHP Code:
    if ($bbuserinfo[emailnotification]) {
      
$emailchecked="checked";
    }
    if (
$bbuserinfo[sendtoforumdef]!=0) {
      
$sendtoforumchecked="checked";
    } 
And in poll.php replace
PHP Code:
// redirect
    
if ($threadinfo[visible]) { 
with
PHP Code:
// redirect
    
if ($threadinfo[visible] && !$sendtoforum) { 
Now, in your newreply and newthread templates, add this code
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.
right after this code
Code:
<br><input type="checkbox" name="signature" value="yes" $signaturechecked> <b>Show Signature:</b> include your profile signature.  Only registered users may have signatures.
In the modifyoptions template add this code
Code:
<tr>
	<td bgcolor="{secondaltcolor}"><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="{secondaltcolor}"><normalfont>
		<input type="radio" name="sendtoforumdef" value="yes" $sendtoforumdefchecked> yes
		<input type="radio" name="sendtoforumdef" value="no" $sendtoforumdefnotchecked> no
	</normalfont></td>
</tr>
right after this code
Code:
<tr>
	<td bgcolor="{secondaltcolor}"><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="{secondaltcolor}"><normalfont>
		<input type="radio" name="emailnotification" value="yes" $emailnotificationchecked> yes
		<input type="radio" name="emailnotification" value="no" $emailnotificationnotchecked> no
	</normalfont></td>
</tr>
In member.php replace
PHP Code:
  $emailnotification=iif($emailnotification=="yes",1,0); 
with
PHP Code:
  $emailnotification=iif($emailnotification=="yes",1,0);
  
$sendtoforumdef=iif($sendtoforumdef=="yes",1,0); 
Also replace
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]'"); 
with
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]'"); 
and add
PHP Code:
  if ($bbuserinfo[sendtoforumdef]) {
    
$sendtoforumdefchecked="checked";
    
$sendtoforumdefnotchecked="";
  } else {
    
$sendtoforumdefchecked="";
    
$sendtoforumdefnotchecked="checked";
  } 
right after
PHP Code:
  if ($bbuserinfo[emailnotification]) {
    
$emailnotificationchecked="checked";
    
$emailnotificationnotchecked="";
  } else {
    
$emailnotificationchecked="";
    
$emailnotificationnotchecked="checked";
  } 
And last but by no means least, run this SQL query:
Code:
ALTER TABLE user ADD sendtoforumdef SMALLINT(6) DEFAULT '0' not null AFTER emailnotification
(For more info about running SQL queries go here or here)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #62  
Old 07-26-2002, 11:20 PM
ptenthus ptenthus is offline
 
Join Date: Jan 2002
Location: Lyons, CO
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doesn't seem to. Any other thoughts?
Reply With Quote
  #63  
Old 07-26-2002, 11:35 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try changing this:

PHP Code:
<input type="hidden" name="sendtoforum" value="$sendtoforumchecked"
to this, then:

PHP Code:
<input type="hidden" name="sendtoforumdef" value="$sendtoforumchecked"
Reply With Quote
  #64  
Old 07-27-2002, 10:20 AM
ptenthus ptenthus is offline
 
Join Date: Jan 2002
Location: Lyons, CO
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope.

And viewing source for the page, I can see that the $sendtofurumchecked is being evaluated as nothing. The account I'm using to test _does_ have the redirect to the thread list turned on in the CP.

Any idea why the variable isn't defined?
Reply With Quote
  #65  
Old 07-27-2002, 03:01 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, try this and let me know if it works. I just put it together and haven't tested it thoroughly yet.

In showthread.php:

Find:

PHP Code:
} elseif ($bbuserinfo['showquickreply']==0) {
    
$replybox='';
} else {
    
$textareacols gettextareawidth(); 

After it add:

PHP Code:
if ($bbuserinfo['sendtoforumdef']) {
        
$sendtoforum 'yes';
    } else {
        
$sendtoforum '';
    } 

Then put this in your showthread_replybox:

PHP Code:
<input type="hidden" name="sendtoforum" value="$sendtoforum"
Reply With Quote
  #66  
Old 08-20-2002, 04:59 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Chen, here is the code I seem to be having problems with? Can you please tell me how to get this hack to work with the Hidden reply hack in this bit of code?

Code:
// redirect
      if ($visible or $hiddenreply==1 && !$sendtoforum) {
        $goto="showthread.php?s=$session[sessionhash]&postid=$postid#post$postid";
      } else {
        $goto="forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]";
      }
      eval("standardredirect(\"".gettemplate("redirect_postthanks")."\",\"$goto\");");
    }
  }
}
or this piece of code:

Code:
// redirect
      if ($prevpost[visible] && !$sendtoforum) {
        $goto="showthread.php?s=$session[sessionhash]&postid=$postid#post$postid";
      } else {
        $goto="forumdisplay.php?s=$session[sessionhash]&forumid=$forumid";
      }
      eval("standardredirect(\"".gettemplate("redirect_postthanks")."\",\"$goto\");");
Reply With Quote
  #67  
Old 08-20-2002, 05:42 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is everyone ready for this? I think I am finally starting to get the hang of this. I fixed my problem stated in the post above.

I replaced this:

Code:
 // redirect
      if ($visible or $hiddenreply==1 && !$sendtoforum) {
with this:

Code:
 // redirect
      if (($visible or $hiddenreply==1) && !$sendtoforum) {
and now the "Hidden reply hack" and the "Option to send User back to forum After posting hack" are like one big happy family.

Thanks to everyone who has helped me along the way to get to this point. I know it's not a big deal to a lot of you, but it sure is to me to know that I am finally starting to understand some of this now.
Reply With Quote
  #68  
Old 09-04-2002, 10:06 PM
Tim Wheatley's Avatar
Tim Wheatley Tim Wheatley is offline
 
Join Date: Nov 2001
Location: England
Posts: 489
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Er.. is this working with 2.2.7??
Reply With Quote
  #69  
Old 09-16-2002, 09:22 PM
Hamma Hamma is offline
 
Join Date: Oct 2001
Location: MA,USA
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not sure, gonna give it a whirl
Reply With Quote
  #70  
Old 09-24-2002, 04:16 AM
JFry JFry is offline
 
Join Date: Sep 2002
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oy. I am screwed up. I can't get this to work on 2.2.7. It is probably me, though, rather than the program. I get the following error when I click "reply" in an existing thread:
Quote:
Warning: Unexpected character in input: '' (ASCII=16) state=1 in /home/thebunga/public_html/forums/newreply.php on line 298
Reply With Quote
  #71  
Old 12-23-2002, 01:50 AM
Savant's Avatar
Savant Savant is offline
 
Join Date: Oct 2002
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A really cool hack, and it allllmost works, got it working in both my replys and quickreply box, just one snag... replys work fine, but now trying to start a new topic gives me this:

Parse error: parse error, unexpected T_ELSE in C:\Inetpub\wwwroot\procreatica\forum\newthread.php on line 258

heres line 256 to 274

// redirect
} elseif ($visible && !$sendtoforum) {
$goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";

} else {
$goto="forumdisplay.php?s=$session[sessionhash]&forumid=$forumid";
}
eval("standardredirect(\"".gettemplate("redirect_p ostthanks")."\",\"$goto\");");

} else {
//create new thread
if ($postpoll) {
$visible = 0;
}
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,postuserid,lastposter,dateline,iconid, visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."' ,'".time()."','$forumid','1','0','".addslashes($po stusername)."','$bbuserinfo[userid]','".addslashes($postusername)."','".time()."','$i conid','$visible','$attachcount')");
$threadid=$DB_site->insert_id();

where did i goof? Thanks in advance for any help
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:24 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.12271 seconds
  • Memory Usage 2,384KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_code
  • (23)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete