4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started 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 ?
-
Let's try this:
1. Open /includes/function.php file.
1.1. Find: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)) ? "&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)) ? "&mode=".$mode : ""))."\">".$thumb."</a>";
}
}
return $thumb;
}
Change to this: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)) ? "&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)) ? "&mode=".$mode : ""))."\">".$thumb."</a>";
}
}
return $thumb;
}
If u dont want use language pack, then u'll need change folowing code:".(($show_link) ? "" : "onClick=\"alert('".$lang['members_only']."'); \"")."
To this:".(($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 " ?> ":$lang['members_only'] = "MEMBERS ONLY CAN VIEW FULL PICTURES IN THIS CATEGORY";
should work. ;) :D
-
Works Great.... :lol:
Thanks V@no
-
Hi
I get following error:
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
when doing the replacement as described above.
???
-
u made a misstake during installation. restore backups and try again.
-
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 Open /includes/function.php file.
but my file is called functions.php :roll:
-
Seems like you're always putting empty quotes in your posts.
The text to be quotted goes BETWEEN [quote][/quote]
Like this: [quote]TEXT GOES HERE[/quote]
Not [quote][/quote]WRONG place for quotted text[quote][/quote]
-
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
-
@ 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
-
try to insert above
return $thumb;
this:else
{
$thumb = "<a href=\"javascript: void();\">".$thumb."</a>";
}
-
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 :)
-
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...
-
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:
-
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/)
-
Und wie geht das in der neuen Version 1.7.1 ??
-
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) ;)
-
How can u get this to work for 1.7.1 ?
thanks for the support
-
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
-
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
-
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
-
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)
<script language="javascript">
function confirm_register()
{
if (confirm('{members_only}'))
{
window.location = '{url_register}';
}
}
</script>
And in includes/functions.php instead of alert('".$lang['members_only']."');
use:confirm_register();
Then in includes/page_header.php below "url_register" => (!empty($url_register)) ? $site_sess->url($url_register) : $site_sess->url(ROOT_PATH."register.php"),
Insert: "members_only" => str_replace("\n", "\\n", str_replace("\r", "\\r", str_replace("'", "\'", $lang['members_only']))),
-
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:
-
@ Liyah
... then try this : http://www.4homepages.de/forum/index.php?topic=11252.msg58106#msg58106 ...
-
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 :)
-
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
-
... 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
-
Great mod!
Thanks.
-
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
-
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}
-
super you are the Best man
-
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.
-
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
-
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
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
$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
-
Please help me :(
I´ve changed the code
$coin_abfrage = "SELECT user_coins FROM ".USERS_TABLE." WHERE user_id = $user_id";
if ($coin_abfrage < 10) {
$show_link = 0;
}
to
$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 :(
-
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
-
This MOD is awesome! Thanks!
-
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 :|
-
I am also using [Mod] Star Rating + Mouseover/out + without pagereload + ip
Sigh - and if install popup message MOD in fresh gallery ?
-
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 ...
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)) ? "&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)) ? "&mode=".$mode : ""))."\">".$thumb."</a>";
}
}
return $thumb;
}
any help :roll: !
-
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.
-
ofcourse am sure sir ! thats why seeked help here 8O
-
This is star rating MOD code ... please post in correct topic (KurtW support).
-
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 ....
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)) ? "&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)) ? "&mode=".$mode : ""))."\">".$thumb."</a>";
}
}
return $thumb;
}
I hope this is okay now !
-
You post original code and you post MOD of star rating before ... is no problem with original code.
-
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
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
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 !
-
I use 4images v1.74 and is:
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 ...
-
yeh so... even I have it in the original functions.php
only thing I didnt paste the entire block :?
-
So ? There is no problem with original ... you post original but you have other real block for edit.
-
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 .
-
after modifying the original code it was malfunctioning in my case .
I no see see error message. Please read step 6 of my signature.
-
its does say error it just doesnt work ... nothing happens when clicked without logging in
-
its does say error it just doesnt work ... nothing happens when clicked without logging in
In global.php file,
find:
error_reporting(E_ERROR | E_WARNING | E_PARSE);
replace:
//error_reporting(E_ERROR | E_WARNING | E_PARSE);
error_reporting(E_ALL);
Try page again. Please report error message you see (in quote !) .
-
done still nothing happened :(
no errors nothing !
check ur pm for url
-
@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.
-
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)
-
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
**********
-
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.