| [ Index ] |
|
Code source de Cr@wltr@ck 2.2.1 |
1 <?php 2 //---------------------------------------------------------------------- 3 // CrawlTrack 2.2.1 4 //---------------------------------------------------------------------- 5 // Crawler Tracker for website 6 //---------------------------------------------------------------------- 7 // Author: Jean-Denis Brun 8 //---------------------------------------------------------------------- 9 // Website: www.crawltrack.fr 10 //---------------------------------------------------------------------- 11 // That script is distributed under GNU GPL license 12 //---------------------------------------------------------------------- 13 // file: crawler-graph.php 14 //---------------------------------------------------------------------- 15 // this graph is made with artichow website: www.artichow.org 16 //---------------------------------------------------------------------- 17 error_reporting(0); 18 //initialize array 19 $listlangcrawlt=array(); 20 //get graph infos 21 $graphname= urlencode($_GET['graphname']); 22 //database connection 23 include "../include/configconnect.php"; 24 $connexion = mysql_connect($crawlthost,$crawltuser,$crawltpassword) or die("MySQL connection to database problem"); 25 $selection = mysql_select_db($crawltdb) or die("MySQL database selection problem"); 26 //get the listlang files 27 include "../include/listlang.php"; 28 //get the functions files 29 $times=0;//give value just to avoid error in functions.php 30 $firstdayweek='Monday'; //give value just to avoid error in functions.php 31 $period=0;//give value just to avoid error in functions.php 32 include "../include/functions.php"; 33 34 //get graph values 35 $sql = "SELECT graph_values FROM crawlt_graph 36 WHERE name='".sql_quote($graphname)."'"; 37 38 $requete = mysql_query($sql, $connexion) or die("MySQL query error"); 39 40 $nbrresult=mysql_num_rows($requete); 41 if($nbrresult>=1) 42 { 43 $ligne = mysql_fetch_array($requete,MYSQL_ASSOC); 44 $data = $ligne['graph_values']; 45 } 46 else 47 { 48 echo"<h1>No Graph values available !!!!</h1>"; 49 exit(); 50 } 51 $datatransfert= unserialize(urldecode(stripslashes($data))); 52 53 foreach ($datatransfert as $key => $value) 54 { 55 $legend[] = $key; 56 $values[]=$value; 57 } 58 59 $graphnameexplode=explode('-',$graphname); 60 $graphtitle=$graphnameexplode[0]; 61 62 63 //build the graph 64 65 //test to see if ttf font is available 66 $fontttf= gd_info(); 67 68 if( @$fontttf['FreeType Linkage']=='with freetype') 69 { 70 $ttf='ok'; 71 } 72 else 73 { 74 $ttf='no-ok'; 75 } 76 77 require_once "artichow/Pie.class.php"; 78 79 80 $graph = new Graph(450, 175); 81 82 if(function_exists('imageantialias')) 83 { 84 $graph->setAntiAliasing(TRUE); 85 } 86 else 87 { 88 $graph->setAntiAliasing(FALSE); 89 } 90 $graph->border->hide(TRUE); 91 92 $graph->shadow->setSize(5); 93 $graph->shadow->smooth(TRUE); 94 95 $graph->shadow->setPosition('SHADOW_LEFT_BOTTOM'); 96 $graph->shadow->setColor(new DarkBlue); 97 if($graphtitle=='crawlervisits') 98 { 99 $crawltlang = $_GET['crawltlang']; 100 //language file include 101 if(file_exists("../language/".$crawltlang.".php") && in_array($crawltlang,$listlangcrawlt)) 102 { 103 include "../language/".$crawltlang.".php"; 104 } 105 else 106 { 107 echo"<h1>No language files available !!!!</h1>"; 108 exit(); 109 } 110 111 $graph->title->set($language['nbr_visits_crawler']); 112 $graph->title->setColor(new DarkBlue); 113 if ($ttf=='ok') 114 { 115 $graph->title->setFont(new Tuffy(10)); 116 } 117 else 118 { 119 $graph->title->setFont(new Font(2)); 120 } 121 } 122 if($graphtitle=='searchengine') 123 { 124 $crawltlang = $_GET['crawltlang']; 125 //language file include 126 if(file_exists("../language/".$crawltlang.".php") && in_array($crawltlang,$listlangcrawlt)) 127 { 128 include "../language/".$crawltlang.".php"; 129 } 130 else 131 { 132 echo"<h1>No language files available !!!!</h1>"; 133 exit(); 134 } 135 136 $graph->title->set($language['nbr_tot_visit_seo']); 137 $graph->title->setColor(new DarkBlue); 138 if ($ttf=='ok') 139 { 140 $graph->title->setFont(new Tuffy(10)); 141 } 142 else 143 { 144 $graph->title->setFont(new Font(2)); 145 } 146 } 147 $plot = new Pie($values); 148 $plot->setCenter(0.35, 0.42); 149 $plot->setSize(0.55, 0.6); 150 $plot->set3D(15); 151 $plot->setLabelPosition(10); 152 $plot->label->setColor(new DarkBlue); 153 154 if ($ttf=='ok') 155 { 156 $plot->label->setFont(new Tuffy(10)); 157 } 158 else 159 { 160 $plot->label->setFont(new Font(2)); 161 } 162 $plot->setBorder(new DarkBlue); 163 164 $plot->setLegend($legend); 165 166 $plot->legend->setPosition(1.7); 167 $plot->legend->shadow->setSize(0); 168 $plot->legend->setBackgroundColor(new White); 169 $plot->legend->border->hide(TRUE); 170 $plot->legend->setTextColor(new DarkBlue); 171 if ($ttf=='ok') 172 { 173 $plot->legend->setTextFont(new Tuffy(10)); 174 } 175 else 176 { 177 $plot->legend->setTextFont(new Font(2)); 178 } 179 $graph->add($plot); 180 $graph->draw(); 181 182 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Thu Sep 6 14:14:11 2007 | par Balluche grâce à PHPXref 0.7 |