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


PHP Item::get_item_images方法代码示例

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


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

示例1: delete_images

 static function delete_images($id)
 {
     $row = DB::select('item_image', 'id=' . $id);
     if ($row) {
         if ($row['root_id']) {
             //Ảnh gốc
             DB::delete('item_image', 'root_id=' . $row['root_id']);
         } else {
             DB::delete('item_image', 'id=' . $id);
         }
         //update memcache IMG
         $sql = "SELECT item_id FROM item_image WHERE (id = {$id} OR root_id = {$id}) " . (User::have_permit(ADMIN_IMAGE) ? '' : " AND user_id=" . User::id());
         $re = DB::query($sql);
         if ($re) {
             $item = mysql_fetch_assoc($re);
             if ($item["item_id"]) {
                 require_once ROOT_PATH . 'core/Item.php';
                 Item::get_item_images($item["item_id"], 1);
             }
         }
         //update memcache IMG
         if ($row['img_url']) {
             if (DB::query("UPDATE item SET img_url='' WHERE img_url='" . $row['img_url'] . "'") && MEMCACHE_ON) {
                 $sql = "SELECT * FROM item WHERE img_url = '{$row['img_url']}'";
                 $re = DB::query($sql);
                 while ($item_memcache = mysql_fetch_assoc($re)) {
                     $item_memcache['img_server'] = 0;
                     $item_memcache['img_url'] = '';
                     AZMemcache::do_put("item:" . $item_memcache['id'], $item_memcache);
                 }
             }
             AZLib::ftp_image_delete_file($row['img_url'], $row['img_server']);
         }
     }
 }
开发者ID:duynhan07,项目名称:elink,代码行数:35,代码来源:ManageImage.php

示例2: ItemDetailForm

 function ItemDetailForm()
 {
     if (Item::$item['display']) {
         $this->user_info = User::getUser(Item::$item['user_id']);
         if (Item::$item['have_image']) {
             Item::$item['images'] = Item::get_item_images(Item::$item['id']);
             //Item::$item['max_path']	= AZLib::getImageThumbMax(Item::$item['img_url'],'',1,Item::$item['img_server']);
         } else {
             Item::$item['images'] = array();
         }
         CGlobal::$curCategory = Item::$item['category_id'];
         //get current category id from item
         Form::Form('ItemDetailForm');
         //$this->link_header("<script>MM_preloadImages('style/images/add_uncheck.gif','style/images/add_check.gif');</script>");
         $this->link_css('style/ItemDetail.css');
         $this->link_css('style/listItem.css');
         $this->link_css('style/aznet/jquery.lightbox.css');
         $this->link_js('javascript/enbac/item_detail.js');
         $this->link_js('javascript/jquery/jquery.ifixpng2.js');
         $this->link_js('javascript/jquery/lightbox/jquery.lightbox.js');
         $this->link_js('javascript/jquery/packed/jquery.jeditable.js');
         $this->link_js('javascript/jquery/packed/jquery.cookie.js');
         $this->link_js('javascript/enbac/bbcode.js');
         $this->link_js('javascript/ZeroClipboard.js');
         if (User::have_permit(ADMIN_ITEM)) {
             $this->link_css('style/admin.css');
             $this->link_js('javascript/enbac/items_list.js');
             $this->link_js('javascript/jquery/ui.datepicker.js');
             $this->link_css('style/aznet/ui.datepicker.css');
         }
     }
 }
开发者ID:duynhan07,项目名称:elink,代码行数:32,代码来源:ItemDetail.php

示例3: gallery_bulk_delete

 function gallery_bulk_delete()
 {
     //Xoá nhiều ảnh
     $arrIDs = explode(',', Url::get('ids'));
     $return = 'fail';
     if (count($arrIDs)) {
         foreach ($arrIDs as $imgID) {
             $image = DB::select('item_image', 'id=' . $imgID . (User::have_permit(ADMIN_IMAGE) ? '' : ' AND user_id=' . User::id()));
             if ($image) {
                 if ($image['img_url']) {
                     AZLib::ftp_image_delete_file($image['img_url'], $image['img_server']);
                     //Xoá ảnh gốc
                     //DB::query("UPDATE item SET img_url='' WHERE img_url='{$image['img_url']}' AND status IN(1,2) " . (User::have_permit(ADMIN_IMAGE) ? '' : ' AND user_id=' . User::id()));
                 }
                 //get Item_id
                 $sql = "SELECT item_id FROM item_image WHERE (id = {$imgID} OR root_id = {$imgID}) " . (User::have_permit(ADMIN_IMAGE) ? '' : " AND user_id=" . User::id());
                 $re = DB::query($sql);
                 if ($re) {
                     $item = mysql_fetch_assoc($re);
                     if ($item["item_id"]) {
                         require_once ROOT_PATH . 'core/Item.php';
                         Item::get_item_images($item["item_id"], 1);
                     }
                 }
                 DB::delete('item_image', '(id=' . $imgID . ' OR root_id=' . $imgID . ')' . (User::have_permit(ADMIN_IMAGE) ? '' : ' AND user_id=' . User::id()));
                 $return = 'success';
             }
         }
     }
     echo $return;
     exit;
 }
