BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   BES Admin Corner (http://www.blackberryforums.com/bes-admin-corner/)
-   -   phpberrystats (http://www.blackberryforums.com/bes-admin-corner/74946-phpberrystats.html)

blubyu 05-01-2007 10:57 AM

phpberrystats
 
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

SimonMac 05-01-2007 11:02 AM

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.

jibi 05-01-2007 11:35 AM

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.

blubyu 05-01-2007 12:34 PM

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.

jibi 05-01-2007 03:01 PM

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).

jibi 05-01-2007 03:21 PM

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.

SimonMac 05-01-2007 03:23 PM

Will give the new code a go when I come back from WES.

jibi 05-01-2007 03:23 PM

...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).

blubyu 05-01-2007 03:45 PM

Quote:

Originally Posted by jibi (Post 525393)
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.

jibi 05-01-2007 05:09 PM

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.

blubyu 05-01-2007 05:27 PM

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.

jibi 05-03-2007 12:14 AM

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.

blubyu 05-03-2007 10:47 AM

Quote:

Originally Posted by jibi (Post 526837)
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?

jibi 05-03-2007 01:10 PM

1 Attachment(s)
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.

blubyu 05-03-2007 05:54 PM

Quote:

Originally Posted by jibi (Post 527403)
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?

jibi 05-03-2007 08:09 PM

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. :)

blubyu 05-04-2007 11:17 AM

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.

SimonMac 05-15-2007 01:03 PM

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.

merlin 05-15-2007 04:00 PM

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

blubyu 05-15-2007 04:56 PM

Quote:

Originally Posted by merlin (Post 537282)
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 8-)


All times are GMT -5. The time now is 10:31 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.