当前位置: 首页>>代码示例>>PHP>>正文


PHP forum::message方法代码示例

本文整理汇总了PHP中forum::message方法的典型用法代码示例。如果您正苦于以下问题:PHP forum::message方法的具体用法?PHP forum::message怎么用?PHP forum::message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在forum的用法示例。


在下文中一共展示了forum::message方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 /**
  * ****************************************************
  * UPDATE
  * ****************************************************
  */
 function update()
 {
     codebase_query(Lang::item('admin.update'), 'plugins' . DS . 'forum' . DS . 'sql' . DS . 'update.sql');
     forum::message(Lang::item('common.message'), Lang::item('admin.update_success'), 'forum.php?c=admin', 3);
 }
开发者ID:phill104,项目名称:branches,代码行数:10,代码来源:admin.php

示例2: delete

 function delete()
 {
     $authorizer = check_model::getInstance();
     $topic_id = $this->validate->get->getInt('id');
     if (!$authorizer->is_topic_id($topic_id)) {
         cpg_die(ERROR, Lang::item('error.wrong_topic_id'), __FILE__, __LINE__);
     }
     if (!$authorizer->can_delete_topic($topic_id)) {
         cpg_die(ERROR, Lang::item('error.perm_denied'), __FILE__, __LINE__);
     }
     $topic = $this->forum->get_topic_data($topic_id, 'board_id');
     $topic_name = $this->forum->get_topic_name($topic_id);
     $this->forum->delete_topic($topic_id);
     forum::message(Lang::item('common.message'), sprintf(Lang::item('topic.delete_topic_success'), $topic_name), 'forum.php?c=board&id=' . $topic['board_id']);
 }
开发者ID:phill104,项目名称:branches,代码行数:15,代码来源:topic.php

示例3: newtopic

 function newtopic()
 {
     include BASE_DIR . 'include' . DS . 'smilies.inc.php';
     include BASE_DIR . 'include' . DS . 'mailer.inc.php';
     $vars = array();
     $errors = array();
     $authorizer = check_model::getInstance();
     $vars['board_id'] = $this->validate->get->getInt('id');
     if (!$authorizer->is_board_id($vars['board_id'])) {
         cpg_die(ERROR, Lang::item('error.wrong_board_id'), __FILE__, __LINE__);
     }
     if (!$authorizer->can_create_topic($vars['board_id'])) {
         cpg_die(ERROR, Lang::item('error.perm_denied'), __FILE__, __LINE__);
     }
     $vars['nagavitor'] = $this->forum->get_nagavitor();
     $vars['icons'] = $this->forum->get_icons();
     $data = array('icon' => 'icon1');
     if ($this->validate->post->keyExists('submit')) {
         $data = array('icon' => $this->validate->post->getRaw('icon'), 'subject' => $this->validate->post->getEscaped('subject'), 'body' => $this->validate->post->getRaw('body'), 'poster_time' => time(), 'poster_id' => USER_ID, 'poster_name' => USER_NAME, 'poster_ip' => Config::item('hdr_ip'), 'smileys_enabled' => 1);
         if (Config::item('fr_msg_icons') == 0 && $data['icon'] == '') {
             $data['icon'] = 'icon1';
         }
         if ($data['subject'] == '') {
             $errors[] = Lang::item('error.empty_subject');
         }
         if ($data['icon'] == '') {
             $errors[] = Lang::item('error.no_msg_icon');
         }
         if ($data['body'] == '') {
             $errors[] = Lang::item('error.empty_body');
         }
         if (strlen($data['body']) > Config::item('fr_msg_max_size') && Config::item('fr_msg_max_size')) {
             $data['body'] = substr($data['body'], 0, Config::item('fr_msg_max_size'));
         }
         global $CONFIG;
         if ($CONFIG['comment_captcha'] == 1 || $CONFIG['comment_captcha'] == 2 && !USER_ID) {
             if (!captcha_plugin_enabled('comment')) {
                 global $lang_errors;
                 $superCage = Inspekt::makeSuperCage();
                 require "include/captcha.inc.php";
                 $matches = $superCage->post->getMatched('confirmCode', '/^[a-zA-Z0-9]+$/');
                 if (!$matches[0] || !PhpCaptcha::Validate($matches[0])) {
                     $errors[] = $lang_errors['captcha_error'];
                 }
             } else {
                 CPGPluginAPI::action('captcha_comment_validate', null);
             }
         }
         if (count($errors) == 0) {
             if ($authorizer->double_post()) {
                 cpg_die(ERROR, Lang::item('error.already_post'), __FILE__, __LINE__);
             } else {
                 $topic_id = $this->forum->insert_topic($vars['board_id'], $data);
                 // to-do: send notify email
                 $users = $this->forum->get_notify_user($vars['board_id'], '');
                 foreach ($users as $user) {
                     if ($user['user_id'] == USER_ID) {
                         continue;
                     }
                     $user = $this->forum->get_user_data($user['user_id'], 'user_email');
                     // prepare email
                     $email_subject = Lang::item('board.board_new_topic') . $data['subject'];
                     $email_body = sprintf(Lang::item('board.notify_email'), $data['subject'], Config::item('fr_prefix_url') . forum::link('topic', '', $topic_id), Config::item('fr_prefix_url') . forum::link('topic', '', $topic_id), Config::item('fr_prefix_url') . forum::link('board', 'notify', $vars['board_id']), Config::item('fr_prefix_url') . forum::link('board', 'notify', $vars['board_id']), Config::item('fr_title'));
                     // send mail
                     cpg_mail($user['user_email'], $email_subject, $email_body, 'text/html', Config::item('fr_title'), Config::item('gallery_admin_email'));
                     // set send = 0
                     $this->forum->set_board_notify($vars['board_id'], 0, $user['user_id']);
                 }
                 // set notify ?
                 if ($this->validate->post->getInt('notify') === 1) {
                     $this->forum->set_topic_notify($topic_id, $this->validate->post->getInt('notify'));
                 }
                 forum::message(Lang::item('common.message'), sprintf(Lang::item('topic.new_topic_success'), $data['subject']), 'forum.php?c=topic&id=' . $topic_id);
             }
         }
     }
     $vars['errors'] = $errors;
     $vars['form'] = $data;
     $this->view->render('board/newtopic', $vars);
 }
开发者ID:phill104,项目名称:branches,代码行数:80,代码来源:board.php

示例4: index

 function index()
 {
     require_once 'include' . DS . 'smilies.inc.php';
     $vars = array();
     $errors = array();
     $authorizer = check_model::getInstance();
     // user or not
     if (!$authorizer->is_user()) {
         cpg_die(ERROR, Lang::item('error.perm_denied'), __FILE__, __LINE__);
     }
     // to-do: display the profile if + avatar
     $vars['nagavitor'] = $this->forum->get_nagavitor();
     $vars['user'] = $user = $this->forum->get_user_data();
     if ($this->validate->post->keyExists('submit')) {
         $data = array('fr_signature' => $this->validate->post->getRaw('fr_signature'));
         if (strlen($data['fr_signature']) > Config::item('fr_signature_max_size') && Config::item('fr_signature_max_size')) {
             $data['fr_signature'] = substr($data['fr_signature'], 0, Config::item('fr_signature_max_size'));
         }
         $avatar_type = $this->validate->post->getRaw('avatar_type');
         if ($avatar_type == 'url') {
             $data['fr_avatar'] = $this->validate->post->getRaw('fr_avatar_url');
             $files = explode('.', $data['fr_avatar']);
             if (!in_array($files[count($files) - 1], array('gif', 'jpg', 'jpeg', 'png'))) {
                 $errors[] = Lang::item('error.wrong_avatar_extension');
             }
         } else {
             if ($avatar_type == 'file') {
                 $upload = load_library('upload', TRUE);
                 $upload->upload_dir = 'plugins/forum/forum/uploads/avatars/';
                 if (!is_dir($upload->upload_dir)) {
                     mkdir($upload->upload_dir, octdec(Config::item('default_dir_mode')));
                 }
                 $upload->extensions = array('.jpg', '.jpeg', '.gif', '.png');
                 $upload->max_length_filename = 255;
                 $upload->rename_file = true;
                 $upload->the_temp_file = $this->validate->files->getRaw('/fr_avatar_file/tmp_name');
                 $upload->the_file = $this->validate->files->getRaw('/fr_avatar_file/name');
                 $upload->http_error = $this->validate->files->getRaw('/fr_avatar_file/error');
                 $upload->replace = 'y';
                 $upload->do_filename_check = 'y';
                 $new_name = 'avatar_' . USER_ID;
                 if ($upload->do_upload($new_name)) {
                     $extension = strtolower(strrchr($upload->the_file, "."));
                     $data['fr_avatar'] = $upload->upload_dir . $new_name . $extension;
                 } else {
                     $errors[] = $upload->show_error_string();
                 }
                 $imagesize = getimagesize($data['fr_avatar']);
                 if (max($imagesize[0], $imagesize[1]) > Config::item('fr_avatar_size') && Config::item('fr_avatar_size')) {
                     if (!function_exists('resize_image')) {
                         require_once 'include/picmgmt.inc.php';
                     }
                     resize_image($data['fr_avatar'], $data['fr_avatar'], Config::item('fr_avatar_size'), Config::item('thumb_method'), Config::item('thumb_use'));
                 }
             } else {
                 unset($data['fr_avatar']);
             }
         }
         if (count($errors) == 0) {
             $this->forum->edit_profile($user['user_id'], $data);
             forum::message(Lang::item('common.message'), Lang::item('profile.update_profile_success'), 'forum.php?c=profile');
         }
     }
     $vars['errors'] = $errors;
     $this->view->render('profile/index', $vars);
 }
开发者ID:phill104,项目名称:branches,代码行数:66,代码来源:profile.php

示例5: delete

 function delete()
 {
     $authorizer = check_model::getInstance();
     $msg_id = $this->validate->get->getInt('id');
     if (!$authorizer->is_msg_id($msg_id)) {
         cpg_die(ERROR, Lang::item('error.wrong_msg_id'), __FILE__, __LINE__);
     }
     if (!$authorizer->can_delete_msg($msg_id)) {
         cpg_die(ERROR, Lang::item('error.perm_denied'), __FILE__, __LINE__);
     }
     $msg = $this->forum->get_message_data($msg_id, 'subject,topic_id');
     $this->forum->delete_message($msg_id);
     if ($this->forum->get_message_count($msg['topic_id']) == 0) {
         $topic = $this->forum->get_topic_data($msg['topic_id'], 'board_id');
         $this->forum->delete_topic($msg['topic_id']);
         forum::message(Lang::item('common.message'), sprintf(Lang::item('message.del_msg_success'), $msg['subject']), 'forum.php?c=board&id=' . $topic['board_id']);
     } else {
         forum::message(Lang::item('common.message'), sprintf(Lang::item('message.del_msg_success'), $msg['subject']), 'forum.php?c=topic&id=' . $msg['topic_id']);
     }
 }
开发者ID:phill104,项目名称:branches,代码行数:20,代码来源:message.php


注:本文中的forum::message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。