Edit Gallery admin link...
darrenUK
Joined: 2007-01-02
Posts: 20 |
Posted: Sat, 2008-03-01 09:35 |
I made a stupidly simple plugin for wordpress a little while ago to add a function that I found to be missing from WPG2. I would like to share it hoping it might help other. It adds a admin link that allows the user to access G2 through the WP admin. An application for this is for if a site is setup with lightbox and you only even see the 'Sidebar Grid Block' side of WPG2 on the front end of the site, just using G2 to upload and manage images like you would use Flickr. Anyway I find it brings integration a bit closer. <?php add_action('admin_menu', 'ddl_add_pages'); function ddl_add_pages() { add_menu_page('Edit Gallery', 'Edit Gallery', 8, __FILE__, 'ddl_toplevel_page'); function ddl_toplevel_page() { ?> |
|
Posts: 20
Copy from <? to ?> paste into notepad or something similar. Save as g2admin-link.php or whatever you want to call it
, just end it with .php
Upload (FTP) to the WordPress's plugin folder, login and activate.
Posts: 1378
I would suggest you add the following before the IFRAME, this will log you into Gallery2 before executing the IFRAME
$wpg2_option = get_option('wpg2_options');
if (!defined('G2INIT')) {
$ret = g2_login();
if ($ret) {
echo '<h2>' . __('Fatal G2 error', 'wpg2') . '</h2> ' . __("Here's the error from G2: ", 'wpg2') . $ret->getAsHtml();
exit;
}
}
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo
Posts: 20
Cool! Tested and revised.