Exemple #1
0
chmod('data/' . md5($pageClass->get_title() . '-' . $pageClass->get_id()) . '.xml', 0775);
$content->assign("monthgraph", true);
$content->assign("monthpixels", getMonthPixels($data['year_count']));
$content->assign("evenyears", getEvenYears(array_keys($data['year_count'])));
$content->assign("sizegraph", true);
$sizegraph->assign("data", $data['year_count']);
$content->assign("sizegraphdata", md5($pageClass->get_title() . '-' . $pageClass->get_id() . '-line'));
file_put_contents('data/' . md5($pageClass->get_title() . '-' . $pageClass->get_id() . '-line') . '.xml', $sizegraph->fetch('sizegraph.tpl'));
chmod('data/' . md5($pageClass->get_title() . '-' . $pageClass->get_id() . '-line') . '.xml', 0775);
$content->assign("usertable", true);
$content->assign("userdata", $data['editors']);
$content->assign("topteneditors", $data['top_fifty']);
$content->assign("url", $url);
$content->assign("lang", $lang);
$content->assign("wiki", $wiki);
WebTool::finishScript();
//Script finished, now we're on to the functions
//Calculate how many pixels each year should get for the Edits per Year table
function getYearPixels(&$data)
{
    $month_total_edits = array();
    foreach ($data as $year => $tmp) {
        $month_total_edits[$year] = $tmp['all'];
    }
    $max_width = max($month_total_edits);
    $pixels = array();
    foreach ($data as $year => $tmp) {
        if ($tmp['all'] == 0) {
            $pixels[$year] = array();
        }
        $processarray = array('all' => $tmp['all'], 'anon' => $tmp['anon'], 'minor' => $tmp['minor']);