How can I sort the content on my site by attribute: most viewed, most commented, most popular, best rating, etc?
Pretty basic question, I know... I just don't know how it's done.
I want to be able to sort out my co开发者_如何学编程ntent 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!
You need a CMS.. Of which there are 2 main routes you can go down:
- Build it yourself
- 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:
- tizag http://www.tizag.com
- 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...
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.
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
精彩评论