Quote:
Originally Posted by Xenon
@Sly: hmm, a lint to that post
would have fit also ^^
As for the postcount, yes i know, will have to add that in my next update (when i find the time to add what i want to add ^^)
|
Didn't notice that post.
I made some changes to your hack that fixed up a couple things, one is corectly setting the users pos count and the other is updating the forum last poster and first poster info if you change the user.
After you install this hack, find:
PHP Code:
// now do changes to thread, if logged in user is an admin and changed the dateline
if ($bbuserinfo['editlevel'] == $editlevel['admin'] AND
$postinfo['dateline'] != $newpost['dateline'])
{
require_once('./includes/functions_databuild.php');
build_thread_counters($postinfo['threadid']);
}
Replace it with:
PHP Code:
//------------------------------------------------------------
if($postinfo['userid']!=$newpost['userid'] && $foruminfo['countposts'])
{
if ($postinfo['userid'] > 0)
{
$DB_site->query("
UPDATE " . TABLE_PREFIX . "user
SET posts=posts-1
WHERE userid = $postinfo[userid]
");
}
if ($newpost[userid] > 0)
{
$DB_site->query("
UPDATE " . TABLE_PREFIX . "user
SET posts=posts+1
WHERE userid = $newpost[userid]
");
}
}
//------------------------------------------------------------
// now do changes to thread, if logged in user is an admin and changed the dateline
if ($bbuserinfo['editlevel'] == $editlevel['admin'] AND
$postinfo['dateline'] != $newpost['dateline'] OR
$postinfo['userid']!=$newpost['userid'])
{
require_once('./includes/functions_databuild.php');
build_thread_counters($postinfo['threadid']);
}
Now in includes/function_datastore.php find:
PHP Code:
// ###################### Start updatethreadcount #######################
function build_thread_counters($threadid)
{
global $DB_site, $threadcache;
and change it to:
PHP Code:
// ###################### Start updatethreadcount #######################
function build_thread_counters($threadid)
{
global $DB_site, $threadcache, $vbphrase;
Now a little ways under that find:
PHP Code:
$lastposter = iif(empty($lastposts['username']), $lastposts['postuser'], $lastposts['username']);
under it add:
PHP Code:
$lastposter = iif(empty($lastposter),$vbphrase['guest'],$lastposter);
Now a little ways under that find:
PHP Code:
$firstposter = iif(empty($firstposts['username']), $firstposts['postuser'], $firstposts['username']);
and under it add:
PHP Code:
$firstposter = iif(empty($firstposter),$vbphrase['guest'],$firstposter);
Thats all, now the posts will show Guest instead of nothing when you enter in a blank field. Also it will now update the post count of those who you change the post to and from.