psnCPGAdmin in the Admin Panel

Well, here is the preview of how to add the psnGallery2 Admin in the WP Administration Panel….

Add the following code in the “psnGallery2.php”
function psnGalMenu() {
add_submenu_page('options-general.php', 'psnGallery2', 'psnGallery2', 1, 'psnCPGAdmin.php');
}

and also this to the :

add_action('admin_menu', 'psnGalMenu');

After the update, the code should look like :
function psnGalMenu() {
add_submenu_page('options-general.php', 'psnGallery2', 'psnGallery2', 1, 'psnCPGAdmin.php');
}

global $CONFIG,$pluginURL;

$CONFIG = psnCPGGetConfig();
if ($CONFIG) {
// Initialize the module
psnCPGInit($CONFIG['DEBUGFLAG']);
psnExcludeSQLAlbum();
add_filter('the_content', 'run_CPGxxxx');
add_filter('the_excerpt', 'run_CPGxxxx');
add_filter('comment_text', 'run_CPGxxxx');
add_action('admin_menu', 'psnGalMenu'); // < - New line
}

Et voil

18 Replies to “psnCPGAdmin in the Admin Panel”

  1. I add this code to psnCPGAdmin.php and works! (WP 2.0)

    require_once(‘admin.php’);
    $parent_file = ‘options-general.php’;

  2. Is there any way for a non php techie to use this plug in? It all seems so greek to me.

    Is there a basic plug in download? I do not see it if there is.

  3. aaah crap. it cut out the middle part of my comment. okay, let’s try it again:

    okay, so here’s how i got this to work, as i was having a problem with it after following senior pez’s instructions.
    #first issue:
    #require_once(’admin.php’);
    #
    #paste this in after the ” $v) {
    # if (is_array($v)) {
    # $array[$k] = add_magic_quotes($v);
    # } else {
    # $array[$k] = addslashes($v);
    # }
    # }
    # return $array;
    #}
    #
    #which is the same code on line 4 of psnCPGAdmin.php …so i deleted
    #those lines from psnCPGAdmin.php and viola! the page came up.
    #
    #now, im pretty new to php code so i hope this makes sense, and this may
    #have been because i did something wrong earlier, but it works now, so i
    #hope this helps.

  4. okay, so here’s how i got this to work, as i was having a problem with it after following senior pez’s instructions.

    first issue:
    require_once(’admin.php’);

    paste this in after the ” $v) {
    if (is_array($v)) {
    $array[$k] = add_magic_quotes($v);
    } else {
    $array[$k] = addslashes($v);
    }
    }
    return $array;
    }

    which is the same code on line 4 of psnCPGAdmin.php …so i deleted those lines from psnCPGAdmin.php and viola! the page came up.

    now, im pretty new to php code so i hope this makes sense, and this may have been because i did something wrong earlier, but it works now, so i hope this helps.

  5. Sorry it hacked off the end of my message. so if I get this all correct the end result of editing the file would be like so:

Comments are closed.