4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: pcfreak on December 29, 2002, 02:11:29 PM

Title: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: pcfreak 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 ?
Title: Popup message
Post by: V@no 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
Title: Popup message
Post by: pcfreak on December 30, 2002, 11:59:01 AM
Works Great.... :lol:

Thanks V@no
Title: Re: Popup message
Post by: charly22 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.
???
Title: Re: Popup message
Post by: V@no on March 16, 2005, 11:33:47 PM
u made a misstake during installation. restore backups and try again.
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: charly22 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
Open /includes/function.php file.
Quote
but my file is called functions.php :roll:
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: Chris 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
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]
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: V@no 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 :D
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: M@2T 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 :)..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
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: V@no on May 10, 2005, 02:35:43 PM
try to insert above
Code: [Select]
return $thumb;this:
Code: [Select]
else
{
  $thumb = "<a href=\"javascript: void();\">".$thumb."</a>";
}
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: M@2T on May 10, 2005, 05:00:40 PM
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 :)
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: V@no 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...
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: Guerillia 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:
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: Mobilemick on June 05, 2005, 05:10:00 PM
Hi all, just installed this mod and all works fine,  and the language mod,  :)


Thanks
Mick


www.mobilemick.com/Gallery5/ (http://www.mobilemick.com/Gallery5/)
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: Marquis2000 on July 01, 2005, 02:48:47 PM
Und wie geht das in der neuen Version 1.7.1 ??
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: der moser on July 20, 2005, 02:52:43 PM
Und wie geht das in der neuen Version 1.7.1 ??

genauso - nur heißt /includes/function.php jetzt /includes/functions.php (oder es hieß auch in 1.7 schon so und v@no hat sich vertippt) ;)
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: impss on August 13, 2005, 04:28:19 AM
How can u get this to work for 1.7.1 ?

thanks for the support
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: artpics on August 13, 2005, 09:39:35 AM
How can u get this to work for 1.7.1 ?

thanks for the support

this mod works for V1.71 and V1.7 , just follow the instructions

RT
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: impss on August 14, 2005, 03:43:10 AM
How can u get this to work for 1.7.1 ?

thanks for the support

this mod works for V1.71 and V1.7 , just follow the instructions

RT

Mine is different
but i put the codes side by side and figured it out

Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: Liyah on January 30, 2006, 06:54:40 PM
Hey V@no! SUPER SUPER SUPER Mod! Den wollte ich schon immer mal haben!
Eine kleine bitte: Ich würde es gut finden wenn dort noch ein Link zur register.php wäre, also Beispiel:

Bla Bla Bla, klicke "hier" um dich zu registrieren.

Also keine Fehlermeldung sondern ein HTML fenster mit sagen wir mal 400 x 300 pixel mittig, dass am besten noch
extrern gelinkt ist, also dass man den link zum HTML fenster im Mod selber einfügen kann, Z.B. www.t-online.de (nicht umbedingt erforderlich, aber nützlich)
Ein HTML Fenster wär nämlich EXTREM praktisch, da man da noch Fehlermeldungsbilder, ne Navigation, oder sogar gleich
den Registriereungsbogen weiter unten mit reintun könnte. Meinst du nich? Ich fänds prima. Wär cool wenn das gehen könnte.

Würd mich über ne Antwort freuen.  :P
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: V@no on January 31, 2006, 01:03:51 AM
Sorry, I don't speak deutsch...
the easiest solution I can give you at the moment is using "OK / Cancel" type of popup dialog box (not a popup window)
add this into header.html template (between <head></head> tags)
Code: [Select]
<script language="javascript">
function confirm_register()
{
  if (confirm('{members_only}'))
  {
    window.location = '{url_register}';
  }
}
</script>
And in includes/functions.php instead of
Code: [Select]
alert('".$lang['members_only']."');use:
Code: [Select]
confirm_register();Then in includes/page_header.php below
Code: [Select]
  "url_register" => (!empty($url_register)) ? $site_sess->url($url_register) : $site_sess->url(ROOT_PATH."register.php"),Insert:
Code: [Select]
  "members_only" => str_replace("\n", "\\n", str_replace("\r", "\\r", str_replace("'", "\'", $lang['members_only']))),
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: Liyah on January 31, 2006, 10:35:55 AM
Thank you! Somehow it unfortunately didn't work for me :( And I think i did everything right.

But anyway, let me translate what i've said so that you can understand me better:

Hey V@no! SUPER Mod! I always wanted to use this one!
I would appreciate it if there could be a link to the register.php, example:

Bla Bla, click "here" to register.

So no alert pop up but a HTML window that has about 400 x 300 pixels, in the middle of the screen,
with an extern link that you can choose all by urself. A HTML window would be EXTREMELY good because
you have the option to add alert pictures, a navigation or also the register form at the bottom of this page.
Don't you think so? It would be cool if there would be a way to do this  :D

I hope that you can help me on this one because it would be really useful!  :wink:
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: mawenzi on January 31, 2006, 01:58:22 PM
@ Liyah

... then try this : http://www.4homepages.de/forum/index.php?topic=11252.msg58106#msg58106 ...
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: mstgokcen on August 09, 2006, 09:57:57 PM
great mode but can we improve it little more...

Is it possible to show a bigger thumbnail instead of a error message (u have to register bla bla)...A bigger thumbnail but not the full size and a message like u have to register to see full size :)

I hope noone will hit me :)
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: F4F on October 26, 2006, 05:21:21 PM
Nice mod, the idea is good...

But how can I modify it, that not a poup window comes?

I only want for users which have no permission, if they klick on the thump, that there is another link. I would put then the link inside, of the register page of my website...

How can I realize this?

Nice greetings from Austria
F4F
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: mawenzi on October 26, 2006, 05:51:54 PM
... und auch dafür haben wir hier eine Lösung ...  :wink:

[MOD] Information if Guest follows direct link to an image/category
http://www.4homepages.de/forum/index.php?topic=7062.0
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: goldcoin on November 28, 2006, 01:20:57 PM
Great mod!
Thanks.
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: macaco007 on June 18, 2007, 10:05:26 PM
hi, first sorry for my bad english, but i will try to explain me
I was installed this mod in my gallery but I really looking a mod for the initial category i mean "when you try to enter to any category"
it display a new page with the register form, it is possible? thanks
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: macaco007 on June 19, 2007, 06:30:36 AM
hi, first sorry for my bad english, but i will try to explain me
I was installed this mod in my gallery but I really looking a mod for the initial category i mean "when you try to enter to any category"
it display a new page with the register form, it is possible? thanks

i will answer me if someone wants the same as me
{if random_cat_image_file}
     {if user_loggedin}<a href="{cat_url}"><img src="{random_cat_image_file}" border="1"></a>{endif user_loggedin}
     {if user_loggedout}<a href="http://www.google.com"><img src="{random_cat_image_file}" border="1"></a>{endif user_loggedout}
{endif random_cat_image_file}   
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: e@agle on July 13, 2007, 10:59:36 PM
super you are the Best man
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: Peppino on July 17, 2007, 07:51:20 AM
Good Morning!

I´ve a question again ;)

I´ve installed the Mod and it works fine.
But how can i modify it, that the popup open when the user has no permission and/or the table-field users_coins is <10.
So I mean, if the user-group has permission, but the user has under 10 coins, then the popup opens too.

I hate my english, but i hope you understood it ;)

OK, jetzt in deutsch, ist einfacher ;)
Also ich hätte den Mod gerne so, das das popup auch erschein, wenn der user keine coins mehr hat, sprich das tabellen-feld user_coins einen Wert <10 hat.
Sprich, selbst wenn er in einer User-Gruppe ist die Zugang hat, wird noch kontrolliert, ob er genug coins hat.

Sag schonmal danke.
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: Peppino on July 18, 2007, 09:19:52 PM
Hello!

Has nobody an idea?
I think the variable $show_link musst be modified, but i don´t know how.

Hat niemand eine idee?
Ich denke das die variable $show_link irgendwo neu definiert werden muss, aber ich weis nicht wo :(

Sage trotzdem schonmal danke.

Gruß Marcus
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: Peppino on July 19, 2007, 12:10:16 PM
Ok, i´ve try it again.

I´ve add after this line  in the functions.php
Ich habe nach diesem Code in der functions.php

Code: [Select]
if (!check_permission("auth_viewimage", $image_row['cat_id']) || !check_permission("auth_viewcat", $image_row['cat_id'])) {
    $show_link = 0;
  }
 

the following code
folgenden code eingefügt

Code: [Select]
$coin_abfrage = "SELECT user_coins FROM ".USERS_TABLE." WHERE user_id = $user_id";

if ($coin_abfrage < 10) {
$show_link = 0;
  }

But now i can´t click any thumb.
The popup opens every time.
Aber jetzt kann ich garkein Thumb mehr anklicken.
Es kommt immer das popup.

Thanks
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: Peppino on July 21, 2007, 10:21:05 AM
Please help me :(

I´ve changed the code

Code: [Select]
$coin_abfrage = "SELECT user_coins FROM ".USERS_TABLE." WHERE user_id = $user_id";

if ($coin_abfrage < 10) {
$show_link = 0;
  }

 to

Code: [Select]
$sql = "SELECT user_coins
          FROM ".USERS_TABLE."
          WHERE user_id = $user_id";
   $result = mysql_query($sql);

if ($result < 10) {
 
$show_link = 0;
  }

but it doesn´t work too :(
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: havanna28 on August 09, 2007, 03:14:53 PM
Hallo

Ich glaube ich habe einen kleinen Fehler gemacht.
Ich bekomme das Popup einwandfrei angezeigt aber leider ohne Text.Hat jemand einen kleinen tipp für mich?

Dirk

Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: skidpics on October 09, 2007, 02:18:12 AM
This MOD is awesome!  Thanks!
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: eddyman1us on November 04, 2007, 12:23:49 PM
this mod looks very promising ...
any ideas to get it worked with 1.7.4 I tried but cudnt help !

I am also using [Mod] Star Rating + Mouseover/out + without pagereload + ip  :|
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: thunderstrike on November 04, 2007, 12:31:15 PM
Quote
I am also using [Mod] Star Rating + Mouseover/out + without pagereload + ip

Sigh - and if install popup message MOD in fresh gallery ?
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: eddyman1us on November 04, 2007, 05:14:51 PM
even if I would have installed on an fresh 1.7.4 galllery that might now have worked as some of the codes in the original version are changed ....

I think little help from knowledgeable person could make it work for all the people having 1.74. this mod can benifit a lot of gallery admins the only thing is its aint updated and  is less known  :(

BTW my partial  functions.php ...

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, $user_info, $setting;

$thumbnails_rating = $config['starrating_thumbs'];

  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($file_src);
      $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."\" />";
// ################## Start Mod Star Rating * Mouseover/ Hover * Rating without pagereload ##############
      $thumb .= rating_bar(''.$image_id.'','$thumbnails_rating_images','$rating_images','$thumbnails_rating_image_width',''.$thumbnails_rating.'','1');
// ################## End Mod Star Rating * Mouseover/ Hover * Rating without pagereload ##############
    }
  }

  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;
}





any help  :roll: !
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: thunderstrike on November 04, 2007, 05:15:46 PM
Quote
even if I would have installed on an fresh 1.7.4 galllery that might now have worked as some of the codes in the original version are changed ....

Even and might ?

Please try if no sure and post result.
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: eddyman1us on November 04, 2007, 05:19:56 PM
ofcourse am sure sir ! thats why seeked help here  8O
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: thunderstrike on November 04, 2007, 05:21:56 PM
This is star rating MOD code ... please post in correct topic (KurtW support).
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: eddyman1us on November 04, 2007, 05:29:49 PM
actually I posted the functions.php code which was modified due to star rating  .. I would take it as my fault anyways here is the orignal code of functions.php from fresh 1.7.4 ....


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($file_src);
      $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;
}


I hope this is okay now !
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: thunderstrike on November 04, 2007, 05:31:19 PM
You post original code and you post MOD of star rating before ... is no problem with original code.
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: eddyman1us on November 04, 2007, 05:53:56 PM
BUT I checked on the fresh install it didnt worked ....

all I can see is the original code from 1.7.1 as stated on page 1 is diffrent from the 1.7.4

one of the line is ...

from 1.7.1
Code: [Select]
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);


while in 1.7.4 its
Code: [Select]
   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($file_src);


