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 )
@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.
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.
Jeff, how do I add it to the BuddyPress menu in the backend? Are there new hooks?
@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.
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.
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?
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.
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).
Are you running the latest WPMU branch and BP trunk?
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' )
Ah. Very nice, Nicola. That will help me as well.
Thanks Nicola, can’t wait to get started on this… I’ll get back to you if I need any help (probably).
This thread still need a red light Erwin?
Sadly the little fix in the plugin doesn’t fix it for me… Still the same errors “site not found”…
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.
@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.
Hi, how can I change the date format.
I whold like to use BP Events date format: d/m/Y
Thanks!