<?php /*********************************************************************** Copyright © 2002, 2003, 2004 Rickard Andersson (rickard@punbb.org) This file is part of PunBB. PunBB is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PunBB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ************************************************************************/ define('PUN_ROOT', './'); require_once PUN_ROOT.'include/common.php'; //require_once 'http://localhost/include/common.php'; if($pun_user['is_guest']) message($lang_common['No permission']); if($pun_user['warn_popup_show'] == 0) message($lang_common['Bad request']); require PUN_ROOT.'lang/'.$pun_user['language'].'/common.php'; require PUN_ROOT.'lang/'.$pun_user['language'].'/punishments.php'; $result = $db->query('SELECT w.reason_plus, w.post_id, w.topic_id, w.time_plus, w.uid_plus, u.username , t.subject FROM '.$db->prefix.'warnings AS w LEFT JOIN '.$db->prefix.'users AS u ON w.uid_plus = u.id LEFT JOIN '.$db->prefix.'topics AS t ON t.id = w.topic_id WHERE w.user_id='.$pun_user['id'].' AND w.warn_popup_show="1"') or error('Unable to fetch warnpost info', __FILE__, __LINE__, $db->error()); /// удаляем попапы $db->query('UPDATE '.$db->prefix.'warnings SET warn_popup_show="0" WHERE warn_popup_show="1" AND user_id='.$pun_user['id']) or error('Unable to update warning popup status', __FILE__, __LINE__, $db->error()); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html dir="ltr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang_common['lang_direction'] ?>" /> <meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" /> <title><?php echo $lang_punishments['Punishments system'] ?></title> <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" /> </head> <body> <div id="punwrap"> <div id="punishment_alert" class="pun"> <div class="class="block"> <div class="blockform"> <h2><span><?php echo $lang_punishments['Punishments system'] ?></span></h2> <div class="box" style="text-align:center"> <p><?php echo $lang_punishments['Received warnings'] ?></p> <ul> <?php while ($warnings = $db->fetch_assoc($result)) { echo " ".'<li>"'.$warnings['reason_plus'] .'"</li>'." "; echo " ".'<li>"'.$warnings['username'] .'"</li>'." "; } ?> </ul> </div> </div> <div class="clearer"></div> </div> </div> </div> </body> </html>
Спустя 20 дней, 6 часов, 25 минут, 36 секунд (29.07.2006 - 22:17) LiZ@RD написал(а):
И что это такое? :)) Что part of PunBB я понял :D
Спустя 6 минут, 22 секунды (29.07.2006 - 22:23) HardWoman написал(а):
Да нет это я для себя создал, тестирую код - добиваюсь уменьшения скрипта (служебный топик) :|
Спустя 10 дней, 11 часов, 36 минут, 20 секунд (10.08.2006 - 10:00) maxim написал(а):
$db->query - не подскажешь что это значит, я тока начал php изучать:)
Спустя 19 минут, 27 секунд (10.08.2006 - 10:19) zilogo написал(а):
QUOTE
$db->query
Очевидно, что $db - экземпляр класса доступа к БД, ну а query - метод этого класса.
_____________
Сложные иерархии рулят!!!