Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
associate $usergroup[title] with specific post? Details »»
associate $usergroup[title] with specific post?
Version: , by TECK TECK is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-12-2002 Last Update: Never Installs: 0
 
No support by the author.

let's suppose i have a board with users who can change their usertitle. as an admin i want to see what usergroup they are in, right under the usertitle.

this is what i tried:
showthread.php
PHP Code:
$usergroups=$DB_site->query("SELECT title, usergroupid FROM usergroup");

while (
$usergroup=mysql_fetch_object($usergroups)) {
  if (
$bbuserinfo['usergroupid']==6) {
    
$editgroup='[<a href="admin/usergroup.php?s=$session[sessionhash]&action=edit&usergroupid=$usergroup[usergroupid]">edit</a>]';
    eval(...);
  } else {
    
$editgroup='';
  }

i dont know how to associate the user with the usergroup, in postbit.
thanks for your help.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-12-2002, 05:50 AM
Neo's Avatar
Neo Neo is offline
 
Join Date: Oct 2001
Location: Anywhere
Posts: 1,817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

do you mean something like $post[usergroupid]
Reply With Quote
  #3  
Old 03-12-2002, 07:24 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i want to be able to grab the usergroup title. for example to show the user is part of Administrators Group.
Reply With Quote
  #4  
Old 03-12-2002, 09:28 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In showthread.php replace:
Code:
avatardateline","")."
FROM post
".iif($forum[allowicons],'LEFT JOIN icon ON icon.iconid=post.iconid','')."
with:
Code:
avatardateline","").",usergroup.title AS usergrouptitle
FROM post
".iif($forum[allowicons],'LEFT JOIN icon ON icon.iconid=post.iconid','')."
LEFT JOIN usergroup ON (usergroup.usergroupid=user.usergroupid)
Then use $post['usergrouptitle'].
Reply With Quote
  #5  
Old 03-12-2002, 04:27 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks alot firefly.
Reply With Quote
  #6  
Old 03-13-2002, 04:57 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmm..
Code:
Database error in vBulletin 2.2.4:

Invalid SQL: 
SELECT
post.*,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,icon.title as icontitle,icon.iconpath,
attachment.attachmentid,attachment.filename,attachment.visible AS attachmentvisible,attachment.counter,usergroup.title AS usergrouptitle
,avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline
FROM post
LEFT JOIN icon ON icon.iconid=post.iconid
LEFT JOIN usergroup ON usergroup.usergroupid=user.usergroupid
LEFT JOIN user ON user.userid=post.userid
LEFT JOIN userfield ON userfield.userid=user.userid
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
                       LEFT JOIN customavatar ON customavatar.userid=user.userid
LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
WHERE post.postid IN (0,1,2)
ORDER BY dateline 

mysql error: Cross dependency found in OUTER JOIN.  Examine your ON conditions

mysql error number: 1120

Script: http://localhost/forum/forum/showthread.php?threadid=1
Referer: http://localhost/forum/forumdisplay.php?forumid=2
i will look into this and let you know where is the bug.. thanks for getting me started..
Reply With Quote
  #7  
Old 03-13-2002, 05:39 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok.. i tried this:
PHP Code:
$usergroups=$DB_site->query("SELECT usergroup.usergroupid,usergroup.title
                             FROM usergroup
                             LEFT JOIN user ON user.usergroupid=usergroup.usergroupid"
);

while (
$usergroup=$DB_site->fetch_array($usergroups)) {
  echo 
"$usergroup[title]";

it does echo all the usergroups.. why it would not work on your code? it doesnt make sense.. and what's up with all this [high]Cross dependency found in OUTER JOIN[/high]?? i searched php.net and didnt find any relevant help. can you explain firefly? i want to learn this stuff.

thanks alot.
Reply With Quote
  #8  
Old 03-13-2002, 11:44 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dunno... try moving the row with LEFT JOIN user above the row with LEFT JOIN usergroup. *shrugs*
Reply With Quote
  #9  
Old 03-13-2002, 02:53 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any of the devs(or hackers) can give me a hint? freddie, PPN? can you make a roumanian happy? thank you for taking the time to read this.
Reply With Quote
  #10  
Old 04-21-2002, 08:37 AM
TaP TaP is offline
 
Join Date: Nov 2001
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

were do i add this?
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 11:12 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.04653 seconds
  • Memory Usage 2,295KB
  • Queries Executed 23 (?)
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
  • (3)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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_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