I think V@no is the right person to solve this problem ..

V@no where are  you !
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: thunderstrike on November 04, 2007, 06:00:17 PM
I use 4images v1.74 and is:

Quote
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($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";

I have for block in includes/functions.php file ...
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: eddyman1us on November 04, 2007, 06:12:00 PM
yeh so... even I have it in the original functions.php
only thing I didnt paste the entire block  :?
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: thunderstrike on November 04, 2007, 06:19:31 PM
So ? There is no problem with original ... you post original but you have other real block for edit.
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: eddyman1us on November 05, 2007, 09:44:13 AM
Hi , thunderstrike

Can you post the whole functions.php which according to you is working for 1.7.4.
as I mentioned earlier even after modifying the original code it was malfunctioning in my case .
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: thunderstrike on November 05, 2007, 12:31:13 PM
Quote
after modifying the original code it was malfunctioning in my case .

I no see see error message. Please read step 6 of my signature.
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: eddyman1us on November 05, 2007, 01:00:26 PM
its does say error it just doesnt work ... nothing happens when clicked without logging in

Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: thunderstrike on November 05, 2007, 01:15:31 PM
Quote
its does say error it just doesnt work ... nothing happens when clicked without logging in

In global.php file,

find:

Quote
error_reporting(E_ERROR | E_WARNING | E_PARSE);

replace:

Code: [Select]
//error_reporting(E_ERROR | E_WARNING | E_PARSE);
error_reporting(E_ALL);

Try page again. Please report error message you see (in quote !) .
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: eddyman1us on November 06, 2007, 01:13:42 PM
done still nothing happened  :(
no errors nothing !
check ur pm for url
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: zakaria666 on September 05, 2010, 12:22:52 AM
@Vano,

Hello and thanks for refering  me to this MOD. This is what I wanted but just to recap, this MOD will give a user a pop up when they try to browse around as a guest and not logged in right??

If so I have installed this MOD and nothing happens. What I mean is that Ive done exactly what this MOD has asked off me and Ive uploaded it to the server sir, and I can still browse around my site as a guest and no popup appears. I thought at first it was the browser, so i tried chrome and its the same on there is well

Am i doing something wrong or is the syntax on my side different from the Code u initially had when implenting this MOD.

thanks sir.
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: V@no on September 05, 2010, 03:15:31 AM
It doesn't matter guest or member, what matters is what visitor is allowed to see. If they are allowed view category, but not allowed view images, then this popup will be displayed when they try click on a thumbnail (by default it only show thumbnails without any links)
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: zakaria666 on September 06, 2010, 01:58:45 AM
I finally it figured it out  :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) arrrrrrrrrrrrrg 4images is so confusing  :lol:

I had to change the the permissions from private to registered. Vano you told me like 6 months ago, private was the same was registered. I think this needs to be changed, because it always confuses me. If 4images technicailly has only 3 levels of permissions then i think private should be integrate to registered.

Thanks man

***********
update

This mod doesnt seem to work for default thumbnails. I.E http://www.4homepages.de/forum/index.php?topic=24054.0 (http://www.4homepages.de/forum/index.php?topic=24054.0) gives default thumbnails (for example youtube thumbnail)...if the thumbnail of the media site video is not saved. So users can still click on videos with default thumbnails without a pop up coming up


**********
Title: Re: [Mod] Popup message when user clicks thumbnail where they have no permission
Post by: V@no on September 06, 2010, 02:28:44 AM
I think this needs to be changed, because it always confuses me.
Confusion of one person is not enough for changing core of the program :P ;)
And I never said private is the same as registered, I said private can only be used on registered members only (not in these exact words of course). When permissions set to private it automatically deny everyone unless overridden per single member or group. If you think this confusing, try out SMF forum software see for yourself what's more confusing... :?

This mod doesnt seem to work for default thumbnails. I.E http://www.4homepages.de/forum/index.php?topic=24054.0 (http://www.4homepages.de/forum/index.php?topic=24054.0) gives default thumbnails (for example youtube thumbnail)...if the thumbnail of the media site video is not saved. So users can still click on videos with default thumbnails without a pop up coming up
It works just fine. Just look in the new code, you'll see three lines with <img and all three of them have the same onclick= code.