vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Give an option to send use to forum after posting and not to thread (https://vborg.vbsupport.ru/showthread.php?t=26734)

Admin 08-27-2001 10:00 PM

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)

cyrus 08-31-2001 09:10 AM

hmm, want this but its a long hack. Is it possible you can make a zip of this please. Itll be appreciated.

Thank you

Admin 08-31-2001 01:28 PM

Umm... there's nothing to zip here.
Do you want me to attach the instructions as a text file?

BBInsider 08-31-2001 06:50 PM

I cant find that anywhere. In newreply.php replace ?? Where is it and how do I get to it? Also is this been tested? thanks!!

http://www.buffalobillsinsider.com/g...ard/index.php3

Admin 09-01-2001 05:41 AM

This was tested succesfully on v2.0.3.

I see your question was answered in another thread, so I won't bother. :)

Christine 09-09-2001 01:25 PM

Hi Firefly - excellent job!

I loaded this up and am not having any trouble with new topics or polls or the UserCP but the newreply isn't working. I have the box on the screen so I know it isn't in the template but when I check it, the system ignores it. No error message, it just returns to thread.

What am I missing here?

Admin 09-09-2001 01:34 PM

Thanks Christine. :)

Sounds to me as if you didn't make the necessary changes to newreply.php.
Double check that, and get back to me.

Christine 09-09-2001 01:37 PM

Wow - that was quick. :D

That was my concern - newreply.php was the only one I was thinking would affect it from the changes I saw. Blah. I tried a few times last night and didn't see any mistakes. I shall try again now and let you know!

Christine 09-09-2001 02:25 PM

Hmmmm - still not working.

