如何按属性对网站上的内容进行排序:观看次数最多、评论最多、最受欢迎、评分最高等?

发布于 2024-08-26 15:08:28 字数 236 浏览 12 评论 0原文

非常基本的问题,我知道......我只是不知道它是如何完成的。

我希望能够按照浏览次数最多、评论最多、最受欢迎、评分最高等方式对网站中的内容进行排序...但我不知道“排序依据”是如何工作的!

应该用哪种脚本语言编写? JavaScript? PHP?可以用XML来完成吗?

我必须设置像 MySQL 这样的数据库吗?有没有好的教程可以解释它?我需要了解其工作原理的确切过​​程。正如你所看到的,我真的需要指导!

Pretty basic question, I know... I just don't know how it's done.

I want to be able to sort out my content in my websites by most viewed, most commented, most popular, best rating, etc... But I don't know how "sort by" works!

Which scripting language should it be written in? JavaScript? PHP? Can it be done with XML?

Do I have to have a database set up like MySQL? Is there a good tutorial anywhere that explains it? I need to be taught the exact process of how it works. As you can see I really need direction!

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

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

发布评论

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

评论(3

转瞬即逝 2024-09-02 15:08:28

您需要一个 CMS.. 其中有 2 条主要路线可供选择:

  1. 自己构建
  2. 使用“现成”的 CMS,例如 Wordpress、Drupal,或带有 CMS 插件的论坛,例如 Simple Machines Forum(SMF - 以前的版本) YaBBSE 和 YaBB)

如果您选择自己制作,那么需要一个学习曲线。您可能需要学习一些 Javascript、大量 PHP,并准备好手动编写任何 HTML 代码。

这不是一件容易的事,但如果你想这样做,我建议:

  1. tizag http://www.tizag.com< /a>
  2. 谷歌“php 内容管理系统”并找到教程(例如 http://www.intranetjournal .com/php-cms/

我建议初学者使用 MySQL 而不是 XML,尽管您可以从 XML 文件中获得与 MySQL DB 几乎相同的基本功能(MySQL 有许多功能并且更好)总的来说,比 XML 好……但如果您只想将数据存储在平面文件中,则 XML 也可以)。

祝你好运,记住这是提问的地方...所以如果你选择学习 PHP 并且不明白为什么有些东西不起作用,或者不掌握一个概念...请给我们所有人喊一声: )

http://www.php.net <- 有用...

You need a CMS.. Of which there are 2 main routes you can go down:

  1. Build it yourself
  2. Use a 'ready made' CMS such as Wordpress, Drupal, or a Forum with a CMS plugin such as Simple Machines Forum (SMF - formerly YaBBSE and YaBB)

IF you are choosing to make it yourself then expect a learning curve. You will probably need to learn a bit of Javascript, a lot pf PHP and get ready to hand code any HTML.

It's not an easy task, but if you want to do it I would suggest:

  1. tizag http://www.tizag.com
  2. google 'php content management systems' and find a tutorial (e.g. http://www.intranetjournal.com/php-cms/)

I would recommend MySQL for starters instead of XML, though you can get nearly the same base functionality out of an XML file as a MySQL DB (MySQL has a number of functions and is better overall than XML... but XML will do if you just want to store data in a flat file).

Good luck, and remember this is the place to ask questions... So if you choose to learn PHP and don't understand why something isn't working, or don't grasp a concept... Give us all a shout :)

http://www.php.net <- useful...

樱&纷飞 2024-09-02 15:08:28

听起来您需要一个包含服务器端技术和内容管理系统的内容管理系统。一个数据库。对于初学者,我会推荐 Wordpress 或 Drupal 开始。它们都具有您提到的所有功能,并且在线社区非常出色。

Sounds like you need a Content Management System that incorporates both server-side technology & a database. For a beginner, I would recommend Wordpress or Drupal to get started. they both have all the features you mentioned baked in, and the online community is excellent.

倾其所爱 2024-09-02 15:08:28

作为一个初学者,我发现 youtube 是一个很大的帮助,如果没有它,当然还有这个网站,我会完全迷失方向。
我发现这个小伙子是最好的http://www.youtube.com/user/phpacademy< /a>

As very much a starter myself I have found youtube to be a great help I would have been completely lost without it, and of course this site.
I found this lad to be one of the best http://www.youtube.com/user/phpacademy

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