Quote:
Originally Posted by MarkFL
If you are using my cron-based approach, then change all instances of $v_thread['views'] to $v_thread['replycount'].
|
Awesome, thank you
--------------- Added [DATE]1474160516[/DATE] at [TIME]1474160516[/TIME] ---------------
Quote:
Originally Posted by MarkFL
If you are using my cron-based approach, then change all instances of $v_thread['views'] to $v_thread['replycount'].
|
I'm testing the View code and it doesn't seem to be working, plug in is active.
--------------- Added [DATE]1474160680[/DATE] at [TIME]1474160680[/TIME] ---------------
PHP Code:
global $vbulletin, $db;
$fids = '36';
$title1 = 'Bronze';
$title2 = 'Silver';
$title3 = 'Gold';
$title4 = 'Platinum';
$title5 = 'Diamond';
$v_threads = $vbulletin->db->query_read("
SELECT thread.*
FROM " . TABLE_PREFIX . "thread AS thread
WHERE views > 99
AND forumid IN (" . $fids . ")
");
while ($v_thread = $vbulletin->db->fetch_array($v_threads))
{
$newprefix = '';
if (($vthread['views'] < 249) AND ($vthread['Bronze'] != $title1))
{
$newprefix = $title1;
}
elseif ($vthread['views'] < 499) AND ($vthread['Silver'] != $title2))
{
$newprefix = $title2;
}
elseif ($vthread['views'] < 999) AND ($vthread['Gold'] != $title3))
{
$newprefix = $title3;
}
elseif ($vthread['views'] < 2499) AND ($vthread['Platinum'] != $title4))
{
$newprefix = $title4;
}
elseif ($vthread['views'] > 2500) AND ($vthread['Diamond'] != $title5))
{
$newprefix = $title5;
}
if ($newprefix)
{
$dataman =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$dataman->set_existing($v_thread);
$dataman->set('prefixid', $newprefix);
$dataman->save();
unset($dataman);
build_forum_counters($v_thread['forumid']);
build_thread_counters($v_thread['threadid']);
}
}