jOpenSimWorld

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

No friends listed text change

14 years 4 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.

14 years 4 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.

14 years 4 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.062 seconds