2010-07-27 22:41:56 +02:00
|
|
|
/*
|
|
|
|
* This file is a part of Winix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
|
|
|
* Copyright (c) 2010, Tomasz Sowa
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "templates.h"
|
|
|
|
#include "ezc.h"
|
|
|
|
#include "core/misc.h"
|
2010-08-10 18:12:50 +02:00
|
|
|
#include "stats.h"
|
2010-07-27 22:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
namespace Stats
|
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
extern long current_item_id;
|
|
|
|
extern Stats stats;
|
2010-07-27 22:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
void stats_from(Ezc::Info & i)
|
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
i.out << DateToStrWithoutHours(stats.stats_start);
|
2010-07-27 22:41:56 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void stats_all(Ezc::Info & i)
|
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
i.out << stats.global_all;
|
2010-07-27 22:41:56 +02:00
|
|
|
}
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2010-07-27 22:41:56 +02:00
|
|
|
void stats_unique(Ezc::Info & i)
|
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
i.out << stats.global_unique;
|
2010-07-27 22:41:56 +02:00
|
|
|
}
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2010-07-27 22:41:56 +02:00
|
|
|
void stats_google(Ezc::Info & i)
|
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
i.out << stats.global_google;
|
2010-07-27 22:41:56 +02:00
|
|
|
}
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2010-07-27 22:41:56 +02:00
|
|
|
void stats_yahoo(Ezc::Info & i)
|
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
i.out << stats.global_yahoo;
|
2010-07-27 22:41:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void stats_item_all(Ezc::Info & i)
|
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
i.out << stats.stats_tab[current_item_id].all;
|
2010-07-27 22:41:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void stats_item_google(Ezc::Info & i)
|
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
i.out << stats.stats_tab[current_item_id].google;
|
2010-07-27 22:41:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void stats_item_yahoo(Ezc::Info & i)
|
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
i.out << stats.stats_tab[current_item_id].yahoo;
|
2010-07-27 22:41:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CreateFunctions(PluginInfo & info)
|
|
|
|
{
|
|
|
|
Ezc::Functions * fun = reinterpret_cast<Ezc::Functions*>(info.p1);
|
|
|
|
|
|
|
|
fun->Insert("stats_from", stats_from);
|
|
|
|
|
|
|
|
fun->Insert("stats_all", stats_all);
|
|
|
|
fun->Insert("stats_unique", stats_unique);
|
|
|
|
fun->Insert("stats_google", stats_google);
|
|
|
|
fun->Insert("stats_yahoo", stats_yahoo);
|
|
|
|
|
|
|
|
fun->Insert("stats_item_all", stats_item_all);
|
|
|
|
fun->Insert("stats_item_google", stats_item_google);
|
|
|
|
fun->Insert("stats_item_yahoo", stats_item_yahoo);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|