Administering the Articles tableAlso, when an article is updated or a new one added, the process is a lot simpler. I just upload the file and then use my administration page to add the article into the database, change title, category, description, hits, etc. I could simplify this even further by adding upload capability to my administration form - then I could do (virtually) everything without an FTP program. Counting the hits to the articlesAs seen above, the Articles table contains the number of times each article is viewed. The code to increment this counter is in the IncrementArticleCounter( ) function in utils/Init.asp - as always, you can get the full source code and the database by clicking on the icon at the bottom of the page. The important part of the code to do that is shown below: // get the name of myself (the asp file)
var sPage = "" + Request.ServerVariables ( 'SCRIPT_NAME' );
// increment counter
oConnection.Execute( 'UPDATE Articles SET Hits=Hits+1 WHERE URL=\'' + sPage + '\';' );
|
So you get a new front page with articles listed by date, popularity and category, and I get to play with more and more fun ASP examples!  |