Mod is out:
http://custom.simplemachines.org/mods/index.php?mod=1300
This trick will allow you to view the users that viewed the topic.
../Sources/Display.php
Find:
fatal_lang_error('smf232', false);
Replace:
fatal_lang_error('smf232', false);
if(!empty($_REQUEST['sa']) && $_REQUEST['sa'] == 'log') {
DisplayLog();
}
Find:
?>
Replace:
function DisplayLog()
{
global $context, $scripturl, $db_prefix, $topic;
isAllowedTo('moderate_forum');
$request = db_query("
SELECT
lt.ID_MEMBER, lt.ID_TOPIC, mem.realName
FROM {$db_prefix}log_topics AS lt
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lt.ID_MEMBER)
WHERE ID_TOPIC = $topic", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
// Build the array.
$context['logs'][] = array(
'member' => array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
),
);
}
mysql_free_result($request);
$context['sub_template'] = 'displaylog';
}
?>
../Themes/default/Display.template.php
Find:
?>
Replace:
function template_displaylog()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
echo '
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 1ex;" align="center">
<tr class="titlebg">
<td>Who Viewed The Topic</td>
</tr>';
foreach($context['logs'] as $log) {
echo '
<tr class="windowbg">
<td>', $log['member']['link'], '</td>
</tr>';
}
echo '
</table>';
}
?>
Find:
<div class="nav" style="margin-bottom: 2px;"> ', $context['previous_next'], '</div>
Replace:
<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 '
SiNaN, that's seriously amazing! Awesome job!
I'm using this and it works wonderfully.
I've seen this kind of thing on other forum software, and the one other place I've seen it is on the Message Index, under the Views column. The number of views would be a link to the View Topic Log or whatever they called it. Do you think that's possible?
Nothing is impossible. :P
I hope I understand your question correctly.
../Themes/default/MessageIndex.template.php
Find:
', $topic['views'], '
Replace:
<a href="' . $scripturl . '?topic='. $topic['id'] . '.0;sa=log">', $topic['views'], '</a>
Wow! I had already asked for this sometime ago...
Please submit it to MOD site.
Thanks!
This is not that complex to be a mod. But I can think of adding a view count and view time for members. Maybe.
SiNan - > Sadrazam!
Question: Who can see this list? All that can read the post? And if member list is not public?
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.
Zitat von: jossanaijr in Juni 04, 2008, 12:27:37 NACHMITTAGS
SiNan - > Sadrazam!
Yes. :)
What about just the users who has the moderate forum permission?
Change the code like this:
Find:
<div class="nav" style="margin-bottom: 2px;"> ', $context['previous_next'], '</div>Replace:
<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 '
Zitat von: Eliana Tamerin in Juni 04, 2008, 12:29:31 NACHMITTAGS
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.
And this is for you Eliana:
MessageIndex.template.php
Find:
', $topic['views'], 'Replace:
', $context['can_moderate_forum'] ? '<a href="' . $scripturl . '?topic='. $topic['id'] . '.0;sa=log">' . $topic['views'] . '</a>' : $topic['views'], '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');.
Awesome. And I've used this context on the Display.template.php file instead.
', !$context['user']['is_guest'] ? '<a href="' . $scripturl . '?topic='. $context['current_topic'] . '.0;sa=log" class="middletext"><b>View Topic Log</b></a>' : '', '
Okay, mod will include a permission for viewing it. Any other ideas?
Maybe a little table of information.
Member Name 1 | Last Viewed Time | (Views #) |
Member Name 2 | Last Viewed Time | (Views #) |
Member Name 3 | Last Viewed Time | (Views #) |
Member Name 4 | Last Viewed Time | (Views #) |
Member Name 5 | Last Viewed Time | (Views #) |
Guests | Last Viewed Time | (Views #) |
| | Total Views |
Exactly what I thought Eliana, thanks. ;)
Wow!
Installed and working perfectly!
Thanks again!
BTW, is it ordered alphabetically or by order?
Zitat von: jossanaijr in Juni 04, 2008, 01:12:38 NACHMITTAGS
BTW, is it ordered alphabetically or by order?
By order I guess.
Topic moved to Tips and Tricks :D
@[SiNaN] I looked at your mods I never noticed they have that down there at the bottom!
Anyway, I don't know much but I have a couple of your mods installed and they work wonderfully!
I trust your work!
Have you made that mod yet? "Who Viewed The Topic"
I looked but I didn't see it.
He has not yet made the mod.
Sinan awesome job!!!
thanks :)
Thanks, hope I'll do it soon. ;)
Zitat von: [SiNaN] in Juni 19, 2008, 07:06:46 VORMITTAG
Thanks, hope I'll do it soon. ;)
How i can do to make of topic author can see the log???
Here is your codes:
Display.php
Find:
fatal_lang_error('smf232', false);
Replace:
fatal_lang_error('smf232', false);
$request = db_query("
SELECT ID_MEMBER_STARTED
FROM {$db_prefix}topics
WHERE ID_TOPIC = $topic
LIMIT 1", __FILE__, __LINE__);
list ($starter) = mysql_fetch_row($request);
mysql_free_result($request);
if($starter = $ID_MEMBER || allowedTo('moderate_forum'))
$context['can_view_who_viewed'] = true;
else
$context['can_view_who_viewed'] = false;
if(!empty($_REQUEST['sa']) && $_REQUEST['sa'] == 'log' && $context['can_view_who_viewed']) {
DisplayLog();
}
And in the DisplayLog() function, you should remove:
isAllowedTo('moderate_forum');
Also you can use $context['can_view_who_viewed'] in the template file to show the button only for the starter.
I think I am doing something wrong, how can I make it so any member can view the list? I want anyone except guests to be able to view it. Thanks. :)
I put this in MessageIndex.template.php
', !$context['user']['is_guest'] ? '<a href="' . $scripturl . '?topic='. $topic['id'] . '.0;sa=log">' . $topic['views'] . '</a>' : $topic['views'], '
But it says to regular members: "You are not allowed to moderate this forum."
I thought the code above would make it so anyone but guests can see.
Edit: Ok, so I just had to remove " isAllowedTo('moderate_forum');" from my Display.php
Glad that you've managed to do it. You can deny guests by just adding this code instead of the one you removed:
is_not_guest();
That's cool, [SiNaN] :)
Can you package it as a mod?
It's quite ready. Just need to check permissions in the Display.template.php.
The mod will include:
- How many times member viewed
- Time of members' last view
- Sorting of members by username, position, last view time, times viewed
- Showing 20 members per page
Zitat von: [SiNaN] in Juli 05, 2008, 06:54:36 VORMITTAG
- Showing 20 members per page
Can you make the number configurable?
I just do not want to add something to the ModSettings. I don't think it is that much important. If you personally want to change the number, just you need to change the number 20 to what you want in Display.php.
But if you say, we need, they I can add. Do we really need?
Zitat von: [SiNaN] in Juli 05, 2008, 07:02:23 VORMITTAG
But if you say, we need, they I can add. Do we really need?
It was just a suggestion (I personally don't need it).
It's totally up to you. :)
Zitat von: [SiNaN] in Juli 05, 2008, 06:54:36 VORMITTAG
It's quite ready. Just need to check permissions in the Display.template.php.
The mod will include:
- How many times member viewed
- Time of members' last view
- Sorting of members by username, position, last view time, times viewed
- Showing 20 members per page
That's awesome, looking forward to it. Thank you. :)
Zitat von: [SiNaN] in Juli 05, 2008, 06:54:36 VORMITTAG
It's quite ready. Just need to check permissions in the Display.template.php.
The mod will include:
- How many times member viewed
- Time of members' last view
- Sorting of members by username, position, last view time, times viewed
- Showing 20 members per page
Awesome ideas!!
Zitat von: Sarge in Juli 05, 2008, 07:07:18 VORMITTAG
It was just a suggestion (I personally don't need it).
It's totally up to you. :)
Sorry Sarge, didn't thought of that you can code a better one if you will need. :)
If you make sure the number is easy to find in the code, it'll be easy for anyone who wants to change that to do so.
nice work
Zitat von: [SiNaN] in Juli 05, 2008, 06:54:36 VORMITTAG
It's quite ready. Just need to check permissions in the Display.template.php.
The mod will include:
- How many times member viewed
- Time of members' last view
- Sorting of members by username, position, last view time, times viewed
- Showing 20 members per page
very nice thank you
waiting for the updated version
avf
Mod is released. See it here:
http://custom.simplemachines.org/mods/index.php?mod=1300
Zitat von: [SiNaN] in Juni 04, 2008, 12:20:53 NACHMITTAGS
Nothing is impossible. :P
That's the essence of why we all like writing software. :)
Other mortals walk around the mountain, walk over the mountain. We programmers lift up the mountain and walk under it. ;)
Zitat von: [SiNaN] in Juli 27, 2008, 08:15:52 VORMITTAG
Mod is released. See it here:
http://custom.simplemachines.org/mods/index.php?mod=1300
Would that work with SMF 2?
Compatible With: 1.1.5
Hmm, let's see. No.
This mod has totally messed my forum. I installed CORRECTLY. As soon as I did I have a load of text/ Jargon above my header when logged in. I uninstalled and deleted but the jargon is still there. :(
There is a mod for this now. Why don't you try that?
I did! what other way is there?
Either way I don't even want it now I'd rather get my forum back to normal health.
Any help would be much appreciated as I'm sure this has happened to others.
Go into your Modifications.english.php and move the ?> to the end of the file.
Hello,
This topic has been a while. I'm trying to modify my forum and it may relate to this mod; perhaps I can get some help from here.
Is it possible to modify my forum so that everytime users view some special topics (I got about 5 special topics), their nicks will turn to different colors, and then if they got off those special topcis, their nicks' color will be back to normal.
Any help will be appreciated. I'm trying to work on this, but not much clue so far. Please help. I'm willing to pay to get my forum work.
Thanks very much.
I'm using smf 1.1.16