Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-28-2000 Last Update: Never Installs: 0
 
No support by the author.

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]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 08-29-2000, 01:00 PM
Guest
 
Posts: n/a
Default

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...
Reply With Quote
  #33  
Old 08-29-2000, 01:07 PM
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #34  
Old 08-29-2000, 09:55 PM
Guest
 
Posts: n/a
Default

you rule Stallion, thanks
Reply With Quote
  #35  
Old 08-30-2000, 12:51 AM
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #36  
Old 08-30-2000, 12:58 AM
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #37  
Old 08-30-2000, 01:28 AM
Guest
 
Posts: n/a
Default

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]
Reply With Quote
  #38  
Old 08-30-2000, 01:31 AM
Guest
 
Posts: n/a
Default

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 ?
Reply With Quote
  #39  
Old 08-30-2000, 02:16 AM
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #40  
Old 08-30-2000, 02:19 AM
Guest
 
Posts: n/a
Default

Quote:
Buddy.php contains a lot of ugly code.
You didn't see it before.....
Reply With Quote
  #41  
Old 08-30-2000, 02:26 AM
Guest
 
Posts: n/a
Default

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!!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:56 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06220 seconds
  • Memory Usage 2,292KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete