Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Remove functions  (Read 6925 times)

0 Members and 1 Guest are viewing this topic.

vedette

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 5
Remove functions
« on: December 18, 2005, 10:10:59 pm »

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... ;)
« Last Edit: December 20, 2005, 09:06:34 am by GauGau »
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: Remove functions
« Reply #1 on: December 18, 2005, 11:44:12 pm »

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
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Remove functions
« Reply #2 on: December 19, 2005, 08:29:41 am »

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.
Logged

vedette

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 5
Re: Remove functions
« Reply #3 on: December 19, 2005, 05:30:03 pm »

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?...  :-\
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Remove functions
« Reply #4 on: December 19, 2005, 10:22:36 pm »

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.
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: Remove functions
« Reply #5 on: December 20, 2005, 03:09:40 am »

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
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 5
Re: Remove functions
« Reply #6 on: December 20, 2005, 08:54:53 am »

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  :)
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: Remove functions
« Reply #7 on: December 20, 2005, 03:37:00 pm »

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
Logged
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.
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 19 queries.