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


PHP Url::build方法代码示例

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


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

示例1: draw

 function draw()
 {
     global $display;
     $cmd = Url::get('cmd');
     $display->add('id_survey', $this->public_survey['id']);
     $display->add('title', stripslashes($this->public_survey['title']));
     $display->add('question', stripslashes($this->public_survey['question']));
     $display->add('url_edit', Url::build('admin_survey', array('cmd' => 'edit', 'id_survey' => $this->public_survey['id'])));
     $opts = DB::fetch_all('SELECT * FROM `public_survey_opinion` WHERE `id_survey`=' . $this->public_survey['id']);
     $i = 0;
     foreach ($opts as &$opt) {
         $i++;
         $opt['num'] = $i;
         $opt['edit'] = Url::build_current(array('id_survey' => Url::get('id_survey', 'int', 0), 'cmd' => 'edit', 'id' => $opt['id']));
         $opt['del'] = Url::build_current(array('id_survey' => Url::get('id_survey', 'int', 0), 'cmd' => 'delete', 'id' => $opt['id']));
     }
     $display->add('opts', $opts);
     if ($cmd == 'edit') {
         $public_survey_opinion = DB::select('public_survey_opinion', 'id=' . Url::get('id', 0));
         if ($public_survey_opinion) {
             $display->add('value', $public_survey_opinion['option']);
             $display->add('option_id', $public_survey_opinion['id']);
         }
     }
     $this->beginForm();
     $display->output('PublicSurveyOption');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:28,代码来源:class.php

示例2: on_submit

 function on_submit()
 {
     $reply_content = trim(Url::get('reply_content'));
     $subject = AZLib::stripUnicode(trim(Url::get('subject')));
     if (strlen($reply_content) > 20) {
         //Gửi mail đã:
         if ($subject == '') {
             $subject = "Tra loi lien he cua ban... ( Reply for your feedback... )";
         }
         $content = $reply_content . MAIL_FOOTER . "<hr />" . "<b>Nội dung ý kiến / liên hệ của bạn đã gửi cho chúng tôi vào lúc: " . date('H:i:s d/m/Y', $this->contact['time']) . ":</b><br />\n\t\t\t\t\t\t<b>&quot;</b>" . stripslashes($this->contact['content']) . "<b>&quot;</b>";
         if (System::sendEBEmail($this->contact['email'], "[" . WEB_NAME . "] {$subject}", $content)) {
             $reply_content = stripslashes($this->contact['reply_content']) . "<a href='" . Url::build('profile', array('id' => User::id())) . "'>" . User::user_name() . "</a> Gửi lúc: " . date('H:i:s d/m/Y', TIME_NOW) . "<br /><b>Email Subject:</b> " . $subject . "<br /><br />" . $reply_content . '<hr />';
             if (DB::update('feedback', array('reply_content' => addslashes($reply_content), 'status' => 1), 'id=' . $this->contact['id'])) {
                 //Gửi mail cho admin
                 System::sendEBEmail(FEEDBACK_EMAIL, "[" . WEB_NAME . "] " . 'Reply for feedback: ' . $this->contact['name'] . ' - ' . $this->contact['address'] . ' - ' . $this->contact['email'], $content);
                 Url::redirect_current();
             } else {
                 $this->setFormError('', 'Không cập nhật được dữ liệu');
             }
         } else {
             $this->setFormError('subject', 'Không gửi được email tới khách hàng!');
         }
         //End gửi mail
     } else {
         $this->setFormError('reply_content', 'Nội dung phản hồi phải lớn hơn 20 ký tự');
     }
 }
开发者ID:duynhan07,项目名称:elink,代码行数:27,代码来源:FeedbackReply.php

示例3: draw

 function draw()
 {
     global $display;
     $cat_newss = array();
     $display->add('is_admin', User::have_permit(ADMIN_NEWS));
     $display->add('url_home', WEB_DIR);
     $display->add('time_now', News::displayTime());
     $display->add('cat_name', $this->news_cat['name']);
     $display->add('cat_url', URL::build('news_list', array('news_catid' => $this->news_cat['id'], 'azname' => AZLib::safe_title($this->news_cat['name']))));
     $condition = ' status=1 ';
     $total = DB::count("news", $condition);
     $limit = '';
     //$pagging	= AZPagging::paging_list($limit,20,'page_no');
     $pagging = AZPagging::paging_list($limit, $total, 20);
     $re = DB::query('SELECT * FROM news WHERE ' . $condition . ' ORDER BY id DESC' . $limit);
     if ($re) {
         while ($news = mysql_fetch_assoc($re)) {
             $news['title'] = stripslashes($news['title']);
             $news['brief'] = stripslashes($news['brief']);
             $news['url'] = Url::build('news_detail', array('news_catid' => $news['news_catid'], 'news_id' => $news['id'], 'azname' => AZLib::safe_title($news['title'])));
             if ($news['image']) {
                 $news['image'] = AZLib::getImageThumb($news['image'], 150, 0, 0, $news['img_server']);
             }
             $news['news_h'] = date('H:i', $news['time_created']);
             $news['news_d'] = date('d-m-Y', $news['time_created']);
             $news['admin_link'] = News::admin_link($news);
             $cat_newss[$news['id']] = $news;
         }
     }
     $display->add('pagging', $pagging);
     $display->add('cat_newss', $cat_newss);
     $display->output("NewsPage");
 }
开发者ID:duynhan07,项目名称:elink,代码行数:33,代码来源:NewsPage.php

示例4: draw

 function draw()
 {
     global $display;
     $news_ids = '';
     $hot_newss = array();
     $configs = @CGlobal::$configs['NewsHomeHot']['conf_val'];
     if ($configs) {
         $configs = unserialize(stripslashes($configs));
         $title_news = $configs['title'];
         $news_ids = $configs['news_ids'];
     } else {
         $title_news = "TIN HOT";
         $news_ids = '';
     }
     if ($news_ids != '') {
         $re = DB::query("SELECT id, title, news_catid FROM news WHERE id IN({$news_ids}) AND status = 1 ORDER BY find_in_set(id,'{$news_ids}')");
         if ($re) {
             while ($news = mysql_fetch_assoc($re)) {
                 $news['title'] = stripslashes($news['title']);
                 $news['url'] = Url::build('news_detail', array('news_catid' => $news['news_catid'], 'news_id' => $news['id'], 'azname' => AZLib::safe_title($news['title'])));
                 $hot_newss[$news['id']] = $news;
             }
         }
     }
     if (User::is_admin()) {
         $display->add("is_admin", 1);
         $display->add("msg", $this->showFormErrorMessages(1));
         $display->add('begin_form', $this->beginForm(true, 'post', false, false, 1));
         $display->add('end_form', $this->endForm(true));
     }
     $display->add('title_news', $title_news);
     $display->add('news_ids', $news_ids);
     $display->add('hot_newss', $hot_newss);
     $display->output("NewsHomeHot");
 }
开发者ID:duynhan07,项目名称:elink,代码行数:35,代码来源:NewsHomeHot.php

示例5: draw

 function draw()
 {
     global $display;
     if (User::is_admin()) {
         $display->add('edit', '<a title="Quản trị Các email" target="_blank" href="' . Url::build('news_letter_admin') . '"><img src="style/images/edit.gif" alt="Sửa" border="0"/></a>');
     }
     $this->beginForm();
     $display->output("NewsLetter");
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:10,代码来源:NewsLetter.php

示例6: draw

 function draw()
 {
     global $display;
     if (Url::get('cmd') == 'activated') {
         //Kích hoạt thành công
         $display->add('title', 'Kích hoạt tài khoản thành công!');
         $this->setFormSucces('', 'Tài khoản của bạn đã được kích hoạt thành công!');
         $display->add('msg', $this->showFormSuccesMessages(1));
     } else {
         $display->add('title', 'Đăng ký thành công!');
     }
     $display->add('url_shop', Url::build('profile', array('user_id' => User::id(), 'user_name' => User::user_name())));
     $display->output('success');
 }
开发者ID:duynhan07,项目名称:elink,代码行数:14,代码来源:register_success.php

示例7: draw

 function draw()
 {
     global $display;
     $display->add('msg', $this->showFormErrorMessages(1));
     $quantity_total = 0;
     $price_total = 0;
     $cart_items = array();
     if (Cart::$cart_items) {
         foreach (Cart::$cart_items as $cart_item_id => $cart_item) {
             $item = Cart::$items[$cart_item['item_id']];
             if (isset(CGlobal::$allCategories[$item['category_id']])) {
                 $cart_item['url'] = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
             } else {
                 $cart_item['url'] = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
             }
             $cart_item['name'] = $item['name'];
             $cart_item['price_num'] = $item['price'];
             $cart_item['price'] = number_format($item['price'], 0, ',', '.');
             if ($item['img_url']) {
                 $cart_item['img_url'] = AZLib::getImageThumb($item['img_url'], 120, 120, 0, $item['img_server']);
             } else {
                 $item['img_url'] = '';
             }
             $cart_item['row_total'] = $cart_item['checked'] ? number_format($item['price'] * $cart_item['quantity'], null, null, '.') . ' VNĐ' : '';
             $cart_item['delete'] = Url::build_current(array('cmd' => 'delete', 'id' => $cart_item['id']));
             $price_total += $cart_item['checked'] ? $item['price'] * $cart_item['quantity'] : 0;
             $quantity_total += $cart_item['checked'] ? $cart_item['quantity'] : 0;
             $cart_items[$cart_item['id']] = $cart_item;
         }
     }
     $display->add('quantity_total', number_format($quantity_total, null, null, '.'));
     $display->add('price_total', number_format($price_total, null, null, '.'));
     $display->add('url_finish', Url::build_current(array('cmd' => 'finish')));
     $display->add('cart_items', $cart_items);
     $display->add("print_link", Url::open_popup(Url::build('cart_print', array('id' => Cart::$cart['id'])), 1000, 800, false, false, false, false, false, 1, 1));
     $this->beginForm();
     $display->output('Cart');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:39,代码来源:Cart.php

示例8: draw

 function draw()
 {
     global $display;
     if (User::is_admin()) {
         $display->add("is_admin", 1);
     }
     $display->add('url_home', WEB_DIR);
     $display->add('time_create', News::displayTime($this->news['time_created']));
     $display->add('title', stripslashes($this->news['title']));
     $display->add('brief', stripslashes($this->news['brief']));
     $display->add('content', stripslashes($this->news['content']));
     $display->add('pen_name', stripslashes($this->news['pen_name']));
     if ($this->news['source'] != '') {
         $display->add('source', " ( theo <i>" . stripslashes($this->news['source']) . "</i> )");
     } else {
         $display->add('source', "");
     }
     if (User::have_permit(ADMIN_NEWS)) {
         $display->add('admin_link', News::admin_link($this->news));
     }
     if ($this->news['image']) {
         $display->add('img_full_url', "http://" . CGlobal::$img_server[$this->news['img_server']] . $this->news['image']);
         $display->add('img_max_path', AZLib::getImageThumbMax($this->news['image'], '', 1, $this->news['img_server']));
         $display->add('image_title', stripslashes($this->news['image_title']));
         $display->add('image_url', AZLib::getImageThumb($this->news['image'], 180, 0, 0, $this->news['img_server']));
         //AZLib::safe_title($this->news['title']))
         $display->add('image_oringin', $this->news['image']);
     }
     $news_cart = CGlobal::$allNewsCategories[$this->news['news_catid']];
     $display->add('news_home_link', Url::build('news'));
     if ($news_cart) {
         $display->add('cat_link', Url::build('news', array('news_catid' => $news_cart['id'], 'azname' => AZLib::safe_title($news_cart['name']))));
         $display->add('cat_name', $news_cart['name']);
     }
     $display->add("share_title", urlencode(CGlobal::$website_title));
     $display->add("share_url", "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
     $display->add("share_des", urlencode(trim(CGlobal::$meta_desc)));
     $display->output("NewsDetail");
 }
开发者ID:duynhan07,项目名称:elink,代码行数:39,代码来源:NewsDetail.php

示例9: admin_link

 static function admin_link($row)
 {
     $str = '';
     if (User::have_permit(ADMIN_NEWS)) {
         $href = urlencode(Url::build_all());
         $str = '<br />';
         $str .= '<a href="' . Url::build('news_admin', array('cmd' => 'add')) . '"><b>Thêm tin</b></a> | ';
         $str .= '<a href="' . Url::build('news_admin', array('id' => $row['id'], 'cmd' => 'edit', 'href' => $href)) . '"><b>Sửa tin</b></a> | ';
         if (!$row['status']) {
             $str .= '<a href="' . Url::build('news_admin', array('id' => $row['id'], 'cmd' => 'pub', 'act' => 'Publish', 'href' => $href)) . '" )"><b>Hiển thị tin</b></a> | ';
         } else {
             $str .= '<a href="' . Url::build('news_admin', array('id' => $row['id'], 'cmd' => 'pub', 'act' => 'UnPublish', 'href' => $href)) . '" )"><b>Ẩn tin</b></a> | ';
         }
         $str .= '<a href="' . Url::build('news_admin', array('id' => $row['id'], 'cmd' => 'delete', 'href' => $href)) . '" onclick="return confirm(\'Bạn có chắc chắn xóa không?\')"><b>Xóa tin</b></a> ';
         $str .= '<br />[ <b>Thêm:</b> <a href="' . Url::build('profile', array('username' => $row['username'])) . '"><b>' . $row['username'] . '</b></a> - ' . date('d/m/Y H:i', $row['time_created']) . ' || ';
         $str .= '<b>Sửa:</b> <a href="' . Url::build('profile', array('username' => $row['user_modify'])) . '"><b>' . $row['user_modify'] . '</b></a> - ' . date('d/m/Y H:i', $row['time_modify']) . ' ]';
         if ($row['admin_comment'] != '') {
             $str .= '<br /><b><font color="red">Ghi chú: </font></b><font color="red">' . $row['admin_comment'] . '</font></b>';
         }
         // Hien thi comment cua Bien tap
     }
     return $str;
 }
开发者ID:duynhan07,项目名称:elink,代码行数:23,代码来源:News.php

示例10: draw

 function draw()
 {
     global $display;
     AZLib::getCats();
     $this->beginForm();
     $item = Item::get_item($this->booking_vip['item_id']);
     if (!$item || $item && $item['status'] == -1) {
         $this->setFormError("item_id", "Tin không tồn tại!");
     } else {
         $display->add('item_name', stripslashes($item['name']));
         $display->add('item_link', Url::build('item_detail', array('id' => $item['id'], 'ebname' => AZLib::safe_title($item['name']))));
     }
     $top_catid = $item['level_1_catid'];
     $cat_id = $item['category_id'];
     $display->add('msg', $this->showFormErrorMessages(1));
     $display->add('item_id', $this->booking_vip['item_id']);
     if ($this->booking_vip['top_cat']) {
         $display->add('category', 1);
     } else {
         if ($this->booking_vip['cat_id']) {
             $display->add('category', 2);
         }
     }
     $display->add('num_contract', $this->booking_vip['num_contract']);
     $display->add('top_cat_name', CGlobal::$allCategories[$top_catid]['name']);
     $display->add('cat_name', CGlobal::$allCategories[$cat_id]['name']);
     $display->add('note', stripslashes(Url::get("note", $this->booking_vip['note'])));
     $display->add('time_start', Url::get("time_start", date('d-m-Y', $this->booking_vip['time_start'])));
     if ($this->booking_vip['time_end']) {
         $display->add('time_end', Url::get("time_end", date('d-m-Y', $this->booking_vip['time_end'])));
     } else {
         $display->add('time_end', Url::get("time_end", ''));
     }
     $display->output('EditBookingVip');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:36,代码来源:EditBookingVip.php

示例11: draw

 function draw()
 {
     global $display;
     $display->add('url_home', WEB_DIR);
     $footer_content = html_entity_decode(@CGlobal::$configs['footer_content']['conf_val'], ENT_QUOTES, "UTF-8");
     if ($footer_content != '') {
         $display->add("footer_content", $footer_content);
     }
     if (User::is_admin()) {
         $display->add("edit_link", Url::open_popup(Url::build('footer_edit'), 800, 600, false, false, false, false, false, 1, 1));
     }
     $display->add("web_dir", WEB_DIR);
     $total = (int) DB::fetch('SELECT count(*) as total FROM ' . _SESS_TABLE . ' WHERE session_expires >' . (TIME_NOW - 900), 'total', 1);
     $mem = (int) DB::fetch('SELECT count(total) as total FROM ( SELECT count(user_id) as total FROM ' . _SESS_TABLE . ' WHERE session_expires >' . (TIME_NOW - 900) . ' AND user_id !=0 GROUP BY user_id) as t', 'total', 1);
     $guest = (int) ($total - $mem);
     $display->add("FOOTER_CONTENT", FOOTER_CONTENT);
     $display->add("is_admin", User::is_admin());
     $display->add("online", number_format($total, null, null, '.'));
     $display->add("mem", number_format($mem, null, null, '.'));
     $display->add("guest", number_format($guest, null, null, '.'));
     $display->add("site_hit", (int) User::$site_hit);
     $display->add("site_hit_day", (int) User::$site_hit_day);
     $display->output("Footer");
 }
开发者ID:duynhan07,项目名称:elink,代码行数:24,代码来源:footer.php

示例12: draw

 function draw()
 {
     global $display;
     $this->beginForm(false, 'post', false, Url::build_current());
     $name = trim(Url::get('name'));
     $order_by = Url::get('order_by', 'id');
     $order_dir = Url::get('order_dir', 'DESC');
     $cond = ' 1 ';
     if ($name != '') {
         $cond .= ' AND name LIKE "%' . $name . '%"';
     }
     $item_per_page = 50;
     $total_row = DB::fetch('SELECT count(*) AS total_row FROM `page` WHERE ' . $cond . ' LIMIT 0,1', 'total_row', 0);
     $items = array();
     $paging = '';
     if ($total_row) {
         $limit = '';
         require_once ROOT_PATH . 'core/ECPagging.php';
         $paging = ECPagging::pagingSE($limit, $total_row, $item_per_page, 10, 'page_no', true);
         $sql = 'SELECT  id ,name,title, description FROM  `page` WHERE ' . $cond . ' ORDER BY ' . $order_by . ' ' . $order_dir . ' ' . $limit;
         $re = DB::query($sql);
         if ($re) {
             while ($row = mysql_fetch_assoc($re)) {
                 $row['href'] = Url::build('edit_page', array('id' => $row['id']));
                 $items[$row['id']] = $row;
             }
         }
     }
     if ($order_dir == 'ASC') {
         $order_dir = 'DESC';
     } else {
         $order_dir = 'ASC';
     }
     $href_id = Url::build_current(array('order_by' => 'id', 'order_dir' => $order_dir));
     $href_name = Url::build_current(array('order_by' => 'name', 'order_dir' => $order_dir));
     $href_des = Url::build_current(array('order_by' => 'description', 'order_dir' => $order_dir));
     $href_title = Url::build_current(array('order_by' => 'title', 'order_dir' => $order_dir));
     $img_id = '';
     $img_name = '';
     $img_title = '';
     $img_des = '';
     if ($order_by == 'id') {
         $img_id = '<img src="style/images/admin/' . ($order_dir != 'DESC' ? 'down' : 'up') . 'arrow.png" alt="">';
     }
     if ($order_by == 'name') {
         $img_name = '<img src="style/images/admin/' . ($order_dir != 'DESC' ? 'down' : 'up') . 'arrow.png" alt="">';
     }
     if ($order_by == 'description') {
         $img_des = '<img src="style/images/admin/' . ($order_dir != 'DESC' ? 'down' : 'up') . 'arrow.png" alt="">';
     }
     if ($order_by == 'title') {
         $img_title = '<img src="style/images/admin/' . ($order_dir != 'DESC' ? 'down' : 'up') . 'arrow.png" alt="">';
     }
     $display->add('img_id', $img_id);
     $display->add('img_name', $img_name);
     $display->add('img_title', $img_title);
     $display->add('img_des', $img_des);
     $display->add('href_id', $href_id);
     $display->add('href_title', $href_title);
     $display->add('href_name', $href_name);
     $display->add('href_des', $href_des);
     $display->add('name', $name);
     $display->add('paging', $paging);
     $display->add('items', $items);
     $display->add('hover', EClassApi::mouse_hover('#E2F1DF', true));
     $display->output('list');
     $this->endForm();
 }
开发者ID:hqd276,项目名称:bigs,代码行数:68,代码来源:list.php

示例13: Send_pm

    static function Send_pm($sender_id, $sender_name, $receiver_user, $title, $content, $once_way = false, $ref_id = 0)
    {
        $num_send = 0;
        $new_row_msg = array('msg_date' => TIME_NOW, 'msg_post' => htmlspecialchars_decode($content), 'msg_author_id' => $sender_id, 'msg_author_name' => $sender_name, 'msg_ip_address' => AZLib::ip());
        // ***** CHÚ Ý *****
        // Newest = 0 - Mới nhất, = 1 - Cũ hơn (Do lỗi tạo giá trị mặc định trường này là 0, nên quy ước hơi bị ngược, để đỡ mất công chạy lệnh update database
        // ***** CHÚ Ý *****
        $msg_id = DB::insert('message_text', $new_row_msg);
        $inbox_ref_id = 0;
        if ($ref_id) {
            $msgText = DB::select('message_topics', 'mt_id = ' . $ref_id . ' AND mt_owner_id = ' . $sender_id);
            if ($msgText['mt_msg_id']) {
                // Kiểm tra xem người nhận còn tin nhắn gốc hay không
                $mtTopic = DB::select('message_topics', 'mt_msg_id = ' . $msgText['mt_msg_id'] . ' AND mt_id <> ' . $ref_id . ' AND mt_owner_id = ' . $receiver_user['id'] . ' AND mt_from_id <> ' . $receiver_user['id']);
                // Nế còn tin nhắn gốc
                if ($mtTopic['mt_id']) {
                    // Gán tin nhắn sắp gửi là tin nhắn mới nhất
                    // Lấy id tin nhắn gốc của người gửi làm ref_id cho tin nhắn sắp gửi
                    $inbox_ref_id = $mtTopic['mt_id'];
                }
            }
        }
        // Đặt cờ tin nhắn mới nhất (inbox) của các tin trong luồng của người nhận = 0
        if ($inbox_ref_id) {
            DB::query('UPDATE message_topics SET mt_newest = 1 WHERE mt_newest = 0 AND mt_vid_folder = \'inbox\' AND (mt_ref_id = ' . $inbox_ref_id . ' OR mt_id = ' . $inbox_ref_id . ') AND mt_owner_id = ' . $receiver_user["id"]);
        }
        // Đặt cờ tin nhắn mới nhất (sent) của các tin trong luồng của người gửi = 0
        if ($ref_id) {
            DB::query('UPDATE message_topics SET mt_newest = 1 WHERE mt_newest = 0 AND mt_vid_folder = \'sent\' AND (mt_ref_id = ' . $ref_id . ' OR mt_id = ' . $ref_id . ') AND mt_owner_id = ' . $sender_id);
        }
        $new_row_msg = array('mt_msg_id' => $msg_id, 'mt_date' => TIME_NOW, 'mt_title' => $title, 'mt_ref_id' => $inbox_ref_id, 'mt_newest' => 0, 'mt_to_name' => $receiver_user["user_name"], 'mt_read' => 0);
        $arrID = array($sender_id, $sender_name, $receiver_user["id"], $receiver_user["user_name"]);
        // Tạo tiêu đề tin nhắn mới
        $msg_id_inbox = AZLib::InserMessage($new_row_msg, $arrID, $status = 'inbox');
        if ($msg_id_inbox) {
            $num_send++;
            //insert vao bang feed
            $feed_sql = "(4,{$receiver_user['id']},{$msg_id_inbox},{$new_row_msg['mt_date']},{$sender_id},0)";
            $feed_sql = "INSERT INTO feed (`type`,`user_id`,`ref_id`,`time`,`act_user_id`,`item_id`) VALUES " . $feed_sql;
            DB::query($feed_sql);
        }
        if ($once_way == false) {
            $new_row_msg['mt_read'] = 1;
            $new_row_msg['mt_ref_id'] = $ref_id;
            $msg_id_sent = AZLib::InserMessage($new_row_msg, $arrID, $status = 'sent');
            $num_send++;
        } else {
            $msg_id_sent = true;
        }
        // Nếu tin được tạo mới là tin nhắn trả lời
        //if($inbox_ref_id)
        //{
        // Đặt cờ đã có tin nhắn trả lời cho tin nhắn gốc trong cả "inbox" và "sent"
        //DB::query('	UPDATE message_topics SET mt_has_reply = 1 WHERE mt_id = ' . $ref_id . ' AND mt_vid_folder = \'inbox\'');
        //	DB::query('	UPDATE message_topics SET mt_has_reply = 1 WHERE mt_id = ' . $inbox_ref_id);
        //}
        if ($msg_id_inbox && $msg_id_sent) {
            $count_pm = true;
            // Đối với tin trả lời, chỉ đếm những tin trả lời mới cho tin thuộc các luồng tin khác nhau
            if ($ref_id) {
                // Kiểm tra xem trong luồng tin hiện tại có tin trả lời nào chưa đọc hay không
                $re = DB::query('SELECT COUNT(*) AS unreadCount FROM message_topics
								WHERE mt_ref_id = ' . $ref_id . ' 
									AND mt_vid_folder = \'inbox\' AND mt_owner_id = ' . $receiver_user["id"] . '
									AND mt_read = 0');
                if ($re) {
                    $row = mysql_fetch_assoc($re);
                    // Nếu có thì không tính thêm tin này vào tổng pm
                    if ($row['unreadCount'] > 1) {
                        $count_pm = false;
                    }
                }
            }
            if ($count_pm) {
                DB::query('UPDATE user SET total_pm = total_pm + 1 WHERE id=' . $receiver_user["id"]);
            }
            User::getUser($receiver_user["id"], 0, 1);
            DB::query("UPDATE message_text SET msg_sent_to_count = {$num_send} WHERE msg_id = {$msg_id}");
            if ($receiver_user['email'] && $receiver_user['email_alert']) {
                $link = WEB_ROOT . Url::build('message');
                $content = trim(addslashes(AZLib::parseBBCode($title . ' - ' . $content, true)));
                AZLib::addCronJob('pm', $content, $receiver_user['id'], User::user_name(), '', 0, '', $link);
            }
            return true;
        } else {
            return false;
        }
    }
开发者ID:duynhan07,项目名称:elink,代码行数:88,代码来源:AZLib.php

示例14: draw_list

 function draw_list($region, $modules)
 {
     $i = 0;
     $last = false;
     if ($modules) {
         foreach ($modules as $key => $item) {
             if ($i) {
                 if ($i > 1) {
                     $last['move_up'] = '<a href="' . Url::build_current(array('cmd' => 'move', 'id' => $this->page['id'], 'block_id' => $last['id'], 'move' => 'up')) . '"><img src="style/images/admin/up_arrow_.gif" alt="Move up"></a>';
                     $last['move_top'] = '<a href="' . Url::build('edit_page', array('id' => $this->page['id'], 'block_id' => $last['id'], 'cmd' => 'move_top')) . '">MoveTop</a>';
                 }
                 $last['move_down'] = '<a href="' . Url::build('edit_page', array('cmd' => 'move', 'id' => $this->page['id'], 'block_id' => $last['id'], 'move' => 'down')) . '"><img src="style/images/admin/down_arrow_.gif" alt="Move down"></a>';
                 $last['move_bottom'] = '<a href="' . Url::build('edit_page', array('id' => $this->page['id'], 'block_id' => $last['id'], 'cmd' => 'move_bottom')) . '">MoveBottom</a>';
             }
             $i++;
             $last =& $modules[$key];
             $last['move_up'] = '';
             $last['move_down'] = '';
         }
         if ($i > 1) {
             $modules[$key]['move_up'] = '<a href="' . Url::build('edit_page', array('cmd' => 'move', 'id' => $this->page['id'], 'block_id' => $item['id'], 'move' => 'up')) . '"><img src="style/images/admin/up_arrow_.gif" alt="Move up"></a>';
             $modules[$key]['move_top'] = '<a href="' . Url::build('edit_page', array('id' => $this->page['id'], 'block_id' => $item['id'], 'cmd' => 'move_top')) . '">MoveTop</a>';
         }
     }
     global $display;
     $display->add('hover', EClassApi::mouse_hover('#CCCCCC', true));
     $display->add('id', $this->page['id']);
     $display->add('name', $region);
     $display->add('items', $modules);
     return $display->output('list_block', true);
 }
开发者ID:hqd276,项目名称:bigs,代码行数:31,代码来源:page_content.php

示例15: get_comment_thoitrang

 function get_comment_thoitrang($sql, $sub = 0)
 {
     global $user_id_arr, $stt, $item_per_page;
     //echo $sql;exit;
     $re = DB::query($sql);
     $items = array();
     $id_parent = '';
     while ($item = mysql_fetch_assoc($re)) {
         if ($sub == 0) {
             $stt++;
         }
         //	if($sub || ($sub == 0 && $stt<=$item_per_page)){
         //$item['created_time'] = EClassApi::duration_time($item['time']);
         $item['created_time'] = date('H:i | d.m.Y', $item['time']);
         if ($item['sender_user_id']) {
             $item['sender_link'] = Url::build('shop', array('user_name' => $item['sender_user_name']));
         } else {
             $item['sender_link'] = '';
         }
         if ($item['sender_user_id']) {
             $item['user_id'] = $item['sender_user_id'];
             if (!in_array($item['sender_user_id'], $user_id_arr)) {
                 $user_id_arr[$item['sender_user_id']] = $item['sender_user_id'];
             }
         } else {
             $item['user_id'] = 0;
             if ($item['id'] % 3 == 0) {
                 $item['sender_avatar_url'] = 'style/avatar/1.png';
             } elseif ($item['id'] % 3 == 1) {
                 $item['sender_avatar_url'] = 'style/avatar/2.png';
             } else {
                 $item['sender_avatar_url'] = 'style/avatar/3.png';
             }
             $html_content = '';
             $item['is_block'] = 0;
             $item['is_admin_mod'] = array();
         }
         $item['content'] = EClassApi::parseBBCode($item['content']);
         $item['URL_badcontent'] = Url::build('item_detail', array('id' => Url::get('id'), 'ctype' => 'comment', 'id_comment' => $item['id']));
         if ($sub) {
             $items['item'][$item['parent_id']][$item['id']] = $item;
         } else {
             if ($item['have_child'] > 0) {
                 $id_parent .= ($id_parent ? ',' : '') . $item['id'];
             }
             $items['item'][$item['id']] = $item;
         }
         $items['id_parent'] = $id_parent;
     }
     //}
     return $items;
 }
开发者ID:hqd276,项目名称:bigs,代码行数:52,代码来源:ajax_comment.ajax.php


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