Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
Use User Profile Fields in AdminCP Emails Details »»
Use User Profile Fields in AdminCP Emails
Version: 1.00, by Elenna Elenna is offline
Developer Last Online: Dec 2017 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.6.8 Rating:
Released: 11-20-2007 Last Update: Never Installs: 7
Re-useable Code Code Changes  
No support by the author.

This is a very quick mod. This is my first release, so I appologize if I've missed any normal verbage or protocols.

I tried to make this simple, but I'm not the best at explaining things. Let me know if you have any questions and I'll do my best to help you out.

This was requested here:
https://vborg.vbsupport.ru/showthread.php?t=150947

This mod will allow you to insert your custom User Profile Fields into emails sent via AdminCP. I have not tested it, but this might work for other mods that use the email.php script in admincp.

See below for the modification. You can also download the attached txt file if you wish.


** This mod requires that you edit a core file. If you upgrade, you will need to re-edit the file. **


In the following examples, I have created a field, field12, that holds 'Game Version'. This mod works best for text fields and single drop-down lists.

Step 1: Noting Your Fields
Go to your User Profile Fields and make note of which fields you want to use in your emails. Also make note of the field Name, seen to the left of Display Order (i.e. field12).


Step 2: Editing File
Open admin/email.php - make a backup just in case!


Step 3: Pulling fields from database
Around line 130, find
Code:
SELECT user.userid, user.usergroupid, user.username, user.email, user.joindate,
useractivation.activationid

After add
Code:
, userfield.field12

Add additional ones if you have multiple fields you want to use in your emails.
Your lines should look something like this:
Code:
SELECT user.userid, user.usergroupid, user.username, user.email, user.joindate,
useractivation.activationid, userfield.field12


Step 4: Naming the Variables
In this step you will name the variables that you use in your email. Just like $username inserts the member's username, you will want to choose something easy to remember and short. I've chosen $gameversion.

Around line 163, find
Code:
array('$email', '$username', '$userid'),

After '$userid' add the variable you want to use, including the dollar sign.
Code:
, '$gameversion'

Your line 163 should look something like this:
Code:
array('$email', '$username', '$userid', '$gameversion'),
Step 5: Linking field and variable
Around line 164, find
Code:
array($user['email'], $user['username'], $user['userid']),

After $user['userid'] add in $user['X'] where X is the field's name.
Code:
$user['field12']),

Your line 164 should look like this:
Code:
array($user['email'], $user['username'], $user['userid'], $user['field12']),

Step 6: Testing
You DID make a backup copy, right? Good! Now, save and upload the email.php file, and send an email to yourself via AdminCP using your spiffy new variable!


Quote:
Hello $username,
Your game version is $gameversion - time to upgrade!

Show Your Support

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

Comments
  #2  
Old 11-21-2007, 10:26 PM
edenx edenx is offline
 
Join Date: Nov 2006
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will be great if this was done via plugins...
Reply With Quote
  #3  
Old 11-22-2007, 01:06 AM
Elenna Elenna is offline
 
Join Date: Jan 2006
Location: St. Charles, MO
Posts: 422
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I don't know how to do that
Reply With Quote
  #4  
Old 11-23-2007, 09:02 AM
gsmlover4u's Avatar
gsmlover4u gsmlover4u is offline
 
Join Date: Jan 2007
Posts: 348
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by edenx View Post
Will be great if this was done via plugins...
agree with you...................
Reply With Quote
  #5  
Old 11-23-2007, 09:04 AM
WhaLberg's Avatar
WhaLberg WhaLberg is offline
 
Join Date: Nov 2006
Location: Dersaadet
Posts: 569
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a great idea.
Reply With Quote
  #6  
Old 11-23-2007, 01:30 PM
Elenna Elenna is offline
 
Join Date: Jan 2006
Location: St. Charles, MO
Posts: 422
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by gsmlover4u View Post
agree with you...................
Feel free to take a stab at it Thus far no one has released anything like this, so it would be most appreciated if you could either help me with the plugin, or be happy with what I've released.
Reply With Quote
  #7  
Old 05-10-2008, 09:41 PM
Elenna Elenna is offline
 
Join Date: Jan 2006
Location: St. Charles, MO
Posts: 422
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This mod still works for 3.7, although I haven't figured out how to add it to that section

If you have upgraded and use this mod, please remember to re-edit your files!
Reply With Quote
Reply

Thread Tools

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 07:19 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.04890 seconds
  • Memory Usage 2,261KB
  • Queries Executed 20 (?)
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
  • (9)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)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