如何使用gallery的随机图片,相信很多人敢兴趣.
再写一篇好文,期待加精。
Gallery在初始状态下是不提供很多组件的,比如我们今天教程中说明的随机图片,热门图片等
这里以Gallery中文版为例:
首先,安装你使用的gallery版本;
其次,
Plugins 中
Get More Plugins 获得
| 内容块 |
| | 模块名称 | 已安装 | 最新 | 描述 | 操作 |
| 图像功能块 | 1.1.0 | 1.1.0 | 随机,最近或最具人气照片或相册 |
因为下载安装不是我们的重点,都是很简单的鼠标操作!
安装好以后,在网站管理 功能区就会多出一个 图像功能块
进入后可以编辑.
调用方法:
方法一, 如果你是在相册内相应位置调用随机相片 热门相片等
你可以直接进去
网站管理 - 主题
中设置
调用的图片数 调用属性等
方法二. 如果你是在相册外面调用相册图片。
你需要使用
外部图片内容块 使用类似下面显示的PHP内容块以便在图库系统以外的PHP页面中显示图片内容块。
<?php@readfile('http://localhost/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title');?>
任何标记有*的参数被省略,将使用上面的网站默认定义值。
g2_blocks 使用管道符 '|' 分割选择列表:randomImage, recentImage, viewedImage, randomAlbum, recentAlbum, viewedAlbum, dailyImage, weeklyImage, monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum, specificItem
g2_show * 使用管道符 '|' 分割选择列表:title, date, views, owner, heading, fullSize;此值也可以是:无
g2_itemId 使用给出的ID限制在相册中的图库子目录项目选择;或当使用特定的项目内容块类型时设定可显示的项目ID。
g2_maxSize Scale images to this maximum size. If used alone Gallery will locate the most-closely-sized image to the specified value - larger images will be scaled down as necessary in your browser. If specified along with g2_show=fullSize the full size image will always be used and scaled down as necessary.
g2_exactSize Just like g2_maxSize except that it will not substitute an image smaller than the size you request, so you'll get the closest match in size possible. Note that this may use a lot more bandwidth if a much larger image has to be scaled down in your browser.
g2_link Href for link on image; value of none for no link; default is link to item in the Gallery
g2_linkTarget 添加链接目标(例如:在新的浏览器窗口打开链接)
任何标记有*的参数被省略,将使用上面的网站默认定义值。
进行调用! 具体使用方法,如果有朋友需要,可以和我联系!
使用经验:
当你在使用gallery,调用随机图片时候,默认的模块属性是没有css控制的。
你需要自己编写!
图片模块路径 modules\imageblock
大家可以自己摸索更多精彩! Gallery还是相当不错的!
[
本帖最后由 baidu 于 2008-6-12 14:38 编辑 ]