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 Comments

Darian · 17/02/2006 at 12:24

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

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

Administrator · 12/07/2005 at 22:01

In fact you have to go on my development site…At http://blog.idahocline.info…You will find the download links….

Amy Celona · 12/07/2005 at 21:14

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.

Matt Pist · 10/06/2005 at 20:17

oh geez… okay so it won’t let me post the complete instructions. feel free to email me at mattpist@riseup.net.

Matt Pist · 10/06/2005 at 20:15

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.

Matt Pist · 10/06/2005 at 20:09

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.

Enigma · 22/04/2005 at 03:19

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:

Enigma · 22/04/2005 at 03:16

Ok I have everything setup as far as psnGallery 2 is concerned, it is functioning but I want to get this administration page working. I did everything like idahocline said, but I got the blank page. So I added the line to “public_html/wp-admin/psnCPGAdmin.php” as Senor Pez said which was to add the exact line as follows: require_once(’admin.php’);

so I take that line and add it in public_html/wp-admin/psnCPGAdmin.php
right after the php opening line which is exactly as follows:

Eric · 20/04/2005 at 20:03

Thanks Senor Pez !

All better!

site admin · 20/04/2005 at 12:56

Thanks Senor Pez ! :o)

As you noticed I am rather busy for the moment….Soon you will know why….

Senor Pez · 20/04/2005 at 07:27

(FYI: The above change is made in the “psnCPGAdmin.php” file.)

Senor Pez · 20/04/2005 at 07:27

(Sigh… it did it again. Third time is the charm, I guess… And please delete my previous attempts, if you will…)

Add this above the line that reads “$debug = false;”:

require_once(‘admin.php’);

Problem fixed.

Oh, and thanks for supporting albums without categories in this release… I had to make a few tweaks to the plugin to make it work before, and we’ll just say that my solution was less than elegant. I’m much happier with the new release; thanks for all your hard work!

Senor Pez · 20/04/2005 at 07:24

(Crap, it choked when I input the command for PHP… here it is again…)

To fix the blank-page problem, add the following line to the top of the “psnCPGAdmin.php” file, after the “php” opening declaration (which includes a “

Senor Pez · 20/04/2005 at 07:21

To fix the blank-page problem, add the following line to the top of the “psnCPGAdmin.php” file, after “

Eric · 12/04/2005 at 18:02

Your plugin is excellent! Thanks for allowing us to use your work!

When trying to add the admin panel I get the following error: “Fatal error: Call to undefined function: psnexcludesqlalbum()”

When I comment out that line I get the psnGallery2 tab in my Options like it is supposed to be. Clicking on it only returns a blank page.

Everything else works just fine. Only the admin panel is not working just yet. I’m running WP 1.5 and Coppermine 1.3.2.

Any thoughts??

Jöran · 10/04/2005 at 21:21

I can’t get it right, hope you can help.
You write that you need to add this“function psnGalMenu() {
add_submenu_page(‘options-general.php’, ‘psnGallery2’, ‘psnGallery2’, 1, ‘psnCPGAdmin.php’);
}”
code to psnGallery2.php. Where do I place it? In the beginning of the code or the and?
The next piece of code “and also this to the :” to where?

Then you write after the update the code look like this:

Where should that code being placed?

Hope you can help

peng · 10/04/2005 at 19:31

Hello. I have tried this, and it does the job ok. A menu was added.
However, when I click it, a blank page appeared.

I can not get into the CPGAdmin panel manually.

How to solve this?

Thanks.

Coppermine Gallery Test Post at cjsimmons.net · 13/10/2005 at 17:36

[…] I’m also currently looking for a pluging or something so that I can display a random image in the sidebar, and so I can specify a photo thumbnail to display. This plugin that I’m using doesn’t support thumbnails for indivudal photos. I have tried psnGallery, but I’m unable to get it working. It installs fine, but it won’t display the images. If you have any ideas, or another plugin, please let me know. // Used for showing and hiding user information in the comment form function ShowUtils() { document.getElementById(“authorinfo”).style.display = “”; document.getElementById(“showinfo”).style.display = “none”; document.getElementById(“hideinfo”).style.display = “”; } function HideUtils() { document.getElementById(“authorinfo”).style.display = “none”; document.getElementById(“showinfo”).style.display = “”; document.getElementById(“hideinfo”).style.display = “none”; } […]

Comments are closed.

%d bloggers like this: