vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   [RELEASE] bList 1.0 (https://vborg.vbsupport.ru/showthread.php?t=2749)

08-28-2000 04:40 AM

Heh, that was quick.

Here it is: Integrated vBulletin Buddy List, v1.0

Originally coded by Stallion, edited and cleaned up by me.

Download buddy.php here: http://www.enter.net/~rmsullivan/buddy.txt and stick it in your main vB directory.

Make a file (temp.php) in your main vB directory, and put this in it:
Code:

<?php
require("global.php");
$DB_site->query("ALTER TABLE user ADD buddylist TEXT not null");
echo "done";
?>

Run it (it should say done), then delete it.

Add this to your <head> tag in the forumhome template:
Code:

<SCRIPT LANGUAGE="JavaScript">
<!--
function popup (addy) {
  var popup = window.open("buddy.php","_new","height=460,location=no,menubar=no,resizable=no,scrollbars=auto,status=no,toolbar=no,width=310" );
}
// -->
</SCRIPT>

And add this to your loggedinusers template:
Code:

(<a href="javascript:popup()"><b>Launch Buddy List!</b></a>)
All other HTML code is contained within buddy.php

Oh, and I almost forgot to mention - set $pmintegrate to your liking. :) I have a check there incase anyway. LOL

Demos: http://www.magic-singles.com/cpa/forums/ and http://forums.planetunreal.com/

[Edited by Ed Sullivan on 12-09-2000 at 11:53 AM]

08-28-2000 04:41 AM

WOO-HOO
I'll probably try this tomorrow, time for bed already

08-28-2000 04:51 AM

Ed and I will be enhancing this as time goes on -- we do have some cool stuff in the works, so try it out and give us feedback on anything you think should be changed/added.

As for why we didn't use templates, I was rushed for time and templates aren't the easiest/most enjoyable thing to code in from a developer's standpoint, so they were left out.

Expect it in a future version though.

That's all for now,

08-28-2000 04:56 AM

( Actually, they're easy to do - just, as developers, we've learned to hate implementing them. :rolleyes: Go figure.)

[Edited by Ed Sullivan on 08-28-2000 at 01:57 AM]

08-28-2000 04:59 AM

Not in the fact you have to go browsing through HTML pages to make a minor interface tweak when you mess up an <a> tag or something ;)

08-28-2000 05:05 AM

I didn't mean like that - I meant they're easy to implement. It's only a line, and it REALLY shortens your code.

But the fact that you have to either make changes to multiple files and rerun the install script, or browse through the templates makes it annoying as hell.

08-28-2000 05:22 AM

Since I see no database modifications, and looking at the script, "your buddies" are stored in a cookie. It is not going to be pretty when I move computers or, even worse, my cookie hating users try to use this.

"we don't do cookies"

I try and try to knock some sense in to them but are you going to change this to use the database soon - I can do it for myself but is that in the plan?

08-28-2000 05:53 AM

I guess it'd be easy enough to have as a server-side option. Add another field in the user database, and instead of using setcookie, just use INSERT.

We'll take that into consideration for the Early Fall Release ;-)

08-28-2000 07:17 AM

hm... nice hack :)

As for the database stuff, I might give it a shot :)

08-28-2000 07:41 AM

the's fast ... so right now it's based on the cookie on the member's pc ?

08-28-2000 07:45 AM

BTW people, If you don't have the PM 1.20 hack installed, change $pmintegrate = 1; to $pmintegrate = 0;

It's on top of buddy.php

08-28-2000 07:47 AM

eva2000: Yeah, right now it's cookie based

I believe there will be server side support in a coming release.

08-28-2000 02:14 PM

We got this out in <24 hours after the first request, and you people are whining already? Sheesh! ;)

Anyway.
rangersfan - yeah, I uses cookies. Yeah, we could change it. But we just wanted to get it released. :D It wouldn't be to hard to insert it into the database; it would just mean some logged in/out checks so users can use it with cookies when they aren't registered, or logged in.

Menno - if you don't have the PM hack installed, it automatically sets $pmintegrate to 0, regardless of what you set it to. :D

08-28-2000 02:35 PM

thanks, so is it the same cookie as the log in one, or separate for the blist ? and how long does the cookie stay on the pc ?

i have a few members who got their friends at school hooked onto my forum and they are sharing a pc and just deleting their cookies logging out and logging in from the same pc for different users...

08-28-2000 02:50 PM

I haven't installed it, I just felt the need to whine - if only to make Mike's day a little happier :)

-jim

08-28-2000 02:53 PM

It uses a different cookie than the board does and it expires in 2020.

Eva2000: So if user A. makes a buddy list then user B. will pull up user A. buddy list when he comes along to use the public computer. I am not complaining, just answering eva's query.

