Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorlament
    • CommentTimeAug 20th 2005 edited
     # 1
    Category Vanilla Started by mark Comments 3 Last comment by lech Last Active 1 day ago new 1 views 955


    how much load on the server would it be to add the number of views a thread has?
  1.  # 2
    unless there's some way of incrementing a field value when you run a SELECT query on the database; i'd assume you have to run an UPDATE query whenever someone views a thread. In which case it would put quite a lot of load onto the server as it would increase the number of queries run on each thread viewing by 50%.
    I think.
    • CommentAuthordknowles
    • CommentTimeAug 20th 2005 edited
     # 3
    number of views total or number of views from yourself?

    either should be easy, but the total number of views won't include people who aren't logged in, of course.


    select count(LastViewed),DiscussionID from LUM_UserDiscussionWatch where DiscussionID='$DiscussionID' group by DiscussionID;


    that should take care of the sql.
    •  
      CommentAuthorDaniel
    • CommentTimeJan 18th 2006
     # 4
    dknowles, I don't allow to view the forum by unregistred users and I don't care about the server load (I have only 10-20 users and a root-server)

    What I want is to show the views per topic, a la
    "Category Random Started by minisweeper Comments 3 Last comment by Bergamot Last Active 30 minutes ago total views 112"

    I'm not good on sql or php (just basic understanding and editing) and really like to integrate this feature (a bit of control is sometimes not the worst thing ;-) )
    Would be great if you could assist (well, okay, you would do the mainpart and I'll assist you...) me in doing this!

    Thank you very much!
    •  
      CommentAuthorBergamot
    • CommentTimeJan 18th 2006 edited
     # 5
    Maybe I'm missing the point, but why not just:

    select count(LastViewed) from LUM_UserDiscussionWatch where DiscussionID='$DiscussionID';
    I mean, if you already know what DiscussionID is, why return it and group by it?
    •  
      CommentAuthorDaniel
    • CommentTimeJan 19th 2006
     # 6
    That wasn't for me I think...any advice for me?
    •  
      CommentAuthorDaniel
    • CommentTimeJan 23rd 2006
     # 7
    *bump* :-(
    •  
      CommentAuthorMark
    • CommentTimeJan 23rd 2006
     # 8
    I actually don't record "times-viewed". The UserDiscussionWatch table is used to record how many comments within a discussion a user has read - this allows for the "X New" text on the discussion list. When a user clicks into a thread, the record is updated - I don't insert a new one.

    So, this would require a whole new extension with a whole new table.
Add your comments
    Username Password
  • Format comments as