Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)

  • yaakhi
    Participant

    @yaakhi

    Thank you it worked.


    yaakhi
    Participant

    @yaakhi

    @bphelp but where exactly is bp-custom.php? sorry i could never ind it 🙁


    yaakhi
    Participant

    @yaakhi

    Sorrry but could not find the line you mentioned 🙁 here is the whole bp_profile_as_homepage_fork.php file `<?php
    /*
    Plugin Name: BP Profile as Homepage Fork
    Description: Sets the user BP Profile as homepage on the site for logged in users. This emulates Facebook.
    Author: Mort3n
    Version: 1.0
    License: GPL2
    */

    /* Copyright 2013 Mort3n

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License, version 2, as
    published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
    */

    /**
    * Redirect logged-in user from site Homepage to Profile
    * @since 1.0
    */
    function bp_profile_as_homepage_fork_homepage(){

    global $bp;

    $selected_role = get_option( ‘bpahpf_role_choice’ );

    //redirection to profile applied to all roles
    if( ” == $selected_role ){
    if( is_user_logged_in() && is_front_page() ){

    wp_redirect( $bp->loggedin_user->domain, 302 );
    exit;
    }
    }
    //redirection to profile applied to all roles EXCEPT selected_role
    else{
    if( !bp_profile_as_homepage_fork_check_user_role( $selected_role ) && is_front_page() ){
    wp_redirect( $bp->loggedin_user->domain, 302 );
    exit;
    }
    }
    }

    /**
    * Redirect after logout
    * @since 1.0
    */
    function bp_profile_as_homepage_fork_logout_redirection(){

    global $bp;

    $redirect = $bp->root_domain;

    wp_logout_url( $redirect );
    }

    /**
    * Checks if a particular user has a role.
    * Returns true if a match was found.
    * Code for this function modified from http://docs.appthemes.com/tutorials/wordpress-check-user-role-function/
    *
    * @param string $role Role name.
    * @param int $user_id (Optional) The ID of a user. Defaults to the current user.
    * @return bool
    */
    function bp_profile_as_homepage_fork_check_user_role( $role, $user_id = null ) {

    if ( is_numeric( $user_id ) )
    $user = get_userdata( $user_id );
    else
    $user = wp_get_current_user();

    if ( empty( $user ) )
    return false;

    return in_array( $role, (array) $user->roles );
    }

    /**
    * Add the admin page to the dashboard menu
    * @since 1.0
    */
    function bp_profile_as_homepage_fork_menu(){

    load_plugin_textdomain( ‘bpahpf-menu’, false, basename( dirname( __FILE__ ) ) . ‘/languages’ );
    add_options_page( __(‘BP Profile as Homepage Fork Settings’, ‘bpahpf-menu’ ), __( ‘BP Profile as Homepage Fork Settings’,’bpahpf-menu’), ‘manage_options’, ‘bpahpfmenu’, ‘bpahpf_settings_page’);
    }

    /**
    * Outputs the settings screen and saves data when submitted
    * @since 1.0
    */
    function bpahpf_settings_page(){

    //check for capability to manage options
    if ( !current_user_can( ‘manage_options’ ) ){

    wp_die( __(‘You do not have sufficient permissions to access this page.’, ‘bpahpf-menu’ ) );

    }

    $opt_name = ‘bpahpf_role_choice’;
    $data_field_name = ‘bpahpf_role_choice’;

    $opt_val = get_option( $opt_name );

    //if nonce checks out then save submitted data
    $nonce=$_REQUEST[‘_wpnonce’];
    if( wp_verify_nonce( $nonce, ‘bpahpf’ ) )
    {
    $opt_val = $_POST[ $data_field_name ];
    update_option( $opt_name, $opt_val );
    ?>
    <div class=”updated”><p><?php _e( ‘Settings saved.’, ‘bpahpf-menu’ ); ?></p></div>
    <?php

    }

    echo ‘<div class=”wrap”>’;
    echo “<h2>” . __( ‘BP Profile as Homepage Fork Settings’, ‘bpahpf-menu’ ) . “</h2>”;
    ?>
    <p>
    <?php _e( ‘Disable Profile as Homepage for a particular user role.’, ‘bpahpf-menu’ ); ?>
    </p>
    <form name=”bpahpf-settings-form” method=”post” action=””>
    <?php wp_nonce_field( ‘bpahpf’ ); ?>
    <p><b>
    <?php _e( ‘You have selected:’, ‘bpahpf-menu’ ); ?>
    </b>
    <?php
    if ( ” == $opt_val )
    _e( ‘No One’, ‘bpahpf-menu’ );
    else
    echo $opt_val;
    ?>
    <hr />
    <?php _e( ‘Who can view Homepage:’, ‘bpahpf-menu’ ); ?>
    <select name=”<?php echo $data_field_name; ?>”>
    <option value=””>
    <?php _e( ‘No One’, ‘bpahpf-menu’ ); ?>
    </option>
    <?php wp_dropdown_roles( );?>
    </select>
    </p>
    <p class=”submit”>
    <input type=”submit” name=”Submit” class=”button-primary” value=”<?php esc_attr_e( ‘Save Changes’, ‘bpahpf-menu’ ) ?>” />
    </p>
    </form>
    </div>
    <?php
    }

    add_action(‘admin_menu’,’bp_profile_as_homepage_fork_menu’);
    add_action(‘wp’,’bp_profile_as_homepage_fork_homepage’);
    add_action(‘wp_logout’,’bp_profile_as_homepage_fork_logout_redirection’);
    ?>


    yaakhi
    Participant

    @yaakhi

    App looks much more improved now, thank you. Now the messages all seem to be shown on a single window that makes it hard to figure out a particular message from a particular person. can we have separate windows for seperate coversations? something like that …


    yaakhi
    Participant

    @yaakhi

    Set access level to “read” for normal usersl


    yaakhi
    Participant

    @yaakhi

    Images in Activity don’t appear only file name is shown. can this be fixed?


    yaakhi
    Participant

    @yaakhi

    Can you implement this
    https://github.com/johnkil/SideNavigation
    instead of dropdown box for choosing filters ?


    yaakhi
    Participant

    @yaakhi

    Thank you, worked great! Keep up the devlopment.


    yaakhi
    Participant

    @yaakhi

    Can you add the capability to see user profiles within app instead of redirecting users to site?


    yaakhi
    Participant

    @yaakhi

    Server plugin still shows 0.2.2 so new update won’t be available, just delete the old version and reinstall the plugin.


    yaakhi
    Participant

    @yaakhi

    did just that and it worked! keep up the gr8 job!


    yaakhi
    Participant

    @yaakhi

    I tried using an admin account everything worked fine, then I tried on a normal account but found no Remote Access settings. I was wondering is this supposed to work only for admins or am I missing something?


    yaakhi
    Participant

    @yaakhi

    sorry it wasn’t something wrong with your app but had trouble with my server. I reinstalled everything and now everything working f9.
    can you help me in putting my web address permenantly into app?


    yaakhi
    Participant

    @yaakhi

    Hi there, app works but i can not post status updates, it just says “user posted an
    update” but the message is missing.

Viewing 14 replies - 1 through 14 (of 14 total)
Skip to toolbar