4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
February 19, 2018, 04:52:34 AM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [Mod] Popup message when user clicks thumbnail where they have no permission
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 3 4 » »» Print
This topic has not yet been rated!
Author Topic: [Mod] Popup message when user clicks thumbnail where they have no permission  (Read 58149 times)
pcfreak
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 0
-Receive: 0


View Profile
« on: December 29, 2002, 02:11:29 PM »

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 » Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #1 on: December 29, 2002, 11:39:42 PM »

Let's try this:

1. Open /includes/function.php file.
1.1. Find:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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:
1
".(($show_link) ? "" : "onClick=\"alert('".$lang['members_only']."'); \"")."
To this:
1
".(($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 " ?> ":
1
$lang['members_only'] = "MEMBERS ONLY CAN VIEW FULL PICTURES IN THIS CATEGORY";


should work. Wink Very Happy
Logged

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)
pcfreak
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #2 on: December 30, 2002, 11:59:01 AM »

Works Great.... Laughing

Thanks V@no
Logged
charly22
Jr. Member
**
Offline Offline

Posts: 64

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #3 on: March 16, 2005, 10:54:47 PM »

Hi
I get following error:
Quote  [Expand]
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  [Expand]

when doing the replacement as described above.
???
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #4 on: March 16, 2005, 11:33:47 PM »

u made a misstake during installation. restore backups and try again.
Logged

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)
charly22
Jr. Member
**
Offline Offline

Posts: 64

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #5 on: March 17, 2005, 11:52:22 AM »

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  [Expand]
Open /includes/function.php file.
Quote  [Expand]
but my file is called functions.php Rolling Eyes
Logged
Chris
4images Moderator
4images Guru
*****
Offline Offline

Posts: 4487

Thank You
-Given: 0
-Receive: 31

Did u ever stop to think and then forget to start?


View Profile
« Reply #6 on: March 17, 2005, 06:54:29 PM »

Seems like you're always putting empty quotes in your posts. 

The text to be quotted goes BETWEEN
1
[quote][/quote]

Like this:
1
[quote]TEXT GOES HERE[/quote]

Not
1
[quote][/quote]WRONG place for quotted text[quote][/quote]
Logged

V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #7 on: March 18, 2005, 12:04:02 AM »

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 Very Happy
Logged

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)
M@2T
Newbie
*
Offline Offline

Posts: 22

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #8 on: May 10, 2005, 02:29:05 PM »

@ 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 Smile..im hoping you might be able to help out Smile

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
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #9 on: May 10, 2005, 02:35:43 PM »

try to insert above
1
return $thumb;
this:
1
2
3
4
else
{
  $thumb = "<a href=\"javascript: void();\">".$thumb."</a>";
}
Logged

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)
M@2T
Newbie
*
Offline Offline

Posts: 22

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #10 on: May 10, 2005, 05:00:40 PM »

Thats great! works like a charm V@no Smile

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 Smile
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #11 on: May 10, 2005, 11:55:31 PM »

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

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)
Guerillia
Newbie
*
Offline Offline

Posts: 29

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #12 on: May 29, 2005, 11:02:59 AM »

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
Logged
Mobilemick
Pre-Newbie

Offline Offline

Posts: 4

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #13 on: June 05, 2005, 05:10:00 PM »

Hi all, just installed this mod and all works fine,  and the language mod,  Smile


Thanks
Mick


www.mobilemick.com/Gallery5/
Logged
Marquis2000
Full Member
***
Offline Offline

Posts: 103

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #14 on: July 01, 2005, 02:48:47 PM »

Und wie geht das in der neuen Version 1.7.1 ??
Logged
Pages: [1] 2 3 4 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.175 seconds with 19 queries.