https://www.icyphoenix.com/viewtopic.php?f=35&t=3852 ----------------------------------- Chaotic Fri 14 Mar, 2008 22:12 Php121 Instant Messenger ----------------------------------- http://www.php121.com/ I used this on my old forum with ezPortal. It was great and worked perfectly. It doesn't require a lot to be done but the instructions are a little tricky. This mod would show who was online by displaying a chat bubble next to their name in the Who Is Online section, would show who/how many people are using Instant Messgener, and it was fully integrated with your existing database. This way users would not have to register again. It wouldn't ask for your password/username because it was integrated. Great mod and it's free. Anyone here think they could work this into IP? Here is the download page: http://www.php121.com/download.php - [color=#ff0019]Wasn't sure where to post this topic, so I posted it here! Sorry.[/color] ----------------------------------- Chaotic Sat 15 Mar, 2008 21:50 Re: Php121 Instant Messenger ----------------------------------- If anyone would be willing to help me work this around for IP, my site will be the guinea pig! ----------------------------------- KasLimon Sat 15 Mar, 2008 23:05 Re: Php121 Instant Messenger ----------------------------------- It seems easy, you just need to know where these lines are now. [b]Open[/b] [i]forum.php[/i] [b]Find[/b][code linenumbers=false] $sql = 'SELECT user_id, username, user_allow_viewonline, user_level, user_lastlogon[/code] [b]In-line, Find[/b][code linenumbers=false]user_lastlogon[/code] [b]In-line After, add[/b][code linenumbers=false], php121_user_chatting[/code] [b]Find[/b][code linenumbers=false] $colored_user = colorize_username($todayrow['user_id'], false);[/code] [b]Replace with[/b][code linenumbers=false] //***PHP121*** $php121 = ''; if ( ($todayrow['php121_user_chatting'] != 0) && ($todayrow['php121_user_chatting'] != NULL )&& (time()-$todayrow['php121_user_chatting']) < 90 ) { $php121 = " Send instant message"; } //***END PHP121*** $colored_user = colorize_username($todayrow['user_id'], false) . $php121;[/code] [b]Open[/b] [i]templates/mg_themes/overall_include.tpl[/i] [b]Find[/b][code linenumbers=false][/code] [b]After, add[/b][code linenumbers=false][/code] [b]Open[/b] [i]templates/mg_themes/overall_header.tpl[/i] [b]Find[/b][code linenumbers=false] {L_INDEX}   [/code] [b]After, add[/b][code linenumbers=false] Instant Messenger   [/code] Try if it works, and if it does, it would be great to add it to customizations forum. I have it working [url=http://www.iesmg.es/ip/]here. Greets! [ot]PS: please don't move this to customizations yet...[/ot] ----------------------------------- ThE KuKa Sat 15 Mar, 2008 23:35 Re: Php121 Instant Messenger ----------------------------------- Nice MODification Kas :wink: ----------------------------------- KasLimon Sat 15 Mar, 2008 23:41 Re: Php121 Instant Messenger ----------------------------------- [quote user="ThE KuKa" post="26210"]Nice MODification Kas :wink:[/quote] I haven't done a modification, I've just adapted it to Icy Phoenix :P Greetings! ----------------------------------- ThE KuKa Sat 15 Mar, 2008 23:55 Re: Php121 Instant Messenger ----------------------------------- Yes! is a modification LOL :lol: ----------------------------------- Chaotic Sun 16 Mar, 2008 00:03 Re: Php121 Instant Messenger ----------------------------------- KasLimon, Great work! I've made all the changes you posted, but the Instant Messenger link still does not show at the top when I am using the Black Pearl template. Would it be possible to put the Instant Messenger link in a block? Also, do you have your test site setup to show who is using Instant Messenger? It should show a chat bubble next to their username in the Who Is Online section in the forum. I was also pretty confused about the SQL directions in the docs folder. It says to: Edit configuration: Copy php121config.php-PHPBB to php121config.php, replacing the existing file. Edit php121config.php and change all the variables to match your database and website configuration. In the php121config.php-PHPBB file, you have to change a variety of variables. The file lists: [spoiler] [/spoiler] Should anything be changed in the Extra Database Options section? ----------------------------------- KasLimon Sun 16 Mar, 2008 00:11 Re: Php121 Instant Messenger ----------------------------------- You should only change the highlighted lines: [spoiler][code linenumbers=false] [/code][/spoiler] Try to apply this code changes [quote user="KasLimon" post="26205"][b]Open[/b] [i]templates/mg_themes/overall_header.tpl[/i] [b]Find[/b][code linenumbers=false] <a href="{FULL_SITE_PATH}{U_INDEX}">{L_INDEX}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;[/code] [b]After, add[/b][code linenumbers=false] <a href="javascript:poptastic('php121/php121im.php');">Instant Messenger</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;[/code][/quote]To all files who start with overall_header in templates/mg_themes dir. I'll try to add it in a block :roll: Greets! ----------------------------------- Chaotic Sun 16 Mar, 2008 00:18 Re: Php121 Instant Messenger ----------------------------------- After some trouble, I finally got it up and running. I'm now going to make those extra code changes to see if the bubble will show up in the WIO section. Thanks for all your help Kas! ----------------------------------- Chaotic Sun 16 Mar, 2008 01:48 Re: Php121 Instant Messenger ----------------------------------- Ok, Instead of having the link in the navigation bar at the top, I think it would best suit me in a block that I could move anywhere. Let me know if you found a way for this to work. Thanks Kas. Also, the Chat Bubble is showing in the wrong place. It should be showing next to the users that are currently online, not in the who has been online line. :?: [spoiler] [img]http://www.icyphoenix.com/files/images/3295/chatbubble.jpg[/img] [/spoiler] ----------------------------------- KasLimon Sun 16 Mar, 2008 16:03 Re: Php121 Instant Messenger ----------------------------------- It will not be easy at all to add it into a block... I'll try later. To show it in current online list: [spoiler][b]Undo all changes you've done to[/b] [i]forum.php[/i] [b]Open[/b] [i]includes/users_online_block.php[/i] [b]Find[/b][code linenumbers=false]$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level,[/code] [b]In-line, find[/b][code linenumbers=false]u.user_level[/code] [b]In-line after, add[/b][code linenumbers=false], u.php121_user_chatting[/code] [b]Find[/b][code linenumbers=false] $user_online_link = colorize_username($row['user_id']);[/code] [b]Replace with[/b][code linenumbers=false] //***PHP121*** $php121 = ''; if ( ($row['php121_user_chatting'] != 0) && ($row['php121_user_chatting'] != NULL )&& (time()-$row['php121_user_chatting']) < 90 ) { $php121 = " Send instant message"; } //***END PHP121*** $user_online_link = colorize_username($row['user_id']) . $php121;[/code] [b]Find[/b][code linenumbers=false] $user_online_link = '' . colorize_username($row['user_id']) . '';[/code] [b]Replace with[/b][code linenumbers=false] $user_online_link = '' . $user_online_link . '';[/code][/spoiler] Greets! ----------------------------------- KasLimon Sun 16 Mar, 2008 16:28 Re: Php121 Instant Messenger ----------------------------------- Integrating with CMS blocks was much easier than I thought Just upload the attached package and add php121 block. Please tell me if it works, and if it does, I'll post the steps to integrate php121 and IP in a new topic. Greets! ----------------------------------- Chaotic Sun 16 Mar, 2008 16:58 Re: Php121 Instant Messenger ----------------------------------- Kas, it works! The chat bubbles appear in the WIO block, which is great! A user can click the chat box to initiate a chat with another user. I also like the way you made this into a block. Users are signed into Instant Messenger as soon as they log in. You made this into a block, with a height dimension field...could you also make a width dimension field? This would allow me to put this block on the left or right side instead of just in the middle. As always Kas, great work! To test this out: www.thelocclan.com User: test Password: 1234 It's at the bottom of the index.php page. ----------------------------------- KasLimon Mon 17 Mar, 2008 17:27 Re: Php121 Instant Messenger ----------------------------------- Of course you can add it to any place :mricy: I've added to the block some abilities so now you can: [list][*]Set block height [*]Set block width [*]Set block alignment (so if you don't set width to 100% you can align it)[/list] Upload the files included in this new package. After uploading, delete the php121 block and add it again. Also, I'd like you to test this php121config file I've attached. It should work without editing it, just upload it to php121 folder. Remember to make a backup first. I'm adding this to Customizations forum in a while. Greets! ----------------------------------- Chaotic Mon 17 Mar, 2008 17:47 Re: Php121 Instant Messenger ----------------------------------- I've got to go do some running around, but I'll be back shortly to test this all out for you. Thanks for your work! ----------------------------------- Chaotic Tue 18 Mar, 2008 07:08 Re: Php121 Instant Messenger ----------------------------------- Kas, I removed my old php121config.php file and replaced it with the one you provided. I replaced all the files you provided, deleted the old php121 block and created it again. Everything worked great! I do have a problem, but it was a problem that you had nothing to do with. I'm not sure if I didn't perform the SQL actions properly but it seems my chat doesn't want to refresh. I'm talking about the main window that shows who is online in the chat. I've logged into my main account with Internet Explorer and logged into the "test" account with Firefox. I am not able to see "test" come online after I logged that account in. Something is wrong with the AJAX or something. I was reading: http://forums.php121.com/viewtopic.php?t=1168 http://forums.php121.com/viewtopic.php?t=1357 http://forums.php121.com/viewtopic.php?t=1354 I found out there are three possible things wrong: [*]You have blank lines at the bottom of your php121config.php file. [*]MySQL 5 is in STRICT mode. [*]You need to hash out a line in mysql5 my.ini. I've checked and I don't have any blank lines at the bottom of my php121config.php file. I tried running this in SQL: [code linenumbers=false]SET @@global.sql_mode='MYSQL40'[/code] but I have to have "super" priveleges to run that code. I contacted my hosting company and they said that since I am running on a shared server, I could not have "super" priveleges. If I had my own dedicated server, I could run that code. So that is a major problem for me, specifically. The last step, which involves hashing out a line of code, I cannot access because I don't have "super" priveleges through my database. So I found a "hack" that will force the main window to refresh every 20-30 seconds automatically, since AJAX in this modification is apparently not working for me. OPEN [b]php121im.php[/b] FIND [codeblock] [/codeblock] IN-LINE AFTER [code linenumbers=false][/code] , ADD [codeblock][/codeblock] I now have this at the bottom of my php121im.php file: [code linenumbers=false] [/code] This shouldn't have to be edited like this, but I had to since there was no other way AJAX was going to update itself on my website. I was wondering if you are hosting your test site on a dedicated server or if it is shared. If it is shared and php121's AJAX is updating itself only when it needs to, I have done something wrong on my end. If you are on a shared server and php121's AJAX is NOT updating, the code above will "fix" it. If you are on a shared server and it's actually updating only when a user comes online or sends you a chat request, let me know exactly how you did it, please! Thanks and good work Kas! *Edit* - I think I am going to remove all php121 SQL entries and re-enter them. ----------------------------------- Chaotic Tue 18 Mar, 2008 12:05 Re: Php121 Instant Messenger ----------------------------------- I fixed the AJAX problem. I deleted all php121 SQL and manually added each, block by block. Everything is refreshing now, only when it needs to, which is the way it's supposed to work. I wonder how the security is with this mod? Do you think an .htaccess file should be added to the php121 directory? You've done a great job Kas and this modification is worthy to be moved into the IP Customizations forum. I can already see this modification being downloaded 1000 times! :lol: Thanks again ----------------------------------- KasLimon Tue 18 Mar, 2008 12:36 Re: Php121 Instant Messenger ----------------------------------- I think htaccess is not neccesary. I'll add a package in customizations with some more security. You'll have to upload it adn overwrite files. Greets! ----------------------------------- KasLimon Tue 18 Mar, 2008 13:14 Re: Php121 Instant Messenger ----------------------------------- http://www.icyphoenix.com/viewtopic.php?f=21&t=3889 ;) ----------------------------------- Chaotic Tue 18 Mar, 2008 15:22 Re: Php121 Instant Messenger ----------------------------------- Kas, Should I download the mod again and overwrite all my old files? I'm asking because you said you'd add a package with more security. Thanks! ----------------------------------- KasLimon Tue 18 Mar, 2008 16:34 Re: Php121 Instant Messenger ----------------------------------- Update only php121 folder (if you upload all it will be the same) It will add some index.html to avoid people entering directly to that folder. Greets! :mricy: ----------------------------------- Chaotic Tue 18 Mar, 2008 16:36 Re: Php121 Instant Messenger ----------------------------------- Thanks!