Ask Login for Voting.. Ask Login for Voting..
 

News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

Ask Login for Voting..

Started by mr.bena, April 10, 2012, 12:58:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mr.bena

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

Αndré

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
{IMAGE}
and just add your text above that token.

mr.bena

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

Αndré

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
$CURRENT_PIC_DATA = CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);
and above, add something like
    if (!USER_ID && $CURRENT_PIC_DATA['aid'] == 30) {
        $CURRENT_PIC_DATA['header'] = 'Please login to vote<br />';
    }


mr.bena

Working.. working..! :D

Thank you, Andre.

mr.bena

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

 
Quoteif (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...