08-28-2000 03:20 PM

Ok, new version is done.

If you are logged in, it uses your profile settings.
If you aren't, it uses a cookie.

Same download spot - but you need to add a field to the user table.

See my first post for info.

08-28-2000 04:03 PM

Worked fine! Have it installed under 1.1.3 Beta 3 at the HoloNet...

08-28-2000 07:00 PM

wow... installed in seconds ! ... works like a charm... great work stallion and Ed :D

08-28-2000 07:19 PM

I take it that this does not work with the first PM hack ( I never bothered to upgrade it as it works ok ) since it wants a field in the session table that I don't have in there.

08-28-2000 07:32 PM

just a question when you click on a member and it lists these threads...

what are they sorted and ordered by ? are these threads, the member has viewed, read, replied to, posted ?

also is there a way to hide the admin's tracks from members ?

08-28-2000 07:48 PM

Yes, it requires PM 1.20 for the private mesaging features, IIRC. We'll look into this for the next release.

The threads are sorted by the date of the reply which the user posted. So if I reply to thread 34 at 9 PM, thread 38 at 11 PM, thread 21 at midnight, and thread 34 again at 1 AM, then it will appear as:
Thread 34
Thread 21
Thread 38
Thread 34
In the next version that section will be enhanced a bit, as well as more configurable.

Not sure what you mean about hiding the admin's tracks? Not displaying the latest posts for admins?

08-28-2000 07:56 PM

thanks... yeah hiding admins posts from members' buddy lists ... is the display set the last 5 threads for each member when you display the threads ?

also in the javascript in the header auto scroll didn't work for me in IE5.5 i had to change it to =yes

08-28-2000 09:56 PM

Yes, its always the last 5. Once again though, we'll try and make it configurable... ;)

I'm not sure why'd you want to block admin posts from users' buddy lists, but we'll add all sorts of options for stuff like that.

About the scroll bars, not sure why it didn't work as planned. I think the default is auto, so we'll just not specify it -- and hope that works.

08-28-2000 11:51 PM

Stallion, one problem I've come across - when adding someone to the buddy list you get to see the posts in a private forum (if he just posted there) that you're not supposed to see.

Also, I have a lot of users who are logged in (i.e. never log out) but are not around really. So how does your diferentiation works in this case?

Thanks,

Bira

08-29-2000 12:11 AM

Just jumping in to say, THANKS! You guys rock.

08-29-2000 12:49 AM

Quote:

Originally posted by bira
Stallion, one problem I've come across - when adding someone to the buddy list you get to see the posts in a private forum (if he just posted there) that you're not supposed to see.

Also, I have a lot of users who are logged in (i.e. never log out) but are not around really. So how does your diferentiation works in this case?

Thanks,

Bira

oooh... hmmm.. yeah need to hide those private forum threads :D

08-29-2000 01:22 AM

Private forums are noted...

You won't be able to view those threads, but I guess the subject lines might be a little revealing.

As far as not logging out, it currently is based off of the active users listing -- and any user with inactivity for over 10 (or is it 15) minutes is automatically removed from that listing. So that should be all set...

08-29-2000 02:05 AM

You da man, Stallion!

08-29-2000 08:17 AM

Any idea when that next version will be out? :D

08-29-2000 01:00 PM

Quote:

Originally posted by Stallion
Private forums are noted...

You won't be able to view those threads, but I guess the subject lines might be a little revealing.

OK, that's what I feared. So I'll have to wait till you release the next version with a fix for that, cos in my board, in many cases just seeing the subject itself can cause havoc...

08-29-2000 01:07 PM

Quick fix for private forums:
Look around line 108, and change the query to:
$posts = $DB_site->query("SELECT post.threadid, post.postid, thread.title FROM thread, post WHERE post.threadid=thread.threadid AND thread.forumid <> '2' AND thread.forumid <> '7' AND post.userid='".intval($split[0])."' ORDER BY post.dateline DESC LIMIT 5");

Where '2' and '7' should be replaced with private forum numbers. If you have more than two, just diplicate the "AND...'7'" format. If you only have one, just drop that part of the query.

More later.

08-29-2000 09:55 PM

you rule Stallion, thanks :)

08-30-2000 12:51 AM

Great hack you guys. Works great on my site.

I would like it to where those with administrator status are still able to see the messages in the private area though.

Thanks,
Parker

08-30-2000 12:58 AM

Quote:

Originally posted by Stallion
Quick fix for private forums:
Look around line 108, and change the query to:
$posts = $DB_site->query("SELECT post.threadid, post.postid, thread.title FROM thread, post WHERE post.threadid=thread.threadid AND thread.forumid <> '2' AND thread.forumid <> '7' AND post.userid='".intval($split[0])."' ORDER BY post.dateline DESC LIMIT 5");

