MyBB.de Forum

Normale Version: Thread Views nur bei reg. Usern hochzählen
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Hallo mybb.de!

Ich habe vor Kurzem ein myBB 1.8.19 Forum aufgesetzt und ich benutze das Flatty Theme.

Momentan kann man meine Threads auch lesen wenn man nicht registriert ist. Das soll auch so bleiben. Jedoch möchte ich, dass Views von unregistrierten Gästen nicht mitgezählt werden. Es sollen nur die Views von registrierten Gästen gezählt werden.

Jemand ne Idee wie ich das hinbekomme?

Danke.
Hallo,

dafür suche mal in der Datei showthread.php nach diesem Code:
PHP-Code:
// Increment the thread view.
if($mybb->settings['delayedthreadviews'] == 1)
{
   $db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");
}
else
{
   $db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
}
++
$thread['views']; 

und ergänze ihn zu:
PHP-Code:
// Increment the thread view.
if($mybb->user['uid'])
{
   if($mybb->settings['delayedthreadviews'] == 1)
   {
       $db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");
   }
   else
   
{
       $db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
   }
   ++$thread['views'];

(24.01.2019, 15:53)doylecc schrieb: [ -> ]Hallo,

dafür suche mal in der Datei showthread.php nach diesem Code:
PHP-Code:
// Increment the thread view.
if($mybb->settings['delayedthreadviews'] == 1)
{
   $db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");
}
else
{
   $db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
}
++
$thread['views']; 

und ergänze ihn zu:
PHP-Code:
// Increment the thread view.
if($mybb->user['uid'])
{
   if($mybb->settings['delayedthreadviews'] == 1)
   {
       $db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");
   }
   else
   
{
       $db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
   }
   ++$thread['views'];


Sieht gut aus. Wo finde ich denn die showthread.php? Sorry, bin noch Anfänger.
Die befindet sich im Hauptordner des Forums, also dort, wohin du alle MyBB Dateien und Ordner per FTP hochgeladen hast.
(28.01.2019, 16:30)doylecc schrieb: [ -> ]Die befindet sich im Hauptordner des Forums, also dort, wohin du alle MyBB Dateien und Ordner per FTP hochgeladen hast.

Funktioniert jetzt. Danke!