*

Burton

  • ***
  • 128
Dear #FirstName# - Yet I am not using First Name
« on: March 07, 2015, 06:26:07 AM »
I am not using FirstName in/on my Registration page.

So there is no  #FirstName# in the system,

So when an Admin/System email goes out it looks like this:  Dear   ,

All changes done in the lang_main.php

I have managed to correct/change some of the #FirstName# to #UserName# or #StrID# and it workd fine, the members Username is placed after Dear

But!  I have a few emails (membership change/upgrade) that nothing seems to work with, I have tried changing #FirstName# to #UserName# or #StrID# or #UserId# or #NickName# or  #RealName# but nope still:  Dear   ,

So I just added after Dear .... Dear Member,

Is there any coding I could add to solve this?

Like  #FirstName# is always replaced by #UserName#

your help appreciated :)

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #1 on: March 07, 2015, 07:08:53 AM »
Hello Burton,

You are more than likely wasting your time trying to send to First Names as Most members
don't even fill it in.

Best to leave it as username and the members know who it is all the same  ;)
#UserName# Should be working also, are you updating the database lang after every editing you do?
« Last Edit: March 07, 2015, 07:31:52 AM by Pharg »
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

Burton

  • ***
  • 128
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #2 on: March 07, 2015, 08:03:11 AM »
Hello Phil,

Thanks for your reply,

Yes updating database language after changes, yet no #UserName# being displayed for Member Upgrade/Change emails,

Not a big problem, just small details :)

"Dear member" looks fine :)

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #3 on: March 07, 2015, 08:48:12 AM »
Hello Phil,

Thanks for your reply,

Yes updating database language after changes, yet no #UserName# being displayed for Member Upgrade/Change emails,

Not a big problem, just small details :)

"Dear member" looks fine :)

Hi Burton,

Try this #sendername# I was just testing the myFriends plugin and this is what is uses in the email.
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

Burton

  • ***
  • 128
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #4 on: March 07, 2015, 09:00:13 AM »
Thank you Phil,

I will try #sendername# and report back the results soon,

best wishes :)

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #5 on: March 07, 2015, 09:50:13 AM »
Thank you Phil,

I will try #sendername# and report back the results soon,

best wishes :)
Hi Burton,

Here it is for the username, I even tested it, its #UserId#
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

Burton

  • ***
  • 128
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #6 on: March 07, 2015, 10:57:23 AM »
Thank you Phil,

I will try that tomorrow, and report back to you,

much appreciation for your time and help :)

*

CBG

  • *****
  • 673
    • osDate Forum
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #7 on: March 07, 2015, 11:31:25 AM »
I have done a quick search through the files that use #FirstName# in osDate 2.6.5 - see below for list.
In some cases #UserName# may not be used, or used for the sender of the message etc..., so what you could do is change the files listed below to use #FirstName# but pull the Username for that user.

buddybanlist.php
compose.php
mailmessages.php
modifyuser.php
resend_conflink.php
savesignup.php
send_birthday_message.php
sendwinks.php
admin\approve_snaps.php
admin\approve_videos.php
admin\featured_profile.php
admin\mship_expiry_reminders.php
admin\profile.php
admin\reactivate.php
cronjobs\mship_expiry_reminders_email.php
cronjobs\mymatches_email.php
cronjobs\send_birthday_messages.php
cronjobs\speeddater_email.php
libs\blog_class.php
plugins\speedDater\libs\speedDater.php
« Last Edit: March 07, 2015, 02:28:02 PM by CBG »
Regards,
CBG (Garry)
osDate: 2.6.5, 2.7 & Evo
PHP: 5.5.x/5.6.x (5.3.x to 5.6.x) | MySQL: 5.5.34-cll

*

Burton

  • ***
  • 128
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #8 on: March 07, 2015, 11:44:16 AM »
Thank you CBG,

That helps, as changing the  #FirstName# to #UserName#  in lang_main.php did not always work for me,

I will go through your list and report back on my findings,

thank you again :)

*

Burton

  • ***
  • 128
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #9 on: March 07, 2015, 11:56:54 AM »
Thank you CBG,

That helps, as changing the  #FirstName# to #UserName#  in lang_main.php did not always work for me,

This is what I get if I change the lang_main.php to #UserId# or #UserName#

......................

Dear #UserId#,

Your current membership level Free has been changed to 3 Month Gold which will expire on May 27, 2015.

.....................

so it does not pull the #UserId# or #UserName# or #StrID#

......................

Dear #UserName#,

Your current membership level 3 Month Gold has been changed to Free which will expire on Feb 26, 2016.

....................
 
CBG could you explain this please?

"so what you could do is change the files listed below to use #FirstName# but pull the Username for that user."

*

CBG

  • *****
  • 673
    • osDate Forum
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #10 on: March 07, 2015, 12:38:05 PM »
I will do a how to today for this, may take awhile but will get it done, but I won't be able to test it, so you will need to report back with bugs.
Regards,
CBG (Garry)
osDate: 2.6.5, 2.7 & Evo
PHP: 5.5.x/5.6.x (5.3.x to 5.6.x) | MySQL: 5.5.34-cll

*

Burton

  • ***
  • 128
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #11 on: March 07, 2015, 12:46:54 PM »
Thank you CBG,

No rush at all, as it only a small not so important issue,

best wishes :)

*

CBG

  • *****
  • 673
    • osDate Forum
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #12 on: March 07, 2015, 02:26:50 PM »
Hi,

