创建一个3单元格表并从数组中填充它 [英] create a 3 cell table and populate it from an array

查看:96
本文介绍了创建一个3单元格表并从数组中填充它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All。

我正在尝试设置一个页面,显示给定年份每个月的月份图片。我想要3列拇指。任何给定年份可能没有图像或最多12张图像。图像位于不同的目录中,它们的位置/文件名/扩展名将从数组中提取。我对count和foreach函数不是很熟悉,但我认为可以使用这些函数的变体来完成。有什么想法吗?

谢谢

Hello All.
I am trying to set up a page that will display the ''picture of month'' for each month of a given year. I want 3 columns of thumbs. There may be no images or up to 12 images for any given year. The images are in different directories and their location /filename/extension will be extracted from an array. I am not very familiar with the count and foreach functions but I assume this can be done using a variation of those. Any thoughts?
Thanks

推荐答案

Hi Gater。欢迎来到TSDN!


一切皆有可能,尤其是像PHP一样灵活的语言:)


我不太确定是什么你想在这里做我理解你想要展示月度图片的部分,但我不明白你打算如何实现它。


你能解释一下吗?详细信息?

或许可以向我们展示代码示例?
Hi Gater. Welcome to TSDN!

Everything is possible, especially in a language as flexible as PHP :)

I''m not exactly sure what you trying to do here. I understand the part where you want to show a ''Picture of the month'', but I don''t understand how you intend to implement it.

Could you explain in more detail?
Perhaps show us code examples?



嗨Gater。欢迎来到TSDN!


一切皆有可能,尤其是像PHP一样灵活的语言:)


我不太确定是什么你想在这里做我理解你想要展示月度图片的部分,但我不明白你打算如何实现它。


你能解释一下吗?详细信息?

或许可以向我们展示代码示例?
Hi Gater. Welcome to TSDN!

Everything is possible, especially in a language as flexible as PHP :)

I''m not exactly sure what you trying to do here. I understand the part where you want to show a ''Picture of the month'', but I don''t understand how you intend to implement it.

Could you explain in more detail?
Perhaps show us code examples?



谢谢您的欢迎Atli!


我将照片保存在图库中,每个月都有文件夹。每个月都会选择一个图像作为月份的图片,并将该文件信息与描述,贡献者等一起输入到pom DB表中。然后可以激活该图像以显示在每个页面上。作为包含的侧栏栏中的站点。除非在其图库文件夹中,否则不会再显示已停用或前几个月的图片。一切正常。


我想创建一个页面来显示任何给定年份的所有pom。根据具体情况,可能有1张图片或最多12张图片。我喜欢脚本来确定页面上将显示多少图像,然后用正确数量的单元格创建和填充显示表格,并用图像填充它们。


代码如此远看起来像这样:

THanks for your welcome Atli!

I am keeping photos in a gallery, with folders for each month. Each month an image is selected as the Pic of the Month and that file information is entered into the pom DB table along with a description, the contributor etc. That image can then be ''activated'' to be displayed on each page of the site in a side bar column as an include. The ''deactivated'' or previous months pics are no longer shown except in their gallery folders. All that works fine.

I want to create a page to display all the pom s for a any given year. Depending on the circumstances there may be 1 image or up to twelve. I like the script to determine how many images will be displayed on the page and then create and populate the display table with the correct number of cells and populate them with the images.

Code so far looks like this:

展开 | 选择 | Wrap | 行号


再次嗨。


虽然我'考虑到你的问题,我对你的代码有一些注意事项。我认为你可能会觉得有些变化很有趣。

我已经接受了你的代码并进行了一些修改,添加了解释我所做的和为什么的评论。
Hi again.

While I''m considering your problem, I have a few notes on your code. A few changes I think you may find interesting.
I''ve taken your code and made a few modification, adding comments explaining what I did and why.
展开 | 选择 | Wrap | 行号


这篇关于创建一个3单元格表并从数组中填充它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