How do I put the ACP link in page_tail.php into the bottom of the gallery pages? How do I put the ACP link in page_tail.php into the bottom of the gallery pages?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

How do I put the ACP link in page_tail.php into the bottom of the gallery pages?

Started by WC, December 14, 2006, 09:37:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WC

I would like to put the ACP link in page_tail.php that usually appears at the bottom of a forum (just above Powered by phpBB © 2001, 2005 phpBB Group) at the bottom of each gallery page. How would I do this to make sure that it only appears for an administrator (as it does on a forum) and not for regular users?

I'm not too sure how to create a custom footer.

Any help appreciated.

Thanks

Joachim Müller

Well, we don't know what an ACP link is nor do we have any idea what page_tail.php in phpBB does.
Basically, stuff that is suppossed to show only if an admin is logged in should look like this:<?php
if (GALLERY_ADMIN_MODE) {
    
// your admin-only output here
    
echo "Hello world";
}
?>
Save above code sample as "custom_footer.php" within coppermine's root folder, then set the custom_footer path in coppermine's config to "custom_footer.php" and test-drive your gallery both logged in as admin and not logged in as admin.
Actual code that is suppossed to show up in that admin-only section is entirely up to you. If you need help with it, you should tell us what ACP is.

WC

Ok I'll try that. ACP = Admin Control Panel. I just assumed everyone used that abbreviation on forums.

BTW, on this bit "// your admin-only output here
    echo "Hello world"; "  do I delete all the text between" // and ; " ? What is the echo "Hello world" there for? is echo some kind of php code?

Thanks

WC

Also, whatever the answer to the above question, I tried just copying exactly the code you gave into a file named custom_footer.php (into the coppermine root) to test it out. I also specified the path in the config section in theme settings, but nothing new shows at the bottom of my page. It still looks exactly the same as before with no custom footer whatsoever.  ???

Is there something I'm doing wrong?

Joachim Müller

Ah OK, now I can see what an ACP is. I can see that you have no experience in PHP at all, so let's do this the other way round: if you just need a link to a particular page to be visible for the admin only (in your case a link to the control panel of your BBS app), just edit Coppermine's admin menu and make it show up there. Edit themes/yourtheme/theme.php, find$template_gallery_admin_menu = <<<EOTand edit the stuff beneath it accordingly. If you don't have that line in your custom theme, copy below section (taken from themes/sample/theme.php) into themes/yourtheme/theme.php, into a new line before?>:// HTML template for gallery admin menu
$template_gallery_admin_menu = <<<EOT

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>
<!-- BEGIN admin_approval -->
                                <td class="admin_menu" id="admin_menu_anim"><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_LNK}</a></td>
<!-- END admin_approval -->
                                <td class="admin_menu"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></td>
                                <td class="admin_menu"><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></td>
                                <td class="admin_menu"><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></td>
                                <td class="admin_menu"><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></td>
                                <td class="admin_menu"><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></td>
                                <td class="admin_menu"><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></td>
                                <td class="admin_menu"><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></td>
<!-- BEGIN log_ecards -->
                                <td class="admin_menu"><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_LNK}</a></td>
<!-- END log_ecards -->
                                <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>
                                <td class="admin_menu"><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></td>
                                <td class="admin_menu"><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>
<!-- BEGIN documentation -->
                                <td class="admin_menu"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></td>
<!-- END documentation -->
                        </tr>
                </table>
                </div>

EOT;
As you can see, this is the code that will compose the admin menu of coppermine. To add your menu entry, just add a new line after<!-- END documentation -->. You can use plain HTML code, so the line you might want to add couldlook like this:                                <td class="admin_menu"><a href="path/to/your/forums/control.panel" title="go to the Forum ACP">Forum ACP</a></td>