php require lib TemplatePower class php require lib mysql class php re

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require('lib/TemplatePower.class.php');
require('lib/mysql.class.php');
require('lib/functions.php');
require('conf.php');
$tpl = new TemplatePower('index.htm');
$tpl->Prepare();
$db->Query('SELECT `eng_words`.`name`,
(SELECT SUM(`eng_assign`.`count`)
FROM `eng_assign`
WHERE `eng_assign`.`word_name` = `eng_words`.`name`) AS `cnt`
FROM `eng_words`
ORDER BY `cnt` DESC
LIMIT 0, 5');
$top_words = $db->RecordsArray();
var_dump($top_words);
$total_pages = $db->QuerySingleValue('SELECT COUNT(`id`) FROM `eng_main`'); // Общее количество добавленных ссылок
$words_uniq = $db->QuerySingleValue('SELECT COUNT(`id`) FROM `eng_words`'); // Количество уникальных слов
$words_total = $db->QuerySingleValue('SELECT SUM(`count`) FROM `eng_assign`'); // Общее количество слов
$word_avg = ceil($words_total/$total_pages); // Среднее количество слов на странице
$db->Query('SELECT `url`, `id`, UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`dateadd`) AS `addtime`
FROM `eng_main`
ORDER BY `id` DESC
LIMIT 0, 5');
while (!$db->EndOfSeek())
{
$last = $db->Row();
$backtime = numeralDate($last->addtime);
$back = $backtime[0].' '.$backtime[1];
$tpl->newBlock('list_pages');
$tpl->assign('url_name', $last->url);
$tpl->assign('url_id', $last->id);
$tpl->assign('time_sub', $back);
}
?>