Author Topic: [Mod] Popup message when user clicks thumbnail where they have no permission  (Read 76103 times)

0 Members and 1 Guest are viewing this topic.

Offline pcfreak

  • Newbie
  • *
  • Posts: 14
    • View Profile
Hey Jan,

New visitors to the gallery, can't see that are restrictions.
Example when a guest hit a thumbnail , and in the admin is fullpicture set only for members, the guest do not see nothing.

So i want to integrate a popup, when a guest hit a thumbnail A popup comes up and says "MEMBERS ONLY CAN VIEUW FULL PICTURES"

How do i integrate this ?
« Last Edit: March 17, 2005, 03:25:43 AM by Chris »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Popup message
« Reply #1 on: December 29, 2002, 11:39:42 PM »
Let's try this:

1. Open /includes/function.php file.
1.1. Find:
Code: [Select]
function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
  global $site_sess, $config;

  if (!check_media_type($media_file_name)) {
    $thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
  }
  else {
    if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
      $file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
      $image_info = @getimagesize($dummy);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
    }
    else {
      $file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
    }
  }

  if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
    }
  }
  return $thumb;
}
Change to this:
Code: [Select]
function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
  global $site_sess, $config, $lang;;

  if (!check_media_type($media_file_name)) {
    $thumb = "<img ".(($show_link) ? "" : "onClick=\"alert('".$lang['members_only']."');\"")."src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
  }
  else {
    if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
      $file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
      $image_info = @getimagesize($dummy);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" ".(($show_link) ? "" : "onClick=\"alert('".$lang['members_only']."'); \"")."border=\"0\"".$width_height." alt=\"".$image_name."\" />";
    }
    else {
      $file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" ".(($show_link) ? "" : "onClick=\"alert('".$lang['members_only']."'); \"")."border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
    }
  }

  if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
    }
  }
  return $thumb;
}
If u dont want use language pack, then u'll need change folowing code:
Code: [Select]
".(($show_link) ? "" : "onClick=\"alert('".$lang['members_only']."'); \"")."To this:
Code: [Select]
".(($show_link) ? "" : "onClick=\"alert('MEMBERS ONLY CAN VIEW FULL PICTURES IN THIS CATEGORY'); \"")."

If u want use language pack then also u'll need change this:
2. Open /lang/languagefolder/main.php add at the end of the file, before " ?> ":
Code: [Select]
$lang['members_only'] = "MEMBERS ONLY CAN VIEW FULL PICTURES IN THIS CATEGORY";

should work. ;) :D
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline pcfreak

  • Newbie
  • *
  • Posts: 14
    • View Profile
Popup message
« Reply #2 on: December 30, 2002, 11:59:01 AM »
Works Great.... :lol:

Thanks V@no

Offline charly22

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Popup message
« Reply #3 on: March 16, 2005, 10:54:47 PM »
Hi
I get following error:
Quote
Parse error: parse error, unexpected '}' in /home/www/htdocs/ak-tur.de/4images/includes/functions.php on line 361

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/www/htdocs/ak-tur.de/4images/includes/functions.php:361) in /home/www/htdocs/ak-tur.de/4images/includes/sessions.php on line 84

Fatal error: Call to undefined function: get_category_dropdown() in /home/www/htdocs/ak-tur.de/4images/includes/page_header.php on line 156
Quote

when doing the replacement as described above.
???

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Popup message
« Reply #4 on: March 16, 2005, 11:33:47 PM »
u made a misstake during installation. restore backups and try again.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline charly22

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Hi Vino,
thanks for your feedback.
You mean the replacement I did was wrong or the installation of 4images?
I exactly followed your describtion:
1. replace in /includes/function.php file the code you described above with the changed code and as I am using language pack,
2. I changed both main.php in my 2 language folders.

Can the error be the cause of misspelling. You descirbed above
Quote
Open /includes/function.php file.
Quote
but my file is called functions.php :roll:

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Seems like you're always putting empty quotes in your posts. 

The text to be quotted goes BETWEEN
Code: [Select]
[quote][/quote]
Like this:
Code: [Select]
[quote]TEXT GOES HERE[/quote]
Not
Code: [Select]
[quote][/quote]WRONG place for quotted text[quote][/quote]

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
I exactly followed your describtion:
1. replace in /includes/function.php file the code you described above with the changed code and as I am using language pack,
well, u replaced it wrong some how...there is nothing anyone can do to help u. Perhaps u missed a bracket ( { } )


@Chris:
It seems to be old habbit from phpbb forum :D
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline M@2T

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • http://4images.aliciakeysfan.com
@ V@no, sorry for posting in the wrong area, was not too sure wether to make a new thread or not, as this is a very old thread, on some forums, get in trouble for digging up old threads.

Anyhow, your very much the mad for mods, and also the creator of this great mod :)..im hoping you might be able to help out :)

Below is what I posted before:

If the user does not have access rights it makes a pop up msg window saying that.  BUT when the mouse is over the thumbnail, the icon remains the same.  Is there anyway to improve this mod, so that it displays the hand icon so that users know they can click on this.

Many thanks

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
try to insert above
Code: [Select]
return $thumb;this:
Code: [Select]
else
{
  $thumb = "<a href=\"javascript: void();\">".$thumb."</a>";
}
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline M@2T

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • http://4images.aliciakeysfan.com
Thats great! works like a charm V@no :)

Thats always bugged me lol, becasue when people see the hand, the assume they can click, if they don't see it, they do not assume this.

It works fine, IE reports a syntax error, but there is no error when people are logged in, all works great.

Cheers :)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
It works fine, IE reports a syntax error, but there is no error when people are logged in, all works great.
JS is something I really dont like to work with...yak...
try to replace void(); with void(0);
but I'm kind of doubt that this is the source source of the error...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Guerillia

  • Newbie
  • *
  • Posts: 29
    • View Profile
Ist es möglich nach dem Popup den User auf die Anmeldeseite umzuleiten?

Is it possible to forward the user to the register site, after he close the Popup ?

-------------------------------------

BTW

The Code is not XHTML valid..

onClick  --> onclick   :idea:

Offline Mobilemick

  • Pre-Newbie
  • Posts: 4
    • View Profile
Hi all, just installed this mod and all works fine,  and the language mod,  :)


Thanks
Mick


www.mobilemick.com/Gallery5/

Offline Marquis2000

  • Full Member
  • ***
  • Posts: 103
    • View Profile
Und wie geht das in der neuen Version 1.7.1 ??