<?
defined('_IN_JOHNCMS') or die('Error: restricted access');
$mp = new mainpage();
$brth = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `dayb` = '" . date('j', time()) . "' AND `monthb` = '" . date('n', time()) . "' AND `preg` = '1'", 0);
if ($brth && $user_id)
echo '<div align="center" class="gmenu"><img src="/images/birthday.gif" alt="" /> Tabrik! Sevimli portalda bugun <a href="users/index.php?act=birth"><span style=color:red;><b>'.$brth.'</b></span></a> kishining tug`ilgan kuni!</div>';
echo $mp->news;
echo '<div class="phdr"><b>Asosiy menyu</b></div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=1">Jinsiy aloqa haqida</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=2">Qarindoshlar (insent)</a> (11)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=3">Birinchi marta</a> (11)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=4">Lesbilar (qiz bilan qiz)</a> (13)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=5">Er xotin munosabatlari</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=6">Ishxonada</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=7">Maktab / kollej / sinfdosh / kursdosh</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=8">Jalablar bilan</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=9">Zo`rlashlar</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=10">Qaynaka, qaynuka va hakozo</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=11">Boshqalar</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=12">Qo`shnilar bilan</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=13">Latifalar (seks haqida)</a> (8)</div>';
require('/library/include.php');
echo '<div class="phdr"><b>Yangi Maqolalar:</b></div>';
$req_lib = mysql_query("SELECT * FROM `lib` WHERE `type`='bk' ORDER BY `time` DESC LIMIT 8 "
for ($i = 0; $lib = mysql_fetch_assoc($req_lib); $i) {
echo '<div class="menu"> » <a href="/library/index.php?id='.$lib['id'].'">'.$lib['name'].'</a>';
$komm = mysql_num_rows(mysql_query("select `id` from `lib` where type = 'komm' and refid = '" . $lib['id'] . "'");
echo '<br>O`qildi: '.$lib['count'].' | ';
echo ' <a href="/library/index.php?act=komm&id=' . $lib['id'] . '">Fikrlar:</a> ('.$komm.')</div>';
}
echo '</div>';
Bobby, Вот тебе архив, распакуй в папку библиотеки library и в mainmeny в нужном месте пропиши
require('library/include.php');
<?
defined('_IN_JOHNCMS') or die('Error: restricted access');
$mp = new mainpage();
$brth = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `dayb` = '" . date('j', time()) . "' AND `monthb` = '" . date('n', time()) . "' AND `preg` = '1'", 0);
if ($brth && $user_id)
echo '<div align="center" class="gmenu"><img src="/images/birthday.gif" alt="" /> Tabrik! Sevimli portalda bugun <a href="users/index.php?act=birth"><span style=color:red;><b>'.$brth.'</b></span></a> kishining tug`ilgan kuni!</div>';
echo $mp->news;
echo '<div class="phdr"><b>Asosiy menyu</b></div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=1">Jinsiy aloqa haqida</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=2">Qarindoshlar (insent)</a> (11)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=3">Birinchi marta</a> (11)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=4">Lesbilar (qiz bilan qiz)</a> (13)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=5">Er xotin munosabatlari</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=6">Ishxonada</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=7">Maktab / kollej / sinfdosh / kursdosh</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=8">Jalablar bilan</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=9">Zo`rlashlar</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=10">Qaynaka, qaynuka va hakozo</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=11">Boshqalar</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=12">Qo`shnilar bilan</a> (10)</div>';
echo '<div class="menu">» <a href="http://vipxxx.tk/library/index.php?id=13">Latifalar (seks haqida)</a> (8)</div>';
require('/library/include.php');
echo '<div class="phdr"><b>Yangi Maqolalar:</b></div>';
$req_lib = mysql_query("SELECT * FROM `lib` WHERE `type`='bk' ORDER BY `time` DESC LIMIT 8 "
for ($i = 0; $lib = mysql_fetch_assoc($req_lib); $i) {
echo '<div class="menu"> » <a href="/library/index.php?id='.$lib['id'].'">'.$lib['name'].'</a>';
$komm = mysql_num_rows(mysql_query("select `id` from `lib` where type = 'komm' and refid = '" . $lib['id'] . "'");
echo '<br>O`qildi: '.$lib['count'].' | ';
echo ' <a href="/library/index.php?act=komm&id=' . $lib['id'] . '">Fikrlar:</a> ('.$komm.')</div>';
}
echo '</div>';
Добавлено 28.11.15 в 20:58:44:
где ошибка
Добавлено 28.11.15 в 21:01:35:
up
[cit]
<?php
echo '<div class="phdr"><b>Категории книг</b></div>';
$sql = mysql_query("SELECT `id`, `name`, `dir`, `description` FROM `library_cats` WHERE `parent`=0 ORDER BY `pos` ASC"smile;
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `library_cats` WHERE `parent`=0"smile, 0);
if ($total) {
while ($row = mysql_fetch_assoc($sql)) {
echo '<div class="list' . (++$i % 2 ? 2 : 1) . '">'
. '<a href="library/index.php?do=dir&id=' . $row['id'] . '">' . functions::checkout($row['name']) . '</a> ('
. mysql_result(mysql_query("SELECT COUNT(*) FROM `" . ($row['dir'] ? 'library_cats' : 'library_texts') . "` WHERE " . ($row['dir'] ? '`parent`=' . $row['id'] : '`cat_id`=' . $row['id'])), 0) . ')';
if (!empty($row['description'])) {
echo '<div style="font-size: x-small; padding-top: 2px"><span class="gray">' . functions::checkout($row['description']) . '</span></div>';
}
echo '</div>';
}
}
?>
[/cit]
я всё сделал но толка на главнуя вийдет 10 категории. а мне нужен 13 категории. как ето сделать
Bobby, потму что код выводит количество пунктов на странице согласно настройкам пользователя (по умолчанию стоит 10)поставь в настройках 20 и будет тебе 20
[cit]echo '<div class="phdr"><b>Категории книг</b></div>';
$sql = mysql_query("SELECT `id`, `name`, `dir`, `description` FROM `library_cats` WHERE `parent`=0 ORDER BY `pos` ASC";
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `library_cats` WHERE `parent`=0", 0);
if ($total) {
while ($row = mysql_fetch_assoc($sql)) {
echo '<div class="list' . (++$i % 2 ? 2 : 1) . '">'
. '<a href="library/index.php?do=dir&id=' . $row['id'] . '">' . functions::checkout($row['name']) . '</a> ('
. mysql_result(mysql_query("SELECT COUNT(*) FROM `" . ($row['dir'] ? 'library_cats' : 'library_texts') . "` WHERE " . ($row['dir'] ? '`parent`=' . $row['id'] : '`cat_id`=' . $row['id'])), 0) . ')';
if (!empty($row['description'])) {
echo '<div style="font-size: x-small; padding-top: 2px"><span class="gray">' . functions::checkout($row['description']) . '</span></div>';
}
echo '</div>';
}
}
[/cit]