|
Joined: Jul 2003
Posts: 46
User
|
User
Joined: Jul 2003
Posts: 46 |
Hi guys, Rick suggested I put a request here so I can get a problem fixed. Just to make it easy here is the topic... http://www.ubbcentral.com/forums/ubbthreads.php/topics/216481/Topic_Views.html#Post216481In a nutshell I want topic views to increase every time someone clicks on a topic, whether it be the same person looking at the information twice or two different people. I hope this makes sense, if not please let me know. Thanks in advance.
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
Do you also want it to count if they go to a 2nd page from a topic?
That's a bit a of the problem if you really want to count every click, and not every new visit to the topic.
|
|
|
|
Joined: Jul 2003
Posts: 46
User
|
User
Joined: Jul 2003
Posts: 46 |
I don't think a click to a 2nd page is necessary. I have members that will come to the board, leave and come back. I don't care if they do it 20 times, but I want it to count as 20 topic hits. Instead of 1 because they didn't clear a cookie.
I hope that makes sense and thanks for the reply.
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
It actually makes it more difficult. You would need some mechanism that tracks if you just clicked to a new page in the topic, or visit the topic fresh.
I am thinking about the referrer variable to check for that.
You are running 7.1.1 and using spider friendly url's right?
Last edited by blaaskaak; 09/12/2008 2:50 AM.
|
|
|
|
Joined: Jul 2003
Posts: 46
User
|
User
Joined: Jul 2003
Posts: 46 |
If it makes it easier to count as a view by clicking to a 2nd or 3rd page that's fine.
I am using 7.1.1. and spider friendly. They like to visit the site.
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
ok. I'll do this coming wednesday, I have a day off then.
|
|
|
|
Joined: Jul 2003
Posts: 46
User
|
User
Joined: Jul 2003
Posts: 46 |
Blaaskaak thank you for doing this.  It is greatly appreciated.
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
You need to modify 2 files: find: /scripts/showthreaded.inc.php if ($_SESSION['current_topic'] != $main_topic_id) { $query = " insert into {$config['TABLE_PREFIX']}TOPIC_VIEWS (TOPIC_ID) values ( ? ) "; $dbh -> do_placeholder_query($query,array($main_topic_id),__LINE__,__FILE__); $_SESSION['current_topic'] = $main_topic_id; }
Replace with: $query = " insert into {$config['TABLE_PREFIX']}TOPIC_VIEWS (TOPIC_ID) values ( ? ) "; $dbh -> do_placeholder_query($query,array($main_topic_id),__LINE__,__FILE__); $_SESSION['current_topic'] = $main_topic_id;
/scripts/showflat.inc.php if ($_SESSION['current_topic'] != $current) { $query = " insert into {$config['TABLE_PREFIX']}TOPIC_VIEWS (TOPIC_ID) values ( ? ) "; $dbh -> do_placeholder_query($query,array($current),__LINE__,__FILE__); $_SESSION['current_topic'] = $current; }
Replace with: $query = " insert into {$config['TABLE_PREFIX']}TOPIC_VIEWS (TOPIC_ID) values ( ? ) "; $dbh -> do_placeholder_query($query,array($current),__LINE__,__FILE__); $_SESSION['current_topic'] = $current;
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
Hm, I would skip that hack for viewthreaded.php... Every message you read is a click. I don't know if you disabled threaded view, but if you didn't, I would stick with the default behavior of the script.
Please mind that it will still cache the view counter, it won't be updated until a post is made.
edit: I just saw the thread on ubbcentral, and it's the same as Rick suggested there. Don't know why it would stop with counting all together, I've tested it, and it works.
Last edited by blaaskaak; 09/18/2008 1:56 AM.
|
|
|
|
Joined: Jul 2003
Posts: 46
User
|
User
Joined: Jul 2003
Posts: 46 |
blaaskaak thanks, I haven't done anything yet. I have to find where these items are located to make the changes.
Just so I am perfectly clear, am I still doing both of them or just one. If one, is it the top or the bottom one.
Please advise as I am going to attempt to do this tomorrow evening if I can find what you are telling me to change.
Thanks again for all of your help.
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
/yourforum/scripts/showthreads.inc.php
that's the one you want to change. But it is the same change Rick asked you to do.
|
|
|
|
Joined: Jul 2003
Posts: 46
User
|
User
Joined: Jul 2003
Posts: 46 |
Ok now I am lost !!! So now do none of them?
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
well, do the one for showflat.inc.php
|
|
|
|
Joined: Jul 2003
Posts: 46
User
|
User
Joined: Jul 2003
Posts: 46 |
I did the top one.. Seems to have worked because the views are up. 
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|