Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Use User Profile Fields in AdminCP Emails Details »
Use User Profile Fields in AdminCP Emails
Mod Version: 1.00, by Elenna (Member) Elenna is offline
Developer Last Online: Dec 2017 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.6.8 Rating: (0 vote - 0 average) Installs: 6
Released: 21 Nov 2007 Last Update: Never Downloads: 16
Not Supported Code Changes Re-usable Code  

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:
http://www.vbulletin.org/forum/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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


After add

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Add additional ones if you have multiple fields you want to use in your emails.
Your lines should look something like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.



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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Your line 163 should look something like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Step 5: Linking field and variable
Around line 164, find

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


After $user['userid'] add in $user['X'] where X is the field's name.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Your line 164 should look like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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!


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

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 21 Nov 2007, 23:26
edenx edenx is offline
 
Join Date: Nov 2006
Will be great if this was done via plugins...
Reply With Quote
  #3  
Old 22 Nov 2007, 02:06
Elenna Elenna is offline
 
Join Date: Jan 2006
Location: St. Charles, MO
Real name: Dana
Sorry, I don't know how to do that
Reply With Quote
  #4  
Old 23 Nov 2007, 10:02
gsmlover4u's Avatar
gsmlover4u gsmlover4u is offline
 
Join Date: Jan 2007
Originally Posted by edenx View Post
Will be great if this was done via plugins...
agree with you...................
Reply With Quote
  #5  
Old 23 Nov 2007, 10:04
WhaLberg's Avatar
WhaLberg WhaLberg is offline
 
Join Date: Nov 2006
Location: Dersaadet
Real name: MengŁ Kağan
This is a great idea.
Reply With Quote
  #6  
Old 23 Nov 2007, 14:30
Elenna Elenna is offline
 
Join Date: Jan 2006
Location: St. Charles, MO
Real name: Dana
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 10 May 2008, 22:41
Elenna Elenna is offline
 
Join Date: Jan 2006
Location: St. Charles, MO
Real name: Dana
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


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 03:50.

Layout Options | Width: Wide Color: