TShopping

 找回密碼
 註冊
搜索
查看: 3123|回復: 1
打印 上一主題 下一主題

小插件, 首頁加入ss 最新相冊

  [複製鏈接]
跳轉到指定樓層
1#
發表於 2008-5-19 00:48:56 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
 
Push to Facebook
插件名: 首頁加入SS最新相冊
製作人: Toufu @ WiWet.com
演示: http://www.wiwet.com

打開include/cache.func.php

  1. array('announcements', 'onlinelist', 'forumlinks', 'advs_index', 'supe_updateusers', 'supe_updateitems', 'tags_index'),
複製代碼
在 'tags_index' 前加入
  1. 'supe_image_index',
複製代碼
  1. if(!in_array($cachename, array('secqaa', 'supe_updateusers', 'supe_updateitems', 'supe_updatecircles'
複製代碼
在後'supe_updatecircles' 後面加入
  1. , 'supe_image_index'
複製代碼
  1. case 'supe_updateitems':
  2.                         global $supe;
複製代碼
在之上加入
//****************首頁顯示最新相冊***************************
//WiWet.com Toufu製作

                case 'supe_image_index':
                        global $supe;
                        supe_dbconnect();
                        $limit = 10;
                        $conditions = 'WHERE tblITEM.folder=1 AND tblITEM.type=\'image\' AND tblITEM.itemid=tblIMG.itemid';
                        $query = $supe['db']->query("SELECT tblITEM.itemid, tblITEM.username, tblITEM.subject, tblIMG.image, tblIMG.imagenum FROM {$supe[tablepre]}spaceitems tblITEM, {$supe[tablepre]}spaceimages tblIMG $conditions ORDER BY dateline DESC LIMIT $limit", 'SILENT');
                        $additem = '';
                        $items = array();
                        while($item = $supe['db']->fetch_array($query))
                                {
                                        $imgsrc = '<img src="http://www.tshopping.com.tw/attachments/'.$item['image'].'" title="'.$item['subject'].' ('.$item['imagenum'].'張) - '.$item['username'].'" width="160" height="120" >';
                                        $items[] = '<em><a href="'.$supe['siteurl'].'?action/viewspace/itemid/'.$item['itemid'].'.html" target="_blank">'.$imgsrc.'</a></em> ';               
                                }


                        if($items)
                                {
                                        for($i = 0; $i < $limit; $i++)
                                                { $additem .=$items[$i];}
                                }
                                else
                                {
                                        $additem = 'SQL error, cannot select anything';
                                }
                                $data = $additem;

                        break;

//****************首頁顯示最新相冊***************************

當中
$limit = 10;                                         為顯示10個相冊
http://www.tshopping.com.tw/attachments/     請改為你的SS attachments 文件夾位置   
width="160" height="120"                    相冊的縮圖尺寸, 可改為任意尺寸, 刪除則為系統預設大小


開啟任何模版檔
加入
  1. <font style="FONT-SIZE: 10pt"><b>最新上傳相冊</b></font>

  2.                                 $_DCACHE[supe_image_index]
複製代碼
更新緩存
完成

 

臉書網友討論
2#
發表於 2011-12-23 01:10:01 | 只看該作者
樓上的稍等啦  

版主招募中

*滑块验证:
您需要登錄後才可以回帖 登錄 | 註冊 |

本版積分規則



Archiver|手機版|小黑屋|免責聲明|TShopping

GMT+8, 2024-4-23 20:59 , Processed in 0.046358 second(s), 19 queries .

本論壇言論純屬發表者個人意見,與 TShopping綜合論壇 立場無關 如有意見侵犯了您的權益 請寫信聯絡我們。

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表