News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Topic View Log

Started by live627, July 16, 2015, 09:15:43 AM

Previous topic - Next topic

live627

[url=https://custom.simplemachines.org/index.php?mod=4060]Link to the mod[/url]

This is a fork of the original mod by [url="http://www.simplemachines.org/community/index.php?action=profile;u=118168"][SiNaN][/url] - http://www.simplemachines.org/community/index.php?topic=251656.msg1629997#msg1629997

Changes:

  • 1.1.x support removed
  • Hits are no longer grouped by member

https://github.com/live627/smf-topic-view-log [center][url="http://creativecommons.org/licenses/by-nc-sa/3.0/"][img]http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png[/img][/url][/center]


Shambles

QuoteHits are no longer grouped by member

Isn't that a reduction in functionality? In the absence of screenshots, does this mean each topic 'hit' generates a separate output line in the topic view?

live627

QuoteIn the absence of screenshots, does this mean each topic 'hit' generates a separate output line in the topic view?
Yes

Shambles

Okidoki.

In my mind, that's a backwards step.

madturnip

Everytime I go to topic view all I see is ME who has viewed it.  Is there something I am doing wrong as the installation never said there were any errors?

Gryzor

Is this supposed to have its own settings page in the Admin area? I can't find anything... thanks!

Shambles

If it's a faithful fork, it'll have permissions settings:


Gryzor

Oh, it's in permissions. Right, I was looking around in he Admin area settings for a mod section... Thanks!

mikedijital

Everything installed great but i noticed no text in the permissions area. can anyone help?

mikedijital

I figured it out this

$txt['permissionname_tvl_view'] = 'View topic view log';
$txt['permissionhelp_tvl_view'] = 'This permission allows users to view the topic view log.';
$txt['permissionname_tvl_view_own'] = 'Own topic';
$txt['permissionname_tvl_view_any'] = 'Any topic';
$txt['permissionname_simple_tvl_view_own'] = 'View own topic view log';
$txt['permissionname_simple_tvl_view_any'] = 'View any topic view log';


needs to be added anywhere in themes/default/languages/managepermissions.english.php

im not quite sure why its not done as part of the install .. i had no errors during install.   

SMF 2.0.11

runningtrades

Quote from: madturnip on July 19, 2015, 06:55:49 PM
Everytime I go to topic view all I see is ME who has viewed it.  Is there something I am doing wrong as the installation never said there were any errors?

i am having the same issue after installing the mod. I can not find the permissions for the mod either....


runningtrades

Quote from: Shambles on October 11, 2016, 02:36:29 PM
http://www.simplemachines.org/community/index.php?topic=538187.msg3829305#msg3829305

found it...had to add the code to both english language files....

still only showing me in the log files though...not showing other member's who have viewed the topic

runningtrades

it seems it will only log the last user...not multiple users who viewed the log

runningtrades

Quote from: runningtrades on October 12, 2016, 03:40:20 PM
it seems it will only log the last user...not multiple users who viewed the log

any solutions? I can now see multiple pages, but only one user name on the first page, after that, all of the other pages are blank...

aegersz

Quote from: mikedijital on September 30, 2015, 09:29:39 PM
I figured it out this

$txt['permissionname_tvl_view'] = 'View topic view log';
$txt['permissionhelp_tvl_view'] = 'This permission allows users to view the topic view log.';
$txt['permissionname_tvl_view_own'] = 'Own topic';
$txt['permissionname_tvl_view_any'] = 'Any topic';
$txt['permissionname_simple_tvl_view_own'] = 'View own topic view log';
$txt['permissionname_simple_tvl_view_any'] = 'View any topic view log';


needs to be added anywhere in themes/default/languages/managepermissions.english.php

im not quite sure why its not done as part of the install .. i had no errors during install.   

SMF 2.0.11

thanks, that worked.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

#16
Quote from: runningtrades on October 12, 2016, 03:40:20 PM
it seems it will only log the last user...not multiple users who viewed the log

same here (at 2.0.11), only shows one viewer. The database entries are OK as i see multiple enties for the individual topics.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

... (continued from above) I have been trying to debug the code by dumping variables but they all look good.

something is stopping the list from populating but my php debugging skills are basic ... at least i tried.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

#18
check the following SQL statement as ONLY 1 row is returned (if it's correct then maybe it should be called for each row that contains the topic number):

                SELECT
                        mem.id_member, mem.member_name, mem.real_name, mg.group_name,
                        tvl.time, COUNT(m.id_msg) AS topic_posts
                FROM {db_prefix}log_topic_view AS tvl
                        LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = tvl.id_member)
                        LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = CASE WHEN mem.id_group = {int:regular_id_group} THEN mem.id_post_group ELS$
                        LEFT JOIN {db_prefix}messages AS m ON (m.id_member = mem.id_member AND m.id_topic = tvl.id_topic)
                WHERE tvl.id_topic = {int:topic}
                ORDER BY {raw:sort}
                LIMIT {int:start}, {int:per_page}',
                array(
                        'sort' => $sort,
                        'start' => $start,
                        'per_page' => $items_per_page,
                        'topic' => $topic,
                        'regular_id_group' => 0,
                )

The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

runningtrades

Quote from: aegersz on October 19, 2016, 08:03:58 AM
check the following SQL statement as ONLY 1 row is returned (if it's correct then maybe it should be called for each row that contains the topic number):

                SELECT
                        mem.id_member, mem.member_name, mem.real_name, mg.group_name,
                        tvl.time, COUNT(m.id_msg) AS topic_posts
                FROM {db_prefix}log_topic_view AS tvl
                        LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = tvl.id_member)
                        LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = CASE WHEN mem.id_group = {int:regular_id_group} THEN mem.id_post_group ELS$
                        LEFT JOIN {db_prefix}messages AS m ON (m.id_member = mem.id_member AND m.id_topic = tvl.id_topic)
                WHERE tvl.id_topic = {int:topic}
                ORDER BY {raw:sort}
                LIMIT {int:start}, {int:per_page}',
                array(
                        'sort' => $sort,
                        'start' => $start,
                        'per_page' => $items_per_page,
                        'topic' => $topic,
                        'regular_id_group' => 0,
                )




my debugging skills are non-existent...lol..did this work for you? The name of the member who viewed the log last changes, and I can see multiple pages, but only one member

aegersz

the info I posted is intended to be for the guy who wrote it. I get the same thing as you but only on 1 page.

as I said, the database table it uses is correct but the query of it only returns the same one line - he expects a number of rows as he sets up an array to receive them.

buggered if i know, I'm just exploring the wonders of php+SQL and I'm only a novice.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

runningtrades

i get multiple pages, but can only see one name on the first page, but the name always changes, as members view the post

aegersz

I was able to get two pages of blanks by altering a SQL query and I have run the SQL from the debugging mods on phpmyadmin and I get the exact same single line returned, despite there being multiple rows to be accessed.

I emailed the author because it's now beyond my current skillset ... i really like this mod BUT that database table is slowly growing with every thread view and that's another concern.

I can't see any code to process all the appropriate rows to provide a consice listing of viewers so I am even more confused !
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

#23
i got it working but it produces HEAPS of information ... try my fix (and see if you like the amount of data it produces) by replacing the top 3 lines of the SQL SELECT code in function list_get_tvl_members in .Sources/TopicViewLog.php as shown below:

change the following:
                SELECT
                        mem.id_member, mem.member_name, mem.real_name, mg.group_name,
                        tvl.time, COUNT(m.id_msg) AS topic_posts


to the following:
                SELECT
                DISTINCT
                        mem.id_member, mem.member_name, mem.real_name, mg.group_name, tvl.time, mem.posts AS topic_posts
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

runningtrades

that fix works perfectly! Thank you very much!!

aegersz

You're welcome but I decided to Uninstall it due to the table it uses that is continually growing and the huge amount of pages it produces.

Good for every now and then though.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

runningtrades

I managed to track down an offending member that I was trying to weed out, so it served it's purpose for me! I'll probably keep the logs for now, see how big they get...if they get too big, I may remove it. But it helped me ban a member I was looking for!

Advertisement: