Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > RPG Integration Hack
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Ok, I seems i ran into a bug. Adding user via admincp Details »»
Ok, I seems i ran into a bug. Adding user via admincp
Version: , by PING1434a PING1434a is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

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.

Comments
  #2  
Old 06-26-2005, 09:19 AM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 06-26-2005, 09:40 AM
PING1434a PING1434a is offline
 
Join Date: Jun 2005
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AHHHHahaha! Woah, i see!,
Thanks! I'll edit out the 2nd fix ^^;

just wondering is there issue with reset and point system not working afterwards? Woah, thanks again! ^^

Edit:
well, not sure what caused it, but just fixed it with a quick sql query:
Code:
UPDATE user SET uttpoints=100 WHERE uttpoints=null;
Reply With Quote
  #4  
Old 06-26-2005, 06:50 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Reset means setting to 0 so obviously it cleaned the points
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:24 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05817 seconds
  • Memory Usage 2,295KB
  • Queries Executed 19 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete