使用 lytebox 和 php 显示画廊的好解决方案

发布于 2024-10-09 09:01:16 字数 684 浏览 7 评论 0原文

我对在我编写的网站解决方案上加载图像的问题思考了一段时间(为了乐趣和体验)

使用的编程语言PHPMYSQL 作为数据库语言 它也使用javascript,但并不广泛。

我最近意识到,我编写的引擎虽然有它的智能解决方案,但也带有很多缺陷和冗余代码。因此,我决定制作一个新的项目,现在融入我所知道的内容,但在我开始上一个项目时没有这样做。

对于新系统,将有一个选项可以将画廊添加到站点并向其上传图像。我之前使用过 javascript 图像查看器 Lytebox。屏幕变暗,出现一张图像,并带有“上一张”和“下一张”按钮以查看其他图像。

问题是我使用带有 lytebox 的组和图像本身,调整大小为拇指。这会导致 lytebox 仅在所有图像加载完毕后才工作。如果您在此之前单击链接,则会显示图像,就像您右键单击并选择“显示图像”一样。

有关这些图像的信息是使用 while 语句从数据库中解析的,计数器的范围从 0 到 sizeof()

我是认为将图像作为拇指可能不是一个好主意,即使您限制上传大小。同样,在上传时添加拇指似乎也很麻烦。如果拇指在满载之前不出现,那就很实用了。

有没有人有什么好的建议。任何帮助将不胜感激。

约翰

I have thought for a while over an issue with the loading of images on a website-solution that I have programmed (For fun and the experience)

The programming language used is PHP with MYSQL as the database language
It also uses javascript, but not extensively

I have recently realized that the engine I programmed, while it has it's smart solutions also carry a lot of flaws and redundant code. I have therefore decided to make a new one, now incorporating what I know, but didn't when I started the previous project.

For the new system, there will be an option to add galleries to a site, and upload images to it. I have used the javascript image viewer Lytebox before. The screen goes dark and an image appears with a "Previous" and "next" button to view the other images.

The problem is that I used groups with lytebox and the images themselves, resized as thumbs. This causes lytebox to work only when all the images have loaded. If you click a link before that, the image is shown as if you right click and choose "Show image"

Information about these images is parsed from a database using a while statement with a counter that goes from 0 to sizeof()

I'm thinking it probably isn't a good idea to have the images as the thumbs, even if you restrict the upload size. Likewise, adding thumbs at upload also seems like a hassle. It would be practical if the thumbs didn't show up before they were fully loaded.

Has anyone got any good tips. Any help would be appreciated.

Johann

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

稚气少女 2024-10-16 09:01:16

并不真地。我想知道的是创建一个允许您上传图像的页面时应该走什么路线。当用户上传文件时,其他系统通常会创建拇指文件吗?有没有一种方法可以在服务器上将图像显示为拇指,而不需要加载整个图像?

同样可行的方法是让 lytebox 弹出,带有白色框架并“等待”图像。基本上除了作为常规链接打开图像之外的所有内容。

我以前在这里有过一个帐户,好像被重置了或者什么的。尝试使用两个 google open-ids 登录。不允许我评论你的评论,所以我不得不以艰难的方式回答我自己的帖子:|

Not really. What I would like to know is what route to go when creating a page that lets you upload images. Does other systems usually create thumbs-files when a user uploads a file? Is there a way to display images on the server as thumbs that doesn't require you to load the entire image?

What would also work would be to get lytebox to pop up, with a white frame and "wait" for the image. Basically everything else than opening the image as a regular link.

I had an account here before, seems like it has been reset or something. Tried logging on with both google open-ids. Wouldn't let me comment your comment so I had to do it the hard way and answer my own post :|

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文