The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
convert this vb2 mysql code to work in vb3
#!/usr/bin/perl -w
# # vBulletin MRTG grapher by discore (tyler@xmission.com) # use strict; use DBI; ################################################## ############################## ## CHANGE this stuff ## ################################################## ############################## # MySQL info my $sqluser = "USERNAME"; my $sqlpass = "PASSWORD"; my $sqlhost = "localhost"; # host of your database my $database = "DATABASE"; # Your board's name my $name = "Your Board Name"; # Your 'Timeout for Cookie' # # Set this to 300 if you want truely accurate graphs. This will report # considerably less users online than vB does. # Or, set this to whatever you "Timeout for Cookie" setting from your vB # Options is to report online users the same way "Who's Online" does. my $cookie_expire = "300"; # Location of 'uptime' program my $uptime_bin = "/usr/bin/uptime"; ################################################## ############################## ## Logically won't need to touch anything after here ## ################################################## ############################## # connect to the database my $dba = "DBI:mysql:database=$database;host=$sqlhost"; my $dbh = DBI->connect("$dba","$sqluser", "$sqlpass",{'RaiseError' => 1}) || die "Could not connect to database: $!\n"; my $data; # output # get number of posts in the last 5 minutes if($ARGV[0] eq "posts") { my $time = time()-300; my $query = $dbh->selectrow_hashref("SELECT COUNT(*) AS count FROM post WHERE dateline>=$time"); my $totalnewposts = $query->{'count'}; $data = $totalnewposts; } # get number of online users elsif($ARGV[0] eq "users") { my $time = time()-$cookie_expire; my $query = $dbh->selectrow_hashref("SELECT COUNT(*) AS sessions FROM session WHERE lastactivity>$time"); my $totalonline = $query->{'sessions'}; $data = $totalonline; } $dbh->disconnect(); # get uptime my $uptime = `$uptime_bin`; $uptime =~ /up (.*?),/; $uptime = $1; chomp($uptime); # print out info for MRTG print <<EOF; $data $data $uptime $name EOF |
#2
|
|||
|
|||
Respectfully, at least say "please" or take an effort to convert the (Perl) script yourself and ask specific questions when you have problems. Some might view your post as audacious when you make a demand in the subject, put forth no effort in converting the script yourself, nor even wrap the code in a [code] tag.
|
#3
|
|||
|
|||
Quote:
but i want it in sh/perl and if people get all offended by the subject, they need to take breather, and step away from the computer im not here &uck around, i have a production servers that pay the bills. i pay for this software, its not gpl so i dont have to be nice. fyi i didnt mean to come off as an ass in my first post SO PLEASE PLEASE if anyone can help out it would be great ps if it should be special bbcode im sorry as a mod since you saw it and havnt changed im guessing it is fine |
#4
|
|||
|
|||
Quote:
For demands you can open an official support ticket at jelsoft (vBcom) or member area. |
#5
|
||||
|
||||
Quote:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|