jOpenSimWorld

Grid Status: Online
Total Regions: 23
Visitors (30 Days): 12
Total Residents: 485
Online Now: 0
Hypergriders online: 0

No friends listed text change

14 years 1 month 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.

14 years 1 month 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.

14 years 1 month 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.103 seconds

Search

Donate jOpenSim

Please consider supporting our efforts.

Amount

Our Regions

Region: Loc X: Loc Y:
Agora 1000 998
BareBad… 997 997
Bohemas 996 998
BoraBor… 1002 999
Crystal… 1001 1000
DeepTho… 1005 998
FoToSan… 999 995
jCity 1001 997
jOpenWe… 1000 999
JuniorT… 1002 1001
Kanadah… 1002 1000
LindaKe… 1000 997
LittleC… 996 997
MonteSc… 1001 1001
Naos 999 999
Pangaea 1005 1003
RiverSi… 999 1000
Sakani 999 998
Snambin 1001 998
Tartola 997 998
ViewerH… 1002 998
WaterWo… 1001 999
WilderK… 1000 1000

jOpenSimWorld

Grid Status: Online
Total Regions: 23
Visitors (30 Days): 12
Total Residents: 485
Online Now: 0
Hypergriders online: 0