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: Line only for certain groups  (Read 4577 times)

0 Members and 1 Guest are viewing this topic.

rgroen

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Line only for certain groups
« on: January 10, 2005, 10:00:06 pm »

Hey Folks,

I have coded the next line:
Code: [Select]
// Indien groep HogeResolutie dan link
$path_to_hr = $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] ."/Ergens/". $CURRENT_PIC_DATA['filename'];
$info['Hoge Resolutie'] = '<a target=_blank href="'.$CONFIG["ecards_more_pic_target"].'/'.$path_to_hr.'" >Gebruik als achtergrond</a>';

My idea is to show this line only to certain groups in my photo gallery. How can I do this.

Ciao
Logged

Nibbler

  • Guest
Re: Line only for certain groups
« Reply #1 on: January 10, 2005, 10:24:33 pm »

check the value of $USER_DATA['user_group'] or the $USER_DATA['groups'] array if you need to know multiple group membership.
Logged

rgroen

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Re: Line only for certain groups
« Reply #2 on: January 10, 2005, 10:57:45 pm »

check the value of $USER_DATA['user_group'] or the $USER_DATA['groups'] array if you need to know multiple group membership.

Oke, but whats the code so only members of a certain group can see this line and hit the link? Thats one thing I really dont know?! So if anyone can help me with this code.
Logged

Nibbler

  • Guest
Re: Line only for certain groups
« Reply #3 on: January 11, 2005, 07:36:29 pm »

Code: [Select]
if ($USER_DATA['user_group'] == 2){ <<your code here>> }
for example.
Logged

rgroen

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Re: Line only for certain groups
« Reply #4 on: January 11, 2005, 10:12:04 pm »

Code: [Select]
if ($USER_DATA['user_group'] == 2){ <<your code here>> }
for example.

Help, It doesn't work! I have tried everything but nothing was good!  :\'(
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Line only for certain groups
« Reply #5 on: January 11, 2005, 10:47:04 pm »

Could you please post your code?
Logged

rgroen

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Re: Line only for certain groups
« Reply #6 on: January 11, 2005, 10:50:41 pm »

Could you please post your code?

No problem,

Code: [Select]
if ($CONFIG['read_iptc_data']) $iptc = get_IPTC($path_to_pic);

    if (isset($iptc) && is_array($iptc)) {
        if (isset($iptc['Title'])) $info[$lang_picinfo['iptcTitle']] = trim($iptc['Title']);
        if (isset($iptc['Copyright'])) $info[$lang_picinfo['iptcCopyright']] = trim($iptc['Copyright']);
        if (isset($iptc['Keywords'])) $info[$lang_picinfo['iptcKeywords']] = trim(implode(" ",$iptc['Keywords']));
        if (isset($iptc['Category'])) $info[$lang_picinfo['iptcCategory']] = trim($iptc['Category']);
        if (isset($iptc['SubCategories'])) $info[$lang_picinfo['iptcSubCategories']] = trim(implode(" ",$iptc['SubCategories']));
    }
    // Create the absolute URL for display in info
    $info['URL'] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" >' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '</a>';
// with subdomains the variable is $_SERVER["SERVER_NAME"] does not return the right value instead of using a new config variable I reused $CONFIG["ecards_more_pic_target"] no trailing slash in the configure

// If member of group HighResolution then...
$path_to_hr = $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] ."/More/High/Orig/". $CURRENT_PIC_DATA['filename'];
$info['Hoge Resolutie'] = '<a target=_blank href="'.$CONFIG["ecards_more_pic_target"].'/'.$path_to_hr.'" >Use as wallpaper on your desktop</a>';
   
// Create the add to fav link
    if (!in_array($CURRENT_PIC_DATA['pid'], $FAVPICS)) {
        $info[$lang_picinfo['addFavPhrase']] = "<a href=addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . " >" . $lang_picinfo['addFav'] . '</a>';
    } else {
        $info[$lang_picinfo['addFavPhrase']] = "<a href=addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . " >" . $lang_picinfo['remFav'] . '</a>';
    }

    return theme_html_picinfo($info);
}
// Displays comments for a specific picture

Hope you can get this baby work. Then we can post it on the forum.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.