utor : Martin
Sursa : phpbbcodes.Ro
Descriere : Acest snippet opreste autorul subiectului de la a-si face singur vizualizari la propriul subiect.
Deschide viewtopic.php
Cautati :
Code:
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET topic_views = topic_views + 1, topic_last_view_time = ' . time() . "
WHERE topic_id = $topic_id";
$db->sql_query($sql);
Inlocuiti cu :
Code:
if ($user->data['user_id'] != $topic_data['topic_poster'] && !$user->data['is_bot'])
{
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET topic_views = topic_views + 1, topic_last_view_time = ' . time() . "
WHERE topic_id = $topic_id";
$db->sql_query($sql);
}