开发者ID:duynhan07,项目名称:elink,代码行数:32,代码来源:ajax_upload.ajax.php

示例4: mark_sold

 function mark_sold()
 {
     if (!User::is_login()) {
         echo "not_login";
         exit;
     }
     if (User::is_block()) {
         echo "no_perm";
         exit;
     }
     $img_id = (int) Url::get('img_id');
     $sold = (int) Url::get('sold');
     if ($img_id) {
         $item_image = DB::select("item_image", "id={$img_id}");
         if ($item_image && $item_image['item_id'] && ($item_image['user_id'] == User::id() || User::is_admin())) {
             $item = Item::get_item($item_image['item_id']);
             if ($item && $item['status'] == 1 && $item['state'] == 0) {
                 if ($sold && $item_image['sold'] == 0) {
                     DB::update("item_image", array('sold' => 1), "id={$img_id}");
                 } elseif ($sold == 0 && $item_image['sold'] == 1) {
                     DB::update("item_image", array('sold' => 0), "id={$img_id}");
                 }
                 //update memcache IMG
                 $sql = "SELECT item_id FROM item_image WHERE (id = {$img_id} OR root_id = {$img_id}) " . (User::have_permit(ADMIN_IMAGE) ? '' : " AND user_id=" . User::id());
                 $re = DB::query($sql);
                 if ($re) {
                     $item = mysql_fetch_assoc($re);
                     if ($item["item_id"]) {
                         require_once ROOT_PATH . 'core/Item.php';
                         Item::get_item_images($item["item_id"], 1);
                     }
                 }
                 echo "success";
                 exit;
             }
         }
     } else {
         echo "no_perm";
         exit;
     }
     echo "unsuccess";
     exit;
 }
开发者ID:hqd276,项目名称:bigs,代码行数:43,代码来源:ajax_item.ajax.php

示例5: on_submit


