vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Show who is online in Teamspeak on forumhome (https://vborg.vbsupport.ru/showthread.php?t=67969)

jluerken 08-02-2004 10:00 PM

Show who is online in Teamspeak on forumhome
 
Hi,

this is my first little hack and I hope one of you has a little bit time to improve it.

This hack will check who is online on a Teamspeak server and generate a list of nicknames in a file.
This file will then be display in the statistics area of forumhome.


Hack can be installed in 5 minutes!
Difficulty: very easy
Screenshot attached

Enhancements: If anyone knows how to start this via vBCron please tell me :D



in forumroot/index.php find:
PHP Code:

require_once('./includes/functions_bigthree.php'); 

Right under it add:
PHP Code:

// get teamspeak data
   
$myts2footer file_get_contents("./whoisints.php"); 


Edit Template FORUMHOME
Find:
PHP Code:

<if condition="$show['birthdays']"

and add the following text above it:

PHP Code:

<!-- teamspeak users -->
<
tbody>
    <
tr>
        <
td class="thead" colspan="2">
            <
a style="float:$stylevar[right]href="#top" onclick="return toggle_collapse('forumhome_teamspeak')"><img id="collapseimg_forumhome_teamspeak" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_teamspeak].gif" alt="" border="0" /></a>
            
Who's online in Teamspeak
        </td>
    </tr>
</tbody>
<tbody id="collapseobj_forumhome_teamspeak" style="$vbcollapse[collapseobj_forumhome_teamspeak]">
    <tr>
        <td class="alt2"><img src="$stylevar[imgdir_misc]/ts2icon.jpg" alt="TS2" border="0" /></td>
        <td class="alt1"><div class="smallfont">$myts2footer</div></td>
    </tr>
</tbody>
<!-- end teamspeak users --> 

Extract ts2forumhomehack.zip
Upload ts2php (compiled c++ file) to /forumhome/
Upload ts2icon.jpg to /forumhome/images/misc/

Use a cronjob to start ts2php every 2 minutes (should be done via vBCron if possible but I don't know how!) with the following command:

./ts2php TEAMSPEAKIP whoisints.php

This will check the Teamspeakserver for users and creates a file whoisints.php with the names in it.

If you run a teamspeak server with a different port run

./ts2php TEAMSPEAKIP -p<port> whoisints.php

Don't forget to chmod 755 ts2php :D



See the screen to take get a better impression!

???`S?LV?R???` 08-03-2004 09:45 PM

awesome, sounds good :)

Holidazed 08-03-2004 09:55 PM

What is a teamspeak server?

BoNfiRe 08-03-2004 10:29 PM

it's a voice comms system similar to roger wilco, ventrillo ect ect ect you can find it here

Reeve of shinra 08-03-2004 11:09 PM

cool hack. maybe this will get people into the teamspeak.

Phalynx 08-04-2004 06:43 AM

Cool Thing! I created a similar hack with the difference that the data is beeing read in realtime from the Server.

http://www.insideearth.de/forum.php?guestlanguageid=5

danbc 08-04-2004 07:39 AM

So if you haven?t got access to regular cron, you can?t get this to work? :(

jluerken 08-04-2004 03:16 PM

Quote:

Originally Posted by Phalynx
Cool Thing! I created a similar hack with the difference that the data is beeing read in realtime from the Server.

http://www.insideearth.de/forum.php?guestlanguageid=5

Would be nice if you post this here.
This can help all users which cannot run own cron jobs.

Mith 08-04-2004 04:07 PM

Quote:

Originally Posted by jluerken

Enhancements: If anyone knows how to start this via vBCron please tell me

Use a cronjob to start ts2php every 2 minutes (should be done via vBCron if possible but I don't know how!) with the following command:

./ts2php TEAMSPEAKIP whoisints.php

Hi,

I would find this very useful for my site, I unfortunately don't know how to run a cron job, but was wondering if anyone knew how to make this run via the vb scheduler.

Many thanks,

Mith

MrNase 08-04-2004 05:00 PM

As far as I know, the vBulletin Cron script can only run *.php scripts :)

SB2002 08-07-2004 12:41 PM

ok, I really want to add this and have been hacking vb's since the 2.1.x days. I've got everything working fine, but it wont update the list (so not really working fine) the ts ip we have is 67.18.180.106:1237 how would i enter that into the cronjob (i'm using crontab on control panel)

anyone able to help me out on what the cronjob line should look like for that ip?

thanks

xxxGiJoe 08-07-2004 03:10 PM

Quote:

Originally Posted by Phalynx
Cool Thing! I created a similar hack with the difference that the data is beeing read in realtime from the Server.

http://www.insideearth.de/forum.php?guestlanguageid=5

I'd definately use this hack if you'd post it for my site... :D

PC Gaming Site
http://WOLFGaming.net

jluerken 08-07-2004 06:27 PM

Quote:

Originally Posted by SB2002
ok, I really want to add this and have been hacking vb's since the 2.1.x days. I've got everything working fine, but it wont update the list (so not really working fine) the ts ip we have is 67.18.180.106:1237 how would i enter that into the cronjob (i'm using crontab on control panel)

anyone able to help me out on what the cronjob line should look like for that ip?

thanks

Ok here is my cronjob as example
0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,3 6,38,40,42,44,46,48,50,52,54,56,58 * * * * /home/www/web1/html/forum/includes/cron/ts2php 217.160.173.218 /home/www/web1/html/forum/whoisints.php >/dev/null 2>&1

This is starting the update every 2 minutes :D
Don't forget to add a -p<port> in your case.

SB2002 08-07-2004 07:02 PM

ok thanks, n00b type question here, but i add the 1237 in inplace of the word port right?

so like -p<1237>

jluerken 08-07-2004 08:34 PM

Quote:

Originally Posted by SB2002
ok thanks, n00b type question here, but i add the 1237 in inplace of the word port right?

so like -p<1237>

Yes, try

ts2php IPADDRESS -p1234 FILE or
ts2php IPADDRESS -p:1234 FILE

Did not remember how I add that :D

SB2002 08-07-2004 10:26 PM

Thanks, im still having problems getting it to work, it doesnt seem to be creating the whoisints.php file at all, or updating it when i manually create a blank php file and name it whoisints.php

It's very late here too, so I've totally given up for tonight, but I dunno what else I can do to try and get it working, which is a crying shame cos the hack itself looks sound, and would have been really useful to have got working. I'll openly admit tho, I only got the control panel stuff added a couple of months back and this is my first experience with cronjobs outside of vb, so this may be the problem for me.

007 08-08-2004 05:09 AM

Does this work for 3.01 by chance? Also, does the TS server need to be the same server as the forum server or could it be different?

This sounds very cool. Thanks a lot!

SB2002 08-08-2004 11:51 AM

works like a charm on 3.0.1, check my forums if you want to see it in action, i have it set to update every 2 minutes now.

thanks for the help with the cronjob too jluerken, I've been waiting for something like this for my clan for months, such a breeze to install, took me a while to get the cron down, you need the port as IP -p:addnumberhere file

Once again, thanks for a great hack.

Bandwurm 08-08-2004 01:08 PM

Quote:

Originally Posted by jluerken
0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,3 6,38,40,42,44,46,48,50,52,54,56,58 * * * * /home/www/web1/html/forum/includes/cron/ts2php 217.160.173.218 /home/www/web1/html/forum/whoisints.php >/dev/null 2>&1

This is starting the update every 2 minutes :D

*/2 * * * * /home/www/web1/html/forum/includes/cron/ts2php 217.160.173.218 /home/www/web1/html/forum/whoisints.php >/dev/null 2>&1

This run's every two minutes too.

j_86 08-08-2004 01:40 PM

Instead of cronning it, run the command whenever index.php is loaded? Surely enough people visit your board to compensate for no-cron job.

croft 08-09-2004 01:48 AM

Quote:

Originally Posted by JimpsEd
Instead of cronning it, run the command whenever index.php is loaded? Surely enough people visit your board to compensate for no-cron job.

By the sound of it you know how to do that ?
If not can someone tell me how to do this cron job ??

I have c-panel. and it says cron job on a button there.

Thats my knowledge of cron =(

help please.

SB2002 08-09-2004 11:53 AM

Quote:

Originally Posted by croft
By the sound of it you know how to do that ?
If not can someone tell me how to do this cron job ??

I have c-panel. and it says cron job on a button there.

Thats my knowledge of cron =(

help please.

I had the same thing, you need to use the absolute url of your site to get to the file and also to create the file, like what the guys above have said, and then simply insert the ts ip address (followed by -p:number) where number = your port number (if applicable) and it should work. I had to use the crontab in control panel, which i assume is kinda the same thing. This was my first even cron job too, and with some help i was able to pop my cherry so to speak. If you get any probs, then give us a shout and i'll see if i can help you, otherwise im sure someone else would be more than willing

croft 08-09-2004 12:25 PM

Quote:

Originally Posted by SB2002
I had the same thing, you need to use the absolute url of your site to get to the file and also to create the file, like what the guys above have said, and then simply insert the ts ip address (followed by -p:number) where number = your port number (if applicable) and it should work. I had to use the crontab in control panel, which i assume is kinda the same thing. This was my first even cron job too, and with some help i was able to pop my cherry so to speak. If you get any probs, then give us a shout and i'll see if i can help you, otherwise im sure someone else would be more than willing


Here is what i have set it up to =(

/home/changed/public_html/dab/ts2php 66.199.253.26 -p:8525 /home/changed/public_html/whoisints.php >/dev/null 2>&1

I tryed the -p8525
-p:8525
I tryed with the url instead of the path.
I tryed everything i can think of and im betting i missed something very easy ?? =(

SB2002 08-09-2004 04:19 PM

when i did mine i didnt have the >dev/null 2>&1 bit, and it works ok, but oddly mine didnt start working for almost 12 hours after the cronjob started, and now it runs every 2 minutes

croft 08-09-2004 07:51 PM

I have tryed without that to. even putting every word together =(
Nothing works it wont create the file or nothin....

I dont want blog up this thread with my stupid questions. Can i pm someone about this ?


- edit -
Ok now the wierdest thing happend. I tryed it again and now it created a file BUT the file isnt php its a tmp file at the end. ???

whoisints.php.tmp

Whats that all about anyway ?

Ohh anmd it sent an email to me stating it couldnt connect to the ip 66.199.253.26:51234
But thats the wrong port number ? Why is it trying to connect to the wrong portnumber ? I have the correct number in the cron.

- edit -

croft 08-11-2004 01:58 PM

Quote:

Originally Posted by croft
I have tryed without that to. even putting every word together =(
Nothing works it wont create the file or nothin....

I dont want blog up this thread with my stupid questions. Can i pm someone about this ?


- edit -
Ok now the wierdest thing happend. I tryed it again and now it created a file BUT the file isnt php its a tmp file at the end. ???

whoisints.php.tmp

Whats that all about anyway ?

Ohh anmd it sent an email to me stating it couldnt connect to the ip 66.199.253.26:51234
But thats the wrong port number ? Why is it trying to connect to the wrong portnumber ? I have the correct number in the cron.

- edit -

Anyone ?

croft 08-12-2004 08:16 PM

a bit of support here please =(

vBTotal 08-15-2004 05:14 PM

saaaaaaaaaaweeeeeeeeeeeeeeeeet !!!!

genmud 08-15-2004 10:27 PM

is there a way to get this type of info without putting everything in vBulletin???

I just wanna use this on my clans site which I dont have vB on(yet) and I was also thinking of making this into a block or something for vBportal or at least being able to include this...

I am a noob @ php :)

any help would be greatly appreciated :)

Genmud

Panic 08-21-2004 05:27 PM

Couldn't get this to work. When I tried executing ts2php from a SSH window I got the following: -

./ts2php: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

Any ideas

jluerken 08-21-2004 06:02 PM

Quote:

Originally Posted by genmud
is there a way to get this type of info without putting everything in vBulletin???

I just wanna use this on my clans site which I dont have vB on(yet) and I was also thinking of making this into a block or something for vBportal or at least being able to include this...

I am a noob @ php :)

any help would be greatly appreciated :)

Genmud


The script is independant of vb which means you can use it also on a normal webpage.

jluerken 08-21-2004 06:02 PM

Quote:

Originally Posted by Panic
Couldn't get this to work. When I tried executing ts2php from a SSH window I got the following: -

./ts2php: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

Any ideas

Which glibc version are you running?

Panic 08-21-2004 07:31 PM

Quote:

GNU C Library stable release version 2.2.5, by Roland McGrath et al.
Copyright (C) 1992-2001, 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 2.95.4 20011002 (Debian prerelease).
Compiled on a Linux 2.4.18 system on 2003-04-08.
Available extensions:
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
linuxthreads-0.9 by Xavier Leroy
BIND-8.2.3-T5B
libthread_db work sponsored by Alpha Processor Inc
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Report bugs using the `glibcbug' script to <bugs@gnu.org>.
See above for version information. So I need a version of ts2php compiled with the glib version installed on my web server, correct?

jluerken 08-21-2004 08:51 PM

Quote:

Originally Posted by Panic
See above for version information. So I need a version of ts2php compiled with the glib version installed on my web server, correct?

Yes that should fix it.
Send me your emailadress in a pm and I will send you the source so that you can compile it on your own.

jluerken 08-24-2004 07:55 PM

Quote:

Originally Posted by Panic
See above for version information. So I need a version of ts2php compiled with the glib version installed on my web server, correct?

@Panic: Did you get the source and compiled it? Tell me if this worked for you cause the answer will maybe also help others!

SilverDawn 08-28-2004 03:40 PM

this is awesome and I have been looking for something like this for a long time.

great hack and I will install it!

Wij 08-30-2004 12:42 PM

I seem to have the same problem as croft.
I'm certain i've installed it correctly and my cron seems fine,its creating a file called whoisints.php.tmp(I do not understand why it is making this file) and I get this error at the top of my page:

Warning: file_get_contents(./whoisints.php): failed to open stream: No such file or directory in /home/wiiija/public_html/wij/phobia/forum/index.php on line 59

Now,if I rename the file to whoisints.php the error dissapears but the file does not update and no users are listed as being on teamspeak,also the whoisints.php.tmp file reappears in the directory :)

My cronjob as it stands:
/home/wiiija/public_html/wij/phobia/forum/includes/cron/ts2php 217.158.150.19 -p:10110 /home/wiiija/public_html/wij/phobia/forum/whoisints.php >/dev/null 2>&1

I'm using cpanel to set the frequency of updates etc.
If theres a glaring mistake I'd appreciate if somebody could point it out but it appears in order to me,I have also chmod 755 the ts2php file as stated in the first post,I hadnt done this at first and thought this maybe the problem but unfortunately not.


Cheers

Wij

Wij 08-30-2004 01:45 PM

I fixed it,I had to remove the ">/dev/null 2>&1" and remove the ":" before the port,it now works 100%,great hack.

**edit** lol,ok 99% works,I've been disconnected from teamspeak for around 30 mins now and its still listing me as connected? :tired:

regards

Wij

LImburg 09-13-2004 04:37 PM

ok, got the thing running (on another machine because of the libstdc++.so.5 error, but where oh where can I define a username and password? Since the TS-server isn't public I really need that...

TIA

jluerken 09-13-2004 05:31 PM

Quote:

Originally Posted by LImburg
ok, got the thing running (on another machine because of the libstdc++.so.5 error, but where oh where can I define a username and password? Since the TS-server isn't public I really need that...

TIA

I've never tested this with a password protected TS but I think it is also working when there is a password on cause you're not really login on. Its only checking who's online like a webbased script which also do not need login data :D


All times are GMT. The time now is 04:49 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.02725 seconds
  • Memory Usage 1,850KB
  • 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
  • (4)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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