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)
-   -   Quick Reply Box (with Close/Open thread switch) (https://vborg.vbsupport.ru/showthread.php?t=40380)

TECK 09-19-2002 09:01 PM

Code:

You can probably imagine that I want this confirmed before I go digging deep into the code again.
you will have to do it. you made a mistake. the hack works perfectly for everyone... well at least for 100 of them. :)

crazza 09-20-2002 07:50 AM

After checking the code four times, installing the hack on a brand spanking new installation of VBulletin 2.2.6 I discovered that I did nothing wrong in the first place.

Route 1.

When entering a thread by clicking the thread's title (e.g. ..../forums/showthread.php?s=&threadid=6055) the thread is only called by threadid.

After entering something in the QuickReply box AND clicking either close or open.. the exact same link will be called as stated above, thus showing you an 'old copy' of the page, without your new post.

Route 2.

When entering a thread by clicking the 'last post' button for this thread (e.g. ..../forums/showthread.php?s=&goto=lastpost&threadid=6055) a 'forced query' is run to determine what the actual lastpost is.

After entering something in the QRB and doing an open or close.. the exact same link will be called.. the same query will be run.. and voila.. there's your post.

Conclusion

Reloading the same page without running the extra query doesn't update correctly when closing or opening the thread. This can be fixed by forcing the reload to run the query (i.e. adding a 'lastpost' statement).

Code change

Only the php code for newreply.php needs to be altered in two places [around lines 308 and 450]

Old code:

Quote:


$threadinfo[notes]="Thread $action by $bbuserinfo[username] on ".vbdate($dateformat." ".$timeformat,time()).". $threadinfo[notes]";
$DB_site->query("UPDATE thread SET open=$threadinfo[open],notes='".addslashes($threadinfo[notes])."' WHERE threadid='$threadid'");

eval("standardredirect(\"".gettemplate("redirect_o penclose")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");

} else {
eval("standardredirect(\"".gettemplate("redirect_p ostthanks")."\",\"$goto\");");
}



New Code:

Quote:


$threadinfo[notes]="Thread $action by $bbuserinfo[username] on ".vbdate($dateformat." ".$timeformat,time()).". $threadinfo[notes]";
$DB_site->query("UPDATE thread SET open=$threadinfo[open],notes='".addslashes($threadinfo[notes])."' WHERE threadid='$threadid'");

$goto="showthread.php?s=&goto=lastpost&threadid=$t hreadid";
eval("standardredirect(\"".gettemplate("redirect_o penclose")."\",\"$goto\");");

} else {
eval("standardredirect(\"".gettemplate("redirect_p ostthanks")."\",\"$goto\");");
}




aLuCaRD 09-20-2002 11:28 AM

Any ideas why my avatars arent showing in the thread now..? There still in the PMs though...

aLuCaRD 09-20-2002 11:47 AM

My bad, was a hack I done before but didnt realise the avatars missing, lmao. Great hack mate, I perfer the QR box without smilies, less load on the server. :D

**EDIT** I mean without not with :D

TECK 09-20-2002 02:27 PM

crazza, do you have it showing:
Code:

eval("standardredirect(\"".gettemplate("redirect_openclose")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");
or:
Code:

eval("standardredirect(\"".gettemplate("redirect_openclose")."\",\"showthread.php?s=$session
[sessionhash]&threadid=$threadid\");");

??

it must be in one line. if separated, that's why is not redirecting you properly.
in the hack, it is listed in one line.

crazza 09-20-2002 02:41 PM

Tech,

Sorry for the inconvenient wrapping in my earlier post.. but yes, the statement was on one line (it wouldn't even end up in the right thread if it wasn't).

But the "fix" I put in works a charm.. so I'm a happy camper after all..

TECK 09-20-2002 02:42 PM

np, the important thing is that it's working great for you now. congrats. :)

crazza 09-20-2002 02:46 PM

And as a bonus I am actually starting to understand all this mumbly jumbly lame excuse for a programming language vbportal vbulletin myseekwall thingamajig :)

It makes me happy I might add..

TECK 09-20-2002 11:01 PM

good to hear this.. and welcome to our community.

yzztik 09-22-2002 02:47 PM

I notice that when you reply using the quick reply box, it does not register that you have posted to subscribe you to the thread if you have that as a default ... is there anything I can add to the code to make it do that? even if I have to add another checkbox below it to do it that would be great!

Any ideas anyone?


All times are GMT. The time now is 07:25 AM.

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.01180 seconds
  • Memory Usage 1,741KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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