Prefix use in send prayer chain message | Prayer Requests | Support

Support Forum

We use and recommend UK2 for hosting - get a month free

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register sp_MemberList Members

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Prefix use in send prayer chain message
24th January 2018
6:01 pm
Avatar
Member
Members
Forum Posts: 16
Member Since:
10th January 2018
sp_UserOfflineSmall Offline

I have a request for a change to file includes/prayer_chain.php:

Old code, line 54:

$results=$wpdb->get_results('SELECT CONCAT_WS(" ", first_name,last_name) AS name FROM '.CA_PEO_TBL.' WHERE prayer_chain=1 ORDER BY last_name,first_name');

Change to:

$results=$wpdb->get_results('SELECT CONCAT_WS(" ", first_name,prefix,last_name) AS name FROM '.CA_PEO_TBL.' WHERE prayer_chain=1 ORDER BY last_name,first_name');

...to add the prefix for a person's name. By testing it on my live testing site, this seems to work.

24th January 2018
6:13 pm
Avatar
Member
Members
Forum Posts: 16
Member Since:
10th January 2018
sp_UserOfflineSmall Offline

Also, label for adding people is currently fixed (is not language dependent):

Also in file includes/prayer_chain.php, line 142:

echo '<form action="" method="POST"><p><label>Add to Chain</label><input type="text" name="name" placeholder="'.__('Name','church-admin').'"/><input type="hidden" name="add_to_prayer_chain"

to be changed to

echo '<form action="" method="POST"><p><label>'.__('Add to Chain','church-admin').'</label><input type="text" name="name" placeholder="'.__('Name','church-admin').'"/><input type="hidden" name="add_to_prayer_chain"
24th January 2018
6:43 pm
Avatar
Admin
Forum Posts: 502
Member Since:
4th March 2015
sp_UserOfflineSmall Offline

The name thing is better done

$name=implode(" ",array_filter(array($row->first_name,$row->middle_name,$row->prefix,$row->last_name)));

That uses all parts of the name where they exist and adds no spaces where they don't

Otherwise made changes suggested. Thanks

If you find the plugin useful, please buy me a coffee for all the late nights working on it!

24th January 2018
10:45 pm
Avatar
Member
Members
Forum Posts: 16
Member Since:
10th January 2018
sp_UserOfflineSmall Offline

You're right, thanks. The above version worked in my check but the new code is better fitting and takes more into account, perfect!

Forum Timezone: Europe/London

Most Users Ever Online: 20

Currently Online:
7 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

David Z.: 65

Allen: 51

Gavin: 31

rrfranks: 25

Janeen: 23

ehout: 20

Jay Jones: 19

Arjan_b: 16

calvarydayton: 14

rdbingham: 12

Member Stats:

Guest Posters: 26

Members: 298

Moderators: 0

Admins: 1

Forum Stats:

Groups: 4

Forums: 13

Topics: 309

Posts: 1182

Administrators: andymoyle: 502