Remove functions Remove functions
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Remove functions

Started by vedette, December 18, 2005, 10:10:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vedette

Searching this forum and trying over and over again didn't  help me.
I want to remove all functions but not the login function for the administrator to upload and arrange files.
Visitors must only see the albums they can choose from and that's it.
So no comment, rating, random pics etc.

Is there perhaps a theme that has this or is there a way to create this.

I almost give up... ;)

artistsinhawaii

The easiest way I can see doing this is to use two nearly identical themes.  (Copy your existing theme into another directory called "admin" ).
   
Leave your admin theme as is.

Copy the following into the the default theme:

Quote
define('THEME_IS_XHTML10_TRANSITIONAL',1);
define('THEME_HAS_NO_SYS_MENU_BUTTONS', 1);
define('THEME_HAS_NO_SUB_MENU_BUTTONS', 1);

// sys_menu
$template_sys_menu = <<<EOT

<!-- BEGIN register -->
                     <a href="register.php"><div align="right"><b>JOIN US</b></a>&nbsp;::

<!-- END register -->
<!-- BEGIN login -->
                        <a href="login.php?"><b>LOG IN</b></a> &nbsp;
<!-- END login -->
<!-- END login -->
<!-- BEGIN logout -->
                        <a href="logout.php?theme=aim"><b>LOG OUT</div></a> &nbsp;
<!-- END logout -->
<!-- BEGIN my_gallery -->
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
<!-- END my_profile -->
<!-- BEGIN faq -->
<!-- END faq -->
<!-- BEGIN enter_admin_mode -->
<!-- END enter_admin_mode -->
<!-- BEGIN leave_admin_mode -->
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
<!-- END upload_pic -->
<!-- BEGIN register -->
<!-- END register -->
EOT;
//sub_menu
$template_sub_menu = <<<EOT

<!-- BEGIN custom_link -->
<!-- END custom_link -->
<!-- BEGIN album_list -->
<!-- END album_list -->

EOT;

Replace your login.php and logout.php files with the ones attached.


Now when you login, it will switch to your "admin" theme.  When you log out, it will switch to your "default" theme.

Users that aren't registered will never log in, so they will never see any of the menus.

Dennis
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

Joachim Müller

Quote from: vedette on December 18, 2005, 10:10:59 PM
So no comment, rating, random pics etc.
Turn off comments and rating in coppermine's groups page as well, and remove "random" from "the content of the mainpage" in coppermine's config as well.

vedette

Hi Guys,
Thanks for trying to help this newbie!

With theme "classic" I have the right look now (only the album and the login button but when I log in, I don't have the upload function.
When I set the "admin" theme, I have all the old functions back.

Home :: My gallery :: User mode :: Upload file :: Logout
Album list :: Last uploads :: Last comments :: Most viewed :: Top rated :: My Favorites :: Search

So... what did I do wrong?

I made a folder in "themes" called "Admin".
I copied everything from the "classic" theme folder to the new "admin" folder.
I pasted your code into the original theme.php file.

like this:

<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.2
  $Source: /cvsroot/coppermine/devel/themes/classic/theme.php,v $
  $Revision: 1.71 $
  $Author: gaugau $
  $Date: 2005/10/25 01:16:24 $
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has all CORE items removed                                     //
// ------------------------------------------------------------------------- //
define('THEME_IS_XHTML10_TRANSITIONAL',1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);
define('THEME_HAS_NO_SYS_MENU_BUTTONS', 1);
define('THEME_HAS_NO_SUB_MENU_BUTTONS', 1);

// sys_menu
$template_sys_menu = <<<EOT

<!-- BEGIN register -->
                     <a href="register.php"><div align="right"><b>JOIN US</b></a>&nbsp;::

<!-- END register -->
<!-- BEGIN login -->
                        <a href="login.php?"><b>LOG IN</b></a> &nbsp;
<!-- END login -->
<!-- END login -->
<!-- BEGIN logout -->
                        <a href="logout.php?theme=aim"><b>LOG OUT</div></a> &nbsp;
<!-- END logout -->
<!-- BEGIN my_gallery -->
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
<!-- END my_profile -->
<!-- BEGIN faq -->
<!-- END faq -->
<!-- BEGIN enter_admin_mode -->
<!-- END enter_admin_mode -->
<!-- BEGIN leave_admin_mode -->
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
<!-- END upload_pic -->
<!-- BEGIN register -->
<!-- END register -->
EOT;
//sub_menu
$template_sub_menu = <<<EOT

<!-- BEGIN custom_link -->
<!-- END custom_link -->
<!-- BEGIN album_list -->
<!-- END album_list -->

EOT;




?>

Was that really stupid?...  :-\

Joachim Müller

that's perfectly OK. You now set the default theme to be the modified classic theme, while you (as admin) should use the admin theme. To accomplish this, choose the classic theme and access the config manually by going to http://yoursite.tld/your_coppermine_folder/admin.php?theme=classic
When in the config, save everything. After that, access the admin theme for you only by going to http://yoursite.tld/your_coppermine_folder/index.php?theme=admin
Whenever you want to access to config, do as I suggested above and temporarily set your theme to the classic one. Once your changes are done, switch back to the admin theme.

artistsinhawaii

vedette,

In my post above I included two slightly modified files for you to download. Did you carry out that step?  These replace login.php and logout.php.  In each only one line of code was modified so that they would automatically switch themes when you login and when you logout.

Dennis
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

vedette

Thanks Guys... it works!!!

You were right Dennis.
I forgot to use your modified files.

Now I can go on trying to modify the look of the theme.

Plenty of stuff on how to do that on the forum I guess.

I'm happy being a step further  :)

artistsinhawaii

vedette,

before you go on to the next step.  Open template.html in your new theme folder and change the path to the style.css in the <head> section of the file. It should point to the style.css file that resides in your new theme folder.

Dennis
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.