Full Secreen Images Only For Registered Users .... Full Secreen Images Only For Registered Users ....
 

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

Main Menu

Full Secreen Images Only For Registered Users ....

Started by legend_neo, January 16, 2005, 11:00:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

legend_neo

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

Joachim Müller

edit displayimage.php, find        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        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

legend_neo

QuoteTo 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 ???

Joachim Müller

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

Joachim

legend_neo

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


Joachim Müller

        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 {

legend_neo

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

if ($CURRENT_ALBUM_DATA['aid'] == '23'  || $CURRENT_ALBUM_DATA['aid'] == '25' )


right ???
thankxx ...


Joachim Müller

Quote from: legend_neo on January 18, 2005, 10:20:01 PM
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.

Quote from: legend_neo on January 18, 2005, 10:20:01 PM
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

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" ;)

legend_neo

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