BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 05-01-2007, 09:57 AM   #1
blubyu
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
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, 10:02 AM   #2
SimonMac
Talking BlackBerry Encyclopedia
 
SimonMac's Avatar
 
Join Date: Feb 2006
Location: Leeds, UK
Model: :(
PIN: Absent :(
Carrier: None :(
Posts: 451
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, 10:35 AM   #3
jibi
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
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, 11:34 AM   #4
blubyu
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
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, 02:01 PM   #5
jibi
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
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, 02:21 PM   #6
jibi
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
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, 02:23 PM   #7
SimonMac
Talking BlackBerry Encyclopedia
 
SimonMac's Avatar
 
Join Date: Feb 2006
Location: Leeds, UK
Model: :(
PIN: Absent :(
Carrier: None :(
Posts: 451
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, 02:23 PM   #8
jibi
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
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, 02:45 PM   #9
blubyu
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
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, 04:09 PM   #10
jibi
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
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, 04:27 PM   #11
blubyu
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
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-02-2007, 11:14 PM   #12
jibi
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
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 12:20 PM..
Offline  
Old 05-03-2007, 09:47 AM   #13
blubyu
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
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 10:07 AM.. Reason: adding to original post.
Offline  
Old 05-03-2007, 12:10 PM   #14
jibi
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
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 12:21 PM..
Offline  
Old 05-03-2007, 04:54 PM   #15
blubyu
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
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, 07:09 PM   #16
jibi
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
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 07:10 PM..
Offline  
Old 05-04-2007, 10:17 AM   #17
blubyu
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
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 10:07 AM.. Reason: Added more content.
Offline  
Old 05-15-2007, 12:03 PM   #18
SimonMac
Talking BlackBerry Encyclopedia
 
SimonMac's Avatar
 
Join Date: Feb 2006
Location: Leeds, UK
Model: :(
PIN: Absent :(
Carrier: None :(
Posts: 451
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, 03:00 PM   #19
merlin
Thumbs Must Hurt
 
Join Date: Jan 2005
Location: Yorkshire, England
Model: 8800
PIN: 2059E07F
Carrier: O2 UK
Posts: 114
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, 03:56 PM   #20
blubyu
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Schneider Electric Energy Server EBX510 Server For Energy Management- picture

Schneider Electric Energy Server EBX510 Server For Energy Management-

$4350.00



MEDIA SERVER DOLBY IMS2000 MSIP-REM-DIB-IMS2000 picture

MEDIA SERVER DOLBY IMS2000 MSIP-REM-DIB-IMS2000

$799.99



MOXA NPort 5410 4 Port Serial Device Server picture

MOXA NPort 5410 4 Port Serial Device Server

$65.00



Intel PRO/1000 PT Dual Port Server Adapter LP - Network Adapter (EXPI9402PTBLK) picture

Intel PRO/1000 PT Dual Port Server Adapter LP - Network Adapter (EXPI9402PTBLK)

$19.99



Weidmüller WI-MOD-945-E (6720005015) Wireless Ethernet & Serial Device Server picture

Weidmüller WI-MOD-945-E (6720005015) Wireless Ethernet & Serial Device Server

$129.99



Schneider Electric Energy Server EBX510 Server For Energy Management picture

Schneider Electric Energy Server EBX510 Server For Energy Management

$865.64







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