Changeset 326
- Timestamp:
- 06/09/08 18:20:44 (6 months ago)
- Files:
-
- statistics/trunk/README (modified) (4 diffs)
- statistics/trunk/config.php (modified) (3 diffs)
- statistics/trunk/lib.php (modified) (2 diffs)
- statistics/trunk/lib/ElggStatisticsChartsClass.php (deleted)
- statistics/trunk/lib/ElggStatisticsChartsInterface.php (added)
- statistics/trunk/lib/ElggStatisticsLibChartsClass.php (added)
- statistics/trunk/lib/ElggStatisticsXMLSWFChartsClass.php (added)
- statistics/trunk/lib/statistics_fetch.php (modified) (1 diff)
- statistics/trunk/lib/statistics_input_view.php (modified) (1 diff)
- statistics/trunk/lib/statistics_show.php (modified) (3 diffs)
- statistics/trunk/plugin.info (modified) (1 diff)
- statistics/trunk/sample.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
statistics/trunk/README
r310 r326 1 1 ELGG statistics plugin 2 2 3 version: 1.03 version: 2.0 4 4 author: beni<b.taraghi@tugraz.at> 5 5 copyright: Graz University of Technology - WG Social Learning<http://www.tugraz.at> … … 13 13 This plugin allows you to compile statistics in ELGG. 14 14 1) The elgg admionistrator (news) can compile statistics over all contents and all users. 15 2) Each community owner can compile statistics over all contents posted in to his/hercommunity and all members16 3) Each User can compile statistics over all contents posted by him /her.17 The c eses 2 and 3 can be turned off in the config file.15 2) Each community owner can compile statistics over all contents posted in to the community and all members 16 3) Each User can compile statistics over all contents posted by himself. 17 The cases 2 and 3 can be turned off in the config file. 18 18 Additionally you can configure the type of contents used for statistics. 19 19 For now weblogs, bookmarks, presentations and files are implemented. … … 21 21 you should have yui plugin installed to be able to use yui calendar. 22 22 23 The statistics plugin uses XML/SWF Charts maani.us :23 The statistics plugin uses XML/SWF Charts maani.us as default: 24 24 http://www.maani.us/xml_charts/ 25 25 … … 30 30 * No technical support, and no product updates by e-mail 31 31 32 If you have installed libchart plugin you can use that chart instead. 33 To do so you must select the chart properly in config file. 32 34 33 35 Installation: statistics/trunk/config.php
r310 r326 3 3 * @package statistics 4 4 * @filesource mod/statistics/config.php 5 * @version 5 * @version 2.0 6 6 * @author beni<b.taraghi@tugraz.at> 7 7 * @copyright Copyright © 2007, Graz University of Technology - WG Social Learning<http://www.tugraz.at> … … 13 13 14 14 global $CFG, $USER; 15 define('XML_SWF_CHART', "xml_swf_chart"); 16 define('LIB_CHART', "lib_chart"); 15 17 16 // set to true if you want that community owners to be able to use statistics for their community 17 // other wise set to false 18 19 20 // select the chart you would like to use for statistics by setting it to the folowing variable 21 // you can cast a look over the charts at the respective websites: 22 // 23 // XML_SWF_CHART: http://www.maani.us/xml_charts/ 24 // LIB_CHART: http://naku.dohcrew.com/libchart/pages/introduction/ 25 // 26 // If you decide for LIB_CHART you should have installed the libchart plugin 27 $CFG->statistics['chart'] = XML_SWF_CHART;//LIB_CHART; 28 29 30 // set to true if you want that community owners be able to use statistics for their community 31 // otherwise set to false 18 32 $CFG->statistics['community'] = true; 19 33 20 // set to true if you want that individual users tobe able to use statistics for their own contents34 // set to true if you want that individual users be able to use statistics for their own contents 21 35 // other wise set to false 22 36 $CFG->statistics['person'] = true; 23 37 38 // CONFIGURATIONS FOR XML_SWF_CHART: 39 24 40 // comment out the type of statistics you do not want to be used. 25 41 // Notice: the ones that are already commented out, are not supported yet. 26 $CFG->statistics[ 'type'] = array("line",42 $CFG->statistics[XML_SWF_CHART]['type'] = array("line", 27 43 "column", 28 44 "stacked column", … … 44 60 //"composite", 45 61 "joined"); 62 63 64 // CONFIGURATIONS FOR LIB_CHART: 65 66 // comment out the type of statistics you do not want to be used. 67 // Notice: the ones that are already commented out, are not supported yet. 68 $CFG->statistics[LIB_CHART]['type'] = array("vertical bar", 69 "horizontal bar", 70 "pie", 71 "line"); 72 46 73 47 74 48 75 // comment out the contents, that you do not want to be used in statistics. 49 76 // the corresponding plug-ins must have been already installed! 50 // if one of following plug-ins is not installed on your system, comment it out or delete it easily from the array below.77 // if one of the following plug-ins is not installed on your system, comment it out or delete it easily from the array below. 51 78 $CFG->statistics['content'] = array("Weblogs", 52 79 "Bookmarks", 53 80 "Files", 54 "Presentations" 55 ); 81 "Presentations"); 56 82 57 83 statistics/trunk/lib.php
r310 r326 3 3 * @package statistics 4 4 * @filesource mod/statistics/lib.php 5 * @version 1.05 * @version 2.0 6 6 * @author beni<b.taraghi@tugraz.at> 7 7 * @copyright Copyright © 2007, Graz University of Technology - WG Social Learning<http://www.tugraz.at> … … 19 19 20 20 require_once($CFG->dirroot . "mod/statistics/config.php"); 21 22 if($CFG->statistics['chart'] == LIB_CHART) { 23 if(!plugin_is_loaded('libchart')) { 24 error_log("libchart plugin is not loaded, statistics plugin uses the default charts"); 25 $CFG->statistics['chart'] = XML_SWF_CHART; 26 } 27 } 21 28 } 22 29 statistics/trunk/lib/statistics_fetch.php
r310 r326 12 12 */ 13 13 14 global $CFG , $messages;14 global $CFG; 15 15 require_once($CFG->dirroot . "mod/statistics/lib/ElggStatisticsClass.php"); 16 16 statistics/trunk/lib/statistics_input_view.php
r310 r326 139 139 140 140 $c1 = "<li><select name=\"".$input_var."[0]\">\n"; 141 if(empty($type_selected) && count($CFG->statistics[ 'type']))142 $type_selected = $CFG->statistics[ 'type'][0];143 foreach ($CFG->statistics[ 'type'] as $type) {141 if(empty($type_selected) && count($CFG->statistics[$CFG->statistics['chart']]['type'])) 142 $type_selected = $CFG->statistics[$CFG->statistics['chart']]['type'][0]; 143 foreach ($CFG->statistics[$CFG->statistics['chart']]['type'] as $type) { 144 144 $selected = $type == $type_selected ? "SELECTED" : ""; 145 145 $c1 .= "<option value=\"$type\" $selected>".$type."</option>\n"; statistics/trunk/lib/statistics_show.php
r310 r326 3 3 * @package statistics 4 4 * @filesource mod/statistics/lib/statistics_show.php 5 * @version 1.05 * @version 2.0 6 6 * @author beni<b.taraghi@tugraz.at> 7 7 * @copyright Copyright © 2007, Graz University of Technology - WG Social Learning<http://www.tugraz.at> … … 15 15 */ 16 16 17 17 if($CFG->statistics['chart'] == XML_SWF_CHART) { 18 18 $html =<<<END 19 19 … … 63 63 END; 64 64 65 } 66 elseif($CFG->statistics['chart'] == LIB_CHART) { 67 $html =<<<END 68 <img alt="statistics" src="sample.php" style="border: 1px solid gray;"/> 69 END; 70 } 71 72 73 74 65 75 // show the table form too 66 76 $data = $_SESSION['statistics']['output']; statistics/trunk/plugin.info
r310 r326 1 1 Maintainer: Behnam Taraghi <btaraghi@tugraz.at> 2 2 Title: Statisticss 3 Version: 1.03 Version: 2.0 4 4 Package: Statistics 5 5 Source-URL: https://svn.elgg.org/plugins/statistics 6 6 Depends: elgg (>= 0.9), PHP>=5.0.x 7 Depends: yui 7 Depends: yui, libchart(optional) 8 8 Tags: statistics 9 9 Priority: optional statistics/trunk/sample.php
r310 r326 3 3 * @package statistics 4 4 * @filesource mod/statistics/sample.php 5 * @version 1.05 * @version 2.0 6 6 * @author beni<b.taraghi@tugraz.at> 7 7 * @copyright Copyright © 2007, Graz University of Technology - WG Social Learning<http://www.tugraz.at> … … 9 9 * 10 10 * 11 * re urns xml result needed for flash files11 * returns chart result needed for gui 12 12 */ 13 13 14 14 require_once(dirname(dirname(dirname((__FILE__))))."/includes.php"); 15 require_once(dirname(__FILE__) . "/lib/ElggStatisticsChartsClass.php");16 15 global $CFG; 16 17 17 $input = isset($_SESSION['statistics']['input']) ? $_SESSION['statistics']['input'] : null; 18 18 $data = isset($_SESSION['statistics']['output']) ? $_SESSION['statistics']['output'] : null; 19 19 20 $content = optional_param("joined_content", ""); 20 21 if($input && is_array($input)) { 21 22 $type = $input[0]; 22 23 if($type == "joined") { 24 // for xml swf chart only 23 25 $joined_use = array("line", "column", "bar", "3d column", "stacked column", "area"); 24 26 $type = $joined_use[array_rand($joined_use)]; … … 27 29 else $type = "line"; 28 30 29 $my_chart = new ElggStatisticsCharts();30 $my_chart->setType($type);31 $my_chart->setData($data);32 $my_chart->setContent($content);33 $output = $my_chart->getXMLChart();34 31 35 header("Content-Length: " . strlen($output)); 36 header("Content-type: text/xml; charset=utf-8"); 37 echo $output; 32 33 if($CFG->statistics['chart'] == XML_SWF_CHART) { 34 require_once($CFG->dirroot . "mod/statistics/lib/ElggStatisticsXMLSWFChartsClass.php"); 35 36 $my_chart = new ElggStatisticsCharts(); 37 $my_chart->setType($type); 38 $my_chart->setData($data); 39 $my_chart->setContent($content); 40 $output = $my_chart->getChart(); 41 42 header("Content-Length: " . strlen($output)); 43 header("Content-type: text/xml; charset=utf-8"); 44 echo $output; 45 } 46 47 elseif($CFG->statistics['chart'] == LIB_CHART) { 48 require_once ($CFG->dirroot ."mod/libchart/libchart/libchart/classes/libchart.php"); 49 require_once($CFG->dirroot . "mod/statistics/lib/ElggStatisticsLibChartsClass.php"); 50 51 $width = $input[1][0]; 52 $height = $input[1][1]; 53 54 $my_chart = new ElggStatisticsCharts($width, $height); 55 $my_chart->setType($type); 56 $my_chart->setData($data); 57 $my_chart->setContent(isset($input[5]) ? $input[5] : ""); 58 $my_chart->getChart(); 59 } 38 60 39 61 ?>
