BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-01-2007, 10:57 AM   #1 (permalink)
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default phpberrystats

Please Login to Remove!

Hey everybody. If some of you have followed this thread:

BerryStats for NonAdmins

Then you might know that I wrote a similar version in php. About a week ago I PM'd jibi to let him know that I might have some more time to start working on it again and to see if there were any changes he would like made to the code. I have spent the last week or so cleaning things up and I have created a site on sourceforge that will host the project.

I have uploaded the latest code that I use here at work. Feel free to download it and play with it. I have included a couple of screenshots on the sourceforge site. Let me know if there is anything else you might like to see.

Here is the url to sourceforge:

phpberrystats
Offline  
Old 05-01-2007, 11:02 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
SimonMac's Avatar
 
Join Date: Feb 2006
Location: Leeds, UK
Model: :(
PIN: Absent :(
Carrier: None :(
Posts: 451
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

blubyu! Gald to see your starting back on this, I'm still using v0.0.7 beta and think its great (the asp version got to big and bloated for my liking)

I look forward to the new features and if you ever need a guinea pig PM me.
__________________
No longer have 15 Domino 6.5 Servers
No longer have 6 BES 4.1.3 Servers
No longer have 2613 Users
But still have the 1 Constant Headache?!?!

Offline  
Old 05-01-2007, 11:35 AM   #3 (permalink)
BlackBerry God
 
jibi's Avatar
 
Join Date: Oct 2004
Location: Jibi's Secret Place
Model: 8900
OS: 4.6.1.174
Carrier: AT&T
Posts: 11,310
Post Thanks: 0
Thanked 1 Time in 1 Post
Default

I'm going to work on some more CSS themes for the package, as well. Although I love the default (I dislike the blue), I think more variety is always a plus. I'll have these done by tomorrow night or so.
__________________
In the beginning the Universe was created. This has made a lot of people very angry and is widely regarded as a bad move.
Offline  
Old 05-01-2007, 12:34 PM   #4 (permalink)
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

One of the things that jibi asked for was dynamic columns on the display page. That is the biggest thing I am working on right now. If I find enough time today I should have that done and ready to test.

Simon - The version that I uploaded to sourceforge was 0.0.9 I think. Off the top of my end head I am not sure what has changed since the version you are using. I guess I should post a change log at sourceforge as well.
Offline  
Old 05-01-2007, 03:01 PM   #5 (permalink)
BlackBerry God
 
jibi's Avatar
 
Join Date: Oct 2004
Location: Jibi's Secret Place
Model: 8900
OS: 4.6.1.174
Carrier: AT&T
Posts: 11,310
Post Thanks: 0
Thanked 1 Time in 1 Post
Default

Inactive time, etc. has been added since then.

In html_header.php, find:

Code:
	<a href="<? echo COMPANYURL ?>"><h2 class="logo"><? echo COMPANY ?></h2></a>
	0.0.9.
Change to:

Code:
	<a href="<? echo COMPANYURL ?>"><h2 class="logo"><? echo COMPANY ?></h2></a>
	<? echo PAGETITLE?><? echo VERSION ?>
You may prefer to remove the PAGETITLE part, but I've always tied the two together (e.g. - phpBlackBerryStats v0.0.9).
__________________
In the beginning the Universe was created. This has made a lot of people very angry and is widely regarded as a bad move.
Offline  
Old 05-01-2007, 03:21 PM   #6 (permalink)
BlackBerry God
 
jibi's Avatar
 
Join Date: Oct 2004
Location: Jibi's Secret Place
Model: 8900
OS: 4.6.1.174
Carrier: AT&T
Posts: 11,310
Post Thanks: 0
Thanked 1 Time in 1 Post
Default

Also, I *rarely* use the Options page, but I started thinking about a localized (or LDAP to AD usergroup auth) admin section that enabled that option (yes, thinking way outside the box). Anyhow, on 0.0.9, there's an "issue" with the options.php page (in PHP 5.2.1 + IIS 5.2/6.0). I get these errors:

Code:
PHP Notice: Use of undefined constant On - assumed 'On' in C:\Inetpub\wwwroot\stats-dev\options.php on line 84 PHP Notice: Use of undefined constant Off - assumed 'Off' in C:\Inetpub\wwwroot\stats-dev\options.php on line 137 PHP Notice: Use of undefined constant Off - assumed 'Off' in C:\Inetpub\wwwroot\stats-dev\options.php on line 199 PHP Notice: Undefined offset: 8 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 8 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 9 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 9 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267 PHP Notice: Undefined offset: 10 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 10 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 11 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 11 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267 PHP Notice: Undefined offset: 12 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 12 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 13 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 13 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267 PHP Notice: Undefined offset: 14 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 14 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 15 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 15 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267 PHP Notice: Undefined offset: 16 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 16 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 17 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 17 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267 PHP Notice: Undefined offset: 18 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 18 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 19 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 19 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267 PHP Notice: Undefined offset: 20 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 20 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 21 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 21 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267
To fix, find each of these three instances:
Code:
    echo On;}
    else {
        echo Off ;} ?></b>
Change to:
Code:
    echo 'On' ;}
    else {
        echo 'Off' ;} ?></b>
Find both instances of:
Code:
<? if ($columns[$i]==1) { ?>
and:
Code:
<? if ($columns[$i]==0) { ?>
Change to:
Code:
<? if ($columns[0]) { ?>
and:
Code:
<? if ($columns[1]) { ?>
I'm not sure if the latter parts are correct ($i is never specified when defining $columns, assuming I'm reading it correctly.. hehe), but the top part is 'technically' correct with the addition of the single-quotes.
__________________
In the beginning the Universe was created. This has made a lot of people very angry and is widely regarded as a bad move.
Offline  
Old 05-01-2007, 03:23 PM   #7 (permalink)
Talking BlackBerry Encyclopedia
 
SimonMac's Avatar
 
Join Date: Feb 2006
Location: Leeds, UK
Model: :(
PIN: Absent :(
Carrier: None :(
Posts: 451
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Will give the new code a go when I come back from WES.
__________________
No longer have 15 Domino 6.5 Servers
No longer have 6 BES 4.1.3 Servers
No longer have 2613 Users
But still have the 1 Constant Headache?!?!

Offline  
Old 05-01-2007, 03:23 PM   #8 (permalink)
BlackBerry God
 
jibi's Avatar
 
Join Date: Oct 2004
Location: Jibi's Secret Place
Model: 8900
OS: 4.6.1.174
Carrier: AT&T
Posts: 11,310
Post Thanks: 0
Thanked 1 Time in 1 Post
Default

...and I'd suggest setting the default URL as ./index.php, as this gives a quick link back to the web folder root rather than the company's internet/intranet site (not very helpful for this page, in most cases).
__________________
In the beginning the Universe was created. This has made a lot of people very angry and is widely regarded as a bad move.
Offline  
Old 05-01-2007, 03:45 PM   #9 (permalink)
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jibi View Post
Also, I *rarely* use the Options page, but I started thinking about a localized (or LDAP to AD usergroup auth) admin section that enabled that option (yes, thinking way outside the box). Anyhow, on 0.0.9, there's an "issue" with the options.php page (in PHP 5.2.1 + IIS 5.2/6.0). I get these errors:

Code:
PHP Notice: Use of undefined constant On - assumed 'On' in C:\Inetpub\wwwroot\stats-dev\options.php on line 84 PHP Notice: Use of undefined constant Off - assumed 'Off' in C:\Inetpub\wwwroot\stats-dev\options.php on line 137 PHP Notice: Use of undefined constant Off - assumed 'Off' in C:\Inetpub\wwwroot\stats-dev\options.php on line 199 PHP Notice: Undefined offset: 8 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 8 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 9 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 9 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267 PHP Notice: Undefined offset: 10 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 10 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 11 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 11 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267 PHP Notice: Undefined offset: 12 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 12 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 13 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 13 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267 PHP Notice: Undefined offset: 14 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 14 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 15 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 15 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267 PHP Notice: Undefined offset: 16 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 16 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 17 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 17 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267 PHP Notice: Undefined offset: 18 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 18 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 19 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 19 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267 PHP Notice: Undefined offset: 20 in C:\Inetpub\wwwroot\stats-dev\options.php on line 248 PHP Notice: Undefined offset: 20 in C:\Inetpub\wwwroot\stats-dev\options.php on line 252 PHP Notice: Undefined offset: 21 in C:\Inetpub\wwwroot\stats-dev\options.php on line 263 PHP Notice: Undefined offset: 21 in C:\Inetpub\wwwroot\stats-dev\options.php on line 267
To fix, find each of these three instances:
Code:
    echo On;}
    else {
        echo Off ;} ?></b>
Change to:
Code:
    echo 'On' ;}
    else {
        echo 'Off' ;} ?></b>
Find both instances of:
Code:
<? if ($columns[$i]==1) { ?>
and:
Code:
<? if ($columns[$i]==0) { ?>
Change to:
Code:
<? if ($columns[0]) { ?>
and:
Code:
<? if ($columns[1]) { ?>
I'm not sure if the latter parts are correct ($i is never specified when defining $columns, assuming I'm reading it correctly.. hehe), but the top part is 'technically' correct with the addition of the single-quotes.
I have Notice errors turned off on my server This must be why they don't show up for me. I will turn them on, make your changes and then test to make sure they still work.

I did get the dynamic columns done and they seem to work great. I will try and get that code uploaded tonight or tomorrow. Oh I also added the Agent ID.
Offline  
Old 05-01-2007, 05:09 PM   #10 (permalink)
BlackBerry God
 
jibi's Avatar
 
Join Date: Oct 2004
Location: Jibi's Secret Place
Model: 8900
OS: 4.6.1.174
Carrier: AT&T
Posts: 11,310
Post Thanks: 0
Thanked 1 Time in 1 Post
Default

YAY! Oh, one more thing (I promise - just be glad the creative juices are running)... the inactivity time may need to be re-thought to include those devices that were never activated (logic: if device != activated && creation time > 30 days). Okay, off to the Braves game and I'll stop now. I'll try and get you some CSS themes tonight, btw.
__________________
In the beginning the Universe was created. This has made a lot of people very angry and is widely regarded as a bad move.
Offline  
Old 05-01-2007, 05:27 PM   #11 (permalink)
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I will look into the inactivity stuff.

I turned notice errors on and I saw the stuff you were talking about (and some other ones you didn't notice). I am pretty sure I have all of them fixed.

I will let you guys know when I get the latest code uploaded.
Offline  
Old 05-03-2007, 12:14 AM   #12 (permalink)
BlackBerry God
 
jibi's Avatar
 
Join Date: Oct 2004
Location: Jibi's Secret Place
Model: 8900
OS: 4.6.1.174
Carrier: AT&T
Posts: 11,310
Post Thanks: 0
Thanked 1 Time in 1 Post
Default

i ended up at the strip club last night, so i apologize for being late on these. i really ended up liking the green one a lot (after a re-work).

let me know if anyone has any requests and i'll put together a 'soothing' color scheme for you - just let me know the base color(s) and i'll work from that.
__________________
In the beginning the Universe was created. This has made a lot of people very angry and is widely regarded as a bad move.

Last edited by jibi : 05-03-2007 at 01:20 PM.
Offline  
Old 05-03-2007, 10:47 AM   #13 (permalink)
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jibi View Post
i ended up at the strip club last night, so i apologize for being late on these. i really ended up liking the green one a lot (after a re-work).

let me know if anyone has any requests and i'll put together a 'soothing' color scheme for you - just let me know the base color(s) and i'll work from that.
I will add these in and then upload 0.0.10 to sourceforge. We had eDirectory problems yesterday so I didn't have a chance to upload anything.

Jibi - LOVE the new themes. I just added them and checked them out. There is one slight problem. On your four themes the inactive users are not highlighted in red. On the default and blue them they are. Any ideas?

Last edited by blubyu : 05-03-2007 at 11:07 AM. Reason: adding to original post.
Offline  
Old 05-03-2007, 01:10 PM   #14 (permalink)
BlackBerry God
 
jibi's Avatar
 
Join Date: Oct 2004
Location: Jibi's Secret Place
Model: 8900
OS: 4.6.1.174
Carrier: AT&T
Posts: 11,310
Post Thanks: 0
Thanked 1 Time in 1 Post
Default

Hmm, I'll have a look at them. They have the .sev warnings in there, but I'm not really sure.

* Updated. Looks like I was still using the previous versions for the test.
Attached Files
File Type: zip css.zip (3.7 KB, 7 views)
__________________
In the beginning the Universe was created. This has made a lot of people very angry and is widely regarded as a bad move.

Last edited by jibi : 05-03-2007 at 01:21 PM.
Offline  
Old 05-03-2007, 05:54 PM   #15 (permalink)
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jibi View Post
Hmm, I'll have a look at them. They have the .sev warnings in there, but I'm not really sure.

* Updated. Looks like I was still using the previous versions for the test.

I found the problem and fixed it. I have uploaded version 0.0.10 to sourceforge. Check it out and see if I have missed anything.

Was it just me or was this site not available for a while?
Offline  
Old 05-03-2007, 08:09 PM   #16 (permalink)
BlackBerry God
 
jibi's Avatar
 
Join Date: Oct 2004
Location: Jibi's Secret Place
Model: 8900
OS: 4.6.1.174
Carrier: AT&T
Posts: 11,310
Post Thanks: 0
Thanked 1 Time in 1 Post
Default

It wasn't available for a while... a long, long while.

I had some issues saving my options - it went to an IE error screen at first. I changed the permissions on the file to modify and that resulted in some PHP errors. Not really sure what that was about, but the options did change. I'll see if I can duplicate the results tomorrow when I get in to work.

P.S. - Might want to include some instructions on enabling SNMP. I'm having troubles.
__________________
In the beginning the Universe was created. This has made a lot of people very angry and is widely regarded as a bad move.

Last edited by jibi : 05-03-2007 at 08:10 PM.
Offline  
Old 05-04-2007, 11:17 AM   #17 (permalink)
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your going to make me install this on a windows machine so that I can test things out aren't you I have all errors turned on here and I don't see any of those errors. The permissions on the config.php file make sense. I need to add that to the read me. I am not sure about the snmp. I didn't have to configure anything on my server. It just worked. But then again I am running this on a linux box so maybe something is installed by default that allows it to run. You can turn the snmp off in the options file and that will make those errors go away.

EDIT: Ok, I got a windows server with IIS up and running. I installed PHP on it and have phpberrystats running on it. I now see the snmp errors that you are talking about. My suggestion for right now is to not enable/install snmp support for php and make sure the snmp option is turned off in the options page. I did some reading and I found the proper way to get snmp installed for PHP on a windows box but I am still having problems getting it to work. I will try and type up an install for the windows side of the php install.

Last edited by blubyu : 05-09-2007 at 11:07 AM. Reason: Added more content.
Offline  
Old 05-15-2007, 01:03 PM   #18 (permalink)
Talking BlackBerry Encyclopedia
 
SimonMac's Avatar
 
Join Date: Feb 2006
Location: Leeds, UK
Model: :(
PIN: Absent :(
Carrier: None :(
Posts: 451
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You will be pleased to know that BerryStats was the topic of a session at WES, I nearly wet myself when I saw it come up.
__________________
No longer have 15 Domino 6.5 Servers
No longer have 6 BES 4.1.3 Servers
No longer have 2613 Users
But still have the 1 Constant Headache?!?!

Offline  
Old 05-15-2007, 04:00 PM   #19 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2005
Location: Yorkshire, England
Model: 8800
PIN: 2059E07F
Carrier: O2 UK
Posts: 114
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi all

Just installed php-berrystats - Changed the config file and gave it a go and I am getting this error

Fatal error: Call to undefined function mssql_connect() in D:\Inetpub\wwwroot\includes\common_funcs.php on line 27

Any ideas what this is or where/how I can add a debug line to print out the sql connect string incase thats the problem

Ta
M
Offline  
Old 05-15-2007, 04:56 PM   #20 (permalink)
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by merlin View Post
Hi all

Just installed php-berrystats - Changed the config file and gave it a go and I am getting this error

Fatal error: Call to undefined function mssql_connect() in D:\Inetpub\wwwroot\includes\common_funcs.php on line 27

Any ideas what this is or where/how I can add a debug line to print out the sql connect string incase thats the problem

Ta
M
Merlin, do you know for sure that you have the mssql stuff working in php? I took some time last week and got this going on a windows box (I do everything here on a linux box). I learned quite a bit about what it takes to get it going on windows now. Anyway, In the root of the phpberrystats folder you can make a quick file (call it something like phpinfo.php) and add the following to the file:

Code:
<?
phpinfo();
?>
Save that file and then bring that file up in a web browser. It should display everything about how your php is installed and setup. You should be able to scroll down and see the modules that are loaded for your php installation. There should be a section about MSSQL. Let me know what you find.


Simon - Really? That is kind of cool
Offline  
Closed Thread


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.