river sidebar glich

hy there i copied pages/river to mod/mytheme/pages/river since i don't wan't to use diferent plugin to handle a few basic modifications 

but this did not owerwrite default look of activity so i use this code in mytheme start

    elgg_unregister_page_handler('activity', 'elgg_river_page_handler');
    elgg_register_page_handler('activity', 'river_new_page_handler');

function river_new_page_handler($page) {
    $base = elgg_get_plugins_path() . 'aalborg_theme';
    require_once($base."/pages/river.php");
    return true;
}​

so the problem now is that after i logout i get default activity view (with one sidebar insted of my modified one with two sidebars) but if i go to any other page and return to activity it sets to my modified view

is this because of my code ore what ? 

thanks in advice 

p.s. sorry for my bad english (i'm from EU)

  • ok i got the problem so logout send me to localhost that have one sidebar and when i press home it's actualy linked to localhost/activity is there a way to change the view for localhost too ? 

  • Try in start.php of your theme:

    elgg_unregister_page_handler('activity', '_elgg_river_page_handler');
    elgg_register_page_handler('activity', 'river_new_page_handler');
    
    function river_new_page_handler($page) {
        elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());
    
        $page_type = elgg_extract(0, $page, 'all');
        $page_type = preg_replace('[\W]', '', $page_type);
        if ($page_type == 'owner') {
            elgg_gatekeeper();
            $page_username = elgg_extract(1, $page, '');
            if ($page_username == elgg_get_logged_in_user_entity()->username) {
                $page_type = 'mine';
            } else {
                set_input('subject_username', $page_username);
            }
        }
        set_input('page_type', $page_type);
    
        require_once dirname(__FILE__) . '/pages/river.php';
        return true;
    }

    Now edit file:

    mod/your_theme/pages/river.php

  • nope still works only under the /activity 

  • even editing elgg core filer for river it only works in activity 

    so what sets the look for index ?

  • ok fixed it myself like this

            elgg_unregister_page_handler('activity', 'elgg_river_page_handler');
            elgg_register_page_handler('activity', 'river_new_page_handler');
            elgg_register_page_handler('', 'river_new_page_handler');

     

    function river_new_page_handler($page) {
        elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());
    
        $page_type = elgg_extract(0, $page, 'all');
        $page_type = preg_replace('[\W]', '', $page_type);
        if ($page_type == 'owner') {
            elgg_gatekeeper();
            $page_username = elgg_extract(1, $page, '');
            if ($page_username == elgg_get_logged_in_user_entity()->username) {
                $page_type = 'mine';
            } else {
                set_input('subject_username', $page_username);
            }
        }
        set_input('page_type', $page_type);
    
        require_once dirname(__FILE__) . '/pages/river.php';
        return true;
    }