No friends listed text change

9 years 10 months ago #64 by rjspence
With no friends on the list for new users, the module displayed a blank friends online box.
I\'ve altered this a tad to say something if new users have not yet added a friend to their list.

/modules/mod_opensim_friends

Original:
========
Line 34-40
// Create a userfriendly status-message
if(count($friendlist) > 0) {

	foreach($friendlist AS $friendkey => $friend) {

		if($friend&#91;\'onlinestatus\'&#93; == 1) $friendlist&#91;$friendkey&#93;&#91;\'statusmsg\'&#93; = \"<font color=\'\".$onlinecolor.\"\'>\".JText::_(\'Online\').\"</font>\";

		else $friendlist&#91;$friendkey&#93;&#91;\'statusmsg\'&#93; = \"<font color=\'\".$offlinecolor.\"\'>\".JText::_(\'<strong>Offline</strong>\').\"</font>\";

	}

}

Changes:
=======
Line 34-41
// Create a userfriendly status-message
if(count($friendlist) < 1) {
        echo JText::_(\'LABEL_FRIENDSLIST\');
        } else {
	foreach($friendlist AS $friendkey => $friend) {

		if($friend&#91;\'onlinestatus\'&#93; == 1) $friendlist&#91;$friendkey&#93;&#91;\'statusmsg\'&#93; = \"<font color=\'\".$onlinecolor.\"\'>\".JText::_(\'Online\').\"</font>\";

		else $friendlist&#91;$friendkey&#93;&#91;\'statusmsg\'&#93; = \"<strong><font color=\'\".$offlinecolor.\"\'>\".JText::_(\'<strong>Offline</strong>\').\"</font></strong>\";

	}

}

Or another way it can be said.. not really necessary that I see. The above works fine.
// Create a userfriendly status-message

if(count($friendlist) < 1) {
        echo JText::_(\'LABEL_FRIENDSLIST\');
        } else if(count($friendlist) > 0) {

	foreach($friendlist AS $friendkey => $friend) {

		if($friend&#91;\'onlinestatus\'&#93; == 1) $friendlist&#91;$friendkey&#93;&#91;\'statusmsg\'&#93; = \"<strong><font color=\'\".$onlinecolor.\"\'>\".JText::_(\'Online\').\"</font></strong>\";

		else $friendlist&#91;$friendkey&#93;&#91;\'statusmsg\'&#93; = \"<strong><font color=\'\".$offlinecolor.\"\'>\".JText::_(\'<strong>Offline</strong>\').\"</font></strong>\";

	}

}

Also need to alter your /languages/en-GB.mod_opensim_friends.ini

Language file addition:
LABEL_FRIENDSLIST=No friends online or none enabled

Please Log in or Create an account to join the conversation.

9 years 10 months ago #65 by foto50
Hmmm, in my demo site, the friends module does not show up at all (not even an empty box) when logged in and not having any friend on the list. Maybe this also got something to do with the template?

Greetz
FoTo50

Please Log in or Create an account to join the conversation.

9 years 10 months ago #66 by rjspence
Interesting. Could be I suppose. I was thinking that my template might be having problems as well until I looked at the code. The code looks good as far as I see both template and module. When installing the module, I noticed that I had the empty box all the time when logged in. I\'ve not had it where the module would not show after setting it to display on the front page (registered users). Might try another module position and set it to front page only and see if that helps. Not sure why it would not show up at all. The only other thing I changed was ownership from apache to another user for editing.

Please Log in or Create an account to join the conversation.

Time to create page: 0.124 seconds

Search

Our Regions

Region: Loc X: Loc Y:
Agora 1000 998
Basilic… 1007 1000
Bay Sho… 997 1003
Boardwa… 1003 1004
BoraBor… 1002 999
Canary … 997 999
Creator… 990 990
Crystal… 1001 1000
DeepTho… 1005 998
Fantasy 1009 1004
FoToSan… 996 995
Hiatus 1007 1004
jAdult 1003 1003
jCity 1009 1003
jOpenWe… 1000 999
JuniorT… 1002 1001
Kanadah… 1002 1000
Kansas 1007 1003
Kodu 980 983
LindaKe… 1000 997
MA2 1008 1003
MA5 1008 1004
MonteSc… 1001 1001
Mountai… 1009 1000
Naos 999 999
Pangaea 1005 1003
RiverSi… 999 1000
Sakani 999 998
Snambin 1001 998
Tropica… 1004 1003
ViewerH… 1002 998
WaterWo… 1001 999
WilderK… 1000 1000

Donate jOpenSim

Please consider supporting our efforts.

Amount