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: Send Ecards only in one Album?  (Read 7250 times)

0 Members and 1 Guest are viewing this topic.

impact

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Send Ecards only in one Album?
« on: May 07, 2006, 12:57:04 am »

Hi there,
first ---> Thanks for such a great and simple Gallery ;) Its fantastic

now -->  Sorry for my bad english  ;D

then
I've got a few Kategories and Albums in my Gallery..And the Ecard function is deaktivated, because I dont want that all my pics could be send per ecard.
How could I activate the Ecard Funktion ONLY for one Album?
Is this possible? Or could I only activate it for the whole Gallery ?

I want that Guests, and registered USERS also , only could send Ecards from a special Ecard Kategorie... I didnt know how to do this ...

hope you know what i mean and you could help me..

thx
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Send Ecards only in one Album?
« Reply #1 on: May 07, 2006, 08:36:33 am »

in coppermine's groups page: enable ecards=yes for the particular group that is suppossed to send ecards.
This is an overall switch for the whole gallery. You can't specify a certain album only where sending ecards is allowed. The only workaround is to edit your theme and add an if/then switch to the section that composes the image menu (specifically the ecard button) and output the ecard button link only on specific album pages. This requires some PHP knowledge and hardcoding the album id of the particular album that is suppossed to show the ecard link.
I review the whole idea - sending ecards is a relict from the nineties - who needs additional emails that just show a pic? Power users will copy'n paste the URL of an image into a regular email, that's it.
Logged

impact

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Send Ecards only in one Album?
« Reply #2 on: May 07, 2006, 12:17:11 pm »

sending ecards is a relict from the nineties - who needs additional emails that just show a pic? Power users will copy'n paste the URL of an image into a regular email, that's it.

Yes you re right.. But even i think its easier to send an ecard out of the Gallery..Without open an extra programm like Outlook or something else..
Even I think that some Users respekt the copyrights and do not Copy and paste... lol ;)

Ok .. I have found the right position in the themes.inc.php (i think) .. It must be here??

if (USER_CAN_SEND_ECARDS) {
        $ecard_tgt = "ecard.php?album=$album$cat_link&pid=$pid&pos=$pos";
        $ecard_title = $lang_img_nav_bar['ecard_title'];
    } else {
        template_extract_block($template_img_navbar, 'ecard_button'); // added to remove button if cannot send ecard
        /*$ecard_tgt = "javascript:alert('" . addslashes($lang_img_nav_bar['ecard_disabled_msg']) . "');";
        $ecard_title = $lang_img_nav_bar['ecard_disabled'];*/
    }

                //report to moderator buttons
    if (($CONFIG['report_post']==1) && (USER_CAN_SEND_ECARDS)) {
        $report_tgt = "report_file.php?album=$album$cat_link&pid=$pid&pos=$pos";
    } else { // remove button if report toggle is off
        template_extract_block($template_img_navbar, 'report_file_button');


I dont really know how to do this, but i want it to do :D ..
Can anybody help me?

Something like this? --> if (USER_CAN_SEND_ECARDS && album=12)
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Send Ecards only in one Album?
« Reply #3 on: May 07, 2006, 12:38:38 pm »

copy the entire function theme_html_img_nav_menu() from themes/sample/theme.php to the theme.php you're actually using

and your attempt wasn't to bad at all, try
Code: [Select]
if (USER_CAN_SEND_ECARDS && $album==12)

impact

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Send Ecards only in one Album?
« Reply #4 on: May 07, 2006, 01:50:16 pm »

Cool ... It works :) ...

There are only 3 things to edit

For everyone who would do the same:

open theme.inc.php

In the following, you had to replace the 10 in ($album==10) with the Album Number that you want to use for Ecards
I even test it with $cat instead of $album ... But that doesnt work ...Dont know why


Find
Code: [Select]
if (USER_CAN_SEND_ECARDS)

Replace with
Code: [Select]
if ((USER_CAN_SEND_ECARDS) && ($album==10)) 

Find
Code: [Select]
if (($CONFIG['report_post']==1) && (USER_CAN_SEND_ECARDS))
Replace with
Code: [Select]
if (($CONFIG['report_post']==1) && (USER_CAN_SEND_ECARDS) && ($album==10))
Find
Code: [Select]
if (!(($CONFIG['report_post']==1) && (USER_CAN_SEND_ECARDS))
Replace with
Code: [Select]
if (!(($CONFIG['report_post']==1) && (USER_CAN_SEND_ECARDS) && ($album==10))

If you want to do this for more than one Album, i think this one ---> ($album==10) must be changed in (($album==10) || ($album==11))

for example ..
« Last Edit: May 07, 2006, 02:15:18 pm by impact »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Send Ecards only in one Album?
« Reply #5 on: May 07, 2006, 02:19:25 pm »

Code: [Select]
[quote author=impact link=topic=31193.msg144492#msg144492 date=1147002616]
For everyone who would do the same:

open theme.inc.php
as written above, this is not recommended
Quote
copy the entire function theme_html_img_nav_menu() from themes/sample/theme.php to the theme.php you're actually using

the correct 'or' syntax would be
(($album==10) || ($album==11))




Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Send Ecards only in one Album?
« Reply #6 on: May 07, 2006, 03:37:31 pm »

As Stramm suggested: never edit include/themes.inc.php
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.