What this does is:
This changes all #FirstName# in the language files to use the members Username instead of there Firstname.

How to:
The changes can be seen below, I have also attached a zip with the changes already made to the files for osDate 2.6.5.
I have NOT tested this, so please report any issues.


Open: buddybanlist.php

Find:
Code: [Select]
$ref_userfirstname = $usr['firstname'];

Change to:
Code: [Select]
$ref_userfirstname = $usr['username'];


Open: compose.php

Find:
Code: [Select]
$message = str_replace('#FirstName#', $row['firstname'] ,$message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $row['username'] ,$message);


Open: mailmessages.php

Find:
Code: [Select]
$msg = str_replace('#FirstName#',$usrrec['firstname'],$msg);

Change to:
Code: [Select]
$msg = str_replace('#FirstName#',$usrrec['username'],$msg);


Open: modifyuser.php

Find:
Code: [Select]
$To = $firstname.' '.$lastname.'<'.$email.'>';

Change to:
Code: [Select]
$To = $username.'<'.$email.'>';

Find:
Code: [Select]
$body = str_replace( '#FirstName#',  $firstname , $body );

Change to:
Code: [Select]
$body = str_replace( '#FirstName#',  $username , $body );


Open: resend_conflink.php

Find:
Code: [Select]
$body = str_replace( '#FirstName#',  $row['firstname'] , $body );

Change to:
Code: [Select]
$body = str_replace( '#FirstName#',  $row['username'] , $body );


Open: savesignup.php

Find:
Code: [Select]
$To = $firstname.' '.$lastname.'<'.$email.'>';

Change to:
Code: [Select]
$To = $username.'<'.$email.'>';

Find:
Code: [Select]
$body = str_replace( '#FirstName#',  $firstname , $body );

Change to:
Code: [Select]
$body = str_replace( '#FirstName#',  $username , $body );


Open: send_birthday_message.php

Find:
Code: [Select]
$message = str_replace('#FirstName#', $row['firstname'] ,$message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $row['username'] ,$message);


Open: sendwinks.php

Find:
Code: [Select]
$message = str_replace('#FirstName#', $usr['firstname'], $message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $usr['username'], $message);


Open: admin\approve_snaps.php

Find:
Code: [Select]
$message = str_replace('#FirstName#', $user['firstname'],$message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $user['username'],$message);


Open: admin\approve_videos.php

Find:
Code: [Select]
$message = str_replace('#FirstName#', $user['firstname'],$message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $user['username'],$message);


Open: admin\featured_profile.php

Find:
Code: [Select]
$message = str_replace('#FirstName#', $usr['firstname'],$message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $usr['username'],$message);


Open: admin\mship_expiry_reminders.php

Find:
Code: [Select]
$letter = str_replace( '#FirstName#',  $user['firstname'] , $letter );

Change to:
Code: [Select]
$letter = str_replace( '#FirstName#',  $user['username'] , $letter );


Open: admin\profile.php

Find:
Code: [Select]
$message = str_replace('#FirstName#', $userlevel['firstname'],$message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $userlevel['username'],$message);

Find:
Code: [Select]
$message = str_replace('#FirstName#', $usr['firstname'],$message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $usr['username'],$message);


Open: admin\reactivate.php

Find:
Code: [Select]
$message = str_replace('#FirstName#', $usr['firstname'] ,$message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $usr['username'] ,$message);


Open: cronjobs\mship_expiry_reminders_email.php

Find:
Code: [Select]
$letter = str_replace( '#FirstName#',  $user['firstname'] , $letter );

Change to:
Code: [Select]
$letter = str_replace( '#FirstName#',  $user['username'] , $letter );


Open: cronjobs\mymatches_email.php

Find:
Code: [Select]
$message = str_replace('#FirstName#', $user['firstname'] ,$message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $user['username'] ,$message);


Open: cronjobs\send_birthday_messages.php

Find:
Code: [Select]
$letter = str_replace( '#FirstName#',  $user['firstname'] , $message );

Change to:
Code: [Select]
$letter = str_replace( '#FirstName#',  $user['username'] , $message );


Open: cronjobs\speeddater_email.php

Find:
Code: [Select]
$message = str_replace('#FirstName#', $user['firstname'] ,$message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $user['username'] ,$message);


Open: libs\blog_class.php

Find:
Code: [Select]
$message = str_replace('#FirstName#', $this->owner_data['firstname'], $message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $this->owner_data['username'], $message);


Open: plugins\speedDater\libs\speedDater.php

Find:
Code: [Select]
$message = str_replace('#FirstName#', $usr['firstname'], $message);

Change to:
Code: [Select]
$message = str_replace('#FirstName#', $usr['username'], $message);

« Last Edit: March 07, 2015, 02:29:22 PM by CBG »
Regards,
CBG (Garry)
osDate: 2.6.5, 2.7 & Evo
PHP: 5.5.x/5.6.x (5.3.x to 5.6.x) | MySQL: 5.5.34-cll

*

Burton

  • ***
  • 128
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #13 on: March 08, 2015, 05:32:41 AM »
Thank you CBG,

Your time and help greatly appreciated :)

*

Burton

  • ***
  • 128
Re: Dear #FirstName# - Yet I am not using First Name
« Reply #14 on: March 12, 2015, 03:11:26 AM »
Hi, I wanted to update this post, I have added all CBG's code changes, and they are working well, the Username is now displayed in all Messages, Winks, Notifications,

thank you CBG :)