Gönderen Konu: TopicLog  (Okunma sayısı 1979 defa)

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı Balaban

  • SGT-Admin
  • *
  • İleti: 3804
  • PR ( Rep ) : 117
  • Cinsiyet: Bay
    • Metal Vids
TopicLog
« : SmfGrup Saati : 23 Ağustos Cts 2008, 00:07 »
Topic Log

Time to see who viewed a topic. This modification enhances the topic log function of SMF and gives you the ability to view the log of the topic you want. Here are the features:


Display view count for each member
Display last view time
8 ways of sorting the list

Username asc/desc
Position asc/desc
Times Viewed asc/desc
Last View asc/desc
Pagination

20 logs per page
2 types of 'View Topic Log' permission

View own
View any
Show log topic name in who's online


File Edits
./Themes/default/languages/Modifications.english.php


Find (at the end of the file):
Kod: [Seç]
?>
Add Before:

Kod: [Seç]
// Topic Log Mod
$txt['lt_title'] = 'Topic Log';
$txt['lt_times'] = 'Times';
$txt['lt_lastView'] = 'Last View';
$txt['tl_no_topic_id'] = 'Topic ID is not set.';
$txt['tl_no_topic'] = 'Topic doesn\'t exist.';
$txt['who_log'] = 'Viewing the topic log of <a href="' . $scripturl . '?action=topiclog;id=%d">%s</a>.';

$txt['cannot_view_topic_log_own'] = 'You are not, on this board, allowed to view the topic log of your own posts.';
$txt['cannot_view_topic_log_any'] = 'Viewing just any topic log in this board is not allowed.';

$txt['permissionname_view_topic_log'] = 'View Topic Log';
$txt['permissionhelp_view_topic_log'] = 'This permission allows a user to view the topic view log.';
$txt['permissionname_view_topic_log_own'] = 'Own topic';
$txt['permissionname_view_topic_log_any'] = 'Any topic';
// Topic Log Mod

./Sources/Display.php

Find:

      
Kod: [Seç]
if (!empty($topicinfo['new_from']))
{
db_query("
UPDATE {$db_prefix}log_topics
SET ID_MSG = $modSettings[maxMsgID]
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $topic
LIMIT 1", __FILE__, __LINE__);

$flag = db_affected_rows() !== 0;
}

if (empty($flag))
db_query("
REPLACE INTO {$db_prefix}log_topics
(ID_MSG, ID_MEMBER, ID_TOPIC)
VALUES ($modSettings[maxMsgID], $ID_MEMBER, $topic)", __FILE__, __LINE__);

Replace With:

Kod: [Seç]
if (!empty($topicinfo['new_from']))
{
db_query("
UPDATE {$db_prefix}log_topics
SET ID_MSG = $modSettings[maxMsgID], times = times + 1, lastView = " . time() . "
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $topic
LIMIT 1", __FILE__, __LINE__);

$flag = db_affected_rows() !== 0;
}

if (empty($flag))
db_query("
REPLACE INTO {$db_prefix}log_topics
(ID_MSG, ID_MEMBER, ID_TOPIC, times, lastView)
VALUES ($modSettings[maxMsgID], $ID_MEMBER, $topic, 1, " . time(). ")", __FILE__, __LINE__);


Find:

   
Kod: [Seç]
$context['topic_starter_id'] = $topicinfo['ID_MEMBER_STARTED'];
Replace With

   
Kod: [Seç]
$context['topic_starter_id'] = $topicinfo['ID_MEMBER_STARTED'];

// Can he see the topic log.
$user_view = !allowedTo('view_topic_log_any');
if ($user_view && $context['topic_starter_id'] == $ID_MEMBER)
$context['can_view_topic_log'] = allowedTo('view_topic_log_own');
else
$context['can_view_topic_log'] = allowedTo('view_topic_log_any');


./Sources/ManagePermissions.php

Find:

Kod: [Seç]
'announce_topic' => false,
Replace With:
            
Kod: [Seç]
'announce_topic' => false,
'view_topic_log' => true,


./Sources/Who.php

Find:
   
Kod: [Seç]
$board_ids = array();
Replace With:
   
Kod: [Seç]
$board_ids = array();
$log_ids = array();


Find:
         
Kod: [Seç]
// Unlisted or unknown action.
Replace With:
         
Kod: [Seç]
// He must be viewing a topic log.
elseif (isset($actions['action']) && $actions['action'] == 'topiclog' && isset($actions['place']) && allowedTo('view_topic_log_any', $actions['place']))
{
// Assume they can't view it.
$data[$k] = $txt['who_hidden'];
$log_ids[(int) $actions['id']][$k] = $txt['who_log'];
}
// Unlisted or unknown action.


Find:
   
Kod: [Seç]
// Load member names for the profile.

Replace With:
   
Kod: [Seç]
// Load log names.
if (!empty($log_ids))
{
$result = db_query("
SELECT t.ID_TOPIC, m.subject
FROM ({$db_prefix}boards AS b, {$db_prefix}topics AS t, {$db_prefix}messages AS m)
WHERE $user_info[query_see_board]
AND t.ID_TOPIC IN (" . implode(', ', array_keys($log_ids)) . ")
AND t.ID_BOARD = b.ID_BOARD
AND m.ID_MSG = t.ID_FIRST_MSG
LIMIT " . count($log_ids), __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($result))
{
// Show the log topic's subject for each of the actions.
foreach ($log_ids[$row['ID_TOPIC']] as $k => $session_text)
$data[$k] = sprintf($session_text, $row['ID_TOPIC'], censorText($row['subject']));
}
mysql_free_result($result);
}

// Load member names for the profile.


./index.php
Find:
      
Kod: [Seç]
'trackip' => array('Profile.php', 'trackIP'),

Replace With:

      
Kod: [Seç]
'trackip' => array('Profile.php', 'trackIP'),
'topiclog' => array('TopicLog.php', 'TopicLog'),


./Themes/default/Display.template.php
Find:
   // Show the page index... "Pages: [1]".
Replace With:
   
Kod: [Seç]
// Topic Log button.
if ($context['can_view_topic_log'])
$normal_buttons['view_topic_log'] = array('text' => 'lt_title', 'image' => 'topiclog.gif', 'lang' => true, 'url' => $scripturl . '?action=topiclog;id=' . $context['current_topic'] . ';place=' . $context['current_board']);

// Show the page index... "Pages: [1]".



Code
This file should not be able to execute standalone. You may have to run the following queries manually...

Query:
Kod: [Seç]
ALTER TABLE {$db_prefix}log_topics
ADD times SMALLINT( 8 ) DEFAULT 1 NOT NULL,
ADD lastView TEXT NOT NULL

File Operations
Alıntı
Move the included file "TopicLog.php" to "./Sources".
Move the included file "TopicLog.template.php" to "./Themes/default".

By [SiNaN]

Link to Mod

Çevrimiçi EmirCan

  • SGT-Admin
  • *
  • İleti: 14053
  • PR ( Rep ) : 247
  • Cinsiyet: Bay
  • EmirCan ( İST )
  • SMF Sürümü: 2.0
Ynt: TopicLog
« Yanıtla #1 : SmfGrup Saati : 23 Ağustos Cts 2008, 00:12 »
Thanks
Emirkuzu.com

Çevrimdışı KEREM...

  • Sr. Member
  • **
  • İleti: 2342
  • PR ( Rep ) : 62
  • Cinsiyet: Bay
    • kerem
  • SMF Sürümü: 1.1.x
Ynt: TopicLog
« Yanıtla #2 : SmfGrup Saati : 23 Ağustos Cts 2008, 00:14 »
thanks nuwanda  ???

Çevrimdışı Linkinpark

  • Sr. Member
  • **
  • İleti: 2394
  • PR ( Rep ) : 133
  • Cinsiyet: Bay
  • slaytyeri.blogspot.com
    • janjanlı
Ynt: TopicLog
« Yanıtla #3 : SmfGrup Saati : 23 Ağustos Cts 2008, 00:17 »
perfect thank you xD
ÖSS BİTTİ SONUNDA :)

Çevrimdışı BuraQ

  • SonDurock.Net
  • Hero Member
  • ***
  • İleti: 3637
  • PR ( Rep ) : 127
  • Cinsiyet: Bay
  • http://enginaltanduzyatanfan.com
    • http://enginaltanduzyatanfan.com
  • SMF Sürümü: 2.0
Ynt: TopicLog
« Yanıtla #4 : SmfGrup Saati : 23 Ağustos Cts 2008, 00:29 »
Thanks
Destek Buradan Alınır..
Smfgrup.com

http://enginaltanduzyatanfan.com
Yakında !


Çevrimdışı Riot!

  • Sr. Member
  • **
  • İleti: 1550
  • PR ( Rep ) : 84
  • Cinsiyet: Bay
  • Eyeless
    • SwéeT ReBéL - CaGLaR StyLe
Ynt: TopicLog
« Yanıtla #5 : SmfGrup Saati : 23 Ağustos Cts 2008, 01:09 »
Nice idea.I liked it.
Thankss.

Çevrimdışı кнη

  • khaan
  • SMF-Modifikasyon
  • *
  • İleti: 3214
  • PR ( Rep ) : 61
  • Cinsiyet: Bay
    • Smf Grup
  • SMF Sürümü: 1.1.x
Ynt: TopicLog
« Yanıtla #6 : SmfGrup Saati : 23 Ağustos Cts 2008, 20:54 »
thanks
Yapamam duramam buralarda..
Bu şehir bana dar geliyor..

Unutup
Seni kalbime gömmek..
Ölümden daha zor geliyor..