Welcome, Guest
Please Login or Register.    Lost Password?

[SOLVED]Hard coded language ("need approval")
(1 viewing) (1) Guest
Pre-RC Discussion
Go to bottomPage: 1
TOPIC: [SOLVED]Hard coded language ("need approval")
#6281
[SOLVED]Hard coded language ("need approval") 3 Years ago Karma: 0
I translated groupjive to Swedish but I still have "need approval" for group managers when they check in for unapproved users. Where can I find that string?
crisscross
Newbie
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2009/01/28 21:41 By crisscross.
The administrator has disabled public write access.
 
#6282
Re:Hard coded language ( 3 Years ago Karma: 25
crisscross wrote:
I translated groupjive to Swedish but I still have "need approval" for group managers when they check in for unapproved users. Where can I find that string?
Crisscross,
This is a tricky one.
The function that returns this value uses the Db value directly... what I mean is, the original Dev stored a value in the STATUS field of the gj_users db of 'active' 'inactive' 'need approval', then uses those values directly in the output. This is OK for a single language program (GJ probably was when first developed) but should be changed to user types which then assign a variable from the language file.

I will work on this a bit later and post something for you if you like...
Aaron.
Braineater
Moderator
Posts: 189
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#6283
FIX for Hard coded language 3 Years ago Karma: 25
OK,
two small mods to make... first open language/english.php and add these two lines,

Code:

define('GJ_NEED_APPROVAL','Needs Approval!');
define('GJ_INVITED','Invited, Needs Approval!');


They can be added to the bottom, or do as I did and insert them around L256 so they are near all the other 'invite' vars. Now go ahead and translate and add the translated lines to your language file.

Open gj/core/members.php and find the following starting at around L215

Code:

for ($i=0, $n=count( $rows ); $i < $n; $i++) {
if ( $gjConfig['real_names'] ) {
$rows[$i]['realname'] = $rows[$i]['name'];
} else {
$rows[$i]['realname'] = $rows[$i]['uname'];
}
}


Change this by adding the following code (4 lines)-
Code:

if ( $rows[$i]['status'] == 'need approval') {
$rows[$i]['status'] = GJ_NEED_APPROVAL ; }
if ( $rows[$i]['status'] == 'invited') {
$rows[$i]['status'] = GJ_INVITED ; }


So the final looks like this..
Code:

for ($i=0, $n=count( $rows ); $i < $n; $i++) {
if ( $gjConfig['real_names'] ) {
$rows[$i]['realname'] = $rows[$i]['name'];
} else {
$rows[$i]['realname'] = $rows[$i]['uname'];
}
if ( $rows[$i]['status'] == 'need approval') {
$rows[$i]['status'] = GJ_NEED_APPROVAL ; }
if ( $rows[$i]['status'] == 'invited') {
$rows[$i]['status'] = GJ_INVITED ; }
}



As usuall, I take no responsibility for the consequences of using this fix... for all I know it could cause the end of the world as we know it... (probably not though...)
If you do not want to go through all the work, I have attached a fixed members.php you can just copy over your existing one... you will need to rename it after downloading...

Have fun,
Aaron.
File Attachment:
File Name: members.txt
File Size: 16291
Braineater
Moderator
Posts: 189
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2009/01/25 00:07 By Braineater.
The administrator has disabled public write access.
 
#6285
Re:FIX for Hard coded language 3 Years ago Karma: 0
Thank you very much for that quick solution!
crisscross
Newbie
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: Braineater
RocketTheme Joomla Templates