vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Custom User Status by Usergroup (https://vborg.vbsupport.ru/showthread.php?t=40423)

Jen 06-28-2002 10:00 PM

Custom User Status by Usergroup
 
I could not find a way to add an additional user status field based on usergroup other than setting a override, which got rid of the normal usertitle based on post count and I didn't want that. This is my solution.

This hack adds an additional field to the usergroup table and allows you to display that custom group status field in addition to the normal usertitle that is defined either custom for the user or normally by number of posts without overriding the usertitle variable.

The end result gives you something like this (depending on how you edit your postbit template) for the output:

Jen
Tyro Hacker
[Custom Group Status Here]
[Users Avatar]
[Users other details]

The custom group status is set within the cp from the user group modify function for each group you want to add this additional status field to.

Questions, Problems, etc.. ask here as I am unable to provide support via email.

Jen 06-29-2002 04:13 AM

# NOTE: This code has been added to the download file. If you have a copy of the file without the User Profile mods, these instructions are for you. Otherwise, use what's in the file.

If you want to add the new custom user status to the users profile here's the edits to do so (These should be all one line and are broken up here to keep the screen from scrolling):

Edit admin/functions.php
find:
PHP Code:

if (!isset($usercache[$userid])) {
    
$usercache["$userid"]=$DB_site->query_first("
SELECT user.*,userfield.* 
FROM user 
LEFT JOIN userfield ON userfield.userid=user.userid WHERE user.userid='
$userid'"); 

replace with:
PHP Code:

if (!isset($usercache[$userid])) {
    
$usercache["$userid"]=$DB_site->query_first("
SELECT user.*,userfield.*, usergroup.groupcustomstats 
FROM user 
LEFT JOIN usergroup ON usergroup.usergroupid=user.usergroupid 
LEFT JOIN userfield ON userfield.userid=user.userid WHERE user.userid='
$userid'"); 

Then just add the following variable to your getinfo template as you want it to display.
PHP Code:

$userinfo[groupcustomstatus


Velocd 06-29-2002 06:48 AM

I was thinking about something like this just last week. Good job :)

Dean C 06-29-2002 07:42 AM

didn't work for me... :(

Bugz 06-29-2002 08:34 AM

im going to try when i wake up later.

im preatty tired and watching mr. deeds

Jen 06-29-2002 08:43 AM

Mist: I think I figured out the problem.. a # character was right before the second replacement db query. I have fixed that in the file and it should install no problem now.

The hack code above is based on an un-hacked vB 2.2.6 install, but works wonderful with the Sig and Avatars by Usergroup hack.

I just tested the updated code on a fresh install of vB 2.2.6 and it worked perfectly.

Jen 06-29-2002 05:58 PM

The download file has been updated to include the steps to add the new Group Custom Status to the user's profile page.

Jen 07-15-2002 03:37 AM

If anyone has had any problems with this, please let me know. otherwise I'd like to move this up to a Final release.

FeDe 08-15-2002 10:08 AM

Just wanted to say, it's a great hack! :D Installed it yesterday and it works perfectly! :D Thanks :).

Chris M 11-02-2002 10:29 AM

Have you ran the query?

Satan


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01036 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete