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)

bira 12-08-2001 10:00 PM

Hi all,

This is a brand new addition to my own BB, so I don't even know how my own users will react to it, let alone how you guys would :)

Hack Description:
  • Posts you have already read in a thread, will show up with their header only (a row that includes the username, post subject and date only). New posts only will appear in full.
  • This is user selectable via the 'Edit Options' page: each user can decide if he wants this option on or not. (By default all existing and new users will have this turned Off).
  • A link at the top of the thread offers to "expand all" posts or "contact all" posts.
  • by clicking on the + sign on a shruk post, it will expand without the page reloading. By clicking on the - sign on an expanded post, it will shrink without the page reloading.
  • [high]this option is available for your IE users only! Netscape users will see no difference and will not be affected anyway at all by the change[/high]
How to install:
  • Please download the attached zipfile.
  • Upload plus.gif and minus.gif to your images directory
  • Upload install_contractposts.php to your admin directory and run that script.
Note: there are quite a few changes to make (primarily additions, not replacements) to the vb scripts and templates. The process should take you several minutes, so I recommend you close your Bulletin Board while installing the hack.

Demo:

You are welcome to visit my Bulletin Board, at http://www.atlasf1.com , to see what the additions look like. To test it in full (ie, the option of old posts being shrunk by default), you will have to register and modify your options after you have received your password.

Cheers,

Bira

bira 12-09-2001 02:25 AM

here's a screen capture of what it would look like if a user selected to contract old posts:

http://www.atlasf1.com/personal/bira...tractposts.gif

(This is on a clean, default vBulletin style/design. My BB has a slightly different style, which is why I am also including this image above)

Hooper 12-09-2001 02:27 AM

Wow Bira. Your going to town on these hacks lately. :D

Going to install tonight!

Hooper 12-09-2001 02:31 AM

All I can say is that it works and looks wonderful on your site.

Thank You. :D

bira 12-09-2001 02:34 AM

that's cool, thanks :)

FWC 12-09-2001 02:54 AM

Bira, I registered on your site to see how it worked. Very cool!! :D

bira 12-09-2001 05:44 AM

ok, if you installed this hack on 2.2.1 there's a small change.

If you haven't installed this hack, or installed it on 2.0.3, ignore this post.

In root/register.php

find 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[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)

And add to it the code highlighted in the above line.

Sorry about this - I initially tested this on 2.0.3, and having tested it now on 2.2.1 as well - I noticed the ',avatarid' md5()and ".'$avatarid'" are missing from this query :)

Crinos 12-09-2001 09:06 AM

Hmmm, I'm getting this error when I try to run install_contractposts.php:

Parse error: parse error in /home/username/public_html/forums/admin/install_contractposts.php on line 278

bira 12-09-2001 09:14 AM

Sorry about that Crinos. Please download the zip file again - I corrected that mistake (forgot to espace the ' in that line :/)

Crinos 12-09-2001 09:55 AM

Thanks bira ...

I just finished installing it on my test board, but now I get this error when I try to click a thread from forumdisplay.php:
Code:

Parse error: parse error in /home/username/public_html/forums/showthread.php on line 401
I looked for that line, and this is what it contained (lines 398-408)
PHP Code:

$counter=0;
$countposts = ($pagenumber-1)*$perpage;
while (
$post=$DB_site->fetch_array($posts) and $counter++<$perpage) {
  if (
$postdoneery(st[postid]]) {
    
$counter--;
    continue;
  } else {
    
$postdone[$post[postid]]=1;
  }
  
$postbits .= getpostbit($post);


Any idea what I did wrong on this one? Thanks in advance :)


All times are GMT. The time now is 01:59 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.01242 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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