piechart

I made some new custom AMFPHP Service classes for the GeSHi – Generic Syntax Highlighter & Google Analytics API.

Which is very nice, because now I can do superclean datahandling in my Flex Backend application. You can already have a look at the first result in an animated PieChart component on the dashboard page. It’s showing the most frequently visited pages in my flex application for a custom daterange. (Thanks to the use of the Flex BrowserManager Object & the Google Analytics Event tracking)

I also added another section called “Code Snippets” to my portfolio. Collecting my most frequently used snippets/classes. Nicely formatted with the AS3 & MXML syntax highliter Service.  It sends a plain String from my mysql DB trough the Custom made AMFPHP Geshi service. And what do we get back?

A new string but with CSS style class declarations. Throw the String now into a HTML Flex container attach a Flash supported CSS file to it… et Voilà. (I’ve also added image caching in my datagrid Traveling component. The flags were flashing all the time when you were scrolling up & down.)

< ?php
require_once 'googleAPI.class.php';
require_once("vo/ReportRequest.php");
 
class GoogleAnalyticsService
{
	public $gapi;
 
    public function GoogleAnalyticsService()
	{
		$this->gapi = new googleAPI('username@gmail.com','password',"youranalyticsaccountname");
    }
 
	public function viewReport(ReportRequest $vo)
	{
		//max 10 metrics
		//and then max 7 dimensions
 
		//"2009-05-01","2009-05-06"
		$reportData = $this->gapi->viewReport($vo->startDate, $vo->endDate,
		"ga:uniquePageviews",
		"ga:pageTitle,ga:pagePath");
 
		return $reportData;
	}
}
?>
< ?php
require_once("vo/Code.php");
require ("geshi.php");
 
class GeshiService
{
public function GeshiService()
{
 
}
 
public function parseCode(Code $code)
{
$geshi = new GeSHi($code->code, $code->type);
$geshi->set_header_type(GESHI_HEADER_PRE_VALID);
$geshi->enable_classes();
$code->parsedHtmlCode = $geshi->parse_code();
 
return $code;
}
}
?>