Here is what I added to newreply.php - I am including the code above and below as well.
PHP 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\");");

    } else {
      if (
$attachmentid and !$foruminfo[moderateattach]) {
        
$DB_site->query("UPDATE thread SET attach = attach + 1 WHERE threadid = '$threadid'");
      } 

PHP Code:

if ($bbuserinfo[userid]!=and !$previewpost) {
    if (
$bbuserinfo[signature]!="") {
      
$signaturechecked="CHECKED";
    }
if (
$bbuserinfo[emailnotification]) {
      
$emailchecked="checked";
    }
    if (
$bbuserinfo[sendtoforumdef]!=0) {
      
$sendtoforumchecked="checked";
    }
  }

  if (
$foruminfo[allowicons]) {
    
$posticons=chooseicons($iconid);
  }  else {
    
$posticons="";
  } 

I am going blind over here. :D What am I missing?

Admin 09-09-2001 02:41 PM

Weird, everything's in place.

Umm, check in your newreply template that the name of the checkbox is sendtoforum. That's really the only thing I can think of... :confused:

Christine 09-09-2001 02:46 PM

Hmmm - from New reply template...
PHP Code:

<br><input type="checkbox" name="signature" value="yes" $signaturechecked> <b>Show Signature:</b> include your profile signature.  Only registered users may have signatures.
                 <
br><input type="checkbox" name="sendtoforum" value="yes" $sendtoforumchecked> <b>Go back to forum:</bafter posting would you like to return to the forum.
    </
smallfont></ 


Admin 09-09-2001 02:46 PM

Bug.

Fix:
In newreply.php replace this
PHP Code:

      // redirect
      
if ($visible) { 

with
PHP Code:

      // redirect
      
if ($visible && !$sendtoforum) { 

Thanks for finding that Christine. :)

Updated main post

Christine 09-09-2001 02:56 PM

We have a winner!!!!

This is working with no errors.

Great job, Firefly!

(I am on 2.0.3 BTW)

Admin 09-09-2001 03:17 PM

Who's da winner???? ;)

Thanks. :)

LuBi 09-13-2001 06:08 AM

Used the auto install and I keep getting this erroer

Warning: Supplied argument is not a valid File-Handle resource in /www/htdocs/forums/admin/avatar_hack_install.php on line 349

Admin 09-13-2001 10:26 AM

[QUOTE]Originally posted by LuBi
Used the auto install and I keep getting this erroer

Warning: Supplied argument is not a valid File-Handle resource in /www/htdocs/forums/admin/avatar_hack_install.php on line 349

LuBi 09-13-2001 10:33 AM

yes yes.. :( wrong hack I got that error on another i tried too install last night. I have school so I'll post it lateri nthe right thread. sorry

Admin 09-13-2001 10:56 AM

I don't understand, you tried to install a hack and it didn't work and you think it's because of this hack, or you just posted in the wrong thread?

LuBi 09-13-2001 11:24 AM

posted in the wrong thread.

Nupraptor 09-20-2001 05:05 AM

I'm having the same problem Christine was having, but the fix you supplied for her doesn't seem to have done the job for me. It works for New Topics and Polls, but not the reply. I've double and triple checked everything, and it matches your instructions to a "T". Ran the Query with no problem. :( At a bit of a loss as to what to do.

Admin 09-20-2001 09:23 AM

You have a good reason to be sad, I have no idea what could possible be wrong. You use v2.0.3, right?

Sorry... :(

Nupraptor 09-20-2001 09:36 AM

Yes I am. Would it be possible for me to contact you and have you look over the contents of the php file?

Admin 09-20-2001 09:48 AM

Yeah sure, I'm at firefly@poolie.net.

Nupraptor 09-21-2001 12:17 AM

Ok, e-mailed you. Thanks ahead of time for the help. :)

Enigma 10-12-2001 01:56 PM

Thanks! nice hack!

SWFans.net 11-11-2001 07:17 PM

Is there a way to add this option to "edit post" as well? I looked over editpost.php and couldn't find any similarities to the instructions.

LuBi 11-11-2001 08:58 PM

Can we get this working on 2.2?

LuBi 11-12-2001 07:23 PM

up up

Admin 11-13-2001 11:17 AM

I'm 99% sure this works on 2.2.0. :)

LuBi 11-13-2001 02:12 PM

Yea!!!! This is a very powerful feature. Thanks, oh and maybe you should update the title if possible to 2.2.0

I'll get back to you with the results.. :D

LuBi 11-13-2001 02:28 PM

Works for 2.2.0!!! I love this hack, thanks again! :D

Admin 11-13-2001 03:30 PM

Thanks LuBi. :)

Tommy Boy 11-21-2001 09:12 PM

If I'm not mistaken, you forgot to add:
PHP Code:

$sendtoforumchecked = ($sendtoforum) ? "checked" ""

Right after:
PHP Code:

    $parseurlchecked=iif($parseurl,"checked","");
    
$emailchecked=iif($email,"checked","");
    
$disablesmilieschecked=iif(!$allowsmilie,"checked","");
    
$signaturechecked=iif($signature,"checked",""); 

In both newthread.php and newreply.php. Without those lines, the checkbox will be cleared when you preview the post.

BTW: Any idea why the following line does NOT work?
PHP Code:

$sendtoforumchecked=iif($sendtoforum,"checked",""); 


bobbydavro 01-08-2002 08:46 AM

Just a query about this hack, is the checkbox automatically checked to take the user back to the forum?

If not how do I make it so it is? basicly I want it so it is on as default.

squawell 01-08-2002 09:51 AM

oh~thankz FireFly!!

this very useful~~~:D:D:D

Admin 01-08-2002 12:54 PM

[QUOTE]Originally posted by bobbydavro
Just a query about this hack, is the checkbox automatically checked to take the user back to the forum?

If not how do I make it so it is? basicly I want it so it is on as default.

Rose 01-08-2002 02:21 PM

I so wanna install this hack! *makes note to do it after work*

Um, I'm a bit new still and I'm not sure what hacks work with what versions. I'm using v.2.2.1. Will this work with it?

Admin 01-08-2002 02:58 PM

Should be. :)

squawell 01-08-2002 03:42 PM

but chen i 'm using v2.2.1 and use ur code it can't work!!

but when i use ur code and tommy boy's code it works!!

so i think would u miss some thing?? ;)

StarBuG 01-08-2002 04:06 PM

WOW!

Very nice hack!

But an attached file to download the hack would be nice! :)

Greetings

StarBuG


All times are GMT. The time now is 04:44 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01514 seconds
  • Memory Usage 1,895KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (26)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete