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)
-   -   Shrink Old Posts in Thread (https://vborg.vbsupport.ru/showthread.php?t=33060)

Bedhead 12-14-2001 09:52 PM

Thank you very much.

I learned something new.
Whenever something is said to be put in fornt, I have been butting it directly in front. OOPS.

Once again thanks.

You contribute very much to vBulletin.

SirSteve 12-15-2001 02:54 AM

Excellent hack Bira! And a huge thanks for the help!

bira 12-15-2001 02:58 AM

Glad you got it sorted, SirSteve :)

FWC 12-15-2001 04:37 AM

I installed this on my test board tonight. I got the postbit how I wanted it and moved it to the real board. It's fabulous. Another great one, Bira!! :)

bira 12-15-2001 04:45 AM

Thank you :)

FWC 12-15-2001 06:02 AM

This is too funny. I'm getting two reactions from the community:

"Dude, you're a genius, you rock. This is incredible."

"Hey, why didn't you have this turned on the whole time?"

I have explained that I am not the one that rocks and that the hack is new. :)

george_proost 12-15-2001 08:40 AM

I'm now using the little + and - in a different way as well.

This <DIV> thing is new to me .... I have hundreds of categories..
Sooooo I put the script in the Header and made some more changes...

see here

What I've done is allow for the contraction of subforums as well.

Thx BIRA.... great hack ( I just need to exclude the Netscrape stuff :( )


five start hack this one ............

inetd 12-16-2001 11:15 PM

How to make, that for extended and new users this option it was ON by default?

Nam 12-16-2001 11:25 PM

[QUOTE]Originally posted by inetd
How to make, that for extended and new users this option it was ON by default?

inetd 12-16-2001 11:29 PM

[QUOTE]Originally posted by Nam


Change the value in registeradult template to yes.

Frank 12-16-2001 11:32 PM

[QUOTE]Originally posted by inetd

extended and new users

inetd 12-16-2001 11:40 PM

yes, existing

bira 12-17-2001 12:20 AM

inetd,

you'll have to run an query: UPDATE user SET hideposts='1'. That will switch it to 'yes' for all existing users.



Frank,

I don't know how FireFly did it, he may have an easier way than me.

I used my Post Counter hack for it.

If you installed it (it's a VERY easy hack to install), you can do the following to make sure the 1st post is always expanded:

In showthread.php, find this code:
Code:

  $post[postcount] = ++$postcount;
  $postbits .= getpostbit($post);

Change it to (addition marked in "high"):

Code:

  $post[postcount] = ++$postcount;
[high]  if ($post[postcount]=="1") {
        $thispost = "1";
  } else {
        $thispost = "";
  }[/high]
  $postbits .= getpostbit($post);

Open admin/functions.php, find:

Code:

        global $display, $HTTP_USER_AGENT;

        if ($post[dateline]>$bbuserinfo[lastvisit]) {

change it to (additions marked in high):

Code:

// Contract Old Posts in Thread (v1.0)
        global $display, [high]$thispost,[/high] $HTTP_USER_AGENT;

        if ($post[dateline]>$bbuserinfo[lastvisit][high] || $thispost=="1"[/high]) {

That's it.

Again, like I said, maybe there's a way of doing it that I'm ignoring and FireFly can help, but I just used my count posts hack for it and it works. *shrug*

FWC 12-17-2001 12:37 AM

[QUOTE]Originally posted by bira

Open admin/functions.php, find:

Code:

        global $display, $HTTP_USER_AGENT;

        if ($post[dateline]>$bbuserinfo[lastvisit]) {

change it to (additions marked in high):

Code:

// Contract Old Posts in Thread (v1.0)
        global $display, [high]$thispost,[/high] $HTTP_USER_AGENT;

        if ($post[dateline]>$bbuserinfo[lastvisit][high] || $thispost=="1"[/high]) {

That's it.

Again, like I said, maybe there's a way of doing it that I'm ignoring and FireFly can help, but I just used my count posts hack for it and it works. *shrug*

bira 12-17-2001 12:40 AM

hrmmm... I think I tried it and it didn't work for me, because $post[countpost] was not global

Frank 12-17-2001 12:42 AM

Ah excellent that works now, cheers Bira :D

bira 12-17-2001 12:48 AM

by the way,

I have a very important warning for those of you who want to turn it on for all existing users: DON'T DO THAT!

If you switch it on for ALL users, people logging on your Bulletin Board with Netscape WILL NOT BE ABLE TO EXPAND THE POSTS.

They will be stuck with entire threads contracted, and with absolutely no way to expand any post at all.

So don't turn it ON by default for all users. Let them make the choice.

FWC 12-17-2001 12:49 AM

[QUOTE]Originally posted by bira
hrmmm... I think I tried it and it didn't work for me, because $post[countpost] was not global

bira 12-17-2001 12:52 AM

hrmmm... maybe I was drunk the night I tried it :D

I'll try again now :)

bira 12-17-2001 12:53 AM

yup, you're right FWC. Thanks :)

FWC 12-17-2001 12:53 AM

[QUOTE]Originally posted by bira
If you switch it on for ALL users, people logging on your Bulletin Board with Netscape WILL NOT BE ABLE TO EXPAND THE POSTS.

They will be stuck with entire threads contracted, and with absolutely no way to expand any post at all.

FWC 12-17-2001 12:55 AM

[QUOTE]Originally posted by bira
yup, you're right FWC. Thanks :)

inetd 12-17-2001 12:56 AM

When the message is minimized, number of the message and the first line from the message is not shown. What to do make?

bira 12-17-2001 12:59 AM

FWC the expand all/contract all will work, because it reloads the page and changes the display setting to show/none. What WON'T work is the javascript function to change between show/none without loading the page.

Theoretically, I could write a more complex hack so that non-IE users could also use the +/-, whereby the page reloads on every click and changes the display setting for that specific post. But it will be a much bigger hack, and I don't think it's very convenient - having to reload the page every time you want to expand or contract a post.

I would also add that there is a way in javascript to write an expand/contract function for Netscape as well, using layers. It will, however, add a lot more code to the page (and therefore more bandwidth) and since the behaviour of layers is very different to dhtml, it will also mean heavily editing the templates, if not creating two template sets.

Since I abhore Netscape with all my heart, I decided quite consciously not to put that effort. 90% of my users are IE users. All I can do for the remaining 10% is make sure they don't get hurt or disabled. That's all

FWC 12-17-2001 01:01 AM

[QUOTE]Originally posted by inetd
When the message is minimized, number of the message and the first line from the message is not shown. What to do make?

bira 12-17-2001 01:02 AM

[QUOTE]Originally posted by inetd
When the message is minimized, number of the message and the first line from the message is not shown. What to do make?

FWC 12-17-2001 01:03 AM

[QUOTE]Originally posted by bira
Since I abhore Netscape with all my heart, I decided quite consciously not to put that effort. 90% of my users are IE users. All I can do for the remaining 10% is make sure they don't get hurt or disabled. That's all

inetd 12-17-2001 01:06 AM

[QUOTE]Originally posted by FireFly

After you do this, place $post[shortmsg] in the posbit template. :)

bira 12-17-2001 01:11 AM

inetd, place it in the first <div></div> -- exact place is wherever you want it to be

FWC 12-17-2001 01:13 AM

[QUOTE]Originally posted by inetd
Where exactly it is necessary to insert $post [shortmsg]?

OGieBear 12-17-2001 11:47 AM

Great Hack, but I have a Bug. The Images Plusimg and minimg don't see

http://members.tripod.de/OGieBears/Bild3.gif

ciao

eva2000 12-17-2001 03:55 PM

awesome hack Bira!!! ... haven't installed it yet since i'm still on a modified 2.2.0 version files for now..

bira 12-17-2001 04:14 PM

OGieBear - you'll need to open those images in an image editor, like PSP or Photoshop, and invert them or change the colours to something light.

eva2000 - thanks :D

OGieBear 12-17-2001 05:18 PM

*autsch*

thx...

the hack is Kewl ....

great works..

dxb 12-17-2001 10:12 PM

I'm using vb2.03 and I noticed in your install instruction in the register.php files a small difference and i think thats because it's more compatibale with 2.2.1

and this is the code

Code:

// Contract Old Posts in Thread (v1.0)
    $DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield."parentemail,coppauser,homepage,icq,aim,yahoo,signature,adminemail,showemail,invisible,usertitle,joindate,cookieuser,daysprune,lastvisit,lastactivity,usergroupid,timezoneoffset,emailnotification,receivepm,emailonpm,options,birthday,maxposts,startofweek,ipaddress,pmpopup,referrerid,nosessionhash[high],avatarid[/high],hideposts) VALUES (NULL,'".addslashes(htmlspecialchars($username))."','".addslashes([high](md5[/high]$password)[high])[/high]."','".addslashes(htmlspecialchars($email))."',".$newstyleval."'".addslashes(htmlspecialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepage))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."','$adminemail','$showemail','$invisible','".addslashes($usertitle)."','".time()."','$cookieuser','".addslashes($prunedays)."','".time()."','".time()."','$newusergroupid','".addslashes($timezoneoffset)."','$emailnotification','$receivepm','$emailonpm','$options','".addslashes($birthday)."','".addslashes($umaxposts)."','".addslashes($startofweek)."','".addslashes($ipaddress)."','$pmpopup','".addslashes($testreferrerid['userid'])."','$nosessionhash'[high],'$avatarid'[/high],'$hideposts')");
// Contract Old Posts in Thread (v1.0)

I changed it to this

Code:


// Contract Old Posts in Thread (v1.0)
$DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield."parentemail,coppauser,homepage,icq,aim,yahoo,signature,adminemail,showemail,invisible,usertitle,joindate,cookieuser,daysprune,lastvisit,lastactivity,usergroupid,timezoneoffset,emailnotification,receivepm,emailonpm,options,birthday,maxposts,startofweek,ipaddress,pmpopup,referrerid,nosessionhash,hideposts) VALUES (NULL,'".addslashes(htmlspecialchars($username))."','".addslashes($password)."','".addslashes(htmlspecialchars($email))."',".$newstyleval."'".addslashes(htmlspecialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepage))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."','$adminemail','$showemail','$invisible','".addslashes($usertitle)."','".time()."','$cookieuser','".addslashes($prunedays)."','".time()."','".time()."','$newusergroupid','".addslashes($timezoneoffset)."','$emailnotification','$receivepm','$emailonpm','$options','".addslashes($birthday)."','".addslashes($umaxposts)."','".addslashes($startofweek)."','".addslashes($ipaddress)."','$pmpopup','".addslashes($testreferrerid['userid'])."','$nosessionhash','$hideposts')");
// Contract Old Posts in Thread (v1.0)

it's working fine for me I just wanted to make sure that all what I did is right

and thank you for this lovely hack :)

bira 12-17-2001 10:21 PM

that looks correct to me, dxb :)

FWC 12-17-2001 10:27 PM

I love the way you can contract a post that has code in it and shrink the rest of the page down to size once you've read that message. :)

bira 12-17-2001 10:35 PM

something was annoying me about this hack, and I finally figured out what it is :D

If you don't put <a name="post$post[postid]"></a> in the first <div></div>, then you can't jumpt to a post directly if that post is contracted.

I now added it to my first <div></div> (it's already placed in the second one) and order is restored.

The funny thing is, I love Parker Clark's preview thread hack. And today I realized that with the preview hack and the contracted posts - I am finally able to go through all new threads/posts in my bb without losing my senses :D

inetd 12-17-2001 10:52 PM

Bira the best!

FWC 12-17-2001 11:17 PM

[QUOTE]Originally posted by bira
something was annoying me about this hack, and I finally figured out what it is :D

If you don't put <a name="post$post[postid]"></a> in the first <div></div>, then you can't jumpt to a post directly if that post is contracted.

I now added it to my first <div></div> (it's already placed in the second one) and order is restored.


All times are GMT. The time now is 08:13 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.02568 seconds
  • Memory Usage 1,822KB
  • 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
  • (8)bbcode_code_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
  • (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