Le Forum des Janusiens est l'espace de discussion des visiteurs de jeanviet.info, inscris-toi pour poster un message, pas de mail de confirmation, une fois reconnu, tu peux commencer à parler !
1 Ã 92 Ã 92


<table>
<tr>
<td>Provencance</td>
<td>Visites</td>
</tr>
<tr>
<td><? echo($reports['3']['Items']['0']['Sources']);?></td>
<td><? echo($reports['3']['Items']['0']['Visites']);?></td>
</tr>
<tr>
<td><? echo($reports['3']['Items']['1']['Sources']); ?></td>
<td><? echo($reports['3']['Items']['1']['Visites']);?></td>
</tr>
<tr>
<td><? echo($reports['3']['Items']['2']['Sources']); ?></td>
<td><? echo($reports['3']['Items']['2']['Visites']); ?></td>
</tr>
<tr>
<td><? echo($reports['3']['Items']['3']['Sources']); ?></td>
<td><? echo($reports['3']['Items']['3']['Visites']); ?></td>
</tr>
<tr>
<td><? echo($reports['3']['Items']['4']['Sources']); ?></td>
<td><? echo($reports['3']['Items']['4']['Visites']); ?></td>
</tr>
</table>
If you want to customize this error message, create app/views/errors/missing_action.thtml.
I am only using localhost. I will recreate on a server that can be reached. It would probably be good to try this over again anyway.
Thanks!
).
/*Ensuite, et malheureusement, les programmeurs d'artichow après les changement de la dernière version on oublié de tester ça, et ça ne fonctionne pas, il faut éditer /php4/inc/drivers/gd.class.php et/ou /php5/inc/drivers/gd.class.php et remplacer les 2 ou 3 "Driver()" par "awDriver()".
* Prefix for class names
* No prefix by default
*/
define('ARTICHOW_PREFIX', 'Arti');
awImage::drawErrorFile('missing-anti-aliasing');
A part ça, Artichow fonctionne très bien
.function visits()Remarquez le "$this->layout = "ajax";" pour ne pas avoir d'html dans l'image.
{
$this->layout = "ajax";
$profiles = $this->GoogleAnalytics->listProfiles($this->loginCookie);
$firstProfile = $profiles[0]['id'];
$this->set('report');
$report = $this->GoogleAnalytics->getReport($this->loginCookie, $firstProfile, GA_REPORT_EXECUTIVE_OVERVIEW, '-7 days', 'yesterday', 10, GA_FORMAT_CUSTOM_ARRAY);
$this->set('reports', $report);
}
<?phpJ'explique pas comment ça fonctionne, il faut aller voir la docu d'Artichow et les nombreux exemples. Remarquez juste que je récupère les infos passez par cakaphp dans les premières lignes. J'ai fait un utf8_encode car mon serveur n'est pas en utf-8.
$legend = array();
$visits = array();
$pages = array();
foreach($reports['0']['Items'] as $value) {
$legend[] = $value[utf8_encode('Période')];
$visits[] = intval($value['Visites']);
$pages[] = intval($value['Consultations de page']);
}
require_once "./artichow/LinePlot.class.php";
$graph = new ArtiGraph(500, 200);
$graph->title->set("Visites de la semaine");
$graph->title->move(0, -5);
$graph->setAntiAliasing(TRUE);
$blue = new ArtiColor(0, 0, 200);
$red = new ArtiColor(200, 0, 0);
$liteRed = new ArtiColor(255, 200, 200);
$liteBlue = new ArtiColor(200, 200, 255);
$group = new ArtiPlotGroup;
$group->setBackgroundColor(
new ArtiColor(240, 240, 240)
);
$group->setPadding(40, 40, 35, 20);
$group->axis->bottom->label->move(0, 5);
$group->axis->bottom->setLabelText($legend);
$plot = new ArtiLinePlot($visits);
$plot->label->set($visits);
$plot->label->move(0, 12);
$plot->label->setColor($blue);
$plot->label->setBackgroundColor($liteBlue);
$plot->label->border->setColor($blue);
$plot->label->setPadding(2, 0, 0, 0);
$plot->setThickness(3);
$plot->setColor($blue);
$plot->setYAxis(PLOT_LEFT);
$group->add($plot);
$group->axis->left->setColor($blue);
$group->axis->left->title->set("Visites");
$group->axis->left->title->move(-5, 0);
$plot = new ArtiLinePlot($pages);
$plot->label->set($pages);
$plot->label->move(0, -12);
$plot->label->setColor($red);
$plot->label->setBackgroundColor($liteRed);
$plot->label->border->setColor($red);
$plot->label->setPadding(2, 0, 0, 0);
$plot->setThickness(3);
$plot->setColor($red);
$plot->setYAxis(PLOT_RIGHT);
$group->add($plot);
$group->axis->right->setColor($red);
$group->axis->right->title->set("Pages Vues");
$group->axis->right->title->move(5, 0);
$graph->add($group);
$graph->draw();
?>
if((in_array($params['action'], $classMethods) || in_array(strtolower($params['action']), $classMethods)) && strpos($params['action'], '_', 0) === 0) {
$privateAction = true;
}
if(!in_array($params['action'], $classMethods) && !in_array(strtolower($params['action']), $classMethods)) {
$missingAction = true;
}
if (in_array(strtolower($params['action']), array('tostring', 'requestaction', 'log',
par:
if((in_array(str_replace('.', '', $params['action']), $classMethods) || in_array(strtolower(str_replace('.', '', $params['action'])), $classMethods)) && strpos(str_replace('.', '', $params['action']), '_', 0) === 0) {
$privateAction = true;
}
if(!in_array(str_replace('.', '', $params['action']), $classMethods) && !in_array(strtolower(str_replace('.', '', $params['action'])), $classMethods)) {
$missingAction = true;
}
if (in_array(strtolower(str_replace('.', '', $params['action'])), array('tostring', 'requestaction', 'log',
et ligne 268:
$output = call_user_func_array(array(&$controller, $params['action']), empty($params['pass'])? null: $params['pass']);par:
$output = call_user_func_array(array(&$controller, str_replace('.', '', $params['action'])), empty($params['pass'])? null: $params['pass']);
Renommez le fichier dans le dossier views "visits.png.thtml" au lieu de "visits.thml" et la methode dans analytics_controller.php "visitspng" au lieu de "visits", et le tour est joué.
.
.
I'm sur you're going to suceed ! take your time !

Bonjour,
J'ai le message "Notice: Undefined variable: arrayReport in [...] stats/app/models/google_analytics.php on line 415"
Une idée?... D'ailleur sur la page http://jeanviet.info/cake/index.php/analytics/stats vous avez vous même cette erreur...
merci,
Stéphane
Bonjour,
J'ai suivi la marche à suivre et j'ai cette erreur :
Fatal error: Call to undefined function curl_init() in /home/clan-ki/stats/app/web_model.php on line 46
Quelqu'un peut m'aider ?
var $analytics = array( 'datasource' => 'google_analytics', 'user' => 'pseudo@gmail.com', 'password' => 'mot2passe', ); }
function audience() {
// You can also reference your profile by name instead
$report = $this->Analytics->report(array(
'profile' => 'www.tonsite.fr',
'report' => 'Dashboard'
));
$this->set('reports', $report);
}

function audience() {
// You can also reference your profile by name instead
$report = $this->Analytics->report(array(
'profile' => 'jeanviet.info',
'report' => 'Dashboard'
));
$this->set('reports', $report);
}
)var $analytics1 = array(on reprend le fichier stats/app/controllers/analytics_controller.php
'datasource' => 'google_analytics',
'user' => 'jamesbond@gmail.com',
'password' => '007',
);
var $analytics2 = array(
'datasource' => 'google_analytics',
'user' => 'superman@gmail.com',
'password' => 'kryptonyte',
);

$response = $this->Http->get('https://www.google.com/analytics/settings/');
$optionsRegex = '/<option.+?value="([0-9]+)".*?>([^<]+)<\/option>/si';
preg_match('/<select.+?id="account".*?>(.+?)<\/select>/is', $response, $accounts);
if ($i != 0) {
$response = $this->Http->get('https://www.google.com/analytics/settings/home?scid='.$id.'');
}
preg_match('/<select.+?id="profile".*?>(.+?)<\/select>/is', $response, $profiles);

!1 Ã 92 Ã 92
Tout savoir sur Jeanviet
Suivre Le Forum par email
S'abonner au Flux RSS du Forum
Suivre Jeanviet sur Twitter
Suivre Jeanviet sur Facebook