Customizing SMF > Tips and Tricks
[TIP/TRICK] Who Viewed The Topic
jossanaijr:
SiNan - > Sadrazam!
jossanaijr:
Question: Who can see this list? All that can read the post? And if member list is not public?
Eliana Tamerin:
Yep, you understood perfectly. ;)
Hehe, I should have thought of that. No matter. Works beautifully.
Thanks again!
BTW, View Count and time would be an awesome feature.
[SiNaN]:
--- Quote from: jossanaijr on June 04, 2008, 12:27:37 PM ---SiNan - > Sadrazam!
--- End quote ---
Yes. :)
What about just the users who has the moderate forum permission?
Change the code like this:
Find:
--- Code: --- <div class="nav" style="margin-bottom: 2px;"> ', $context['previous_next'], '</div>
--- End code ---
Replace:
--- Code: --- <div class="nav" style="margin-bottom: 2px;"> ', $context['previous_next'], '</div>';
if($context['can_moderate_forum'])
echo '
<a href="' . $scripturl . '?topic='. $context['current_topic'] . '.0;sa=log">View Topic Log</a>';
echo '
--- End code ---
[SiNaN]:
--- Quote from: Eliana Tamerin on June 04, 2008, 12:29:31 PM ---Yep, you understood perfectly. ;)
Hehe, I should have thought of that. No matter. Works beautifully.
Thanks again!
BTW, View Count and time would be an awesome feature.
--- End quote ---
And this is for you Eliana:
MessageIndex.template.php
Find:
--- Code: --- ', $topic['views'], '
--- End code ---
Replace:
--- Code: --- ', $context['can_moderate_forum'] ? '<a href="' . $scripturl . '?topic='. $topic['id'] . '.0;sa=log">' . $topic['views'] . '</a>' : $topic['views'], '
--- End code ---
Also you can use !$context['user']['is_guest'] instead of $context['can_moderate_forum'] if you want it to display it just for users.
I'll make a mod with view count and time after my finals.
Made it more secure, added isAllowedTo('moderate_forum');.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version