简单的 PHP 脚本在文本文件(数组)中排列文件链接
我正在尝试编写一个简单的基于网络/文本的文件编辑器,该编辑器具有网络服务器上文件链接的类别,并且这些类别还具有上传后的旧文件的存档。
很简单,但例如在文件管理中的“动物”类别中,我想重新排序猫狗猪鸟,上下移动单个项目...如何在数组内上下移动项目?
如果有人已经有了现成解决方案的想法,我会将我的想法粘贴在这里:
网页上的一个类别如下所示:
动物:
- 猫(链接:/files/cats.jpg)
- 狗(链接:/files/dogs.jpg)
- 猪(链接:/files/pigs.jpg)
- 鸟类(链接:/files/birds.jpg)
存档:
- 老猫(链接:/files/oldercats.jpg)
- 老狗(链接:/files/olderdogs.jpg)
- 老猪(链接:/files/olderpigs.jpg)
- 老鸟(链接:/files/olderbirds.jpg)
类别保存在服务器上的单个文本文件中(Animals.db)。存档文件是一个单独的文本文件(Animals-archive.db)。用户可以创建和删除类别。
Im trying to code a simple web/text based file editor that has categories for links to a files on webserver and these categories also have archives for older files once uploaded.
Simple to do but for example inside "Animals" category in the file management I want to reorder cats dogs pigs birds, move single item up and down... how can I move items up and down inside an array?
If someone already has an idea for ready made solution, I paste my idea here:
One catergory on a web page looks like this:
Animals:
- Cats (link: /files/cats.jpg)
- Dogs (link: /files/dogs.jpg)
- Pigs (link: /files/pigs.jpg)
- Birds (link: /files/birds.jpg)
Archive:
- Older Cats (link: /files/oldercats.jpg)
- Older Dogs (link: /files/olderdogs.jpg)
- Older Pigs (link: /files/olderpigs.jpg)
- Older Birds (link: /files/olderbirds.jpg)
Category is saved on a single text file on a server (Animals.db) . Archive file is a separate text file (Animals-archive.db). User is able to create and delete categories.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我推荐 jQuery 的 UI Sortable:
http://jqueryui.com/demos/sortable/
I recommend jQuery's UI Sortable:
http://jqueryui.com/demos/sortable/