Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2008, 04:26 PM
FCS-Webmaster FCS-Webmaster is offline
 
Join Date: Aug 2007
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [IM] Instant Messenger for vBulletin

Maybe you need it, maybe you don`t...just your decision.

How often do you see someone and want to tell him something instant, so you go to your private messages write him and boom...he`s offline without reading your message cause he didn`t noticed of not refreshing the site. This is what happens to me a hundred times.
Not all of my users are comfortable with the world wide web or used in it.

So how is this: Log into your website and automatically a IM System opens with all your user and you can send Users a message and boom he gets it really instant!

If you decide to follow the instructions: SAVE YOUR DB for complete backup

How?! It`s really easy! just install this one:
IM php121

But notice this one for integration for a vbulletin board!
IMPORANT FOR VBULLETIN INTEGRATION READ FIRST BEVOR COMPLETE INSTALLING

If you want to have your own Buddylist integrated you do need a phpfile and a cronjob:

1. the PHP File:

PHP Code:
?php
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (!
is_object($vbulletin->db))
{
    exit;
}

// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
$dbhost 'localhost';
$dbuname 'YOURSETTING';
$dbpass 'YOURSETTING';
$dbname 'YOURSETTING';

// ?bertrage Buddies von VBulletin an Messenger falls noch nicht vorhanden
$send=mysql_connect ($dbhost,$dbuname,$dbpass);
mysql_select_db($dbname);
$sqlbefehl "select userid,relationid from userlist order by userid desc";
$erg mysql_db_query($dbname$sqlbefehl$send); 
while (
$output1=mysql_fetch_array($erg))
    {
    
$send1=mysql_connect ($dbhost,$dbuname,$dbpass);
    
mysql_select_db($dbname);
    
$sqlbefehl1 "select userid,buddyid from imbuddylist where userid = $output1[0] and buddyid = $output1[1]";
    
$erg1 mysql_db_query($dbname$sqlbefehl1$send1); 
    if (!
$output2=mysql_fetch_array($erg1))
        {
        
$send2=mysql_connect ($dbhost,$dbuname,$dbpass);
        
mysql_select_db($dbname);
        
$sqlbefehl2 "INSERT INTO imbuddylist (userid,buddyid) VALUES('$output1[0]','$output1[1]')";
        
mysql_db_query($dbname$sqlbefehl2$send2);
        }
    }
    
// L?sche Buddies von Messenger falls bei VBulletin nicht mehr vorhanden
$send3=mysql_connect ($dbhost,$dbuname,$dbpass);
mysql_select_db($dbname);
$sqlbefehl3 "select userid,buddyid from imbuddylist order by userid desc";
$erg3 mysql_db_query($dbname$sqlbefehl3$send3); 
while (
$output3=mysql_fetch_array($erg3))
    {
    
$send4=mysql_connect ($dbhost,$dbuname,$dbpass);
    
mysql_select_db($dbname);
    
$sqlbefehl4 "select userid,relationid from userlist where userid = $output3[0] and relationid = $output3[1]";
    
$erg4 mysql_db_query($dbname$sqlbefehl4$send4); 
    if (!
$output4=mysql_fetch_array($erg4))
        {
        
$send5=mysql_connect ($dbhost,$dbuname,$dbpass);
        
mysql_select_db($dbname);
        
$sqlbefehl5 "delete from imbuddylist where userid = '".$output3[0]."' and buddyid = '".$output3[1]."'";
        
mysql_db_query($dbname$sqlbefehl5$send5);
        }
    }

// Tell that Cronjob is completed
    
log_cron_action('Buddies_to_IM'$nextitem);
?> 
NOTE:Replace YOUSETTING with your settings of the database name, admin and password. Also I do not use any prefixes! Save this file as cron_phpmessenger.php in includes/cron.

2. The Cron
To have this running you need a cron. Go to your ACP -> Crons -> Add

Name: Buddies_to_IM
Title: Buddies_to_IM
Description: Your Buddies in the IM
For all Time settings (day, hour, minute, etc) use the stars.
Active: Yes
Logs:Yes
Filename: ./includes/cron/cron_phpmessenger.php
Add on: vbulletin

Save & Done.
Cause I don`t get the Autologin to run (description follows below at least of the post), I do have another solution. So on login (vb) the IM popsup and you have to login with the same details of your vb login.

3. Automatic Popup (NOT AUTOLOGIN)

Go to login.php and find:
PHP Code:
// create new session

                
process_new_login($vbulletin->GPC['logintype'], $vbulletin->GPC['cookieuser'], $vbulletin->GPC['cssprefs']); 
add below:

PHP Code:
// login to IM

                
echo "<script language=\"JavaScript\">newwindow = window.open('./php121/php121im.php', 'name', 'height=400, width=200, left=20, top=20, toolbar=no, menubar=no, directories=no, location=no, scrollbars=no, status=no, resizable=yes, fullscreen=no'); if (newwindow.focus) {window.focus()};</script>"
If there is someone out with a better solutions I will be pleased for it! I`m a really n00b in this. Th one here works fine for me 3.6.8PL2 so no garantuee for anything.


If theres someone out with a good knowledge of programming please have a look on this code and try to convert it for vbulletin bords: Autologgin
Reply With Quote
  #2  
Old 02-12-2008, 04:32 PM
Zaiaku's Avatar
Zaiaku Zaiaku is offline
 
Join Date: Jul 2007
Location: 3rd Level of Hell
Posts: 502
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I saw that script a long time ago and though it could be useful to have thing but decided against it for a few reason. I may need this after I upgrade to 3.7. Niec work!
Reply With Quote
  #3  
Old 02-13-2008, 01:51 AM
FCS-Webmaster FCS-Webmaster is offline
 
Join Date: Aug 2007
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nobody out there who could help me?!
What I am finally searching is the possibility to send my login data from vb to the IM....come one I bet there are some smart coders out there who could fix the autologin easy.
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 12:08 PM.


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.03767 seconds
  • Memory Usage 2,215KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete