站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
Gallery:模块:imageblock
”
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
Firebrance
(
讨论
|
贡献
)
2008年8月18日 (一) 17:21的版本
(
差异
)
←上一版本
|
最后版本
(
差异
) |
下一版本→
(
差异
)
跳转至:
导航
、
搜索
警告:您正在编辑的是本页面的旧版本。
如果您发布该更改,该版本后的所有更改都会丢失。
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
=Image Block模块= 使得区块可用做外观主题显示随机/最近/访问量最高的图片或相册。 ==描述== 显示随机的图片或访问量最高的图片的突出,或从一堆其他图片区块类型中进行选择来在某特定相册或所有Gallery页面上显示。或者使用外部图片区块来在其他网站上显示这些图片。 ==特点== * 选择不同类型的图片区块(image block):随机图片,最近访问的图片,访问量最高的图片,随机相册高亮,最近访问的相册高亮,访问量最高的相册,每日图片(每日改变一次),每周图片(每周改变一次),每月图片(每月改变一次),每日相册高亮,每周相册高亮以及每月相册高亮 * 添加多个图片区块 * 为每个图片区块设置是否显示标题,日期,访问计数器 * 另外,如果在外观主题模板(theme.tpl,album.tpl,photo.tpl)中手动添加了区块或者你使用外部图片区块的话,就可以选择显示某个itemID所定义的特定项目 * 使用'''外部图片区块(external imageblock)'''在其他网站或你网站的其他页面上显示Gallery(随机)图片 * 限制给定id相册下Gallery子树的项目选择(仅对模板中或外部图片区块中手动添加的图片区块可用) * 为区块选择一个最大显示尺寸 * 显示全尺寸的图片 ==用法== * 如果需要的话在下载页面中下载此模块。G2的最小安装包及典型安装包中没有包括进此模块。 * 在''站点管理(site admin)'' -> ''模块(modules)''中安装并激活此模块。 * 在''站点管理(site admin)'' -> ''图片区块(Image Blocks)''中进行'''配置'''。 * 在''站点管理(site admin)'' -> ''外观主题(themes)'' -> ''matrix''(或其他某个激活或被使用的外观主题)的边栏中'''添加图片区块(Add image blocks)'''。 * 你可以单独地对每个图片区块进行配置:参见[[Gallery:How_To_Setup_Image_Blocks|如何安装图片区块(Image Blocks)]] * 现在你以及站点访问者就可以在所有相册或相片页面的边栏中看到'''图片区块(image blocks)'''了。 另见: * [[Gallery:GalleryEmbed:getImageBlock|如何在嵌入的G2中使用图片区块或将其作为外部图片区块的一个备用选择]] * [[Gallery:How_To_Use_The_External_Image_Block_When_url_fopen_Is_Disabled|在url_fopen禁用的情况下如何使用外部图片区块]] * [[Gallery:Themes:Reference:Blocks|如何在某个外观主题模板中手动添加一个图片区块(Image Block)]] == 外部选项 == 以下选项可用: <pre> blocks 竖直分隔线(|)分隔列表: randomImage, recentImage, viewedImage, randomAlbum, recentAlbum, viewedAlbum, dailyImage, weeklyImage, monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum, specificItem; default is randomImage show 竖直分隔线(|)分隔列表: title, date, views, owner, heading, fullSize, rawImage, none itemId 限制给定id相册下Gallery子树的项目选择; 或当使用specificItem区块类型时,对要显示的项目id进行限制 maxSize 将图片按比例扩大到最大尺寸。如果单独使用的话,Gallery将会定位尺寸设定最接近的 图片为定义数值 – 更大的图片则会在你的浏览器中根据需要按比例缩小。 如果与g2_show=fullSize一起定义的话,那么全尺寸的图片将总是被使用并根据需要按比例缩小。 exactSize 除了不会替换小于所选尺寸的图片之外,它跟g2_maxSize几乎是一样的, 因此你会获取最接近某特定尺寸的图片。注意如果更大的图片要在浏览器中按比例缩小的话, 将会占用很多带宽。 link Href为图片上的链接;无数值即为无链接;默认为链接到Gallery中的项目 linkTarget 添加一个链接目标(例如在新的浏览器窗口中打开链接) </pre> 有必要对maxSize和exactSize参量做一个阐述: * maxSize – 为外部图片区块定义maxSize参量试图智能化地确定尺寸最为合适的图片以填充区块。此特点的加入将帮助用户及管理者有效地降低带宽消耗,并返回与所请求尺寸''相近''的图片。之前(而目前已此方式定义时),maxSize的唯一用处就是与fullSize视图选项一起使用。返回了庞大尺寸的图片,但按maxSize所定义的尺寸被浏览器缩小了。现在maxSize参量可以单独使用了,无需再跟fullSize视图选项一起使用。 <pre> 示例图片: 100px 缩略图 500px 重设尺寸的图片 1024px 原始尺寸的图片 maxSize参量: maxSize=299 返回100px的缩略图,因为这是与 所请求的maxSize"最接近"的尺寸。(约199px,然而 500px的图片约为201px) maxSize=300 返回500px的重设尺寸图片,因为在这种情况下, 一个图片具有两种尺寸,而这两种尺寸都同等接近时 (都约为200px),那么其中稍大的尺寸将应质量需要被选中并返回 maxSize=800 返回1024px的原始尺寸图片 </pre> * exactSize - Just like maxSize except that the image returned will be guaranteed to be downsampled from the next larger size. This means that you'll never get back an image smaller than the dimensions you specify, except in the case where you specify a dimension larger than the original itself. <pre> 示例图片: 100px 缩略图 500px 重设尺寸的图片 1024px 原始尺寸的图片 exactSize参量: exactSize=299 返回500px的重设尺寸图片,因为这是 最接近的稍大尺寸图片。 exactSize=500 返回500px 的重设尺寸图片,因为这是 最符合的。 exactSize=800 (或更大)返回1024px的原始尺寸图片 </pre> NOTE: Until very recent versions of this module, the "exactSize" parameter did not exist and the "maxSize" parameter did not function as described above. I am not certain, but I _believe_ the documents above apply to version 1.0.11 (which works with Gallery 2.2 RC1) and not to the version of the module that comes with Gallery 2.1.2. == 举例 == 按水平方向显示图片。添加: .one-image { display: inline; } 到正在使用的外观主题的css。 ---- 在模板中以4x4格显示最近访问的图片,图片最大尺寸设定为50: {literal} <style> .one-image { display: inline; } .g2imageblock { width: 106px; } </style> {/literal} <pre> <div class="g2imageblock"> {g->block type="imageblock.ImageBlock" blocks="recentImage|recentImage|recentImage|recentImage" maxSize=50} </div> </pre> 如果你使用更大的maxSize的话,就对.g2imageblock css的宽度进行调整。 ---- ==权限,授权以及密码加密的项目== The image block module checks permissions first. This means that a user can only see albums or images in the image block for which he/she has sufficient authorization. If an album is password-protected using the [[Gallery:Modules:password|password]] module, items inside the album will not be shown in the image block (unless the user is the owner of the album). However, the ablum itself will be shown in the image block. Images or other items that are password-protected directly will also be shown in the image block with their thumbnails. If the user nagivates to one of these password-protected albums or items, he/she will be asked for a password. To exclude password-protected albums and items from the image block completely, the following coding needs to be added to the file gallery2/modules/imageblock/classes/ImageBlockHelper.class before this statement. list ($ret, $owner) = GalleryCoreApi::loadEntitiesById($item->getOwnerId()); Coding to be added: //check if the item is directly protected by a password. //in this case, do not show it in the image block, not even as a preview: if( $item->hasOnLoadHandler('Password') ){ continue; } ==被请求的特点== 目前尚无有关此模块的特点请求。 ==Bugs== 目前尚无有关此模块的已知问题。 [[Category:Gallery 2:Modules]]
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)