User Status Plugin hacking

Hi all,

I've been working to alter Brett's user status plugin to change css to add a colored border around the user's avatar instead of an icon, but I can't seem to find an end solution to getting the borders to display.

I got the icon to stop displaying, and have found the conditional that triggers whether a user is online or not. my problem is that I don't know what method I could use to override the css to change these borders.

I tried to extend the view based based on the conditional, but came to find that you're supposed to call extended views in start.php, so i'm guessing thats not my solution.

my next proposed solution is using the conditional to switch between css entry for an "online" and "offline" status. I tried various methods of this in the first place, but didn't make any headway. If anyone has any suggestions or solutions i'd love to hear them.

thanks in advance,

Colin

  • Hey Colin, 

    Can you give show the code for the conditional in the user status plugin? (I've never used it before)

    I've hacked some Elgg CSS a few times, I might be able to help. 

  • mod/user_status/views/default/user_status/online.php

    <?php
    /**
     * User Status
     *
     * @package User Status
     * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
     * @author Brett Profitt
     * @copyright Brett Profitt 2009
     * @link http://eschoolconsultants.com
     */

    // this timeout is in minutes
    $timeout = 60 * (int)get_plugin_setting('online_timeout', 'user_status');
    $last_action = $vars['entity']->last_action;


    if (time() - $last_action < $timeout) {
        $params = array(
            'user_status_name' => $vars['user_status_name'],
            'alt' => elgg_echo('user_status:online'),
            'size' => $vars['size']
        );
        echo elgg_view('user_status/user_status_icon', $params);
    }

     

     

  • i've had some time to brainstorm and have a cup ;)

    does it seem more plausible/possible to

    A.) variablize the css to change based on online status condition

    B.) variablize the html to change css classes/ids of html elements to an "online" css entry for online status condition

     

  • I'd probably variablize the CSS/HTML like you mentioned.. somehow ;) I'm not a CSS wizard, but that'd probably be my approach. My CSS related hacks are just that.. hacks. 

  • What i'm looking for more than changing core (or theme) css to be variablized is a way to do this as patch to the current user_status plugin.

    i've come to the conclusion that I would most likely achieve this by copying the relevant avatar css to the user_status css file so as to override the original css from the theme (of course loading the user_status plugin later in the load order from the theme file), variablizing the border declaration and using the online status conditional to trigger the changes to the variable controlling the border syntax.

    anyone have any advice or opinions? I'd be glad to hear them. Also if anyone has any information regarding which css information pertains to user avatars, that would greatly appreciated

  • Try to check the code in izap recent visitors plugin it has that code to display green boder when user is online.