Version: , by PING1434a
Developer Last Online: Nov 2023
Version: Unknown
Rating:
Released: 06-26-2005
Last Update: Never
Installs: 0
No support by the author.
Ok I've installed this hack for about 2 weeks now, just testing around, I relized something just now. some modification in showthread.php is making new users, if you add them through admin cp, making them come out as "Guest" on post bit. (if you look at my thread here:https://vborg.vbsupport.ru/showthread.php?t=91091 , i've posted it thinking it was something else causing the problem). User Title, Profile, and Avatar on the forum comes out fine if I change the mode to Hybrid or Threaded mode.
Has this issue been covered before? I'm running on 3.0.7 , I'm gonna work at it try to get this fixed, but it'd be great if someone can point me to the right direction. I have an idea how to get this fixed, perhaps when doing new registeration via registeration form, it addes value to a rpg table validating the user? It seems adding user via admincp, is missing some code.
Cheers! I'll keep updated!
-PiNG
EDIT! :
Ok found this bit of code that's causing it!:
On this bit of code:
PHP Code:
// rpg
$sqlplug1 = "userfield.$vboptions[rpg_namefield] AS rpgname,
user.ma AS uma,user.hp AS uhp,user.pp AS upp,user.ap AS uap,
rpg_items_user.*,
rpg_battle_stats.*,
rpg_race.name AS rpgracename,
rpg_race.alignment AS rpgalignmentname,
rpg_class.name AS classname,
rpg_class.folder AS classfolder,
rpg_element.name AS elename,
rpg_clan.title AS clantitle,
";
$sqlplug2 = "LEFT JOIN " . TABLE_PREFIX . "rpg_items_user AS rpg_items_user ON(rpg_items_user.userid=user.userid)
LEFT JOIN " . TABLE_PREFIX . "rpg_battle_stats AS rpg_battle_stats ON(rpg_battle_stats.userid=user.userid)
LEFT JOIN " . TABLE_PREFIX . "rpg_class AS rpg_class ON(rpg_class.id=user.rpgclass)
LEFT JOIN " . TABLE_PREFIX . "rpg_element AS rpg_element ON(rpg_element.elementid=user.element)
LEFT JOIN " . TABLE_PREFIX . "rpg_clan AS rpg_clan ON(rpg_clan.clanid=user.clan)
LEFT JOIN " . TABLE_PREFIX . "rpg_race AS rpg_race ON(rpg_race.raceid=user.rpgrace)
AND rpg_race.alignmentid=user.alignment
";
$totalcats = $DB_site->query_first("SELECT COUNT(*) AS countcats FROM " . TABLE_PREFIX . "rpg_items_cats");
$posts = $DB_site->query("
SELECT
post.*, post.username AS postusername, post.ipaddress AS ip,
user.*, userfield.*, usertextfield.*,
$sqlplug1 " . iif($forum['allowicons'], 'icon.title as icontitle, icon.iconpath,') . "
" . iif($vboptions['avatarenabled'], 'avatar.avatarpath, NOT ISNULL(customavatar.avatardata) AS hascustomavatar, customavatar.dateline AS avatardateline,') . "
" . iif($vboptions['reputationenable'], 'level,') . "
" . iif(!$deljoin, 'NOT ISNULL(deletionlog.primaryid) AS isdeleted, deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason,') . "
editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline,
editlog.reason AS edit_reason,
post_parsed.pagetext_html, post_parsed.hasimages,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
" . iif(!($permissions['genericpermissions'] & CANSEEHIDDENCUSTOMFIELDS), $datastore['hidprofilecache']) . "
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = post.userid)
LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid = user.userid)
" . iif($forum['allowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = post.iconid)") . "
" . iif($vboptions['avatarenabled'], "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)") .
iif($vboptions['reputationenable'], " LEFT JOIN " . TABLE_PREFIX . "reputationlevel AS reputationlevel ON(user.reputationlevelid = reputationlevel.reputationlevelid)") . "
" . iif(!$deljoin, "LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND deletionlog.type = 'post')") . "
LEFT JOIN " . TABLE_PREFIX . "editlog AS editlog ON(editlog.postid = post.postid)
LEFT JOIN " . TABLE_PREFIX . "post_parsed AS post_parsed ON(post_parsed.postid = post.postid)
$sqlplug2 WHERE $postids ORDER BY dateline $postorder ");
If i take the $sqlplug1 and 2 out of:
PHP Code:
$posts = $DB_site->query("
SELECT
post.*, post.username AS postusername, post.ipaddress AS ip,
user.*, userfield.*, usertextfield.*,
$sqlplug1 " . iif($forum['allowicons'], 'icon.title as icontitle, icon.iconpath,') . "
" . iif($vboptions['avatarenabled'], 'avatar.avatarpath, NOT ISNULL(customavatar.avatardata) AS hascustomavatar, customavatar.dateline AS avatardateline,') . "
" . iif($vboptions['reputationenable'], 'level,') . "
" . iif(!$deljoin, 'NOT ISNULL(deletionlog.primaryid) AS isdeleted, deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason,') . "
editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline,
editlog.reason AS edit_reason,
post_parsed.pagetext_html, post_parsed.hasimages,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
" . iif(!($permissions['genericpermissions'] & CANSEEHIDDENCUSTOMFIELDS), $datastore['hidprofilecache']) . "
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = post.userid)
LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid = user.userid)
" . iif($forum['allowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = post.iconid)") . "
" . iif($vboptions['avatarenabled'], "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)") .
iif($vboptions['reputationenable'], " LEFT JOIN " . TABLE_PREFIX . "reputationlevel AS reputationlevel ON(user.reputationlevelid = reputationlevel.reputationlevelid)") . "
" . iif(!$deljoin, "LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND deletionlog.type = 'post')") . "
LEFT JOIN " . TABLE_PREFIX . "editlog AS editlog ON(editlog.postid = post.postid)
LEFT JOIN " . TABLE_PREFIX . "post_parsed AS post_parsed ON(post_parsed.postid = post.postid)
$sqlplug2 WHERE $postids ORDER BY dateline $postorder ");
it fixes that problem....
EDITED! :
OK!!! I found it, give me time to post a fix on this!
TEH F1X! #1: Open forum-path/admincp/user.php
Find:
PHP Code:
$userid = $DB_site->insert_id();
Replace with:
PHP Code:
$userid = $DB_site->insert_id();
// Start - RPG Integration Hack by Revan - Fix by PiNG :)
$DB_site->query("INSERT INTO ".TABLE_PREFIX."rpg_items_user (userid) VALUES ($userid)");
$DB_site->query("INSERT INTO ".TABLE_PREFIX."rpg_battle_stats (userid) VALUES ($userid)");
// End - RPG Integration Hack by Revan - Fix by PiNG :)
Now adding users from Admin Control Panel(admincp) will have the right title on the postbit!
I ran into this problem while test-importing users for the site.
-PiNG
Easy Search Keywords: Adding Users AdminCP Admin User Add Problem Guest Postbit Not Showing
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Thanks for the fixes
Your first fix is the correct one, it was a mistake on my end to leave it out. I am hoping for a hook in the user.php for 3.5 so this will be no more.
Your 2nd fix is incorrect, as the ACP page titled "DB Fix" repopulates the battle_stats and items_user tables