Where '2' and '7' should be replaced with private forum numbers. If you have more than two, just diplicate the "AND...'7'" format. If you only have one, just drop that part of the query.

More later.

yep it works those private threads are hidden :D

08-30-2000 01:28 AM

Better fix(:)):

Use the built-in VB function to dynamically decide whether or not a user can see a forum (and subsequently a thread in that forum):

Code:

$getperms = getpermissions( $bbuserid, $bbusergroupid, $forumid );

if( $getperms[ canview ] == 0 ) {

  // user is not allowed to see

} else {

  // show the title, whatever

} // end if

So, this will allow mods / admins to see the mod forum / thread titles, whereas other user will see whatever you tell them to see.


[Edited by mrogish on 08-29-2000 at 10:29 PM]

08-30-2000 01:31 AM

Quote:

Originally posted by mrogish
Better fix(:)):

Use the built-in VB function to dynamically decide whether or not a user can see a forum (and subsequently a thread in that forum):

Code:

$getperms = getpermissions( $bbuserid, $bbusergroupid, $forumid );

if( $getperms[ canview ] == 0 ) {

  // user is not allowed to see

} else {

  // show the title, whatever

} // end if

So, this will allow mods / admins to see the mod forum / thread titles, whereas other user will see whatever you tell them to see.


[Edited by mrogish on 08-29-2000 at 10:29 PM]

now where would you add that bit ?

08-30-2000 02:16 AM

Quote:

Originally posted by eva2000
now where would you add that bit ?
Change this:

Code:

    if ($split[1]) {
        $posts = $DB_site->query("SELECT post.threadid, post.postid, thread.title FROM thread, post WHERE post.threadid=thread.threadid AND post.userid='".intval($split[0])."' ORDER BY post.dateline DESC LIMIT 5");
    }

to this:

Code:

    if ($split[1]) {
        $posts = $DB_site->query("SELECT post.threadid, post.postid, thread.title, thread.forumid FROM thread, post WHERE post.threadid=thread.threadid AND post.userid='".intval($split[0])."' ORDER BY post.dateline DESC LIMIT 5");
    }

This returns the forumID that the thread is living in...

Next replace:

Code:

                          while ($post=$DB_site->fetch_array($posts)) {
                                  $shorttitle = substr($post[2],0,35);
                                  if ($shorttitle!=$post[2]) { $shorttitle .= "..."; }
                                  ////// HTML //////
                          $postz .= "<tr><td width=\"100%\"><FONT SIZE="1" FACE="verdana,arial,helvetica">??<a href=\"showthread.php?threadid=".$post[0]."#post".$post[1]."\" target=_blank>$shorttitle</a></font></td></tr>\n";
                          ////// END //////
                          }

(argh, ugly indentation!)

to this:

Code:

if( $posts ) {
  while( $post = $DB_site->fetch_array( $posts ) ) {
     
    $shorttitle = substr( $post[ 2 ], 0, 35 );
         
    if( $shorttitle != $post[ 2 ] ) { $shorttitle .= "..."; }
         
    $getperms = getpermissions( $bbuserid, $bbusergroupid, $post[ 4 ] );
         
    if( $getperms[ canview ] == 0 ) {
   
      // User is not authorized to see this forum or any threads in it
   
      ////// HTML //////
      $postz .= "<tr><td width=\"100%\"><FONT SIZE="1" FACE="verdana,arial,helvetica">  Moderators-Only Thread</font></td></tr>\n";
      ////// END //////
 
    } else {
   
      ////// HTML //////
      $postz .= "<tr><td width=\"100%\"><FONT SIZE="1" FACE="verdana,arial,helvetica">  <a href=\"showthread.php?threadid=".$post[0]."#post".$post[1]."\" target=_blank>$shorttitle</a></font></td></tr>\n";
      ////// END //////
       
    } // end if

  } // end while
} // end if

This will replace the link with "Moderators-Only Thread". You can call it whatever you want.

According to my PHP parsing mind, this should work. However, we don't run this hack so I haven't tested it -- check it out and let me know.

BTW:
Buddy.php contains a lot of ugly code. :)

08-30-2000 02:19 AM

Quote:

Buddy.php contains a lot of ugly code.
You didn't see it before.....

08-30-2000 02:26 AM

I didn't mean to imply that you guys are bad programmers or anything, but it hurt my eyes to look at this code!! :)

And hey, don't read my "online user listing" thread -- talk about the pot calling the kettle black!! :)


All times are GMT. The time now is 05:02 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.01341 seconds
  • Memory Usage 1,824KB
  • 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
  • (9)bbcode_code_printable
  • (6)bbcode_quote_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