本文整理汇总了PHP中errors函数的典型用法代码示例。如果您正苦于以下问题:PHP errors函数的具体用法?PHP errors怎么用?PHP errors使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了errors函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: deletetheme
function deletetheme($themeid, $reset)
{
global $user, $FUNCTIONS_LANG, $error, $error_die;
if (!$user['admin_panel']) {
# No one should be able to actually use this function except an admin,
# its there just to be safe ;)
$error_die[] = $FUNCTIONS_LANG["e_permissions"];
return false;
}
if (empty($themeid)) {
# tut tut, dont mess around with the URLs
$error[] = $FUNCTIONS_LANG["e_th_specify_delete"];
return false;
}
# tut tut, dont mess around with the URLs
if (empty($reset)) {
$error[] = $FUNCTIONS_LANG["e_th_specify_everyone"];
return false;
}
if (!errors()) {
$themes = call('sql_query', "SELECT * FROM themes WHERE theme_id = '{$themeid}'");
$r = call('sql_fetch_array', $themes);
$query = call('sql_query', "DELETE FROM themes WHERE theme_id = '{$themeid}'");
$sql = call('sql_query', "DELETE FROM theme_settings WHERE theme_id = '{$themeid}'");
$sql = call('sql_query', "UPDATE users SET theme = '{$reset}' WHERE theme = '" . $r['theme_name'] . "'");
if ($sql) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:30,代码来源:deletetheme.php
示例2: editarticle
function editarticle($subject, $summary, $full_article, $cat, $rating, $comment, $id)
{
global $user, $error, $error_die;
if (!$user['admin_panel']) {
$error_die[] = 'You do not have permission to do this';
//No one should be able to actually use this function except an admin, its there just to be safe ;)
return false;
}
if (empty($subject)) {
$error[] = 'You must specify a subject';
return false;
}
if (empty($summary)) {
$error[] = 'You must specify a summary for your article';
return false;
}
$comment = !isset($comment) ? 0 : 1;
$rating = !isset($rating) ? 0 : 1;
if (!errors()) {
$query = call('sql_query', "UPDATE articles SET subject = '{$subject}', summary = '{$summary}', full_article = '{$full_article}', cat = '{$cat}', ratings = '{$rating}', comments = '{$comment}' WHERE id = '{$id}'");
if ($query) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:25,代码来源:editarticle.php
示例3: output_maintenance
function output_maintenance($title = '', $body = '', $head = '')
{
global $error, $error_die;
if (theme('output_error') != false) {
$body = theme('output_error');
$title = 'Error';
unset($error_die);
}
if (errors()) {
$error = theme('title', 'Error') . theme('start_content') . '<div class="errors"><ul>';
foreach ($error as $errors) {
$error .= '<li>' . $errors . '</li>';
}
$error .= '</ul></div>' . theme('end_content');
unset($error);
} else {
$error = '';
}
$output = theme('head', stripslashes($title), $head) . '
<body class="thrColLiqHdr">
<div id="maintenance-container">' . theme('start_content') . stripslashes($body) . theme('end_content') . '</div>
</body>
</html>';
die($output);
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:25,代码来源:output_maintenance.php
示例4: addemoticon
function addemoticon($code, $image, $text)
{
global $user, $error, $error_die;
if (!$user['admin_panel']) {
$error_die[] = 'You do not have permission to do this';
//No one should be able to actually use this function except an admin, its there just to be safe ;)
return false;
}
if (empty($code)) {
$error[] = 'You must specify the code';
return false;
}
if (empty($image)) {
$error[] = 'You must specify an image';
return false;
}
if (empty($text)) {
$error[] = 'You must specify text';
return false;
}
$code = str_replace(array("\"", "'"), '', $code);
if (!errors()) {
$query = call('sql_query', "INSERT INTO emoticons (code, image, alt) VALUES ('{$code}', '{$image}', '{$text}')");
if ($query) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:28,代码来源:addemoticon.php
示例5: addcomment
function addcomment($id, $type, $message, $token)
{
global $user, $error, $error_die;
call('checktoken', $token);
if (!$user['post_comment']) {
$error[] = 'You do not have permission to post a comment';
return false;
}
$existcheck = call('sql_query', "SELECT id, comments FROM {$type} WHERE id = '{$id}'");
$fetch = call('sql_fetch_array', $existcheck);
if (call('sql_num_rows', $existcheck) == 0) {
$error_die[] = 'This ' . $type . ' no longer exists so adding a comment was not possible';
return false;
}
if ($fetch['comments'] != '1') {
$error_die[] = 'Posting of comments on this ' . $type . ' is disabled';
return false;
}
if (empty($message)) {
$error[] = 'Please enter a message';
return false;
}
if (!errors()) {
$sql = call('sql_query', "INSERT INTO comments (comment_type, type_id, message, author, author_id, ip, post_time) VALUES ('{$type}', '{$id}', '{$message}', '" . $user['user'] . "', '" . $user['id'] . "', '" . call('visitor_ip') . "', '" . time() . "' ) ");
if ($sql) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:29,代码来源:addcomment.php
示例6: editpage
function editpage($name, $content, $id, $comment, $rating)
{
global $user, $error, $error_die;
if (!$user['admin_panel']) {
$error_die[] = 'You do not have permission to do this';
//No one should be able to actually use this function except an admin, its there just to be safe ;)
return false;
}
$sql = call('sql_query', "SELECT * FROM pages WHERE id = '{$id}'");
if (call('sql_num_rows', $sql) == 0) {
$error[] = 'This page no longer exists';
return false;
}
if (empty($content)) {
$error[] = 'You must specify content for the page';
return false;
}
if (empty($name)) {
$error[] = 'You must specify a name for the page';
return false;
}
if (!errors()) {
$comment = !isset($comment) ? 0 : 1;
$rating = !isset($rating) ? 0 : 1;
$query = call('sql_query', "UPDATE pages SET pagename = '{$name}', content = '{$content}', comments = '{$comment}', ratings = '{$rating}' WHERE id = '{$id}'");
if ($query) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:30,代码来源:editpage.php
示例7: deleteuser
function deleteuser($id)
{
global $user, $error, $error_die;
if (!$user['admin_panel']) {
$error_die[] = 'You do not have permission to do this';
//No one should be able to actually use this function except an admin, its there just to be safe ;)
return false;
}
if ($user['id'] == $id) {
$error_die[] = 'You can not delete your own account';
//why would you want to delete your own account in the admin panel? Makes no sense
return false;
}
$sql = call('sql_query', "SELECT * FROM users WHERE id = '{$id}'");
if (call('sql_num_rows', $sql) == 0) {
$error[] = 'This user no longer exists';
return false;
}
if (!errors()) {
$query = call('sql_query', "DELETE FROM users WHERE id = '{$id}'");
if ($query) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:25,代码来源:deleteuser.php
示例8: editemoticon
function editemoticon($code, $image, $text, $id)
{
global $user, $error, $error_die;
if (!$user['admin_panel']) {
$error_die[] = 'You do not have permission to do this';
//No one should be able to actually use this function except an admin, its there just to be safe ;)
return false;
}
if (empty($code)) {
$error[] = 'You must specify the code';
return false;
}
if (empty($image)) {
$error[] = 'You must specify an image';
return false;
}
if (empty($text)) {
$error[] = 'You must specify text';
return false;
}
if (!errors()) {
$query = call('sql_query', "UPDATE emoticons SET code='{$code}', image='{$image}', alt='{$text}' WHERE id='{$id}'");
if ($query) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:27,代码来源:editemoticon.php
示例9: action
function action()
{
router();
if (empty($_GET[0]) || $_GET[0] == 'index.php') {
$_GET[0] = SCRIPT_NAME;
}
if (empty($_GET[1])) {
$_GET[1] = 'main';
}
//$_GET = array_map('strtolower', $_GET);
// $file = CONTROLLERS_PATH . $_GET[0] . '.php';
$file = CONTROLLERS_PATH . $_GET[0] . '.php';
// var_dump($file ,__FILE__);exit;
if (!file_exists($file)) {
errors();
exit;
//die('The server is busy, please try again later.');
}
// echo $_GET[1];eixt;
$c = new index();
// if( !method_exists( $c, $_GET[1] ) )
// {
// errors();
// exit();
// //die('The server is busy, please try again later.');
// }
$c->{$_GET}[1]();
// $c->display($c->tpl);
}
开发者ID:noikiy,项目名称:webgame,代码行数:29,代码来源:functions.php
示例10: addban
function addban($ip, $reason, $type)
{
global $user, $error, $error_die;
if (!$user['admin_panel']) {
$error_die[] = 'You do not have permission to do this';
//No one should be able to actually use this function except an admin, its there just to be safe ;)
return false;
}
if (empty($ip)) {
$error[] = 'You must specify an ip address to ban';
return false;
}
if ($type == 'ip' && !preg_match('^([1]?\\d{1,2}|2[0-4]{1}\\d{1}|25[0-5]{1})(\\.([1]?\\d{1,2}|2[0-4]{1}\\d{1}|25[0-5]{1})){3}$^', $ip)) {
$error[] = 'Invalid IP';
return false;
}
$visitor_range = substr(call('visitor_ip'), 0, strlen(call('visitor_ip')) - strlen(strrchr(call('visitor_ip'), ".")));
$visitor_range = substr($visitor_range, 0, strlen($visitor_range) - strlen(strrchr($visitor_range, ".")));
if (call('visitor_ip') == $ip || $visitor_range == $ip) {
$error[] = 'You can not ban your own IP';
return false;
}
if (!errors()) {
if ($type == 'ip') {
$query = call('sql_query', "INSERT INTO bans (ip, reason, time_created, created_by) VALUES ('{$ip}', '{$reason}', '" . time() . "', '" . $user['id'] . "')");
} elseif ($type == 'range') {
$query = call('sql_query', "INSERT INTO bans (ip_range, reason, time_created, created_by) VALUES ('{$ip}', '{$reason}', '" . time() . "', '" . $user['id'] . "')");
}
if ($query) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:33,代码来源:addban.php
示例11: sitesettings
function sitesettings($registration, $reg_approval, $email, $mail, $host, $username, $password, $mode, $message, $captcha, $topics, $posts, $name, $tos)
{
global $user, $error_die;
if (!$user['admin_panel']) {
$error_die[] = 'You do not have permission to do this';
//No one should be able to actually use this function except an admin, its there just to be safe ;)
return false;
}
if (!errors()) {
$reg = call('sql_query', "UPDATE settings SET value = '{$registration}' WHERE variable = 'registration'");
$register_approval = call('sql_query', "UPDATE settings SET value = '{$reg_approval}' WHERE variable = 'register_approval'");
$emailq = call('sql_query', "UPDATE settings SET value = '{$email}' WHERE variable = 'email'");
$mail_type = call('sql_query', "UPDATE settings SET value = '{$mail}' WHERE variable = 'mail'");
$smtp_host = call('sql_query', "UPDATE settings SET value = '{$host}' WHERE variable = 'smtp_host'");
$smtp_username = call('sql_query', "UPDATE settings SET value = '{$username}' WHERE variable = 'smtp_username'");
$smtp_password = call('sql_query', "UPDATE settings SET value = '{$password}' WHERE variable = 'smtp_password'");
$maintenance_mode = call('sql_query', "UPDATE settings SET value = '{$mode}' WHERE variable = 'maintenance_mode'");
$maintenance_message = call('sql_query', "UPDATE settings SET value = '{$message}' WHERE variable = 'maintenance_message'");
$register_captcha = call('sql_query', "UPDATE settings SET value = '{$captcha}' WHERE variable = 'register_captcha'");
$topic_page = call('sql_query', "UPDATE settings SET value = '{$topics}' WHERE variable = 'topics_page'");
$posts_topic = call('sql_query', "UPDATE settings SET value = '{$posts}' WHERE variable = 'posts_topic'");
$site_name = call('sql_query', "UPDATE settings SET value = '{$name}' WHERE variable = 'site_name'");
$terms = call('sql_query', "UPDATE settings SET value = '{$tos}' WHERE variable = 'tos'");
if ($reg && $register_approval && $emailq && $mail_type && $smtp_host && $smtp_username && $smtp_password && $maintenance_mode && $maintenance_message && $register_captcha && $topic_page && $posts_topic && $site_name && $terms) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:28,代码来源:sitesettings.php
示例12: unstickytopic
function unstickytopic($topicid)
{
global $user, $error, $error_die;
if (empty($topicid)) {
$error_die[] = 'The id of the topic to be made a sticky was not entered';
return false;
}
$checktopic = call('sql_query', "SELECT thread_author FROM forum_topics WHERE topic_id = '{$topicid}'");
$fetch = call('sql_fetch_array', $checktopic);
if (call('sql_num_rows', $checktopic) == 0) {
$error_die[] = 'This topic does not exist';
return false;
}
if ($fetch['thread_author'] == $user['user'] && $user['sticky_own_topic'] || $user['sticky_any_topic']) {
if (!errors()) {
$query = call('sql_query', "UPDATE forum_topics SET sticky = '0' WHERE topic_id = '{$topicid}'");
if ($query) {
return true;
}
} else {
$error_die[] = 'You do not have permission to perform this action';
return false;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:25,代码来源:unstickytopic.php
示例13: editarticlecat
function editarticlecat($name, $description, $visible, $id)
{
global $user, $error, $error_die;
if (!$user['admin_panel']) {
$error_die[] = 'You do not have permission to do this';
//No one should be able to actually use this function except an admin, its there just to be safe ;)
return false;
}
if (empty($name)) {
$error[] = 'You must specify a name';
return false;
}
if (empty($description)) {
$error[] = 'You must specify a description';
return false;
}
if (empty($visible)) {
$error[] = 'You must state who this category is visible to';
} else {
foreach ($visible as $key => $value) {
$visible .= $value . ',';
}
$visible = str_replace('Array', '', $visible);
$count = strlen($visible);
$visible = substr($visible, 0, $count - 1);
}
if (!errors()) {
$query = call('sql_query', "UPDATE article_categories SET name = '{$name}', description = '{$description}', visible = '{$visible}' WHERE id = '{$id}'");
if ($query) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:33,代码来源:editarticlecat.php
示例14: updatethemes
function updatethemes($footer, $logo, $left, $right, $upper, $lower, $visible, $id)
{
global $user, $FUNCTIONS_LANG;
if (!$user['admin_panel']) {
# No one should be able to actually use this function except an admin,
# its there just to be safe ;)
$error_die[] = $FUNCTIONS_LANG["e_permissions"];
return false;
}
if (empty($visible)) {
$error[] = $FUNCTIONS_LANG["e_th_use_theme"];
return false;
} else {
foreach ($visible as $key => $value) {
$visible .= $value . ',';
}
$visible = str_replace('Array', '', $visible);
$count = strlen($visible);
$visible = substr($visible, 0, $count - 1);
}
if (!errors()) {
$site_footer = call('sql_query', "UPDATE theme_settings SET value = '{$footer}' WHERE variable = 'footer' AND theme_id = '{$id}'");
$site_logo = call('sql_query', "UPDATE theme_settings SET value = '{$logo}' WHERE variable = 'logo'AND theme_id = '{$id}'");
$exclude_left = call('sql_query', "UPDATE theme_settings SET value = '{$left}' WHERE variable = 'exclude_left'AND theme_id = '{$id}'");
$exclude_right = call('sql_query', "UPDATE theme_settings SET value = '{$right}' WHERE variable = 'exclude_right'AND theme_id = '{$id}'");
$exclude_upper = call('sql_query', "UPDATE theme_settings SET value = '{$upper}' WHERE variable = 'exclude_upper'AND theme_id = '{$id}'");
$exclude_lower = call('sql_query', "UPDATE theme_settings SET value = '{$lower}' WHERE variable = 'exclude_lower'AND theme_id = '{$id}'");
$theme_perms = call('sql_query', "UPDATE themes SET theme_visibility = '{$visible}' WHERE theme_id = '{$id}'");
if ($site_footer && $site_logo && $exclude_left && $exclude_right && $exclude_upper && $exclude_lower && $theme_perms) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:33,代码来源:updatethemes.php
示例15: uninstallplugin
function uninstallplugin($id)
{
global $user, $error, $error_die;
if (!$user['admin_panel']) {
$error_die[] = 'You do not have permission to do this';
//No one should be able to actually use this function except an admin, its there just to be safe ;)
return false;
}
if (empty($id)) {
$error[] = 'No Plugin was selected';
return false;
}
$sql = call('sql_query', "SELECT folder FROM plugins WHERE id = '{$id}'");
if (call('sql_num_rows', $sql) == 0) {
$error[] = 'This Plugin does not exist';
return false;
}
if (!errors()) {
$fetch = call('sql_fetch_array', $sql);
include './Plugins/' . $fetch['folder'] . '/plugin-info.php';
$delete = call('sql_query', "DELETE FROM plugins WHERE id = '{$id}'");
if (isset($plugin['uninstall']) && is_array($plugin['uninstall'])) {
foreach ($plugin['uninstall'] as $uninstall) {
call('sql_query', $uninstall);
}
}
if ($delete) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:31,代码来源:uninstallplugin.php
示例16: trackip
function trackip($ip)
{
global $settings;
// how many rows to show per page
$rowsPerPage = $settings['topics_page'];
// by default we show first page
$pageNum = 1;
// if $_GET['page'] defined, use it as page number
if (isset($_GET['page'])) {
$pageNum = $_GET['page'];
}
// counting the offset
$offset = ($pageNum - 1) * $rowsPerPage;
$fetch = array();
if (!errors()) {
$sql = call('sql_query', "SELECT id, topic_id, author_id, post_time, subject, ip FROM forum_posts WHERE ip LIKE '%{$ip}%' ORDER BY post_time DESC LIMIT {$offset}, {$rowsPerPage}");
if (call('sql_num_rows', $sql) != 0) {
while ($r = call('sql_fetch_array', $sql)) {
$fetch[] = array('post_id' => $r['id'], 'topic_id' => $r['topic_id'], 'author' => call('userprofilelink', $r['author_id']), 'post_time' => call('dateformat', $r['post_time']), 'subject' => '<a href="' . $settings['site_url'] . '/index.php?act=viewtopic&id=' . $r['topic_id'] . '&page=' . ceil($r['id'] / $settings['posts_topic']) . '#' . $r['id'] . '" target="_blank">' . $r['subject'] . '</a>', 'ip' => $r['ip'], 'type' => 'post');
}
} else {
$fetch[] = array('ip' => 'The search returned zero results', 'type' => 'post');
}
$sql = call('sql_query', "SELECT id, ip FROM users WHERE ip LIKE '%{$ip}%'");
if (call('sql_num_rows', $sql) != 0) {
while ($r = call('sql_fetch_array', $sql)) {
$fetch[] = array('user' => call('userprofilelink', $r['id']), 'ip' => $r['ip'], 'type' => 'user');
}
} else {
$fetch[] = array('ip' => 'The search returned zero results', 'type' => 'user');
}
}
return $fetch;
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:34,代码来源:trackip.php
示例17: buildError
function buildError($error, $num)
{
if ($GLOBALS['useDebug'] == false) {
log_error($error, $num);
} else {
errors($error, $num);
}
}
开发者ID:nero08,项目名称:CraftedWeb,代码行数:8,代码来源:error.php
示例18: editboard
function editboard($name, $description, $postgroup, $visible, $id, $moderators, $category, $sticky, $lock)
{
global $user, $error, $error_die;
if (empty($visible)) {
$error[] = 'You must state who this board is visible to';
return false;
} else {
foreach ($visible as $key => $value) {
$visible .= $value . ',';
}
$visible = str_replace('Array', '', $visible);
$count = strlen($visible);
$visible = substr($visible, 0, $count - 1);
}
if (empty($postgroup)) {
$error[] = 'You must state who may post in this board';
return false;
} else {
foreach ($postgroup as $key => $value) {
$postgroup .= $value . ',';
}
$postgroup = str_replace('Array', '', $postgroup);
$count2 = strlen($postgroup);
$postgroup = substr($postgroup, 0, $count2 - 1);
}
if (!$user['admin_panel']) {
$error_die[] = 'You do not have permission to do this';
//No one should be able to actually use this function except an admin, its there just to be safe ;)
return false;
}
if (empty($description)) {
$error[] = 'You must specify a description';
return false;
}
if (empty($name)) {
$error[] = 'You must specify a name for the board';
//silly, but seriously why make a board without naming it, how are people meant to know what it is!
return false;
}
$sql = call('sql_query', "SELECT * FROM forum_boards WHERE id = '{$id}'");
if (call('sql_num_rows', $sql) == 0) {
$error[] = 'This board no longer exists';
return false;
}
$sticky = empty($sticky) || !$sticky ? 0 : 1;
$lock = empty($lock) || !$lock ? 0 : 1;
if (!errors()) {
$query = call('sql_query', "UPDATE forum_boards SET board_name = '{$name}', board_description = '{$description}', visible = '{$visible}', post_group = '{$postgroup}', cat = '{$category}', creation_sticky = '{$sticky}', creation_lock = '{$lock}' WHERE id = '{$id}'");
$username = explode(", ", $moderators);
foreach ($username as $recipient) {
$sql_2 = call('sql_query', "INSERT INTO forum_moderators (user_id, board_id) VALUES ('{$recipient}', '{$id}')");
}
if ($query) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:57,代码来源:editboard.php
示例19: postreply
function postreply($topicid, $subject, $message, $token, $smiley, $time)
{
global $user, $error, $error_die;
call('checktoken', $token);
if (empty($topicid) || !is_numeric($topicid)) {
$error_die[] = 'No topic selected';
return false;
}
if (empty($message)) {
$error[] = 'Your message is empty';
return false;
}
$sql = call('sql_query', "SELECT * FROM forum_topics WHERE topic_id = '{$topicid}'");
$fetch = call('sql_fetch_array', $sql);
if (call('sql_num_rows', $sql) == 0) {
$error_die[] = 'Topic does not exist';
return false;
}
if ($fetch['locked'] == '1') {
$error_die[] = 'This topic is locked! You may not post a reply';
return false;
}
if (empty($subject)) {
$subject = 'Re: ' . $fetch['thread_title'] . '';
}
$sql_2 = call('sql_query', "SELECT * FROM forum_boards WHERE id = '" . $fetch['board_id'] . "'");
$fetch_2 = call('sql_fetch_array', $sql_2);
if (call('sql_num_rows', $sql_2) == 0) {
$error_die[] = 'Error this board does not exist';
return false;
}
if (!call('visiblecheck', $user['membergroup_id'], $fetch_2['post_group'])) {
$error_die[] = 'You do not have permission to create a new reply in this board';
return false;
}
//check to see if someone has posted already in this topic while this user was posting
$timecheck = call('sql_query', "SELECT * FROM forum_posts WHERE topic_id = '{$topicid}' AND post_time>{$time}");
if (call('sql_num_rows', $timecheck) != 0) {
$error[] = 'Someone has made a reply while you were posting. Please review the post';
unset($_SESSION['post_time']);
return false;
}
if (!errors()) {
$smiley = empty($smiley) || !smiley ? 0 : 1;
$deleteread = call('sql_query', "DELETE FROM topic_read WHERE topic_id = '{$topicid}' AND user_id!='" . $user['id'] . "'");
$deleteboardread = call('sql_query', "DELETE FROM board_read WHERE board_id = '" . $fetch['board_id'] . "'");
$insertreply = call('sql_query', "INSERT INTO forum_posts (topic_id, board_id, post_time, author_id, name_author, subject, message, ip, disable_smiley) VALUES ('{$topicid}', '" . $fetch['board_id'] . "', '" . time() . "', '" . $user['id'] . "', '" . $user['user'] . "', '{$subject}', '{$message}', '" . call('visitor_ip') . "', '{$smiley}')");
$replyid = call('sql_insert_id');
$updateboardcount = call('sql_query', "UPDATE forum_boards SET posts_count=posts_count+1, last_msg='{$replyid}' WHERE id='" . $fetch['board_id'] . "'");
$updatereplycount = call('sql_query', "UPDATE forum_topics SET replies=replies+1, latest_reply='{$replyid}' WHERE topic_id='{$topicid}'");
$updateuserspost = call('sql_query', "UPDATE users SET posts=posts+1 WHERE id='" . $user['id'] . "'");
if ($insertreply) {
return true;
}
}
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:56,代码来源:postreply.php
示例20: output_admin
function output_admin($title = '', $body = '', $head = '', $update = '')
{
global $settings, $authid, $user, $error;
if (errors()) {
$errors = theme('start_content') . '<p><h2>Error:</h2></p><div class="errors"><ul>';
foreach ($error as $error1) {
$errors .= '<li>' . $error1 . '</li>';
}
$errors .= '</ul></div>' . theme('end_content');
unset($error);
} else {
$errors = '';
}
if (isset($_SESSION['update'])) {
$update = '<div class="content" align="center" id="update" style="display: block;">' . $_SESSION['update'] . '</div>';
unset($_SESSION['update']);
} else {
$update = '<div align="center" id="update"></div>';
}
if (empty($user['admin_menu'])) {
$menu = 'left.php';
} else {
$menu = $user['admin_menu'];
}
if (file_exists('themes/' . $settings['site_theme'] . '/Layouts/Admin/Menu/' . $menu)) {
include 'themes/' . $settings['site_theme'] . '/Layouts/Admin/Menu/' . $menu;
} elseif (file_exists('themes/_Admin/' . $menu . '/theme-info.php')) {
$theme_path = 'themes/_Admin/' . $menu . '/';
include $theme_path . 'theme-info.php';
include $theme_path . $theme_default;
} else {
include 'Layouts/Admin/Menu/' . $menu;
}
$output = theme('head', $title, $head . '<style type="text/css">
.thrColLiqHdr #mainContent {
margin-bottom: 0;
margin-left: 1%;
margin-top: 0;
margin-right: 1%;
}
</style>') . '
<body class="thrColLiqHdr">
<div id="container">
' . theme('top') . theme('links') . '
<div id="mainContent">';
if (theme('output_error') == false) {
$output .= $menu;
} else {
$output .= theme('output_error');
}
$output .= theme('footer');
die($output);
}
开发者ID:eodivision,项目名称:eoCMS,代码行数:53,代码来源:output_admin.php
注:本文中的errors函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论