Advanced search  

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

Pages: [1]   Go Down

Author Topic: Ask Login for Voting..  (Read 4009 times)

0 Members and 1 Guest are viewing this topic.

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Ask Login for Voting..
« on: April 10, 2012, 12:58:41 am »

Hi, I want to ask the visitors to login if they want to give votes. I want the request text to appear above the intermediate pictures. Could you please help me..
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Ask Login for Voting..
« Reply #1 on: April 12, 2012, 11:13:05 am »

Copy the template block template_display_media from the sample theme to your theme's theme.php file if it doesn't exist. Then, find
Code: [Select]
{IMAGE}and just add your text above that token.
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Ask Login for Voting..
« Reply #2 on: April 12, 2012, 03:05:20 pm »

Thank you, Andre. It is partially solved, I want this to appear only for album_id=30. Is there a way to make it?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Ask Login for Voting..
« Reply #3 on: April 16, 2012, 11:33:44 am »

Undo the suggested change. Instead, copy the function theme_html_picture from the sample theme to your theme's theme.php file if it doesn't exist. Then, find
Code: [Select]
$CURRENT_PIC_DATA = CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);and above, add something like
Code: [Select]
    if (!USER_ID && $CURRENT_PIC_DATA['aid'] == 30) {
        $CURRENT_PIC_DATA['header'] = 'Please login to vote<br />';
    }
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Ask Login for Voting..
« Reply #4 on: April 16, 2012, 07:51:55 pm »

Working.. working..! :D

Thank you, Andre.
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Ask Login for Voting..
« Reply #5 on: April 18, 2012, 01:44:04 am »

Hi, Andre. I try to modify the above code like this

 
Quote
  if (USER_ID && $CURRENT_PIC_DATA) {
        $CURRENT_PIC_DATA['footer'] = 'Welcome..<br />';
    }

It does not work. My aim is to show some text below the picture only if the user has logged in...
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.