• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Most Popular Documents - How to implement ?

New Here ,
May 16, 2007 May 16, 2007

Copy link to clipboard

Copied

Hi

I have a database table used to store document details

e.g.

DOCID
DOCDATE
DOCTITLE
DOCSUMMARY
DOCPATH (which contains the document filename)

I would like to add the functionality of showing which documents are the most popular, so I plan to add a

DOCCOUNT field to the table, to count the number of times the document is viewed/clicked on from the document listing pages.

How can I achieve this, is it possible ? ?
TOPICS
Advanced techniques

Views

332

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 16, 2007 May 16, 2007

Copy link to clipboard

Copied


one possible way:

make a page, i.e. viewdoc.cfm, which will:
a) run a query to increment the DOCCOUNT field by one for a document
based on url/form var (i.e. url.docid) passed to the page
b) get docpath from db
c) cflocate user to actual docpath (or serve up the requested doc any
other way)

all links to docs in your website should be changed to something like
viewdoc.cfm?docid=#docid#

--
Azadi Saryev
Sabai-dee.com
Vientiane, Laos
http://www.sabai-dee.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 16, 2007 May 16, 2007

Copy link to clipboard

Copied

LATEST
If it were me, and it's not, I'd create a table with fields document_id, timestamp, and at least one other field, maybe the ip address. Every time a document is viewed, I'd add a record.

This approach will enable you to do things like Most Popular This Week, This month, etc

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation