Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter ashton1993

    (@ashton1993)

    Yeah, sure thing, basically I got pooped out with using bp-custom.php to modify the properties of Buddypress externally so I figured it’d be hard-coded in somewhere and I could hack it easily enough which turned out to be much easier, anyway, download the plugin and then open the file Buddypress->bp-groups->bp-groups-loader.php the region your interested in is lines 265-359 which defines the menu in a pretty straightforwards way, on line 275 change 'default_subnav_slug' => 'home', to 'default_subnav_slug' => 'forum', if you want to play arround with the other values each menu item is set out like this:

    if ( $this->current_group->enable_forum && bp_is_active( 'forums' ) ) {
    $sub_nav[] = array(
    'name'            => __( 'Forum', 'buddypress' ),
    'slug'            => 'forum',
    'parent_url'      => $group_link,
    'parent_slug'     => $this->current_group->slug,
    'screen_function' => 'groups_screen_group_forum',
    'position'        => 40,
    'user_has_access' => $this->current_group->user_has_access,
    'item_css_id'     => 'forums'
    );
    }

    All you probably want to change is name which is just how it shows on the navigation, slug which is what it looks like in the URL and position which is just the order on the menu and I don’t reckon you’ll have any problem with that, upload it again and it’ll work like a charm, hope that helps.

    P.S: I’m using Buddypress 1.54

    Thread Starter ashton1993

    (@ashton1993)

    Sorry, just ended up a bit busy and forgot about this but basically I was using inline upload and had modified it so that when a user uploaded a file it would go to their own directory (I’m using buddypress for a social networking rig) except I discovered the plugin WP-Filebase which makes this obsolete >_<

    Thread Starter ashton1993

    (@ashton1993)

    Awesome! It’s working perfectly now! Well thanks for all the help ?? do you think it’d be useful for me to post the code somewhere it can be used again by others or would I just be clogging things up?

    Thread Starter ashton1993

    (@ashton1993)

    I’ve refined my code more though still having some dificulity, it should work but for some reason it doesn’t:

    <?php
    		global $current_user;
    		get_currentuserinfo();
    
    		$filename = "https://www.pixelsgame.org/upload/{$current_user->user_login}/";
    
    		if (file_exists($filename)) {
    		echo 'https://www.pixelsgame.org/upload/' . $user_info->user_login . ' supposedly already created'; } else {
    		echo 'https://www.pixelsgame.org/upload/' . $current_user->user_login . ' supposedly just created';
    		mkdir("$filename");
        		}
    		?>

    It echoes “https://www.pixelsgame.org/upload/ashton supposedly just created” when I use it though doesn’t create the directory, any clues?

    Thread Starter ashton1993

    (@ashton1993)

    Heh, it was only when you posted that I realized I could change the upload directory rather than set up another FTP account to get decent looking links. Anyways I changed the code to:

    <?php $upload_dir = wp_upload_dir(); ?>
    <?php mkdir($upload_dir . "" . $user_info->user_login); ?>

    Which doesn’t return an error phew, though neither does it create a directory for that user, I however came to the realization $user_info->user_login should only return a value when a user is logged in so I went on to write:

    24		<?php $upload_dir = wp_upload_dir();
    25		$dirname = $_POST[$user_info->user_login];
    26		$filename = "/$upload_dir/{$dirname}/";
    27
    28		if (file_exists($filename)) {
    29		echo ""; } else {
    30		mkdir($upload_dir . "" . $user_info->user_login);
    31    		}
    32		?>

    Then chuck it in the theme header but got this error

    Warning: mkdir() [function.mkdir]: File exists in /hermes/bosweb/web096/b966/ipg.pixelsgamenet/wp-content/plugins/buddypress/bp-themes/bp-default/header.php on line 30

    Sorry if I’m just being silly.

    Thread Starter ashton1993

    (@ashton1993)

    Oh sorry, it’s:

    <?php mkdir("/upload/" . $user_info->user_login); ?>

    Should have specified that was line 14

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