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: Full Secreen Images Only For Registered Users ....  (Read 5220 times)

0 Members and 1 Guest are viewing this topic.

legend_neo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 54
Full Secreen Images Only For Registered Users ....
« on: January 16, 2005, 11:00:01 am »

HI..
pardone me if this thread is already there  .... but believe me i didi a 4 hours search but cant find whati was looking for ,...

the thing is i want for everyone to see albums + normal size images .... but if a person( unregistered user ) want to see the actual image .. he see "loging page or some message that he must be a user"  ......... is this possible ?? ... also ... its for certain albums .. not for all albums ...

the thing i get from search was a but different in each case... while inmy album there is no private kind of album ... but i just want that only users could be able to see certain full size images .......... ideally it would be like 
i have 2 albums = say wallpapers of medium quality and high quality  ...
for registered user ... everything is accessabe ...
for unregistered user ... viewing a highquality image (the full image) is not allowed  ... but still he can see its in slide show .. or normal form ...

thankxxx ...
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Full Secreen Images Only For Registered Users ....
« Reply #1 on: January 16, 2005, 11:40:27 am »

edit displayimage.php, find
Code: [Select]
        if (isset($image_size['reduced'])) {
            $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
            $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
            $pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
        } else {
and replace with
Code: [Select]
        if (isset($image_size['reduced'])) {
            $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
            $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
             if (USER_ID) {
                $pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
                $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
                $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
                $pic_html .= "</a>\n";
             } else {
                $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
                $pic_html .= "You need to be <a href=\"login.php\">logged in</a> to access the full-size image.\n";
             }
        } else {
To make the code dependant on a certain album, replace if (USER_ID) { in above code with any additional criteria you can come up with.

Joachim
Logged

legend_neo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 54
Re: Full Secreen Images Only For Registered Users ....
« Reply #2 on: January 16, 2005, 12:04:37 pm »

Quote
To make the code dependant on a certain album, replace if (USER_ID) { in above code with any additional criteria you can come up with.

thnkss 4 ur help ...as u suggest to use additional criteria .... could u please give me some hint ... i dont knwo much abut php coading  ...

ur chaneg will make everyone to be registered user to see full size image  .... but i want it to apply only on few albums ... not all ..... and what additional things i must use... i dont know much .........but i think it will be album name  but how to do it ???
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Full Secreen Images Only For Registered Users ....
« Reply #3 on: January 16, 2005, 12:21:39 pm »

Code: [Select]
if (USER_ID && $CURRENT_ALBUM_DATA['aid'] == '23') {(replace 23 with the actual id of the album...)

Joachim
Logged

legend_neo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 54
Re: Full Secreen Images Only For Registered Users ....
« Reply #4 on: January 16, 2005, 02:34:36 pm »

again ... to see all  full size image ... u must be the registered user....  that is something i m not asking for .....

in simple coad it will be something like

if (album ==special)
   user must be log in to see full size image
else
  everything is working normal ...

the important thing is  ...

if ( album == special)
  un registered user can see normal pics

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Full Secreen Images Only For Registered Users ....
« Reply #5 on: January 17, 2005, 05:18:48 am »

Code: [Select]
        if (isset($image_size['reduced'])) {
            $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
            $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            if ($CURRENT_ALBUM_DATA['aid'] == '23') { // replace "23" with the album id of your "special" album
              if (USER_ID) {
                $pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
                $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
                $pic_html .= "</a>\n";
              } else {
                $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
                $pic_html .= "You need to be <a href=\"login.php\">logged in</a> to access the full-size image.\n";
              }
            } else {
              $pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
              $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
              $pic_html .= "</a>\n";
            }
        } else {
Logged

legend_neo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 54
Re: Full Secreen Images Only For Registered Users ....
« Reply #6 on: January 18, 2005, 10:20:01 pm »

yup... got it .. but the thing is ... let suppose i have 10/15 such albums .. i have to puc all "aid's" there   ... and if i will make any aother such album .. i have to edit my "displayimage.php," everytime ......... have to use ftp ...etc...

so is that possible to implement it as a property function from the admin panel ... i mean .. where i can edit properties of an album .. can i have an opition there that select if album is "special" or not ..... and implements the same coad ... ???

is this possible ... otherwise ... the code is perfect ...
due to some network problems i m facing here .. i was unable to try it for 2 or more albums ... but i guess it will be like
Code: [Select]
if ($CURRENT_ALBUM_DATA['aid'] == '23'  || $CURRENT_ALBUM_DATA['aid'] == '25' )

right ???
thankxx ...

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Full Secreen Images Only For Registered Users ....
« Reply #7 on: January 19, 2005, 08:20:01 am »

so is that possible to implement it as a property function from the admin panel ... i mean .. where i can edit properties of an album .. can i have an opition there that select if album is "special" or not ..... and implements the same coad ... ???
Possible in theory (if you code it), but I won't code it for you - too much effort.

due to some network problems i m facing here .. i was unable to try it for 2 or more albums ... but i guess it will be like
Code: [Select]
if ($CURRENT_ALBUM_DATA['aid'] == '23'  || $CURRENT_ALBUM_DATA['aid'] == '25' )
yes, correct.

Joachim

P.S. I understand that English is not your first language, but could you please try to make your postings more readible? Try using less frequently those 3 dots, and try to use full sentences and capitalization where applicable. Will make it much more likely that people will look into the issues you're talking about :-X
P.P.S. The word is "code", not "coad" ;)
Logged

legend_neo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 54
Re: Full Secreen Images Only For Registered Users ....
« Reply #8 on: January 23, 2005, 07:48:47 pm »

Ouch,
sorry, so sorry , for spellings 
I got yout point. And from now on, you will see a clear difference. :)
And
just a little intro. me just 16 y old kid . so please, please, please ,dont mind if sometimes i asked stupid questions
( coz i have got one warning from U  :( ).
And i think i got what i was looking for , although i will have to change config.php file each time . but i think thats the only way out.
Thankxxx 4 ur support
Logged
Pages: [1]   Go Up
 

Page created in 0.028 seconds with 19 queries.