//.........这里部分代码省略.........
                             $item_insert_temp_images[$img['id']]['time'] = $img['time'];
                             $item_insert_images[] = $item_insert_temp_images[$img['id']];
                         }
                         $item_images[$img['id']]['time'] = $img['time'];
                         $item_images[$img['id']]['img_url'] = $img['img_url'];
                         if ($img['item_id']) {
                             //Đã có item_id rồi, đúp bản ghi
                             $image = $item_images[$img['id']];
                             if ($img['root_id']) {
                                 $image['root_id'] = $img['root_id'];
                             } else {
                                 $image['root_id'] = $img['id'];
                             }
                             $item_insert_images[] = $image;
                         } else {
                             //Chưa có item_id, cập nhật
                             $img['item_id'] = $id;
                             $item_update_images[$img['id']] = $item_images[$img['id']];
                         }
                     }
                 }
             }
         }
         if ($item_insert_images) {
             $inser_sql = '';
             foreach ($item_insert_images as $item_image) {
                 $inser_sql .= ($inser_sql ? "," : "") . "\r\n\t\t\t\t\t\t('" . addslashes($item_image['title']) . "',\r\n\t\t\t\t\t\t'" . $item_image['position'] . "','" . $item_image['item_id'] . "','" . $item_image['img_server'] . "','" . $item_image['img_url'] . "','" . $item_image['root_id'] . "',\r\n\t\t\t\t\t\t'" . $item_image['time'] . "','" . $item_image['user_id'] . "','" . $item_image['user_name'] . "')";
             }
             $inser_sql = "INSERT INTO `item_image` (`title`,`position`,`item_id`,`img_server`,`img_url`,`root_id`,`time`,`user_id`,`user_name`) \r\n\t\t\t\t\t\t\tVALUES " . $inser_sql;
             DB::query($inser_sql);
         }
         if ($item_update_images) {
             foreach ($item_update_images as $img_id => $item_image) {
                 if (!DB::update('item_image', $item_image, 'id=' . $img_id)) {
                     $image_err = true;
                 }
             }
         }
         //if($item_delete_ids && !DB::delete('item_image','id IN('.$item_delete_ids.') AND user_id='.$this->item['user_id'].' AND root_id!=0')){
         if ($item_delete_ids && !DB::delete('item_image', 'id IN(' . $item_delete_ids . ') AND root_id!=0')) {
             $image_err = true;
         }
         if ($unused_ids && !DB::update('item_image', array('item_id' => '0', 'title' => '', 'position' => '0'), 'id IN(' . $unused_ids . ') AND user_id=' . $this->item['user_id'] . ' AND root_id=0')) {
             $image_err = true;
         }
         //$main_img = DB::select('item_image','item_id='.$id.' AND user_id='.$this->item['user_id'].' ORDER BY position ASC');
         $main_img = DB::select('item_image', 'item_id=' . $id . ' ORDER BY position ASC');
         if ($main_img) {
             $img_url = $main_img['img_url'];
             $i_server = $main_img['img_server'];
         } else {
             $img_url = '';
             $i_server = 0;
         }
         if ($item_insert_images || $item_update_images || $item_delete_ids || $unused_ids) {
             Item::get_item_images($id, 1);
         }
         //tuannk 2010.07.26
         //end tuannk 2010.07.26
         /*if($this->img_url == '' && $img_url !='' )
         		{
         			DB::update('item',array( 'img_server'=>$i_server, 'img_url'=>$img_url,'have_image'=>1),'id='.$id);
         		}
         		elseif($item_have_image){
         			DB::update('item',array( 'have_image'=>1),'id='.$id);
         		}*/
         ##############################################################################
         #Filters
         $filters = Url::get('filter');
         $filter_search = "";
         $filter_ids = "";
         foreach ($filters as $fgid => $fils) {
             foreach ($fils as $fid) {
                 $filter_search .= ($filter_search != '' ? " " : '') . "g{$fgid}f{$fid}f";
                 $filter_ids .= ($filter_ids != '' ? "," : '') . $fid;
             }
         }
         #Filters
         ##############################################################################
         $item_array['filter_search'] = $filter_search;
         $item_array['filter_ids'] = $filter_ids;
         if ($this->img_url == '' && $img_url != '') {
             $item_array['img_server'] = $i_server;
             $item_array['img_url'] = $img_url;
             $item_array['have_image'] = 1;
         } elseif ($item_have_image) {
             $item_array['have_image'] = 1;
         }
         //DB::update('item',array( 'have_image'=>1),'id='.$id);
         DB::update('item', $item_array, 'id=' . $id);
         if (MEMCACHE_ON) {
             AZMemcache::do_remove("item:{$id}");
         }
         if (Url::get('ref')) {
             Url::redirect("manage_item");
         } else {
             Url::redirect("item_detail", array("id" => $id));
         }
     }
 }
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:EditItemForm.php

示例6: insert_sub_image_payment

 function insert_sub_image_payment()
 {
     $img_id = Url::get('image_id');
     $code_emb = Url::get('url_data');
     $main_item_id = Url::get('main_item_id');
     $embed_index = Url::get('embed_index');
     if (empty($code_emb) || $code_emb == "undefined") {
         $code_emb = "";
         DB::query("UPDATE `item_image` SET des = '' WHERE id={$img_id}");
     } else {
         if (strlen(strstr($code_emb, '<a href="https://sohapay.com')) > 0 && strlen(strstr($code_emb, '<img')) > 0) {
             $str_start = strpos($code_emb, '<a href="https://sohapay.com');
             $main_str = substr($code_emb, $str_start);
             $sub_str = split("</a>", $main_str);
             $code_emb = $sub_str[0] . "</a>";
             $patt = '<a href="https://sohapay.com';
             $res = DB::select('item_image', "id={$img_id}");
             $str = split($patt, $res['des']);
             $des_new = $str[0] . $code_emb;
             DB::query("UPDATE `item_image` SET des = '" . $des_new . "' WHERE id={$img_id}");
             /* $item_memcache['reply_count']=1000;
                if (MEMCACHE_ON) {
                    eb_memcache::do_put("item:$main_item_id", $item_memcache);
                    echo "ngannv";
                }*/
         } else {
             DB::query("UPDATE `item_image` SET des = '' WHERE id={$img_id}");
         }
     }
     Item::$item['id'] = $main_item_id;
     Item::get_item_images($main_item_id, 1);
 }
开发者ID:hqd276,项目名称:bigs,代码行数:32,代码来源:ajax_user.ajax.php


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