Development estimate

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
sanjay
Forum Members
Forum Members
Posts: 19
Joined: Fri Oct 15, 2004 7:28 am

Development estimate

Post by sanjay »

Hi all,

I have a friend working for a state agency looking at environmental issues. They want to develop a site similar to:

http://www.climatecrisis.net/takeaction ... alculator/

But the energy usage is going to be actual rather than estimates. They will get get kwh and therms data from the users' utility companies and show progress over time.

1) User will log on (may need to be secure), will need a un & pw.
2) Populate forms to provide details needed for obtaining information from utilities.
3) The data will need to be shown in graphs.
4) Custom content displaying average for locality and for "friends" they have chosen.

I found that there are open source solutions for displaying graphs (php/mysql based), I assume a fair amount of work will be needed to integrate 1 of these to CMSMS.

There's money available to do this! or there will be, when we can show it can be done...

Any ideas and thoughts??

cheers
sanjay
User avatar
Lahuindai
Forum Members
Forum Members
Posts: 66
Joined: Mon Aug 01, 2005 11:00 am

Re: Development estimate

Post by Lahuindai »

graphs are easy as the libraries exist and integrating it into cmsms is fairly easy, if you want i can whip one up somewhere for you too look at with example code ......

G
sanjay
Forum Members
Forum Members
Posts: 19
Joined: Fri Oct 15, 2004 7:28 am

Re: Development estimate

Post by sanjay »

Lahuindai wrote: graphs are easy as the libraries exist and integrating it into cmsms is fairly easy, if you want i can whip one up somewhere for you too look at with example code ......

G
That would be great. Thanks, I look forward to seeing that.
User avatar
Lahuindai
Forum Members
Forum Members
Posts: 66
Joined: Mon Aug 01, 2005 11:00 am

Re: Development estimate

Post by Lahuindai »

Hello Sanjay,

I'll try get to this tonight, been busy as hell the last week .....
User avatar
Lahuindai
Forum Members
Forum Members
Posts: 66
Joined: Mon Aug 01, 2005 11:00 am

Re: Development estimate

Post by Lahuindai »

Sanjay, did you get the email ?

Maybe post the reply here so everybody can have a look, i would but i did not save a copy bfore sending it to you :)

G
sanjay
Forum Members
Forum Members
Posts: 19
Joined: Fri Oct 15, 2004 7:28 am

Re: Development estimate

Post by sanjay »

Thanks for the code Lahuindai. Here's your email below.

I'm ftp'ing JPgraph as I write. Although I think I'm going to need help on that.

I'll post the url if it works ...

Thanks again
Sanjay

---------

Hello Sanjay,

The library you wish to use (or at least it's the most complete from what i can see) is JpGraph
and is available from http://www.aditus.nu/jpgraph. Some example code below as i'm busy shifting to
new server and will only have place for example code in a week or so when they are stable.

Step 1:

Create a page in cmsms and add an image tag as follows:

Code: Select all

<img src='testgraph.php' width=300 height=200>
Step 2:

Create testgraph.php and add the following code

Code: Select all

<?php
  include_once ("jpgraph.php");   
  include_once ("jpgraph_line.php"); // Could be _bar etc depending on type of graph

  $graph_values = array(1,2,3,5,7,9,13,40,90,10);

  $graph = new Graph(300,200);
  $graph->SetScale("textlin");

  $plot = new LinePlot($graph_values);
  $graph->add($plot);
  $graph−>Stroke();
?>
and there you have it, nice and simple. Wrapping that up into cmsms should not be too difficult
depending on how complex the graphs are that you will need.

G
Post Reply

Return to “Developers Discussion”