winix/plugins/stats/templates.cpp

90 lines
1.4 KiB
C++
Executable File

/*
* 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"
#include "stats.h"
namespace Stats
{
extern long current_item_id;
extern Stats stats;
void stats_from(Ezc::Info & i)
{
i.out << DateToStrWithoutHours(stats.stats_start);
}
void stats_all(Ezc::Info & i)
{
i.out << stats.global_all;
}
void stats_unique(Ezc::Info & i)
{
i.out << stats.global_unique;
}
void stats_google(Ezc::Info & i)
{
i.out << stats.global_google;
}
void stats_yahoo(Ezc::Info & i)
{
i.out << stats.global_yahoo;
}
void stats_item_all(Ezc::Info & i)
{
i.out << stats.stats_tab[current_item_id].all;
}
void stats_item_google(Ezc::Info & i)
{
i.out << stats.stats_tab[current_item_id].google;
}
void stats_item_yahoo(Ezc::Info & i)
{
i.out << stats.stats_tab[current_item_id].yahoo;
}
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