Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • phos flip
    Participant

    @wamoma

    Wish I’d seen that a few weeks ago! Thanks ๐Ÿ™‚

    Turned out I’d forgotten to reset post data on another widget – rookie error!


    phos flip
    Participant

    @wamoma

    <tumbleweed> ๐Ÿ™‚

    I figured out a solution. Probably not at all elegant but in case it’s of use the following creates a shortcode that can be used to show data to friends only using [isfriend]data[/isfriend]:

    function isfriend( $atts, $content = null ) {
    
    global $bp;
    $is_friend = friends_check_friendship( $bp->loggedin_user->id, $bp->displayed_user->id );
    $is_me = bp_is_my_profile();
    
    if($is_friend or $is_me) {
       return '<div class="right text">'.$content.'</div>';
    } 
    
    }
    
    add_shortcode("isfriend", "isfriend");
    

    phos flip
    Participant

    @wamoma

    perfect!

    Thank you ๐Ÿ™‚


    phos flip
    Participant

    @wamoma

    :-)


    phos flip
    Participant

    @wamoma

    To be frank it wouldn’t piss me off any more than trying to navigate through the spam on here.

    Fair point that maybe my opinions have no value on here and certainly offer nothing to help. You did however prevent discussion, and it much as I don’t doubt there are powerful minds already at work on the issue that doesn’t mean it isn’t possible somebody else might have a helpful suggestion to make given the opportunity to discuss.

    I did try to search for relevant threads – all I got was results of spam though ;-)


    phos flip
    Participant

    @wamoma

    The error was just because I’d deleted a string for one of the translations. Have added the string back in and now saves with no errors but still doesn’t update the changes on the site.


    phos flip
    Participant

    @wamoma

    Hi Paul – this is what I have in custom.php

    `define( ‘BPLANG’, ‘mysite’ );
    if ( file_exists( WP_PLUGIN_DIR . ‘/languages/buddypress-‘ . BPLANG . ‘.mo’ ) ) {
    load_textdomain( ‘buddypress’, WP_PLUGIN_DIR . ‘/languages/buddypress-‘ . BPLANG . ‘.mo’ );
    }`

    and I have ‘buddypress-s4c.mo in the languages folder (in plugins) (and also the .po file)

    I’ve just gone through it again just to double check I wasn’t being dumb. I’m using poedit and noticed it gave a couple of errors when saving (wasn’t clear what they were). I’ll download poedit again and see if that maybe helps.


    phos flip
    Participant

    @wamoma

    For those saying it needs the links changing to ms-admin.php I’m guessing that means the plugin only works if multisites are enabled in wordpess?

    I’ve tried playing around to get it working in buddypress without multisites enabled but no joy.


    phos flip
    Participant

    @wamoma

    Don’t know if this is any use to anyone and no doubt there are far better ways of doing it but just in case it is of use….

    I’ve created (hacked really) a plugin made up of 3 files, one of which is useless for now but at a future point I’d like to play around with it.

    bp-group-catdisp.php

    `<?php
    /*
    Plugin Name: Display Categories
    Plugin URI:
    Description: Displays a blog category in groups
    Author: Mas
    Version: 0.1
    License: GNU General Public License 2.0 (GPL) http://www.gnu.org/licenses/gpl.html
    Site Wide Only: true
    */
    if ( !defined( ‘BP_GROUP_CATDISP’ ) )
    define ( ‘BP_GROUP_CATDISP’, ‘programme’ );

    function bp_group_catdisp_init() {
    bp_group_catdisp_wrapper();
    }

    if ( defined( ‘BP_VERSION’ ) )
    bp_group_catdisp_wrapper();
    else
    add_action( ‘bp_init’, ‘bp_group_catdisp_init’ );
    //above links to admin screen in backend
    require(dirname(__FILE__) . “/bp-group-catdisp-admin.php”);

    // group options
    function bp_group_catdisp_wrapper() {
    class bp_group_catdisp extends BP_Group_Extension {
    var $visibility = ‘private’;

    var $enable_create_step = false;
    var $enable_edit_item = false;
    var $has_caps = false;

    function bp_group_catdisp () {
    global $groups_template;

    // group title

    $this->name = __( ‘Programme’, ‘programe’ );
    $this->slug = BP_GROUP_CATDISP;
    $this->nav_item_position = 12;
    $this->create_step_position = 12;

    // group ID for displaying category within
    global $bp;

    $group_array = array( 17,11 );

    if ( in_array( $bp->groups->current_group->id, $group_array) )
    //group ID to display in array. Note can reverse this code ie. set it not to display in listed groups by placing !in_array( $bp etc.

    {
    $this->enable_nav_item = true;
    } else {
    $this->enable_nav_item = false;
    }

    }

    function display () {
    global $bp, $groups_template;

    include(“bp-group-catdisp-edit.php”);

    //bit above links to file that prints to tab

    }

    }
    bp_register_group_extension( ‘bp_group_catdisp’ );
    }

    ?>
    `

    bp-group-catdisp-edit.php

    `

    stories4change Y-Care Programme

    Information and modules related to the Y-Care Programme 2010/11

    <a href="” rel=”bookmark” title=”Permanent Link to “>

    Sorry, no posts matched your criteria.

    `

    bp-group-catdisp-admin.php

    `<?php

    function group_catdisp_add_admin_menu() {
    add_submenu_page( ‘bp-general-settings’, __( ‘Group Categories’, ‘bp_group_catdisp’ ), __( ‘Disp Cats’, ‘bp_group_catdisp’ ), ‘manage_options’, __FILE__, ‘group_catdisp_plugin_options’ );
    }
    add_action(‘admin_menu’, ‘group_catdisp_add_admin_menu’, 15);

    function group_catdisp_plugin_options() {
    if (!current_user_can(‘manage_options’)) {
    wp_die( __(‘You do not have sufficient permissions to access this page.’) );
    }
    $updated = false;
    //above this is php for creating admin page and below is printed onto admin page

    ?>

    <?php
    if ( !$options = get_option( ‘bp_gm_settings’ ) )
    $per_page = 10;
    else
    $per_page = $options;

    $args = array( ‘type’ => ‘alphabetical’, ‘per_page’ => $per_page );

    if ( $_GET == ‘name’ )
    $args = ‘alphabetical’;
    else if ( $_GET == ‘group_id’ )
    $args = ‘newest’;
    else if ( $_GET == ‘popular’ )
    $args = ‘popular’;

    if ( $_GET )
    $args = $_GET;
    else
    $args = 1;

    if( bp_has_groups( $args ) ) :
    global $groups_template;
    ?>

    <?php
    if ( !$group )
    $group =& $groups_template->group;
    ?>

    Category

    Categories

    You don’t have any groups to manage.

    <?php
    }
    ?>
    `

    The first two hard code a group by ID and display a selected wordpress category within that group. The last file is the useless one. I’d started hacking from one of @boonebgorges plugins with the idea of creating an admin screen from which groups could be linked to blog categories.

    I’ve run out of time for now to play with that further and so for now am just going to duplicate the first two files for another couple of groups which will work for my purposes.


    phos flip
    Participant

    @wamoma

    no that’s exactly what I was looking for – thanks :)


    phos flip
    Participant

    @wamoma

    I’ve got stuck on this code:

    `if ( !groups_get_groupmeta( $bp->groups->current_group->id, ’14’ ) )

    {
    $this->enable_nav_item = true;
    } else {
    $this->enable_nav_item = false;
    }`

    I’m trying to insert the group ID or name. I’ve tried every variation I can think of but none work – it either displays in all groups or none whichever way I do it. Can somebody help with what I should be doing?


    phos flip
    Participant

    @wamoma

    Just adding to this rather than creating a new topic:

    I keep getting an error when trying to upload an avatar (on here):

    Upload Failed! Error was: Unable to create directory /home/buddypress/public_html/wpmu/wp-content/blogs.dir/1/files/avatars/6656263. Is its parent directory writable by the server?

    Also get a โ€™page not foundโ€™ whenever trying to search through search pages with multiple pages

    And when I do look through searches there seems to be endless spam.

    Appreciate there seem to be only a very small number of people keeping things going on here and they obviously give an awful lot so I really don’t want to offend, but it does seem that it’s not the best advert for using buddypress.

    That said I’m using it anyway and looking forward to it too!


    phos flip
    Participant

    @wamoma

    hm – just tried the lite version of that plugin and doesn’t do anything at all. I see somebody else has mentioned the same on the plugin page.

    Also see that the person apparently singing it’s praises appears to work for them – given she was told 2 days ago it wasn’t working and how much they charge for the fully functional version I’d have thought they’d have pretty quick to respond!

    I’m curious too how it’s somehow obtained 11 full star ratings already when seemingly it doesn’t work?!


    phos flip
    Participant

    @wamoma

    looks as though the membership plugin here:

    http://premium.wpmudev.org/project/membership

    has the functionality I’m after. Seems like an absolute rip off signing up to that site though!


    phos flip
    Participant

    @wamoma

    no need to apologise – very much appreciated! I’ll give that a go & report back, many thanks

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