Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
I just updated from Version 7.3 to 7.5 to find the same problem I posted 1 year ago exists :-(

The "views" counters still do not work correctly.

as example a post can be read 100 times, the views counter for that post does not increase at all and only does so when a new post is written.

This means if your forum is mostly being read for it's content and little posting by others then the views counts make it appear that the system is never used and that posts have content no one has an interest in when in fact many had in fact read/viewed the content

So it appears since V7.3 this issue is not fixed,
yet is there are least now a work around ?

Thanks




JR
Team ZR-1 Corvette Racer's
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Right now it still has to be triggered by a new post. You could add the function call to a couple other scripts so it's rebuilt more often. For example, maybe when someone logs in. You could add the following right after the trigger_subscriptions() line:

Code
update_views_counter();

We will have this addressed in version8 as it will be inside our new cron system to auto update every so often.


Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
Thanks for the reply Rick

That would not work in my case as even though there is about 700 users with a login they seldom do and most visitors come via search engines

Most of my content is "techie" in detail and people come there to obtain the help information they need but rarely do the visitors post themselves

This means a post can be viewed 200 times but the view counter sits at zero, appearing as content had no value to the viewers

My forum gets about 100 visitors a day yet counters never update until I post and counters update but then again do not function until I post another new post.


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Well, you could also add that function call to maybe your showflat script. It's going to update quite a bit more often, whenever someone views a post, but since it's being updated often, it should impact performance much at all.

Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
Rick what file would I be editing for this ?

and exact code that should be added for that file ?


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
You'd want to edit scripts/showflat.inc.php and add:

update_views_counter();

You can add it around line 66 or so, right after:

if (!$mode) $mode = "showflat";


Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
How often would this cause an update as I added that line as shown below.
Then read a post 5 times and views count is still the same

if (!$mode) $mode = "showflat";

$show_all_posts = ($page == "all");
update_views_counter();

// Grab current page from session variable
$page_was_kludged = false;
if (!$page) {
$page = $_SESSION['currentpage'];
$page_was_kludged = true;


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
It should update whenever you look at a post. To see if it's actually doing anything, what you'd do is run the following query:

SQL Query
select * from ubbt_TOPIC_VIEWS

When it hasn't been updated, that will contain some rows, after it's been updated it should be empty, or maybe contain a couple rows at most.

Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
Rick I do not know where to do that query but code change was done 2 hours ago.
One post I have viewed 20 times over that time and the views count has not changed at all.

Also FYI, even of a existing post is edited, content changed and saved does not cause view counts to be updated.


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
You can run the query in the Database Tools area of the control panel. In there you'll see a SQL Command tab.

Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
OK I ran that command and the ID count goes up quite a bit but the views counter barely does, ie, read the same post 10 times,
views count only increased by 1

Went from one section to another, then would go back to the same section, read, go to another section and come back and the posts view count the same.
Did a page reload and counter still the same.


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
One thing to note, it's only going to count your visit to a thread 1 time for your session. If maybe you have another browser and you visit the topic while not logged in, you'll get the additional view, but as a single user testing, every view to the topic isn't going to get registered.

Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
Oh oo,

I had updated to V 7.5 today and in doing what you suggested I
clicked on LOGOUT and it says it is and then shows I am logged in again.

I clear browser cache when it closes, bring it up again, go to forum and I am still logged in

I tried it with IE 6 and also firefox 3.6 BETA and in both cases i cannot logout now ?

Never had this issue with V 7.3


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
First thing I'd do is check your sessions directory and make sure it's fully writable, possibly clear out any existing sessions while you're at it).

Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
Also I used the function to delete the cookie and still cannot logout even though system says it logging me out


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
where is that directory and you mean by manual FTP to that on server ?


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Yes, if you FTP into your site in your main UBB directory you'll see the sessions directory. Make sure that has full write permissions (and just to be safe, go inside of it and delete all files within).

Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
sessions directory on server is set at 755
and has over 120 files in it


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Ok, you want the sessions directory to be 777, and that's a pretty standard amount of files.

Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
opps I was looking at main ubb folder, sessions is set at 777 which is full write


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
deleted all session files and then went to forum and again clicking on logout, system says it is logging me out and then main page says I am still logged in and mus be because I can go right to admin functions


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Ok, in that case, just take a look inside the sessions directory and see how many files there are. There might be 100s, but shouldn't be thousands. Next, I'd take a look at your cookie path under Primary Settings -> Advanced Options. Normally that should just be /

You may need to manually delete the cookies from your browser. Especially if that's been changed at all, or if you've switched from normal to search engine friendly URLs recently.

Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
Odd

Yes the cookie folder is pointed to root as /

Went into browser and killed off all cookies to me domain and then went to forum and was NOT logged in

Logged in, fine
Logged right out and it did it correctly ??

Interesting is I used via "my stuff" cookies and had it delete from there but second later cookie was there again

Could this be something with Firfox 3.6 that is cause ?


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
So back to where I was,
even with session files deleted, cookie killed, session killed but logging in again the views count had not increased to what it was 4 hours ago .



JR
Team ZR-1 Corvette Racer's
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
What topic are you testing on? I went to your site, clicked on a few topics in your C3 forum, like "This should be illegal" and the view counter from 213 to 214. Went to your gallery forum and clicked on the "Crash em, Burn em, learn to drive em" and it went from 247, to 248.

Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
Rick I read this post 25 times today and the count is still at 8 which is what it was this AM

http://www.teamzr1.com/ubbthreads/ubbthreads.php?ubb=showflat&Number=3240#Post3240


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
It's at 10 now wink Forgot, that it's not going to count your own visits to the thread. It will only count others. And just an FYI, even if I read it 25 times in a row, it's not going to count 25 views. It tries to be a bit logical and only count actual visits by different users, per session.

Last edited by Rick; 01/01/2010 6:33 PM.
Joined: Jun 2007
Posts: 286
T
enthusiast
enthusiast
T Offline
Joined: Jun 2007
Posts: 286
OK I see the count on that post went up by 2 so the work around is doing something so my guess is that once a session is made and no matter if you unload the browser and then go back it still is same session and you can read the same post 1,000 times and it still seen as 1 read/session so

will have to wait until you have V8 with fixes for this

Thanks


JR
Team ZR-1 Corvette Racer's
Joined: Jun 2009
Posts: 40
newbie
newbie
Joined: Jun 2009
Posts: 40
I am having the same problem with my View count. Is the Coding still correct for me to apply: (

-------------

You'd want to edit scripts/showflat.inc.php and add:

update_views_counter();

You can add it around line 66 or so, right after:

if (!$mode) $mode = "showflat";


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (Ruben), 1,248 guests, and 268 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)