【发布时间】:2011-05-02 08:27:30
【问题描述】:
我一直在我的博客上集思广益,讨论如何实现这一点,这是在我几个月前工作的另一个博客中完成的。
当您被重定向到博客图库中 jpg 图片的直接 URL - 例如此屏幕截图:http://www.gamesteady.com/gallery/half-life-2/half-life-2-screenshots_30.jpg 时,它会自动将图片插入以下 php 文档:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<title> title... </title>
<img src="http://www.gamesteady.com/img/.jpg" border="0" alt=" image" width="100%" style="display:block;" />
<h3>
<a href="http://www.gamesteady.com/pictures/">Back to gallery </a> <span style="font-size: 12px;">or</span> <a href="/img_downloader.php?show_image=.jpg" title="Download picture">Download picture of image</a>
</h3>
</body>
</html>
即使您输入http://gamesteady.com/gallery/ashdasudh913h.jpg - 它也会启动相同的文档。这是用.htaccess 完成的吗?我一直在网上搜索类似的方法,但找不到或理解任何方法。
非常感谢您在这方面的帮助,因为我长期以来一直在寻找一种方法来做到这一点。我还在学习 php/css 和 wordpress,但我真的很想在我的博客中使用这个功能。
【问题讨论】: