Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp-Events plugins directory question

  • Avatar of Erwin Gerrits
    Erwin Gerrits
    Participant

    @egerrits

    Ever since BuddyPress moved into plugins/buddypress I am having a bit of trouble getting bp-Events to upgrade the database. It used to be integrated on the BuddyPress menu, and every time the version changes or the database version changes, the upgrade script upgrades the database.

    Now bp-events sits in the plugins/buddypress directory but is listed with the regular plugins in WP and has nothing to do with the BuddyPres backend anymore. I am having trouble figuring out HOW and WHEN the version upgrades work now.

    Anybody have any insights?

Viewing 18 replies - 1 through 18 (of 18 total)
  • Avatar of Nicola Greco
    nicolagreco
    Participant

    @nicolagreco

    i really suggest you (for stats and user experience)

    to put it in plugins/bp-events/

    Then you should add some code to stop it working if bp is disabled,

    contact me if needed ( nicola at buddypressdev.org )

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    @Erwin

    As Nicloa suggests, placing your plugin in plugins/bp-events/ makes sense. Also, perhaps you should consider adding it to the BuddyPress menu in WP admin.

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Actually, come to think of it, maybe you should keep it in plugins/buddypress/. That will make it easier to add it to the BuddyPress menu in the backend.

    Avatar of Erwin Gerrits
    Erwin Gerrits
    Participant

    @egerrits

    Jeff, how do I add it to the BuddyPress menu in the backend? Are there new hooks?

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    @Erwin-

    I believe so. I was just looking at that possibility yesterday and will be experimenting with this myself today. Let me take a quick look and get back to you shortly.

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Okay, not a new hook per se, but a new admin menu group (BuddyPress) to which you should be able to add additional submenu pages. It still uses the add_action call to a WPMU hook (admin_menu).

    Look at how its done in bp_core_add_admin_menu() in bp_core.php. Then, additional submenus under BuddyPress menu group are added in other BP components–like xprofile_add_admin_menu() in bp_xprofile.php.

    Avatar of Erwin Gerrits
    Erwin Gerrits
    Participant

    @egerrits

    Jeff–thanks for this, I’ll wrestle with this this afternoon. Do you know how when the database upgrade routine runs? When you just go to the backend (like it was) or do we now have to deactivae/reactivate to upgrade?

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    I’m just delving into this more deeply, so perhaps I am missing something.

    But, it still seems to be done the same way as in the past. Each BP component checks to make sure it is running the most current version by comparing against the defined constant bp-[xxx]-db-version. If an older version, then the install function runs again doing whatever is necessary.

    I believe you’re already doing this with your plugin.

    Avatar of Erwin Gerrits
    Erwin Gerrits
    Participant

    @egerrits

    OK–the database upgrade is hooked to “admin_menu” so it runs as soon as you login as admin and go to the dashboard. it just seemed not to run anymore… maybe I’m just screwed up with my dbase versions (it’s been known to happen).

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Are you running the latest WPMU branch and BP trunk?

    Avatar of Nicola Greco
    nicolagreco
    Participant

    @nicolagreco

    to add stuff under the buddyrpess menu in wp admin it’s not needed to keep your plugin in /plugins/buddypress :S

    look here from the bpdev-admin.php code

    add_menu_page(
    'BPDEV Admin',
    'BPDEV Admin',
    2,
    'bpdev-admin',
    'bpdev_admin_settings_page',
    BPDEV_PLUGINS_URL . '/bpdev-core/images/icon.png'
    );

    add_submenu_page(
    'bpdev-admin',
    'All Plugins',
    'All Plugins',
    1,
    'bpdev-plugins',
    'bpdev_admin_plugins'
    );

    so, the first create a new item, the second a new sub-item, you should create a subitem like that

    add_submenu_page(
    'buddypress', <== check this on the code
    'My Plugin',
    'My Plugin',
    1,<= Position
    'bpdev-plugins', <= Slug
    'bpdev_admin_plugins' <= callback
    );

    put it in a function and add_action( '_admin_menu', 'my_function_with_my_menus' )

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Ah. Very nice, Nicola. That will help me as well. :)

    Avatar of Erwin Gerrits
    Erwin Gerrits
    Participant

    @egerrits

    Thanks Nicola, can’t wait to get started on this… I’ll get back to you if I need any help (probably).

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    This thread still need a red light Erwin?

    Avatar of Michael Berra
    Michael Berra
    Participant

    @miguael

    Sadly the little fix in the plugin doesn’t fix it for me… Still the same errors “site not found”…

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Erwin the component db upgrade routines run when you change the component db version numbers. If you want to mod the db tables and upgrade them somehow then you need to bump the component’s db version number.

    Your component’s check installed routine runs and only runs the install fn if site admin visit’s the wp back end and the current component db version number defined in your code is > than that stored in site meta.

    The stored current ver number gets updated to the current component db version number after whatever table mods happen. Then the code’s component db version number matches the site meta stored component db version number and it doesn’t run again.

    The component table upgrades have nothing to do with where your component lives, what back end menu it appears in or with anything else that bp or other components are doing.

    It’s up to you as the component author to decide when table upgrades happen. It’s controlled by your component specific db version number.

    Avatar of Erwin Gerrits
    Erwin Gerrits
    Participant

    @egerrits

    @Burtadsit,

    Thanks for this… I figured as much, however I’ve seen some odd behaviour in the past, so I was wondering what was happening.

    Avatar of Marcelo Vetter
    Marcelo Vetter
    Participant

    @mfvetter

    Hi, how can I change the date format.

    I whold like to use BP Events date format: d/m/Y

    Thanks!

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

You must be logged in to reply to this topic.