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)
-   -   "Who Posted" Enhancement: View All Posts By User In This Thread (https://vborg.vbsupport.ru/showthread.php?t=32784)

Admin 11-29-2001 02:33 PM

[QUOTE]Originally posted by bira
FireFly you must have the same checks or this file will become a way for users to look at hidden threads, for example.

I stripped off what clearly isn't needed (like go to next/last thread, like go to newest post, etc).

But you still have to make the same "work" as you would for showthread:
[...]
In short, you treat it almost exactly like you'd treat a thread. Well, it IS a thread. Just only one poster's messages in it :)

bira 11-29-2001 02:41 PM

oh, I see what you mean, sorry! ahahaha, sorry - I completely misunderstood you :)

That's nifty - I didn't think of doing what you did :blush:

I can only see one small change, really, but that can be overcome easily, so I'll edit the first post now and post the new lean version of the hack :D

Thanks

Admin 11-29-2001 02:48 PM

... or has Kaizen would say, "the penny has dropped for you". :p

[QUOTE]Originally posted by bira
I can only see one small change, really, but that can be overcome easily, so I'll edit the first post now and post the new lean version of the hack :D

bira 11-29-2001 03:12 PM

Actually I prefer it in a separate file, FireFly - less calls and code parsing. There's no need to parse the entire showthread.php code for this function, hence I'd rather separate them and be more economic.

If, however, you prefer to only edit showthread.php, then what you did is not enough. Do the following:

1) Find

Code:

if ($goto=="nextnewest") {
And change it to:

Code:

if (($goto=="nextnewest") && (!isset($postuserid))) {
2) Find

Code:

if ($goto=="nextoldest") {
And change it to:

Code:

if (($goto=="nextoldest") && (!isset($postuserid))) {

3) Find

Code:

// draw nav bar
$navbar=makenavbar($threadid,"thread",0);

And change it to:

Code:

// draw nav bar
if (isset($postuserid)) {
        $navbar=makenavbar($threadid,"thread",1);
} else {

        $navbar=makenavbar($threadid,"thread",0);
}

4) Find

Code:

if ($thread[pollid]) {
And change it to:

Code:

if (($thread[pollid]) && (!isset($postuserid))) {
5) Find

Code:

$postscount=$DB_site->query_first("SELECT COUNT(*) AS posts FROM post WHERE post.threadid='$threadid' AND post.visible=1");
And change it to:

Code:

$postscount=$DB_site->query_first("SELECT COUNT(*) AS posts FROM post WHERE post.threadid='$threadid' ".iif(isset($postuserid), "AND post.userid='$postuserid'", "")." AND post.visible=1");
6) Find

Code:

$getpostids=$DB_site->query("
        SELECT post.postid FROM post
        WHERE post.threadid='$threadid' AND post.visible=1
        ORDER BY dateline $postorder LIMIT ".($limitlower-1).",$perpage
");

And change it to (this is the change you already made):

Code:

$getpostids=$DB_site->query("
        SELECT post.postid FROM post
        WHERE post.threadid='$threadid' ".iif(isset($postuserid), "AND post.userid='$postuserid'", "")." AND post.visible=1
        ORDER BY dateline $postorder LIMIT ".($limitlower-1).",$perpage
");


7) Find

Code:

$pagenav = getpagenav($totalposts,"showthread.php?s=$session[sessionhash]&threadid=$threadid&perpage=$perpage");
And change it to
Code:

$pagenav = getpagenav($totalposts,"showthread.php?s=$session[sessionhash]&threadid=$threadid".iif(isset($postuserid), "&postuserid=$postuserid", "")."&perpage=$perpage");
These are the changes I could pick up off the top of my head. Personally I prefer to separate the two, so as not to add more procedures to showthread, and at the same time to deduct unnecessary procedures from showposts

Cheers,

Bira

Admin 11-29-2001 04:26 PM

Thanks bira for letting me know. :)

I actually only did the 3rd, 5th, 6th and 7th changes you listed, the others are really minor and not worth it. :)

Oh, and you have one ." too many here, and also something else: :)
Code:

$pagenav = getpagenav($totalposts,"showthread.php?s=$session[sessionhash]&threadid=$threadid&perpage=$perpage".iif(isset($postuserid), "&post.userid='$postuserid", "").");

bira 11-29-2001 04:36 PM

redid that line for clarity's sake :)

Admin 11-29-2001 04:42 PM

You forgot to remove the dot between post and userid in that line. ;)
Sorry for being petty. :)

bira 11-29-2001 04:53 PM

argh, bloody hell, heh. I'm not focused today, think I'll go have dinner and watch telly. Shouldn't be messing with code in my state :D

Martz 11-29-2001 10:49 PM

A seperate file is very appealing, ease of installation and bug hunting, less rehacking to do before an upgrade and if all hacks were *somehow* made this way we could keep our support for unedited files. Just a thought, as they say.

What are the disadvantages of using many files?

bira 11-29-2001 11:14 PM

[QUOTE]Originally posted by Martz
What are the disadvantages of using many files?


All times are GMT. The time now is 01:46 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.01093 seconds
  • Memory Usage 1,746KB
  • 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
  • (15)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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