4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Vraxor on November 16, 2002, 03:46:47 PM
-
Hi all,
I know that there already are many posting on this topic, but I finally succeeded in getting it to work. So this is more or less a tutorial.
This is what you have to do.
1. Open Details.php
2. add after:
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
Add this:
$sql = "SELECT image_name FROM ".IMAGES_TABLE." WHERE image_id = $id";
$image_name = $site_db->query($sql);
$sql = "SELECT user_id FROM ".IMAGES_TABLE." WHERE image_id = $id";
$user_id = $site_db->query($sql);
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
// Start Emailer für comments
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject("Comment Posted");
$site_email->register_vars(array(
"user_name" => $image_row['user_name'],
"recipient_name" => $recipient_name,
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
Make sure that you posted it before:
}
}
unset($row);
unset($spam_row);
}
//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
3. Now you have to make a mail template called comment_email.html
put this in the comment_email.html:
Dear {user_name},
someone posted a comment on {image_name} at {site_name}.
To view the comment go to: {image_url}
Date: {comment_date}
------
Best regards, {site_name}
save this mail template in: [ROOT]/Lang/[your_language]/email/
This should be all.
Note:
Always back-up any file you begin to edit.
I cannot be held responsible for any data loss or any other problem that might happen after editing files like I explained above.
I do not have much php knowledge so I expect that there will be some improvements possible in the code I just gave. If you have any additions or improvements to the code I posted, please feel free to reply.[/list:u]
I hope you all like this addition.
Cheers,
Vraxor
-
I forgot something important.
Most of the code was provided by Tommy. He posted something about this earlier, but that was in german and I did not really understand what it was about.
Anyways, some credits belong to him too 8)
Vraxor
-
Vraxor and Tommy,
thank you very much!! this is great option and this works SUPER..
one little bug is at :
3. Now you have to make a mail template called comment_mail.html
put this in the comment_mail.html:
need to: comment_email.html other you get error in 1.7.V
Thanks Again
-
one little bug is at :
3. Now you have to make a mail template called comment_mail.html
put this in the comment_mail.html:
need to: comment_email.html other you get error in 1.7.V
Actually it's because of this PHP line:
$site_email->set_body("comment_email", $config['language_dir']);
So if you want to use comment_mail.html just change the php line or else use the file name comment_email.html. I just wanted to point out its a simple little change and not due to any particular 4images version.
Way to go guys! Nice mod.
-
I have little question about the data of the comments..I posted comments under my own images 2 times and I got e-mail with the same data of posted comments : Date: 31.12.1969 19:00 no matter I asked one member that got comments with the same Date: 31.12.1969 19:00.
how I can fix this?
Thank you for your help,
Cath
-
@ Mec4D:
I think you can better leave that line out, since I have the same problem. The date is incorrect, should be able to fix, but I did not find it any important.
So just remove the "Date: {comment_date}" out of the template.
About the "Comment_mail.html": Yes, I made a type error. It should be: 'Comment_email.html", but I already changed it.
Cheers,
Vraxor
-
Hi Vraxor,
Thanks for the credits, but you take it by your self and the credits go back to you :wink:
The code is right and you have make a very good tutorial about this, and it must run with the little corrections from Mec4d very good.
@Mec4d Yes, delete the line with the comment_date (in the code and in the template), it only makes problems :wink:
But, some little cosmetic changes i will give you here -
for your line:
$site_email->set_subject("Comment Posted");
take this line:
$site_email->set_subject($lang['send_comment_emailsubject']);
Now go to your lang/"your language"/main.php/ to the point "Comments":
After this code:
//-----------------------------------------------------
//--- Comments ----------------------------------------
//-----------------------------------------------------
.
.
.
$lang['post_comment'] = "post comment";
add this code:
$lang['send_comment_emailsubject'] = "Your picture has become a new comment";
For the text "Your picture..." write what you want, i hope in better english as mine. Thats the email subject :wink:
For your line:
"user_name" => $image_row['user_name'],
"recipient_name" => $recipient_name,
take this lines:
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"user_name" is the name of the person who makes the comment
"recipient_name" is the name of the owner of the picture. He / She becomes this mail.
Now you can take this code in your comment_email.html
Dear {recipient_name},
{user_name} posted a comment on {image_name} at {site_name}.
To view the comment go to: {image_url}
------
Best regards, {site_name}
Everybody who has make the Mod-phpbb integration must chance this line:
"recipient_name" => stripslashes($image_row['user_name']),
with this line:
"recipient_name" => stripslashes($image_row['username']),
If you don`t do it you have no recipient_name in your template.
When you test this mod at home (at your local server on your Pc), it is right that you become an error-messages like this: Error in email.php. You cant send on your local Pc emails :wink: Online (on your webspace) this Mod runs correctly !!!
So I think that was all for the moment :D
... and sorry for my english its not the best :wink:
cu
tommy
-
Vraxor and Tommy,
thank you so much..I changed already the codes and everything works perfect!
I was waiting for this module for long time and finaly you got this guys working!!!!!
Big Hugs! to both of you
Catharina
-
Thanks a lot Tommy,
these last additions work great and I got a little messed up between the 2 diffent usernames ;-)
Cheers,
Vraxor
-
Thank you very, very much for this really helpful add-on! I just changed the codes and it works great! I'm raelly glad about it... - and I think my users feel the same...
Wishing you a happy day,
Biggi
-
Hi @all,
today I have a further question:
how could I manage it not only to show the link to the comment, but further the comment itself in the e-mail? Is this possible?
Could someone show the code-changes? That would be great...
Have a nice day,
Biggi
-
but then, how would u know for witch picture was that coments?
-
I want the whole comment just in addition. The title of the image and the link should'nt be replaced. Just additional.
By the way: I'd like to change the notifies. I only need them, if a user commented, but NOT, if I answered to a comment.
My knowledge of PHP isn't good enough, so I would be glad if someone could help to realize my wishes.
Thanks,
Biggi
-
HI Biggy,
I know it's not perfect right now and this results in a notify also beeing send when you post a comment on your own image. I could fix this by making an owner check in the comment system, but right now I just don't feel like coding too much and it's still too difficult for me to say it will be done in 10 minutes, in fact I don't know if I could do it at all.
About putting the comment into the mail, this might be possible. Only prob is that my PHP knowledge is too limited at the moment to say how. And right now I'm working on totally different things so I don't have time to figure it out. Maybe somebody else would like to improve the mod.
Cheers,
Vraxor
-
Hi Vraxor,
nevertheless I thank you for your answer. I know about the problem working on other projects and not having any time. You may say, I leased it :wink:
Maybe some day somebody else could solve the problem...
Regards,
Biggi
-
To have the Server Date and Time,
Add this line in your details.php
$current_time = time();
Befor this
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject("Comment Posted");
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => $image_row['user_name'],
"recipient_name" => $recipient_name,
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
So it should look like
$current_time = time();
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject("Comment Posted");
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => $image_row['user_name'],
"recipient_name" => $recipient_name,
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
Good Luck
-
but in the navigation bar i see this:
Home / Nature / Resource id #21
What is "Resource id #21"
before posting the comment nav bar looks like:
Home / Nature / TreeForest
-
anybody can help me??
-
NO sorry, Hunter, I don't really understand that either, but maybe somebody else does. It aint a problem for me though.
Cheers,
Vraxor
-
ok...I will continiue waiting for someone else you can fix this, mod is really good, but buggy :(
-
I've modified this nice MOD a bit... first of all, to get rid of those "Resource id #21", and second - to check, if user wants to recieve mails from admin. For this I've also added one field to User Profile, to let user choose himself, if he wans emails or not.
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowemails = ($row['user_allowemails']);
if ($user_allowemails == 1) {
$current_time = time();
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject("Comment Posted");
$site_email->register_vars(array(
"recipient_name" => $recipient_name,
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
//-------------------------------------------------------
Btw, the reason for "Resource id #" was using $image_name variable in sql query. I even removed these queries at all, because all necessary data alreary here, from the query at the very begining of page.
Add this table row to member_editprofile.html
<tr>
<td class="row2"><b>{lang_allow_emails}</b></td>
<td class="row2">
<input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
{lang_yes}
<input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
{lang_no}</td>
</tr>
-
Thanks for fixing, but I found in a member_profile.html some code as you type below
<tr>
<td class="row2"><b>{lang_allow_emails}</b></td>
<td class="row2">
<input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
{lang_yes}
<input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
{lang_no}</td>
</tr>
This is a default button for disabling recieving notifications from a admin? That already has in a user contol panel?
-
Thanks for fixing, but I found in a member_profile.html some code as you type below
Sorry for confusion. I'm using 4blue_orange1 template, and just found out that for some reason this row was removed from template. Since you already have it in yours, you don't have to add anything..
-
Hi,
on my website, vistors often discuss in the comments.
So for me it would be very useful to have an email sent to everyone, who has posted a comment, not only to the owner of the image.
is this possible?
cya, Jörg
-
Hi for some reason the code SLL posted wont send me the email....maybe it's because I have removed the button on the user profile to disable them from picking? I would like to leave it removed from there profile but also have SLL code to work...any ideas?
-
I would like to leave it removed from there profile but also have SLL code to work...any ideas?
take away if ($user_allowemails == 1) {
line and one "}" at the very bottom
-
thanks that worked, but gave me 1 more problem....the email it sent me said
{user_name}, instead of my username
-
That means you've modified something else in this file. Try original MOD code, which you can find in the beginning of this thread.
-
That means you've modified something else in this file. Try original MOD code, which you can find in the beginning of this thread.
hmm confused I just started out fresh and it worked with the original code. I then modified it and now is still doesnt insert the username...anymore ideas? Thanks
Also everything else worked fine, the
Resource id #21 is gone
it sends the email to me when I post a comment on an image i added
the image name is correct in the email and so it the date and time and everything....just wont replace {user_name} with my name which is Jason in my gallery
-
Change the template like this:
Dear {recipient_name}, ........
-
hi thank you so much it works great now
-
.
-
.
-
Da ich leider kein Englisch kann habe ich in diesem Thema ein wenig den Überblick verloren und würde mich freuen wenn jemand eine komplett neue Anleitung schreiben könnte.
Danke!!!
--------------------------------------------------
Since I know unfortunately no English have I in this topic a little the overview lost and if someone would be pleased a completely new guidance write could. Thanks!!!
-
"Message-Id: <E18nhks-0002Fy-00@....."
Any ideas yet?
I believe this message id was added by your mail server and has nothing to do with 4images code
-
Um auch den Kommentar mit in der Mail anzuzeigen, habe ich das folgende so abgeändert:
// Start Emailer für comments
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"image_name" => $image_row['image_name'],
"site_name" => $config['site_name'],
"image_url" => $image_url,
"comment_text" =>$comment_text,
"comment_headline"=>$comment_headline,
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
}
{comment_headline} und {comment_text} müssen jetzt nur noch in der comment_email.html eingefügt werden.
-
Um auch den Kommentar mit in der Mail anzuzeigen, habe ich das folgende so abgeändert:
...
{comment_headline} und {comment_text} müssen jetzt nur noch in der comment_email.html eingefügt werden.
Nice! :D
-
is it possible that only the webmaster get an email and not the owner of the picture? what must i change?
-
(sorry for my english)
Maybe someone can help me,
i did integrated my 4images with invisionsboard, everythings works fine,
and i want to use this mod too.
thanks :)
-
O.K. I just did it,
anyway thank you very much.
boti :D
-
Hallo Cancy,
ich hab mich gerade sehr über Deine Nachricht gefreut, daß es eine Lösung für die Anzeige des Kommentares in der Mail gibt. Habe das auch gleich alles so geändert.
Leider erscheint bei mir überhaupt keine Änderung in der comment_email.html
details.php und {comment_text] in der comment_email.html sind drin. Woran könnte das liegen? Es müßte doch nun eigentlich klappen? Hast Du irgendeine Idee? Ich stehe vor einem Rätsel :roll:
Viele Grüße, Biggi
-
Hm, seltsam...
Hier nochmal der komplette Block:
$sql = "INSERT INTO ".COMMENTS_TABLE."
(image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
VALUES
($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
$sql = "SELECT image_name FROM ".IMAGES_TABLE." WHERE image_id = $id";
$image_name = $site_db->query($sql);
$sql = "SELECT user_id FROM ".IMAGES_TABLE." WHERE image_id = $id";
$user_id = $site_db->query($sql);
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
// Start Emailer für comments
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"image_name" => $image_row['image_name'],
"site_name" => $config['site_name'],
"image_url" => $image_url,
"comment_text" =>$comment_text,
"comment_headline"=>$comment_headline,
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
}
unset($row);
unset($spam_row);
}
und so sieht die comment_email.html bei mir aus:
Hallo {recipient_name},
{user_name} gab einen Kommentar zu deinem Bild "{image_name}" ab im {site_name}.
Kommentar:
{comment_headline}
{comment_text}
Hier kannst du den Kommentar ansehen: {image_url}
------
Mit freundlichen Grüssen,
{site_name}
Ich kann dir sonst beides (detail.php & comment_email.html) mal schicken wenn du möchtest.
Liebe Grüsse
Cancy
-
Juppiduppiduuuuuuuh :D
Ich war gestern so spät etwas geistig umnachtet und habe die geänderte comment_email.html ständig ins template-Verzeichnis geladen, obwohl sie ja ins Verzeichnis lang/deutsch/email gehört :-)
Nun klappt es auch mit sämtlichen Nachbarn - äh - Kommentaren :D
Vielen Dank nochmal für Deine Hilfsbereitschaft!
Übrigens: Deine Homepage ist toll gestaltet und es war sehr interessant, was man aus diesem Galerie-Skript machen kann!
Viele Grüße & gute Nacht,
Biggi
-
any way to make it so that the user could choose wether to use this option or not?
-
sure. the user can select it he accepts or not mails from admin in his profile
-
sure. the user can select it he accepts or not mails from admin in his profile
If the user does this they won't recieve any e-mail sent by the admin though...
-
Great addition but I am getting empty emails.
Anyone?
Chepe
-
Guten Morgen an alle,
Cancy hatte ja eine Möglichkeit geschaffen, den Text eines Kommentares gleich in der Benachrichtigungs-Email anzuzeigen. Das klappt alles wunderbar.
Nun würde ich gerne in der Benachrichtigung auch noch angezeigt haben, wie der letzte Kommentator bewertet hat. Ungefähr so:
Kommentartext hier
Bewertung: X Punkte
Kann mir bitte nochmals jemand behilflich sein? Wie könnte ich das in die Benachrichtigungsmail einbauen? Ich habe schon hin- und herprobiert, aber meine PHP-Kenntnisse reichen einfach nicht :roll: Ich würde mich sehr freuen, wenn jemand eine Lösung für mich hätte! Vielen Dank!
Biggi
------------------------------------------------------------------------------------
I'll try it in english:
Cancy had managed to show the whole comment-text to the owner of an image. It works fine!
Now I'd like to show the rating of the last user who commented too. For example this way:
Comment-text here
Rating: x Points
I'd be happy if someone could post a solution for this, because I cannot manage ist by myself. Thanks in advance!
-
Hat sich erledigt. Danke! Lösung poste ich gleich noch.
I've managed it. Solution followes in a few minutes...
-
Und hier die Lösung, wie man in der Benachrichtigungsmail zusätzlich zum Kommentar-Text auch die Bewertung des letzten Kommentators mit anzeigt:
Here's the solution:
Suche in der details.php:
Search in details.php:
"comment_text" =>$comment_text,
"comment_headline"=>$comment_headline,
Füge in der nächsten Zeile ein:
Add in next line:
"rating" => $rating,
Ergänze in der comment_email.html:
Add in comment_email.html:
Bewertung: {rating} Punkte
oder in Englisch:
Voting: {rating} Points
That's it.
Viele Grüße, Biggi
-
After adding this mod, I notice after I add a comment to a photo that on the page that comes up after adding the comment, the photo is listed as:
Resource id #29
I've never noticed this before. If I go to a fresh image before adding a comment, it lists the photo name, but after adding a comment it lists it as
Resource id #29 the 29 can be replaced by another number depending on the image. Anyway to fix this?
-
After adding this mod, I notice after I add a comment to a photo that on the page that comes up after adding the comment, the photo is listed as:
Resource id #29
I've never noticed this before. If I go to a fresh image before adding a comment, it lists the photo name, but after adding a comment it lists it as
Resource id #29 the 29 can be replaced by another number depending on the image. Anyway to fix this?
I think u didnt read throught the replys ;)
from the MOD code delete top four lines: $sql = "SELECT image_name FROM ".IMAGES_TABLE." WHERE image_id = $id";
$image_name = $site_db->query($sql);
$sql = "SELECT user_id FROM ".IMAGES_TABLE." WHERE image_id = $id";
$user_id = $site_db->query($sql);
-
Is it possible to set that members will set if they want email notification or not?
Like in settings...?
-
yes ;)
-
hehe V@no.... this is a tip right??? :D
-
ok, chose:
1. only image owners can chose receive or not emails on new posted comments
2. any registered members can "subscribe" for any images they want, to receive emails on new posted comments.
the first variant is already exist (no offical mods though), u can see it at my site ;)
the second variant is not exist (I'm not aware of), but I was thinking to make it sometimes today.
-
you are right, you have this function when you want to add photo to your page. But saidly i couldn't find instruction how to install that mode :cry:
-
v@no: i saw on your page, that you can check box where you can choose between reciving notification or not (its in UPLOAD section). But where or how did you set this?
-
I really wanna get this MOD goin' in my gallery. I had everything set up but I'd get a returned E-mail everytime some posted a comment. It said there was no recipient specified. I also noticed that in these returned E-mails the usernames weren't showing up in the Dear ______, area. I've got my gallery integrated in to PHPnuke and I think it may have something to do with some different mysql calls. What table is it pulling user_name and user_email from?
-
What table is it pulling user_name and user_email from?
Whatever is specifyed in /includes/constants.php
define('USERS_TABLE' , blah blah);
-
That makes sense. Will it also use the modified row names for that table that I have set in sessions.php? I mean, is it looking specifically for rows called user_name and User_email or will it go to sessions.php to pull the correct row names?
-
Halli hallo,
also ich bin ganz neu hier und irgendwie komm ich nicht klar *heul*
Also ich hab das ganze jetzt mal so geändert und auch in den richtigen Verzeichnisen abgelegt. Ich bekomme aber keine Email *heul*
Ich habe allerdings unter den Bildern den usernamen entfernt, da es ja nur meine Bilder sind. Liegt das daran??? Wenn nicht, kann mir dann bitte jemand helfen - bevor ich meinen PC zum Fenster raus werfe.
Danke schon mal im voraus.
Sternchen
-
Hm, seltsam...
Hier nochmal der komplette Block:
$sql = "INSERT INTO ".COMMENTS_TABLE."
(image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
VALUES
($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
$sql = "SELECT image_name FROM ".IMAGES_TABLE." WHERE image_id = $id";
$image_name = $site_db->query($sql);
$sql = "SELECT user_id FROM ".IMAGES_TABLE." WHERE image_id = $id";
$user_id = $site_db->query($sql);
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
// Start Emailer für comments
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"image_name" => $image_row['image_name'],
"site_name" => $config['site_name'],
"image_url" => $image_url,
"comment_text" =>$comment_text,
"comment_headline"=>$comment_headline,
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
}
unset($row);
unset($spam_row);
}
und so sieht die comment_email.html bei mir aus:
Hallo {recipient_name},
{user_name} gab einen Kommentar zu deinem Bild "{image_name}" ab im {site_name}.
Kommentar:
{comment_headline}
{comment_text}
Hier kannst du den Kommentar ansehen: {image_url}
------
Mit freundlichen Grüssen,
{site_name}
Ich kann dir sonst beides (detail.php & comment_email.html) mal schicken wenn du möchtest.
Liebe Grüsse
Cancy
Can someone please translate this into English for me? This is exactly what I need!
-
Hello,
I've a problem because my USERS_TABLE is on vbulletin, $image_row['user_name'] and $image_row['user_email'] don't work!
Who can I do?
Thanks
-
Hey Flash7,
I have no idea how Vbulletin names these table fields, but you should look for those fields in the database and edit them in php accordingly.
So if Vbulletin has a table field like username instead of user_name, you should change $image_row['user_name'] to $image_row['username']
Same for user_email.
Hope this helps.
Cheers,
Vraxor
-
Vraxor,
thank you...now work :)
-
Hmm, hab das mal grad gemacht, aber irgendwie kriege ich keine e-mail ???
-
Gibt es eine Möglichkeit, den User über neue Anmerkungen zu den Fotos zu informieren zu denen er bereits eine Anmerkung verfasst hat?
Noch besser wäre es wenn sich jeder User per Klick selber aussuchen könnte ob er eine
Benachrichtigun erhält sobald ein Kommentar zu dem ausgewählten Bild geschrieben wurde.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Is there a possibilty to inform users with e-mail if there are further comments at photos they`ve already commented.
So they can make discussions .Even better it would be if a user can choose by click at a button if he wants to be informed and by a click of a button he
could see if a new comment has been written to the photo.
I hope you understand what i mean.
Also other solutions in that way are o.k.
Gruß, Michael
-
ok, chose:
1. only image owners can chose receive or not emails on new posted comments
2. any registered members can "subscribe" for any images they want, to receive emails on new posted comments.
the first variant is already exist (no offical mods though), u can see it at my site ;)
the second variant is not exist (I'm not aware of), but I was thinking to make it sometimes today.
I'm highly interested in those two functions. Is there a solution available in the meantime ?
Thanks, Martin
-
This is a great MOD for people with much material belonging to people who sends in stuff! Like me! :D
Thanks
-
Nun würde ich gerne in der Benachrichtigung auch noch angezeigt haben, wie der letzte Kommentator bewertet hat. Ungefähr so:
Kommentartext hier
Bewertung: X Punkte
Das funzt aber so nicht, denn Bewertung und Kommentar lassen sich ja nicht zusammen absenden, sondern geht ohne einen zusätzlich Hack nur einzeln...
-
Hi,
THX very nice MOD!! :mrgreen:
Is there any possibility to send the email and a pm via postnuke?
Would be great...
Greetz and THX,
JiMbO
-
I've modified this nice MOD a bit... first of all, to get rid of those "Resource id #21", and second - to check, if user wants to recieve mails from admin. For this I've also added one field to User Profile, to let user choose himself, if he wans emails or not.
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowemails = ($row['user_allowemails']);
if ($user_allowemails == 1) {
$current_time = time();
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject("Comment Posted");
$site_email->register_vars(array(
"recipient_name" => $recipient_name,
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
//-------------------------------------------------------
Btw, the reason for "Resource id #" was using $image_name variable in sql query. I even removed these queries at all, because all necessary data alreary here, from the query at the very begining of page.
Add this table row to member_editprofile.html
<tr>
<td class="row2"><b>{lang_allow_emails}</b></td>
<td class="row2">
<input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
{lang_yes}
<input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
{lang_no}</td>
</tr>
Hello,
i have put in this Code. But now i have user_allowemails Code in my file to become Mails from Admin yes or no.
Now i have change the Code. I have change all user_allowemails to user_allowmailcomments and i have made a table in .users called user_allowmailcomments .
My new code is this one
Details.php
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
$sql = "SELECT user_allowmailcomments FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowmailcomments = ($row['user_allowmailcomments']);
if ($user_allowmailcomments == 1) {
$current_time = time();
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject("Kommentar geschrieben - Coment Posted");
$site_email->register_vars(array(
"recipient_name" => $recipient_name,
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
//-------------------------------------------------------
and in member_editprofile.htm this
<tr>
<td class="row2"><b>{lang_user_allowmailcomments}</b></td>
<td class="row2">
<input type="radio" name="user_allowmailcomments" value="1"{user_allowmailcomments_yes} />
{lang_yes}
<input type="radio" name="user_allowmailcomments" value="0"{user_allowmailcomments_no} />
{lang_no}</td>
</tr>
But now i see this a i can´t save...
(http://www.terraristik-galerie.de/sonstiges/yesno.gif)
-
uh k......i'm gonna cry...or scream...whichever feels better...lol
i un get it....
i added info to details.php and uploaded the comment_email.html template....but....I STILL dont get emails when i test out comments on my own images....
it's supposed to email me even if I comment on myown photo right?
any ideas as to why i wouldnt get the email *i've tried using a different email address also*
-
ich habe noch ein weiteres problem:
nun werden bei mir jeweils mit einem abgegebenen kommentar zwei gleiche kommentare unter dem bild ausgegeben.
was ist da zu tun?
====== translate in bad english :-( =======
I still have another problem:
now, two same commentaries becomes form spent with me with a submitted commentary under him/it in each case.
what is to be done there?
the part of my details.php:
//-----------------------------------------------------
//--- Save Comment ------------------------------------
//-----------------------------------------------------
$error = 0;
if ($action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
$id = intval($HTTP_POST_VARS[URL_ID]);
$sql = "SELECT cat_id, image_allow_comments
FROM ".IMAGES_TABLE."
WHERE image_id = $id";
$row = $site_db->query_firstrow($sql);
if ($row['image_allow_comments'] == 0 || !check_permission("auth_postcomment", $row['cat_id']) || !$row) {
$msg = $lang['comments_deactivated'];
}
else {
$user_name = un_htmlspecialchars(trim($HTTP_POST_VARS['user_name']));
$comment_headline = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']));
$comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));
// Flood Check
$sql = "SELECT comment_ip, comment_date
FROM ".COMMENTS_TABLE."
WHERE image_id = $id
ORDER BY comment_date DESC
LIMIT 1";
$spam_row = $site_db->query_firstrow($sql);
$spamtime = $spam_row['comment_date'] + 180;
if ($session_info['session_ip'] == $spam_row['comment_ip'] && time() <= $spamtime && $user_info['user_level'] != ADMIN) {
$msg .= (($msg != "") ? "<br />" : "").$lang['spamming'];
$error = 1;
}
$user_name_field = get_user_table_field("", "user_name");
if (!empty($user_name_field)) {
if ($site_db->not_empty("SELECT $user_name_field FROM ".USERS_TABLE." WHERE $user_name_field = '".strtolower($user_name)."' AND ".get_user_table_field("", "user_id")." <> '".$user_info['user_id']."'")) {
$msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
$error = 1;
}
}
if ($user_name == "") {
$msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
$error = 1;
}
if ($comment_headline == "") {
$msg .= (($msg != "") ? "<br />" : "").$lang['headline_required'];
$error = 1;
}
if ($comment_text == "") {
$msg .= (($msg != "") ? "<br />" : "").$lang['comment_required'];
$error = 1;
}
if (!$error) {
$sql = "INSERT INTO ".COMMENTS_TABLE."
(image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
VALUES
($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
$sql = "INSERT INTO ".COMMENTS_TABLE."
(image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
VALUES
($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
// Start Emailer für comments
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_subject("Neuer Kommentar");
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->register_vars(array(
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"image_name" => $image_row['image_name'],
"site_name" => $config['site_name'],
"image_url" => $image_url,
"comment_text" =>$comment_text,
"comment_headline"=>$comment_headline,
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
}
unset($row);
unset($spam_row);
}
-
keiner eine idee?
vielleicht nochmal etwas ausführlicher:
wenn ich den mod so einbaue und dann einen kommentar schreibe, erscheint dieser doppelt unter dem bild.
email, etc klappt alles wunderbar.
no one an idea?
maybe again somewhat more detailed:
if I install the mod so and then write a commentary, this appears doubly under him/it forms.
email, etc turns wonderfully all.
-
did u install this mod?
http://www.4homepages.de/forum/index.php?topic=7294.0
if so, it has a bug in the installation instructions, which causes double comments.
-
no i don't.
i have only install this mail owner mod on the galleryversion 1.7
with the original details.php => i have no problems
with the new details.php (see my code on page 5) => have double comments under a picture and a email
i search in this forum for double comments, but nobody have this problem ???
-
forgot it...
a double line was responsible :lol:
-
great MOD thank you
-
I have changed deatils.php and created comment_email.html then I tested it by posting comments. but nothing works.. e-mails were not recieved.. what to do?
-
is you email system works ok? can you send emails via ACP and via members email page?
-
:oops: strange today it worked (may be because I used fresh brain).. anyway thanx for good MOD
-
Why admins do not receive comments for their images?
-
[EDITED]
It turns out the $site_sess string is not needed from the $image_links since the SESSIONID is clearly not necessary. ;)
-
Why admins do not receive comments for their images?
Only admins? have you tested it with regular member(s) or more then one admin account with VALID email address?
[ Unrelated to the question above ] but did found some things unusual :
No, its not. Why would you need attach sessionid into emails?
-
Ok V@no. I bolded what I modified above. :roll:
-
Ok V@no. I bolded what I modified above. :roll:
I saw the difference, and my responce above is the same as the following:Why would you need attach sessionid into emails?
Your changes do exactly that - ensure that sessionid attached to the url if no cookies used.
The query changes is just....c'mon! what next? tabulation corrections? :roll:
-
your changes do exactly that - ensure that sessionid attached to the url if no cookies used.
The query changes is just....c'mon! what next? tabulation corrections?
Then if you did noticed the difference, it is clairly you did not see the very first post on this topic since I only modified the $image_link in order to be used with $site_sess and simply made a slight modification to the SQL statements. The rest was made by the author himself.
-
I only modified the $image_link in order to be used with $site_sess
THAT IS MY POINT!!!
-
Well, I do not see ANYWHERE ABOVE that you were talking about the $image_link. You only, as usual, questionned my modification without any specifics. :?
-
So, you are a robot! or a bot? You dont understand if one tells you a clue, and not pointing directly to the issue...very narrow minded...
whatever. Just be quiet, please.
-
Why admins do not receive comments for their images?
Only admins? have you tested it with regular member(s) or more then one admin account with VALID email address?
Nevermind V@no I've found the problem.
Now another question to the MOD'S author:
Can I disable notification on comments made by myself?
I mean I don't want to receive my own comments.
-
I'd suggest you using this code instead:
http://www.4homepages.de/forum/index.php?topic=2705.msg14792#msg14792
then replaceif ($user_allowemails == 1) {
with:if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
-
I'd suggest you using this code instead:
http://www.4homepages.de/forum/index.php?topic=2705.msg14792#msg14792
then replaceif ($user_allowemails == 1) {
with:if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
Wow V@no! It works!
Thank you.
-
[EDITED]
All right I've made all corrections specified above & below (till this reply (http://www.4homepages.de/forum/index.php?topic=2705.msg58214#msg58214")) and the final code was (it works :wink: ):
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;
$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowemails = ($row['user_allowemails']);
if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
"comment_text" =>(stripslashes($comment_text)),
"comment_headline"=>(stripslashes($comment_headline)),
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
}
}
unset($row);
unset($spam_row);
}
Don't forget to add:
$lang['send_comment_emailsubject'] = "COMMENT_NOTIFICATION_SUBJECT_HERE";
to /lang/language/main.php
PS.It will also disable sending you your own comments.
Perhaps I'd be useful for someone ...
-
@fgallery:
Looks good. However, these two lines :
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";
could also simply be stated like this :
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;
$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;
;)
-
@fgallery:
Looks good. However, these two lines :
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";
could also simply be stated like this :
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;
$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;
;)
Does it make any difference?
Sorry, I'm not a coder :)
-
@fgallery:
Well, if you compare both of these quotes, you can see there are more " with your strings.
Example :
URL_IMAGE_ID."=".$id."";
when it could simply be :
URL_IMAGE_ID."=".$id;
since there are no beginning with == > " < == after the "= (equality) ". ;)
As for :
".get_user_table_field("", "user_name")."
Yes, there is since the user_name field is not an additional user field but a core field from the USERS_TABLE. ;)
-
I've upadated my full code, thanks!
PS.I thought your corrections would also fix this problem:
If I write for e.g. testin' in Hedline and/or Comment I'll receive it as testin\'
-
If I write for e.g. testin' in Hedline and/or Comment I'll receive it as testin\'
In your codings, make sure that the related query $HTTP_POST_VARS contains the stripslashes module with it. ;)
If you're not sure where exacly this line might be in the code (and if the code itself is NOT too big) please post it here as I will take a look at it. ;)
-
Update :
I found it. You're probably talking about this line :
"comment_headline"=>$comment_headline,
change it to :
"comment_headline"=>(stripslashes($comment_headline)),
;)
-
Update :
I found it. You're probably talking about this line :
"comment_headline"=>$comment_headline,
change it to :
"comment_headline"=>(stripslashes($comment_headline)),
;)
I guess I should do the same with 'comment_text'.
-
I guess I should do the same with 'comment_text'.
Precisely. 8)
-
[EDITED]
All right I've made all corrections specified above & below (till this reply (http://www.4homepages.de/forum/index.php?topic=2705.msg58214#msg58214")) and the final code was (it works :wink: ):
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;
$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowemails = ($row['user_allowemails']);
if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
"comment_text" =>(stripslashes($comment_text)),
"comment_headline"=>(stripslashes($comment_headline)),
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
}
}
unset($row);
unset($spam_row);
}
Don't forget to add:
$lang['send_comment_emailsubject'] = "COMMENT_NOTIFICATION_SUBJECT_HERE";
to /lang/language/main.php
PS.It will also disable sending you your own comments.
Perhaps I'd be useful for someone ...
What do this??? Mail at new comments on/off???
-
No, it ensures that you wont receive email when you post a comment to your own images and that only people who choosed to receive email from administrators will get notifyed. (if they choosed not to receive emails from admin, they wont receive emails about new comments either)
P.S. thinking again, yes, its kind of on/off switch ;)
-
OK :)
and now for a dummy...
When i insert this in my details.php
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
then i turn on/off mail by new comments for my own pics with the Receive emails from administrators Function and when i comment my own pic i don´t become a mail????
What is with other comments from other users. When i write a comment to a pic from an other user i become a mail when another one write a comment, too???
and why this
$lang['send_comment_emailsubject'] = "COMMENT_NOTIFICATION_SUBJECT_HERE";
i have insert this in my main.php but see nothing ???
Sorry for this stupid questions but i don´t understand this big topic...
*EDIT*
When i write a comment i become this error message
DB Error: Bad SQL Query: SELECT user_allowemails FROM bildergalerie_users WHERE user_name = JensF
Unknown column 'JensF' in 'where clause'
-
@JensF
1)Open details.php and find:
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
Add after:
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;
$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowemails = ($row['user_allowemails']);
if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
"comment_text" =>(stripslashes($comment_text)),
"comment_headline"=>(stripslashes($comment_headline)),
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
Be sure to add this before:
}
}
unset($row);
unset($spam_row);
}
//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
2)Create file called comment_email.html, put this code into the file:
Dear {recipient_name},
{user_name} posted a comment on {image_name} at {site_name}.
To view the comment go to: {image_url}
------
Best regards, {site_name}
Upload comment_email.html to /lang/language/email/.
3)Open /lang/language/main.php and find:
$lang['post_comment'] = "post comment";
Add after:
$lang['send_comment_emailsubject'] = "COMMENT_NOTIFICATION_SUBJECT_HERE";
Replace COMMENT_NOTIFICATION_SUBJECT_HERE to whatever you want to appear in mail subject.
4)Open /templates/template/member_editprofile.html & add this code to the right place.
<tr>
<td class="row2"><b>{lang_allow_emails}</b></td>
<td class="row2">
<input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
{lang_yes}
<input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
{lang_no}</td>
</tr>
This switch will allow users to enable or disable comments notification.
I can translate this instruction into deutsch but I hope it's clear enough ;)
@Vraxor
Perhaps you could update install instructions and delete all confusing comments ;)
-
@fgallery:
That's right. Good to know you got it covered. ;)
-
Thanks fgallery but i become this error when i write a comment
DB Error: Bad SQL Query: SELECT user_allowemails FROM bildergalerie_users WHERE user_name = JensF
Unknown column 'JensF' in 'where clause'
-
@JensF:
I might be wrong but it seems to me you're using mySQL 5 right ? ;)
-
@JensF:
I might be wrong but it seems to me you're using mySQL 5 right ? ;)
Yes, i´m using 4.1.15-Debian_0.dotdeb.0-log. Is there a problem with it???
*EDIT*
you have edit your post :D
-
Yes, i´m using 4.1.15-Debian_0.dotdeb.0-log. Is there a problem with it???
According to me - no. If you did installed the patches from the troubleshooting section of the forum and did applied the steps correctly, there shouldn't be anymore problems left. ;)
*EDIT*
you have edit your post Very Happy
Doh ! too slow. :oops:
-
Update:
I just noticed I might of made a slight mistake.
To be sure,
replace this line :
$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;
with this one :
$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = '".$recipient_name."'";
Then, test your action again to see if the SQL error message is gone. ;)
-
Sorry, when i do this changes i become ablank page when i click on an image...
If you did installed the patches from the troubleshooting section of the forum and did applied the steps correctly, there shouldn't be anymore problems left
Which one you mean. I have take a look and i thing i have installed all the important fixes...
-
Sorry, when i do this changes i become ablank page when i click on an image...
Fixed from the post above. Try it now. ;)
-
Hi,
thanks for this. Now it works. No error message, User becomes Mail (or not ;) ).... Great!!!
But i have hope that all User become a Mail to the image they have write a comment....but its now for the owner... IT´S OK !!!!
But a little Problem i have found..I don´t now is it a problem with this Mod...
Now when i send a Newsletter (same function allowemail) every user become get 2 newsletters (2 mails)....bevor this mod the users become get one of them....
-
@JensF
become = werden (nicht bekommen)
get = erhalten
ich frag mich schon warum deine User mit diesem MOD jetzt alle Newsletter werden ... :mrgreen:
nichts für ungut ... ist nur ein spaßiger Tipp !
(P.S. die neue Forenübersicht für die index.php folgt noch ! )
-
@JensF
become = werden (nicht bekommen)
get = erhalten
ich frag mich schon warum deine User mit diesem MOD jetzt alle Newsletter werden ... :mrgreen:
nichts für ungut ... ist nur ein spaßiger Tipp !
(P.S. die neue Forenübersicht für die index.php folgt noch ! )
Naja, wie man in meiner Signatur ja sehen kann
-> Sorry for my bad English <-
bin ich nicht so gut im englischen aber bisher bin ich immer damit durchgekommen 8)
Das mit der Forenübersicht wäre klasse...Danke schonmal.
P.S. Hab meinen Beitrag geändert :roll:
-
Hi,
thanks for this. Now it works. No error message, User becomes Mail (or not Wink ).... Great!!!
Outstanding. My sincere apologize for this error.
Now when i send a Newsletter (same function allowemail) every user become get 2 newsletters (2 mails)....bevor this mod the users become get one of them....
I can't say on this one, I do not have the newsletter MOD installed ... was it ever completed after all ? After I checked from a specific topic, the MOD wasn't completed ...
@JensF
become = werden (nicht bekommen)
get = erhalten
ich frag mich schon warum deine User mit diesem MOD jetzt alle Newsletter werden ... Mr. Green
nichts für ungut ... ist nur ein spaßiger Tipp !
(P.S. die neue Forenübersicht für die index.php folgt noch ! )
Weeeeee ! finally someone who takes care to make grammar corrections on this forum. :lol:
-
I can't say on this one, I do not have the newsletter MOD installed ... was it ever completed after all ? After I checked from a specific topic, the MOD wasn't completed ...
I mean the normal send eMail function from the galery...
-
And when you do not send any e-mails from the newsletter, but elsewhere on 4images, does it send twice or they all send twice ?
-
Hi!
Plz help me.
This is my problem:
When the gallery send the mail owner, this image link appear.
http://myhost.com:81/details.php?image_id=3838
How can I may be take the 81 port?
I'd like this link to image link the mail:
http://myhost.com/details.php?image_id=3838
-
Ok, Jensf, I am going to need a little assistance here. I tried to modify my code so that the user could choose whether or not he would accept email when a new comment is made, instead of just choosing whether or not to accept email from admin. It seems to be working ok, but with my lack of knowledge in PHP, I cannot seem to get the option to display right in the member_editprofile.html file. When I load up the members control panel page, I can see the radio buttons, but I cannot see the text that states what the buttons are for. Also, even though I select the yes button, when I click on save, and the page reloads, it states at the top that my profile was updated, but the radio buttons are now both blank. I did add the table to mysql for called user_allowmailcomments. It was set to tinyint with a value/length of 1. I am completely beside myself trying to understand why the text doesn't show up.
Here is my code:
member_editprofile.html:
<tr>
<td class="head1"><b>{lang_allowmailcomments}</b></td>
<td class="head1">
<input type="radio" name="user_allowmailcomments" value="1"{user_allowmailcomments_yes} />
{lang_yes}
<input type="radio" name="user_allowmailcomments" value="0"{user_allowmailcomments_no} />
{lang_no}</td>
</tr>
lang/english/main.php:
$lang['allowmailcomments'] = "Email me:";
and details.php:
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;
$sql = "SELECT user_allowmailcomments FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = '".$recipient_name."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowmailcomments = ($row['user_allowmailcomments']);
if ($image_row['user_id'] != $user_info['user_id'] && $user_allowmailcomments == 1) {
$current_time = time();
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
"comment_text" =>(stripslashes($comment_text)),
"comment_headline"=>(stripslashes($comment_headline)),
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
//----------------------------------------------------
I don't have a lot of knowledge with php, but from what I can tell, nothing seems out of line compared with the "allow_emailcomments" section just above this one. I have tried renaming the variables every which way, and can't get the text to show up, nor the radio buttons to show the selected option. Please help!
Thanks, and thanks everyone for the great mod!
-
Vano,
I saw on your site that you have an option for users when they upload their images to check a box so they can receive comments on their images. Can you share how you did this, and is there an option for the image owner to change this later on for a particular image, i.e. can they turn on notification for one image, and turn it off for another image at the same time?
Thanks
-
Plz help me!!!
-
Somebody...help me...
This is my question
Posted on: March 30, 2006, 08:00:32 PM
-
link to your gallery?
did you defined your script url in constants.php?
define('SCRIPT_URL', 'http://www.yourdomain.com/4images');
is port 81 correct if browsing through the gallery?
-
OH!
Very Good!!!
THX 8)
-
Hallo
cooler MOD. Ich bekomme nur immer diese Fehlermeldung. Woran kann das liegen.
DB Error: Bad SQL Query: SELECT user_allowmailcomments FROM maritim_users WHERE user_name = 'Steffen'
Unknown column 'user_allowmailcomments' in 'field list'
Hat jemand eine Idee?
Gruß Steffen
-
** sorry my bad english **
Hi, how can I use this MOD to my private gallery, Im the only registered user so only me will received the email. But I want to know how can I received this notifications with the name of my guest that he fiils on the "post commentary" form of every photo, and if its posible can he choose if they want to received notifications of new comments.
Can some body help me?
Thanks!
-
help please :roll:
-
Please read my little idea http://www.4homepages.de/forum/index.php?topic=15216.0
-
Mod works in 1.7.4
-
I don't have a lot of knowledge with php, but from what I can tell, nothing seems out of line compared with the "allow_emailcomments" section just above this one. I have tried renaming the variables every which way, and can't get the text to show up, nor the radio buttons to show the selected option. Please help!
Thanks, and thanks everyone for the great mod!
In db_field_definitions.php
on the end just before ?> add
$additional_user_fields['user_allowmailcomments'] = array($lang['user_allowmailcomments'], "radio", 0);
in the member.php
find //--- Show Profile
and several lines later $site_template->register_vars(array(
on the end of list add
"lang_allowmailcomments" => $lang['allowmailcomments']
Now find //--- Edit Profile
in this section find (it could be little different than mine) and add this red marked fragment
$sql = "UPDATE ".USERS_TABLE."
SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', user_sex = '$user_gender' ,user_allowmailcomments = '$user_allowmailcomments' , ".get_user_table_field("", "user_icq")." = '$user_icq'".$additional_sql."
WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id'];
$site_db->query($sql);
find $user_allowemails = $user_info['user_allowemails'];
add $user_allowmailcomments = $user_info['user_allowmailcomments'];
find
}
if ($user_allowemails == 1) {
$user_allowemails_yes = " checked=\"checked\"";
$user_allowemails_no = "";
}
else {
$user_allowemails_yes = "";
$user_allowemails_no = " checked=\"checked\"";
}
add if ($user_allowemails == 1) {
$user_allowmailcomments_yes = " checked=\"checked\"";
$user_allowmailcomments_no = "";
}
else {
$user_allowmailcomments_yes = "";
$user_allowmailcomments_no = " checked=\"checked\"";
}
now it should works
---------------------------------
and little correction for SEO - short link system (works with seom mod instaled wersion where links looks like http://sitename.com/img329)
Find $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;
change it to
//SEO $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;
$image_url = $script_url."/img".$id;
---------------
Where can I setup a subject of email?
-
ok, chose:
1. only image owners can chose receive or not emails on new posted comments
2. any registered members can "subscribe" for any images they want, to receive emails on new posted comments.
the first variant is already exist (no offical mods though), u can see it at my site ;)
the second variant is not exist (I'm not aware of), but I was thinking to make it sometimes today.
V@no or Anybody,
was the > 2. any registered members can "subscribe" for any images they want, to receive emails on new posted comments
figured out?
anyone have or can make this mod?
Thanks
-
Ich hab das jetzt gemacht wie auf Seite 1 beschrieben.
Aber ich bekomm das nicht hin das die User die Funktion im Member Bereich deaktivieren können.
Könnte mir das vieleicht nochmal jemand kurz posten ?
Wäre mir echt geholfen Danke
-
Hi ! I don't understand why but my users and i don't receive any notification. I have PM installed and I receive notifications from the site about new pm but not about a new comment. My gallery don't have any error, i use 1.7.3 version. The url: http://www.myart.es could someone help me please?
-
The same problem.. Istalled this MOD, everything seemed to be ok, but notification emails do not come to the post-authors :(
-
Mod dont work with 1.7.4.
Site details.php dont loading, blank white page is shown.
Any solutions ?
-
Any solutions ?
Set error_reporting from global.php (E_ALL). Is say if blank page on MOD ?
-
Sorry, dont unterstand. Can you explain ? What i have to change in the global.php ?
-
In global.php file,
change:
error_reporting(E_ERROR | E_WARNING | E_PARSE);
for:
//error_reporting(E_ERROR | E_WARNING | E_PARSE);
error_reporting(E_ALL);
2 - Try MOD to see blank page.
-
2 - Try MOD to see blank page.
Dont know what you mean with this ? I dont wanna see a blank page, i would like to work this mod.
Sorry for my bad english, im german...
-
I dont wanna see a blank page, i would like to work this mod.
Ok so try instruction.
-
will this work with 1.7.4?
-
Yes.
-
Sry, intruction doesn´t work. I´ve a blank page again, when i go on details.
I´ve changed
error_reporting(E_ERROR | E_WARNING | E_PARSE);
to
//error_reporting(E_ERROR | E_WARNING | E_PARSE);
error_reporting(E_ALL);
in global.php, without an effect.
-
Is say host web error log from cPanel ?
-
Is say host web error log from cPanel ?
Don´t know what you mean with this ! !
-
Examp:
http://www.cyclone-hosting.net/images/cpanel.png
Analysis and log files - > error log.
-
Ich habe das MOD installiert und es funktioniert wunderbar!
Aber ich habe ein kleines Problem!
Ich habe für die verschiedenen User verschiedene Sprachen zur Auswahl.
Wenn ich jetzt auf z.B. Französisch stelle und dann einen Kommentar poste, bekomme ich eine mail mit französischem (natürlich von mir in den {lang, french, email, comment_email} vorgegebenen) Text.
Hab ich was überlesen oder gibt es hier noch keine Lösung?
Super wäre, wenn der Bildeigentümer diese mail in der von ihm eingestellten Sprache erhalten würde und nicht in der Sprache des Absenders!
I´ve installed this MOD and it works perfect!
But there is a little problem!
I have different languages, which could be joined by users.
When I set now to French and post a comment, I will get an email with French text (this one I´ve written within {lang, french, email, comment_email}, not the text posted.
Do I have overread something or is there no resolution at the time?
It would be good, if the image owner would get the email in his language and not in the language of the comment poster!
Thx
-
....... und hier sind die Texte in verschiedenen Sprachen (falls sie jemand braucht). Nur "Friends of Vipersgarden" gegen Euren Galerie Namen austauschen.:
...... and here are the texts (if somebody will need them). Just change "Friends of Vipersgarden" to your gallery name:
in Italian:
Caro {recipient_name},
{user_name} ha inviato un commento alla tua immagine: "{image_name}", nella galleria dell'utente "Friends of VipersGarden".
{comment_headline}:
{comment_text}
Per leggere il commento clicca qui: {image_url}
------
Saluti, {site_name}
in French:
Bonjour {recipient_name},
{user_name} a ajouté(e) un commentaire sur votre image: "{image_name}", dans la galérie d'images {Friends of VipersGarden}.
{comment_headline}:
{comment_text}
Pour lire le commentaire suivez ce lien: {image_url}
------
Cordialement, {site_name}
in Deutsch:
Lieber {recipient_name},
{user_name} hat ein Kommentar zu Deinem Bild: "{image_name}" bei Friends of VipersGarden Benutzer-Bildergalerie abgegeben.
{comment_headline}:
{comment_text}
Hier kannst Du es lesen: {image_url}
------
Mit freundlichen Grüßen, {site_name}
and in English:
Dear {recipient_name},
{user_name} posted a comment on your image: "{image_name}", at Friends of VipersGarden - User gallery.
{comment_headline}:
{comment_text}
To view the comment go to: {image_url}
------
Best regards, {site_name}
mit freundlichen Grüßen
Kind regardes
Mario
-
Ich glaube, dass ein derartiges MOD für alle, die ihre Galerie multilingual betreiben von grossem Nutzen wäre !!
Ich habe jetzt in der Datenbank unter "4images_users" ein Feld "user_language" eingerichtet.
Und in den template.html (member_editprofile.html, member_profile.html und register_form) die entsprechenden Felder ergänzt.
Funktioniert alles wunderbar!
I´m sure, a MOD like this would be very usefull for all, having their gallery multilingual.
I´ve made within the database a new field "user_language" and also made fields in the template.html files (member_editprofile.html, member_profile.html and register_form).
Works fine!
(http://vipersgarden.at/4images/test/language.jpg)
Jetzt müßte nur noch bei Versendung einer e-mail die Sprache des Empfängers (z.B. bei posting eines Kommentars, mails vom Admin, usw.) aus der Datenbank ausgelesen werden und die mail in der entsprechenden Sprache versandt werden.
Es ist ja ziemlich uninteressant, wenn z.B. ein Benutzer mit französischer Spracheinstellung ein Kommentar zu einem Bild postet und der kroatische Bildeigentümer dann die mail (nur den Text in der lang/email) in französisch erhält!
Aber wie geht das ????????
Now the script should look in the database for the language of the recipient and the mail should be sent in this language.
It´s not very good, when, for example, user choosen french is posting a comment to an image and the croatian imageowner gets this mail (only the text from lang/email) in french!
Sounds pretty simple! But how it works ?????
Thanks
Mario
-
Now the script should look in the database for the language of the recipient and the mail should be sent in this language.
It´s not very good, when, for example, user choosen french is posting a comment to an image and the croatian imageowner gets this mail (only the text from lang/email) in french!
Sounds pretty simple! But how it works ?????
Can try this:
http://www.4homepages.de/forum/index.php?topic=6749.0
can use [english][french] - all install lang in folder lang with tag foreach text (and email text) you like. ;)
-
Hallo Leute,
irgendwie habe ich hier keinen Durchblick mehr.
Da ich kein englisch kann, würde ich mich riesig freuen wenn mir jemand den Vollständigen Script mal zumailen könnte.
Gruß
Peter
-
hi, dem schließe ich mich an:
es muss ja nur einmal zusammenhängend sein, und vor allem für V 1.7.6 kompertiebel
denn dort gibts kein: $site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
nur:
$site_db->query($sql);
}
//-----------------------------------------------------
//---Clickstream---------------------------------------
//-----------------------------------------------------
fügt man es dazwischen ein, bleibt die details.php beim Aufruf leer
...und wie der letzte Poster geschrieben hat, überschlagen sich in diesem Thread die Ereignisse
schöner wäre, eine normale Anleitung, angepasst an Version 1.7.6
dann würde der MOD auch funktionieren (für mein Mini-Anspruch)
-
Würde dies auch begrüßen.
Blicke bei dem langen Thread auch nicht mehr durch, wie der genue Mod aktuell am besten für die neue Version 1.7.6 auszusehen hat :?
-
Hallo,
leider funktionierte meine Galerie (v.1.7.) nach dem Umzug auf einen neuen Server nicht mehr richtig. Ich habe dann den Fehler gefunden ...es lag an der neuen PHP version ..in dem Fall PHP Version 5.1.6
Ich habe nun alle Probleme damit http://www.4homepages.de/forum/index.php?topic=10184.15 beheben können allerdings bleibt diese Mod, die leider nicht funktioniert. Es werden keine Mails mehr versendet. Kann mir vielleicht jemand helfen? Der Code ist noch original wie auf Seite 1 dieses Threads.
-
Also ich habe
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
in 1.7.6
Habe es gerade mit dem Code von Seite1 in 1.7.6 geprüft; Geht alles wunderbar...
-
Hallo,
ich verwende dieses hier: http://www.4homepages.de/forum/index.php?topic=2705.msg58205#msg58205
Doch leider kommt keine Mail an!?
Das Kommentar erscheint auf der Seite aber oben steht ein Fehler:
An unexpected error occured. Please try again later.
details.php
<?php
$action = $HTTP_GET_VARS['action'];
if ($action == 'calendarprint') {
$main_template = 'calendar';
}
else {
$main_template = 'details';
}
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');
if (!$image_id) {
redirect($url);
}
$additional_sql = "";
if (!empty($additional_user_fields)) {
foreach ($additional_user_fields as $key => $val) {
$additional_sql .= ", u.".$key;
}
}
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
$image_row = $site_db->query_firstrow($sql);
$cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;
$is_image_owner = ($image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 1 : 0;
if (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id) || !$image_row) {
redirect($url);
}
$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$site_template->register_vars("random_cat_image", $random_cat_image);
unset($random_cat_image);
//################################ Start MOD Ajax Slideshow/Diashow ##############################
$max_length_image_name = 65;
$max_length_image_description = 55;
$ajax_slideshow_view = 0;
$ajax_slideshow = "<script type=\"text/javascript\" src=\"templates/".$config['template_dir']."/js/diashow.js\"></script>\n";
$ajax_slideshow .= "<script type=\"text/javascript\">\n<!-- \n";
$ajax_slideshow .= "var viewer = new PhotoViewer();\n";
$ajax_slideshow .= "viewer.setSlideDuration(".$config['ajax_slideshowviewer_setSlideDuration'].");\n";
$ajax_slideshow .= "viewer.disablePanning();\n";
$ajax_slideshow .= "viewer.disableAutoPlay();\n";
$ajax_slideshow .= "viewer.".$config['ajax_slideshowviewer_Fading']."Fading();\n";
$ajax_slideshow .= "viewer.setBackgroundColor('".$config['ajax_slideshowviewer_setBackgroundColor']."');\n";
$ajax_slideshow .= "viewer.setBorderWidth(".$config['ajax_slideshowviewer_setBorderWidth'].");\n";
$ajax_slideshow .= "viewer.setFontSize(".$config['ajax_slideshowviewer_setFontSize'].");\n";
$ajax_slideshow .= "viewer.".$config['ajax_slideshowviewer_Shade']."Shade();\n";
$ajax_slideshow .= "viewer.setShadeColor('".$config['ajax_slideshowviewer_setShadeColor']."');\n";
$ajax_slideshow .= "viewer.setShadeOpacity('".$config['ajax_slideshowviewer_setShadeOpacity']."');\n";
$ajax_slideshow .= "viewer.".$config['ajax_slideshowviewer_Loop']."Loop();\n";
$ajax_slideshow .= "viewer.setOnClickEvent(viewer.close);\n";
$ajax_slideshow .= "viewer.disableToolbar();\n";
$count = 0;
$bgcounter = 0;
$ext = get_file_extension($image_row['image_media_file']);
$config['ajax_slideshowviewer_Types_array'] = explode(",", $config['ajax_slideshowviewer_Types']);
if (in_array($ext, $config['ajax_slideshowviewer_Types_array'])) {
$ajax_slideshow_view = 1;
show_image($image_row);
$image_name_short = (isset($image_row['image_name']) && strlen($image_row['image_name']) > $max_length_image_name) ? substr(format_text(stripslashes($image_row['image_name']), 2), 0, $max_length_image_name)."..." : format_text(stripslashes($image_row['image_name']), 2);
$image_name_short = str_replace("\r","",$image_name_short);
$image_name_short = str_replace("\n","",$image_name_short);
$image_name_short = str_replace("<br>","",$image_name_short);
$image_name_short = str_replace("<br />","",$image_name_short);
$image_name_short = str_replace("'","",$image_name_short);
$image_name_short = str_replace("<","<",$image_name_short);
$image_name_short = str_replace(">",">",$image_name_short);
$image_name_short = stripslashes($image_name_short);
$image_name_short = "".$lang['image_name']." $image_name_short";
if ($config['ajax_slideshowviewer_description'] == "enable") {
$image_description_short = (isset($image_row['image_description']) && strlen($image_row['image_description']) > $max_length_image_description) ? substr(format_text(stripslashes($image_row['image_description']), 1, 0, 1), 0, $max_length_image_description)."..." : format_text(stripslashes($image_row['image_description']), 1, 0, 1);
$image_description_short = str_replace("\r","",$image_description_short);
$image_description_short = str_replace("\n","",$image_description_short);
$image_description_short = str_replace("<br>","",$image_description_short);
$image_description_short = str_replace("<br />","",$image_description_short);
$image_description_short = str_replace("'","",$image_description_short);
$image_description_short = str_replace("<","<",$image_description_short);
$image_description_short = str_replace(">",">",$image_description_short);
$image_description_short = stripslashes($image_description_short);
if ($image_description_short == "") {
$image_description_short = " ";
} else {
$image_description_short = "<br>".$lang['description']." $image_description_short";
}
}
else {
$image_description_short = " ";
}
$ajax_slideshow .= "viewer.add('".MEDIA_DIR."/".$image_row['cat_id']."/".$image_row['image_media_file']."', '".$image_description_short."', '".$image_name_short."');\n";
}
if ($count > 0) {
$leftover = ($config['image_cells'] - $count);
}
$ajax_slideshow .= "//-->\n</script>\n";
if ($user_info['user_level'] == GUEST && $config['ajax_slideshowviewer_Show'] == "1" && $ajax_slideshow_view == "1") {
$ajax_slideshow_button = "<img src=\"".get_gallery_image("diashow_off.gif")."\" border=\"0\" alt=\"\" />";
$site_template->register_vars(array(
"ajax_slideshow_button" => $ajax_slideshow_button
));
}
elseif ($user_info['user_level'] != GUEST && $config['ajax_slideshowviewer_Show'] == "1" && $ajax_slideshow_view == "1" || $config['ajax_slideshowviewer_Show'] == "2" && $ajax_slideshow_view == "1") {
$ajax_slideshow_button = "<a href=\"javascript:void(viewer.show(0))\"><img src=\"".get_gallery_image("diashow.gif")."\" border=\"0\" alt=\"\" /></a>";
$site_template->register_vars(array(
"ajax_slideshow" => $ajax_slideshow,
"ajax_slideshow_button" => $ajax_slideshow_button
));
}
else {
$site_template->register_vars(array(
"ajax_slideshow" => "",
"ajax_slideshow_button" => "",
));
}
unset($ajax_slideshow);
//################################ End MOD Ajax Slideshow/Diashow ##############################
//-----------------------------------------------------
//--- Show Image --------------------------------------
//-----------------------------------------------------
$image_allow_comments = (check_permission("auth_readcomment", $cat_id)) ? $image_row['image_allow_comments'] : 0;
$image_name = format_text($image_row['image_name'], 2);
//-----------------------------------------------------
//--- Image Terms -------------------------------------
//-----------------------------------------------------
if ($action == "terms") {
terms_add($cat_id, (($image_row['terms']) ? $image_id : ""));
}
$terms = 0;
if (!terms_check($cat_id, (($image_row['terms']) ? $image_row : "")) && $action != "terms")
{
if ($image_row['terms'])
{
$terms_agreement = ($lang['terms_agreement'][$image_row['terms_msg']]) ? $lang['terms_agreement'][$image_row['terms_msg']] : $lang['terms_agreement'][0];
}
else
{
$terms_agreement = ($lang['terms_agreement'][$cat_cache[$cat_id]['terms_msg']]) ? $lang['terms_agreement'][$cat_cache[$cat_id]['terms_msg']] : $lang['terms_agreement'][0];
}
$site_template->register_vars(array(
"url_home" => $site_sess->url(ROOT_PATH."index.php"),
"lang_terms" => $lang['terms'],
"mode" => $mode,
"lang_terms_agreement" => $terms_agreement,
"lang_agree" => $lang['agree'],
"lang_agree_not" => $lang['agree_not']
));
$terms = $site_template->parse_template("terms");
}
$site_template->register_vars(array(
"show_terms" => $terms,
"no_terms" => ($terms) ? 0 : 1
));
//--- End Image Terms -------------------------------------
/*
MOD MULTI-LIGHTBOXES
START REPLACE
*/
$lightbox_id = (isset($HTTP_POST_VARS['lightbox_id']) && $HTTP_POST_VARS['lightbox_id']) ? $HTTP_POST_VARS['lightbox_id'] : ((isset($HTTP_GET_VARS['lightbox_id']) && $HTTP_GET_VARS['lightbox_id']) ? $HTTP_GET_VARS['lightbox_id'] : 0);
show_image($image_row, $mode.(($lightbox_id) ? "&lightbox_id=".$lightbox_id : ""), 0, 1);
/*
MOD MULTI-LIGHTBOXES
END REPLACE
*/
//--- Start mod: pin images -----------------------------
$image_pin_allow = $image_row['image_pin_allow'];
$ext = get_file_extension($image_row['image_media_file']);
$allow_filetypes = array('jpg','jpeg','JPG','JPEG','gif','bmp','png');
if (in_array($ext, $allow_filetypes) && $image_pin_allow == '1') {
$image_pin_allow = '1'; } else {
$image_pin_allow = '0';
}
//--- End mod: pin images -------------------------------
$in_mode = 0;
$sql = "";
if ($mode == "lightbox") {
/*
MOD MULTI-LIGHTBOXES
START REPLACE
*/
$ids = $user_info['lightbox_image_ids'];
if ($lightbox_id)
{
$sql = "SELECT l.lightbox_id, l.lightbox_name, l.lightbox_private, l.lightbox_image_ids, l.user_id, u.user_name, u.user_lightbox_private
FROM ".LIGHTBOXES_TABLE." l
LEFT JOIN ".USERS_TABLE." u ON u.user_id = l.user_id
WHERE l.lightbox_id = '".$lightbox_id."'";
if ($row = $site_db->query_firstrow($sql))
{
$ids = (!$row['lightbox_private'] && $row['user_lightbox_private'] && $config['lightbox_share'] || $user_info['user_level'] == ADMIN ) ? $row['lightbox_image_ids'] : "";//$user_info['lightbox_image_ids'];
$lightbox_name = $row['lightbox_name']." (".$row['user_name'].")";
}
else
{
$lightbox_name = "";
}
}
else
{
$lightbox_name = $user_info['lightboxes'][$user_info['user_lightbox']]['name'];
}
$txt_clickstream = $lang['lightbox'].(($lightbox_name) ? " - ".$lightbox_name : "");
if (!empty($ids)) {
$image_id_sql = str_replace(" ", ", ", trim($ids));
/*
MOD MULTI-LIGHTBOXES
END REPLACE
*/
$sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND image_id IN ($image_id_sql) AND (cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
$in_mode = 1;
}
}
elseif ($mode == "search") {
if (!isset($session_info['searchid']) || empty($session_info['searchid'])) {
$session_info['search_id'] = $site_sess->get_session_var("search_id");
}
if (!empty($session_info['search_id'])) {
$search_id = unserialize($session_info['search_id']);
}
$sql_where_query = "";
if (!empty($search_id['image_ids'])) {
$sql_where_query .= "AND image_id IN (".$search_id['image_ids'].") ";
}
if (!empty($search_id['user_ids'])) {
$sql_where_query .= "AND user_id IN (".$search_id['user_ids'].") ";
}
if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
$new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
$sql_where_query .= "AND image_date >= $new_cutoff ";
}
if (!empty($search_id['search_cat']) && $search_id['search_cat'] != 0) {
$cat_id_sql = 0;
if (check_permission("auth_viewcat", $search_id['search_cat'])) {
$sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
$cat_id_sql .= ", ".$search_id['search_cat'];
if (!empty($sub_cat_ids[$search_id['search_cat']])) {
foreach ($sub_cat_ids[$search_id['search_cat']] as $val) {
if (check_permission("auth_viewcat", $val)) {
$cat_id_sql .= ", ".$val;
}
}
}
}
$cat_id_sql = $cat_id_sql !== 0 ? "AND cat_id IN ($cat_id_sql)" : "";
}
else {
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
$cat_id_sql = $cat_id_sql !== 0 ? "AND cat_id NOT IN (".$cat_id_sql.")" : "";
}
if (!empty($sql_where_query)) {
$sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
FROM ".IMAGES_TABLE."
WHERE image_active = 1
$sql_where_query
$cat_id_sql
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
$in_mode = 1;
}
}
if (!$in_mode || empty($sql)) {
$sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND cat_id = $cat_id
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
}
$result = $site_db->query($sql);
$image_id_cache = array();
$next_prev_cache = array();
$break = 0;
$prev_id = 0;
while($row = $site_db->fetch_array($result)) {
$image_id_cache[] = $row['image_id'];
$next_prev_cache[$row['image_id']] = $row;
if ($break) {
break;
}
if ($prev_id == $image_id) {
$break = 1;
}
$prev_id = $row['image_id'];
}
$site_db->free_result();
if (!function_exists("array_search")) {
function array_search($needle, $haystack) {
$match = false;
foreach ($haystack as $key => $value) {
if ($value == $needle) {
$match = $key;
}
}
return $match;
}
}
$act_key = array_search($image_id, $image_id_cache);
$next_image_id = (isset($image_id_cache[$act_key + 1])) ? $image_id_cache[$act_key + 1] : 0;
$prev_image_id = (isset($image_id_cache[$act_key - 1])) ? $image_id_cache[$act_key - 1] : 0;
unset($image_id_cache);
// Get next and previous image
if (!empty($next_prev_cache[$next_image_id])) {
$next_image_name = format_text($next_prev_cache[$next_image_id]['image_name'], 2);
/*
MOD MULTI-LIGHTBOXES
START REPLACE
*/
$next_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id.((!empty($mode)) ? "&mode=".$mode.(($lightbox_id) ? "&lightbox_id=".$lightbox_id : "") : ""));
/*
MOD MULTI-LIGHTBOXES
END REPLACE
*/
if (!get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
$next_image_file = ICON_PATH."/404.gif";
}
else {
$next_image_file = get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
}
if (!get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
$next_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next_image_id]['image_media_file']).".gif";
}
else {
$next_thumb_file = get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
}
}
else {
$next_image_name = REPLACE_EMPTY;
$next_image_url = REPLACE_EMPTY;
$next_image_file = REPLACE_EMPTY;
$next_thumb_file = REPLACE_EMPTY;
}
if (!empty($next_prev_cache[$prev_image_id])) {
$prev_image_name = format_text($next_prev_cache[$prev_image_id]['image_name'], 2);
/*
MOD MULTI-LIGHTBOXES
START REPLACE
*/
$prev_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev_image_id.((!empty($mode)) ? "&mode=".$mode.(($lightbox_id) ? "&lightbox_id=".$lightbox_id : "") : ""));
/*
MOD MULTI-LIGHTBOXES
END REPLACE
*/
if (!get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
$prev_image_file = ICON_PATH."/404.gif";
}
else {
$prev_image_file = get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
}
if (!get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
$prev_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev_image_id]['image_media_file']).".gif";
}
else {
$prev_thumb_file = get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
}
}
else {
$prev_image_name = REPLACE_EMPTY;
$prev_image_url = REPLACE_EMPTY;
$prev_image_file = REPLACE_EMPTY;
$prev_thumb_file = REPLACE_EMPTY;
}
$site_template->register_vars(array(
"next_image_id" => $next_image_id,
"next_image_name" => $next_image_name,
"next_image_url" => $next_image_url,
"next_image_file" => $next_image_file,
"next_thumb_file" => $next_thumb_file,
"prev_image_id" => $prev_image_id,
"prev_image_name" => $prev_image_name,
"prev_image_url" => $prev_image_url,
"prev_image_file" => $prev_image_file,
"prev_thumb_file" => $prev_thumb_file
));
unset($next_prev_cache);
//-----------------------------------------------------
//--- Save Comment ------------------------------------
//-----------------------------------------------------
$error = 0;
if ($action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
$id = intval($HTTP_POST_VARS[URL_ID]);
$sql = "SELECT cat_id, image_allow_comments
FROM ".IMAGES_TABLE."
WHERE image_id = $id";
$row = $site_db->query_firstrow($sql);
if ($row['image_allow_comments'] == 0 || !check_permission("auth_postcomment", $row['cat_id']) || !$row) {
$msg = $lang['comments_deactivated'];
}
else {
$user_name = un_htmlspecialchars(trim($HTTP_POST_VARS['user_name']));
$comment_headline = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']));
$comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));
$captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";
// Flood Check
if ($id != "2"){ //added for latest news mod
$sql = "SELECT comment_ip, comment_date
FROM ".COMMENTS_TABLE."
WHERE image_id = $id
ORDER BY comment_date DESC
LIMIT 1";
$spam_row = $site_db->query_firstrow($sql);
$spamtime = $spam_row['comment_date'] + 180;
if ($session_info['session_ip'] == $spam_row['comment_ip'] && time() <= $spamtime && $user_info['user_level'] != ADMIN) {
$msg .= (($msg != "") ? "" : "").$lang['spamming'];
$error = 1;
}
}
$user_name_field = get_user_table_field("", "user_name");
if (!empty($user_name_field)) {
if ($site_db->not_empty("SELECT $user_name_field FROM ".USERS_TABLE." WHERE $user_name_field = '".strtolower($user_name)."' AND ".get_user_table_field("", "user_id")." <> '".$user_info['user_id']."'")) {
$msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
$error = 1;
}
}
if ($user_name == "") {
$msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
$error = 1;
}
if ($comment_headline == "") {
$msg .= (($msg != "") ? "<br />" : "").$lang['headline_required'];
$error = 1;
}
if ($comment_text == "") {
$msg .= (($msg != "") ? "<br />" : "").$lang['comment_required'];
$error = 1;
}
if ($captcha_enable_comments && !captcha_validate($captcha)) {
$msg .= (($msg != "") ? "<br />" : "").$lang['captcha_required'];
$error = 1;
}
if (!$error) {
$sql = "INSERT INTO ".COMMENTS_TABLE."
(image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
VALUES
($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
$msg = $lang['comment_success'];
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;
$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowemails = ($row['user_allowemails']);
if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
"comment_text" =>(stripslashes($comment_text)),
"comment_headline"=>(stripslashes($comment_headline)),
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
}
}
unset($row);
unset($spam_row);
}
//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
if ($image_allow_comments == 1) {
$site_template->register_vars(array(
"has_rss" => true,
"rss_title" => "RSS Feed: ".$image_name." (".str_replace(':', '', $lang['comments']).")",
"rss_url" => $script_url."/rss.php?action=comments&".URL_IMAGE_ID."=".$image_id
));$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq").", u.userpic
FROM ".COMMENTS_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
WHERE c.image_id = $image_id
ORDER BY c.comment_date ASC";
$result = $site_db->query($sql);
$comment_row = array();
while ($row = $site_db->fetch_array($result)) {
$comment_row[] = $row;
}
$site_db->free_result($result);
$num_comments = sizeof($comment_row);
if (!$num_comments) {
$comments = "<tr><td class=\"commentrow1\" colspan=\"2\">".$lang['no_comments']."</td></tr>";
}
else {
$comments = "";
$bgcounter = 0;
for ($i = 0; $i < $num_comments; $i++) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$comment_user_email = "";
$comment_user_email_save = "";
$comment_user_mailform_link = "";
$comment_user_email_button = "";
$comment_user_homepage_button = "";
$comment_user_ckopf_button = format_text($comment_row[$i][$user_table_fields['user_ckopf']]);
$comment_user_icq_button = "";
$comment_user_profile_button = "";
$comment_user_status_img = REPLACE_EMPTY;
$comment_user_name = format_text($comment_row[$i]['comment_user_name'], 2);
$comment_user_info = $lang['userlevel_guest'];
$comment_user_id = $comment_row[$i]['user_id'];
$user_row_comment = get_user_info($comment_user_id);
if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
$comment_user_name = format_text($comment_row[$i][$user_table_fields['user_name']], 2);
$comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$comment_user_id);
$comment_user_profile_button = "<a href=\"".$comment_user_profile_link."\"><img src=\"".get_gallery_image("profile.gif")."\" border=\"0\" alt=\"".$comment_user_name."\" /></a>";
$comment_user_status_img = ($comment_row[$i][$user_table_fields['user_lastaction']] >= (time() - 300) && ((isset($comment_row[$i][$user_table_fields['user_invisible']]) && $comment_row[$i][$user_table_fields['user_invisible']] == 0) || $user_info['user_level'] == ADMIN)) ? "<img src=\"".get_gallery_image("user_online.gif")."\" border=\"0\" alt=\"Online\" />" : "<img src=\"".get_gallery_image("user_offline.gif")."\" border=\"0\" alt=\"Offline\" />";
$comment_user_homepage = (isset($comment_row[$i][$user_table_fields['user_homepage']])) ? format_url($comment_row[$i][$user_table_fields['user_homepage']]) : "";
if (!empty($comment_user_homepage)) {
$comment_user_homepage_button = "<a href=\"".$comment_user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$comment_user_homepage."\" /></a>";
}
$comment_user_icq = (isset($comment_row[$i][$user_table_fields['user_icq']])) ? format_text($comment_row[$i][$user_table_fields['user_icq']]) : "";
if (!empty($comment_user_icq)) {
$comment_user_icq_button = "<a href=\"http://www.icq.com/people/about_me.php?uin=".$comment_user_icq."\" target=\"_blank\"><img src=\"http://status.icq.com/online.gif?icq=".$comment_user_icq."&img=5\" width=\"18\" height=\"18\" border=\"0\" alt=\"".$comment_user_icq."\" /></a>";
}
if (!empty($comment_row[$i][$user_table_fields['user_email']]) && (!isset($comment_row[$i][$user_table_fields['user_showemail']]) || (isset($comment_row[$i][$user_table_fields['user_showemail']]) && $comment_row[$i][$user_table_fields['user_showemail']] == 1))) {
$comment_user_email = format_text($comment_row[$i][$user_table_fields['user_email']]);
$comment_user_email_save = format_text(str_replace("@", " at ", $comment_row[$i][$user_table_fields['user_email']]));
if (!empty($url_mailform)) {
$comment_user_mailform_link = $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_mailform));
}
else {
$comment_user_mailform_link = $site_sess->url(ROOT_PATH."member.php?action=mailform&".URL_USER_ID."=".$comment_user_id);
}
$comment_user_email_button = "<a href=\"".$comment_user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$comment_user_email_save."\" /></a>";
}
//---[MOD] BUDDY V.1.0.0 beta ------------
//----2007 by eMagix for 4images gallery --
//----------- START CODE -----------------
if (($user_info['user_level'] != GUEST) && ($user_info['user_id'] != $comment_user_id)) {
$buddy_url = $self_url;
$buddy_url .= (!empty($mode)) ? ((strpos($buddy_url, '?') !== false) ? "&" : "?")."mode=".$mode : "";
$buddy_url .= strpos($buddy_url, '?') !== false ? "&" : "?";
// IF USER ALREADY A BUDDY SHOW ALREADY BUDDY TEXT
$buddy_status = check_buddy($comment_user_id);
if ($buddy_status == 1) {
$buddy_button = $lang['user_buddy_yes'];
}
// IF USER REQUEST PENDING SHOW PENDING TEXT
elseif ($buddy_status == 0) {
$buddy_button = $lang['user_buddy_pending'];
}
// IF NOT YET BUDDY SHOW BUTTON
elseif ($buddy_status == -1) {
$buddy_url .= "action=addbuddy&id=".$comment_user_id."";
$buddy_button = "<a href=\"".$site_sess->url($buddy_url)."\"><img src=\"".get_gallery_image("buddy_no.gif")."\" border=\"0\" alt=\"\" /></a>";
}
}
else {
// BUDDY BUTTON DISABLED
$buddy_button = "<img src=\"".get_gallery_image("buddy_off.gif")."\" border=\"0\" alt=\"\" />";
}
//----------- END CODE -----------------
if (!isset($comment_row[$i][$user_table_fields['user_level']]) || (isset($comment_row[$i][$user_table_fields['user_level']]) && $comment_row[$i][$user_table_fields['user_level']] == USER)) {
$comment_user_info = $lang['userlevel_user'];
}
elseif ($comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
$comment_user_info = $lang['userlevel_admin'];
}
$comment_user_info .= "<br />";
$comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
$comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
}
$comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";
///// Nuevo tipo de usuarios /////
/* ******* Antes ********
$admin_links = "";
if ($user_info['user_level'] == ADMIN) {
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a> ";
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif ($is_image_owner) {
$admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a> ";
$admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
}
// ******* Ahora *********
*/
$admin_links = "";
if ($user_info['user_level'] == ADMIN || ($user_info['user_level'] == MODERADOR && $user_info['user_moderador_comentarios'] == 1)) {
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a> ";
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif ($is_image_owner) {
$admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a> ";
$admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
}
///// Fin nuevo tipo de usuario /////
// Mod PM Start
if ($user_info['user_level'] > GUEST && $user_info['user_pm_ban'] == 0) {
$comment_user_pm = "<a href=\"".$site_sess->url(ROOT_PATH."pm.php?action=quote&mode=comment&id=".$comment_row[$i]['comment_id']."&user_id=".$comment_row[$i]['user_id']."&username=".$comment_row[$i]['user_name'])."\" /><img src=\"".get_gallery_image("pm.gif")."\" border=\"0\" alt=\"".$lang['pm_user_pm_alt']."\" /></a>";
} elseif ($user_info['user_level'] == GUEST){
$comment_user_pm = "<img src=\"".get_gallery_image("pm.gif")."\" border=\"0\" alt=\"".$lang['pm_hinweis']."\" />";
}else {
$comment_user_pm = "";
}
// Mod PM END
$site_template->register_vars(array(
"comment_id" => $comment_row[$i]['comment_id'],
"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row_comment['user_avatar'] == "") ? "blank.gif" : $user_row_comment['user_avatar'])."\" name=\"icons\" border=\"0\" hspace=\"15\" alt=\"\">" : "",
// Mod PM Start
"comment_user_pm" => $comment_user_pm,
// Mod PM Start
"comment_user_id" => $comment_user_id,
"comment_user_status_img" => $comment_user_status_img,
"comment_user_name" => $comment_user_name,
"comment_user_info" => $comment_user_info,
"comment_user_profile_button" => $comment_user_profile_button,
"comment_user_email" => $comment_user_email,
"comment_user_email_save" => $comment_user_email_save,
"comment_user_mailform_link" => $comment_user_mailform_link,
"comment_user_ckopf_button" => $comment_user_ckopf_button,
"comment_user_email_button" => $comment_user_email_button,
"comment_user_homepage_button" => $comment_user_homepage_button,
"comment_user_icq_button" => $comment_user_icq_button,
"comment_user_ip" => $comment_user_ip,
"comment_userpic" => ($config['userpic'] && $comment_row[$i]['userpic']) ? ROOT_PATH."data/userpic/".$comment_row[$i]['userpic'] : "",
// Mod PM Start
"comment_headline" => format_text($comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
"comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
// Mod PM End
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']),
"buddy_button" => $buddy_button, // BUDDY MOD BY EMAGIX
"row_bg_number" => $row_bg_number,
"admin_links" => $admin_links
));
$comments .= $site_template->parse_template("comment_bit");
} // end while
} //end else
$site_template->register_vars("comments", $comments);
unset($comments);
//-----------------------------------------------------
//--- BBCode & Form -----------------------------------
//-----------------------------------------------------
$allow_posting = check_permission("auth_postcomment", $cat_id);
$bbcode = "";
if ($config['bb_comments'] == 1 && $allow_posting) {
$site_template->register_vars(array(
"lang_bbcode" => $lang['bbcode'],
"lang_tag_prompt" => $lang['tag_prompt'],
"lang_link_text_prompt" => $lang['link_text_prompt'],
"lang_link_url_prompt" => $lang['link_url_prompt'],
"lang_link_email_prompt" => $lang['link_email_prompt'],
"lang_list_type_prompt" => $lang['list_type_prompt'],
"lang_list_item_prompt" => $lang['list_item_prompt'],
));
$bbcode = $site_template->parse_template("bbcode");
}
if (!$allow_posting) {
$comment_form = "";
}
else {
$user_name = (isset($HTTP_POST_VARS['user_name']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['user_name'])), 2) : (($user_info['user_level'] != GUEST) ? format_text($user_info['user_name'], 2) : "");
$comment_headline = (isset($HTTP_POST_VARS['comment_headline']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_headline'])), 2) : "";
$comment_text = (isset($HTTP_POST_VARS['comment_text']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_text'])), 2) : "";
$site_template->register_vars(array(
"bbcode" => $bbcode,
"user_name" => $user_name,
"comment_headline" => $comment_headline,
"comment_text" => $comment_text,
"lang_post_comment" => $lang['post_comment'],
"lang_name" => $lang['name'],
"lang_headline" => $lang['headline'],
"lang_comment" => $lang['comment'],
"lang_captcha" => $lang['captcha'],
"lang_captcha_desc" => $lang['captcha_desc'],
"captcha_comments" => (bool)$captcha_enable_comments
));
$comment_form = $site_template->parse_template("comment_form");
}
$site_template->register_vars("comment_form", $comment_form);
unset($comment_form);
} // end if allow_comments
// Admin Links
///// Nuevo tipo de usuarios /////
/* ******* Antes ********
// Admin Links
$admin_links = "";
if ($user_info['user_level'] == ADMIN) {
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a> ";
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif ($is_image_owner) {
$admin_links .= ($config['user_edit_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a> ";
$admin_links .= ($config['user_delete_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
}
// ******* Ahora *********
*/
$admin_links = "";
if ($user_info['user_level'] == ADMIN || ($user_info['user_level'] == MODERADOR && $user_info['user_moderador_imagenes'] == 1)) {
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a> ";
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif ($is_image_owner) {
$admin_links .= ($config['user_edit_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a> ";
$admin_links .= ($config['user_delete_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
}
///// Fin nuevo tipo de usuario /////
$site_template->register_vars("admin_links", $admin_links);
// Update Hits
if ($user_info['user_level'] != ADMIN) {
$sql = "UPDATE ".IMAGES_TABLE."
SET image_hits = image_hits + 1
WHERE image_id = $image_id";
$site_db->query($sql);
}
//-----------------------------------------------------
//---Clickstream---------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if ($mode == "lightbox" && $in_mode) {
$page_url = "";
if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
if (!empty($regs[1]) && $regs[1] != 1) {
$page_url = "?".URL_PAGE."=".$regs[1];
}
}
/*
MOD MULTI-LIGHTBOXES
START REPLACE
*/
$page_url .= ($lightbox_id) ? (($page_url) ? "&" : "?")."lightbox_id=".$lightbox_id : "";
$clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php".$page_url)."\" class=\"clickstream\">".$txt_clickstream."</a>".$config['category_separator'];
/*
MOD MULTI-LIGHTBOXES
END REPLACE
*/
}
elseif ($mode == "search" && $in_mode) {
$page_url = "";
if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
if (!empty($regs[1]) && $regs[1] != 1) {
$page_url = "&".URL_PAGE."=".$regs[1];
}
}
$clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."search.php?show_result=1".$page_url)."\" class=\"clickstream\">".$lang['search']."</a>".$config['category_separator'];
}
else {
$clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$clickstream .= $image_name."</span>";
//######################################### Start MOD: Calendar Print #####################################################
if ($user_info['user_level'] >= USER) {
$calendar_print_button_popup = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$image_row['image_id']."&action=calendarprint")."\" onclick=\"opendetailwindow()\" target=\"detailwindow\"><img src=\"".get_gallery_image("calendar_print_on.gif")."\" border=\"0\" /></a>";
} else {
$calendar_print_button_popup = " <img src=\"".get_gallery_image("calendar_print_off.gif")."\" border=\"0\" alt=\"\" />";
}
//########################################## End MOD: Calendar Print #####################################################
//-----------------------------------------------------
//--- Start mod: pin images ---------------------------
//-----------------------------------------------------
if (($config['pin_image_show'] == 'yes' && $image_pin_allow == '1') || ($config['pin_image_show'] == 'yes1' && $user_info['user_level'] >= USER && $image_pin_allow == '1') || ($config['pin_image_show'] == 'yes2' && $user_info['user_level'] >= USER && $image_pin_allow == '1') || ($config['pin_image_show'] == 'yes3' && $user_info['user_level'] == ADMIN && $image_pin_allow == '1') || ($config['pin_image_show'] == 'yes4' && $user_info['user_level'] == ADMIN && $image_pin_allow == '1')) {
$pin_image_show = '1';
$pin_image_show_info = '1';
$pin_image_show_access = '1';
} elseif ($config['pin_image_show'] == 'yes1' && $user_info['user_level'] == GUEST && $image_pin_allow == '1') {
$pin_image_show = '1';
$pin_image_show_info = '1';
$pin_image_show_access = '0';
} elseif ($config['pin_image_show'] == 'yes2' && $user_info['user_level'] == GUEST && $image_pin_allow == '1') {
$pin_image_show = '0';
$pin_image_show_info = '1';
$pin_image_show_access = '0';
} elseif ($config['pin_image_show'] == 'yes3' && $user_info['user_level'] != ADMIN && $image_pin_allow == '1') {
$pin_image_show = '1';
$pin_image_show_info = '0';
$pin_image_show_access = '0';
} elseif ($config['pin_image_show'] == 'yes4' && $user_info['user_level'] >= USER && $image_pin_allow == '1') {
$pin_image_show = '1';
$pin_image_show_info = '0';
$pin_image_show_access = '0';
} else {
$pin_image_show = '0';
$pin_image_show_info = '0';
$pin_image_show_access = '0';
}
if ($config['pin_image_smilie'] == 0 && $config['pin_image_captcha'] == 0) {
$pin_window_height = '280';
}
elseif ($config['pin_image_smilie'] == 1 && $config['pin_image_captcha'] == 0) {
$pin_window_height = '320';
}
elseif ($config['pin_image_smilie'] == 1 && $config['pin_image_captcha'] == 1) {
$pin_window_height = '510';
}
if ($config['pin_image_show'] == 'yes' || $config['pin_image_show'] == 'yes1' || $config['pin_image_show'] == 'yes2' || $config['pin_image_show'] == 'yes3' || $config['pin_image_show'] == 'yes4') {
$sql = "SELECT * FROM ".PIN_TABLE."
WHERE pin_image_id = $image_id
ORDER BY pin_id DESC";
$result=mysql_query($sql);
$pin_image = "\n";
$pin_image .= "<div id=\"image_content\">\n";
$pin_image .= "<div class=pgdiv>\n";
for ($i=0; $i<mysql_num_rows($result); $i++) {
mysql_data_seek ($result, $i);
$row = mysql_fetch_row($result);
$pin_id=$row[0];
$pin_image_id=$row[1];
$pin_user_id=$row[2];
$pin_user_name=$row[3];
$pin_art=$row[4];
$pin_col=$row[5];
$pin_headline=$row[6];
$pin_text=$row[7];
$pin_date = format_date($config['date_format']." ".$config['time_format'],$row[9]);
$pin_x=$row[10];
$pin_y=$row[11];
// ---- Start Admin Pin Links --------------------------------------------------
$admin_pin_links = "";
if ($user_info['user_level'] == ADMIN) {
$admin_pin_links .= "<a href='admin/pins.php?action=editpin&pin_id=".$pin_id."' target='_blank'>(Edit)</a> ";
$admin_pin_links .= "<a href='admin/pins.php?action=removepin&pin_id=".$pin_id."' target='_blank'>(Delete)</a>";
}
// ---- END Admin Pin Links ----------------------------------------------------
// ---- Start replace smilie codes ---------------------------------------------
if ($config['pin_image_smilie'] != 0) {
$search_smilie = array("#)", "#-D", "#(", "#-o", "#?#", "#?", "#-)", "#-x", "#-p", "#-*", "#*-(", "#3-(", "#roll#", "#wink#", "#-|", "#o", "#3-)", "#lol#", "LOL", "#!#", "#idea#");
$replace_smilie = array("smile", "biggrin", "sad", "eek", "question", "confused", "cool", "mad", "razz", "redface", "cry", "evil", "rolleyes", "wink", "neutral", "surprised", "twisted", "lol", "lol", "exclaim", "idea");
for($smile=0;$smile<count($search_smilie);$smile++) {
$pin_headline = str_replace($search_smilie[$smile],"<img src='".TEMPLATE_PATH."/smilies/icon_".$replace_smilie[$smile].".gif'>",$pin_headline);
$pin_text = str_replace($search_smilie[$smile],"<img src='".TEMPLATE_PATH."/smilies/icon_".$replace_smilie[$smile].".gif'>",$pin_text);
}
}
// ---- End replace smilie codes -----------------------------------------------
// ---- Start pin text Umbruch -------------------------------------------------
$pin_text = wordwrap($pin_text, 17, "\n", TRUE);
// ---- END pin text Umbruch ---------------------------------------------------
if ($pin_user_id != -1) {
$pin_image .= "<a style=\"cursor:pointer;\"><img src=\"".TEMPLATE_PATH."/images/pin/pin".$pin_art.".png\" border=\"0\" style=\"position:absolute; left:".($pin_x-($config['pin_position_x']))."; top:".($pin_y-($config['pin_position_y'])).";\" title=\"header=[".$pin_headline."] body=[".$pin_text."<p><small>".$lang['pin_from']."<br /><a href='member.php?action=showprofile&user_id=".$pin_user_id."'><u>".$pin_user_name."</u></a><br />(".$pin_date.")".$admin_pin_links."</small></p>] fade=[on] fadespeed=[0.06] requireclick=[off] singleclickstop=[on] doubleclickstop=[off]\"></a>\n";
}
else {
$pin_image .= "<a style=\"cursor:pointer;\"><img src=\"".TEMPLATE_PATH."/images/pin/pin".$pin_art.".png\" border=\"0\" style=\"position:absolute; left:".($pin_x-($config['pin_position_x']))."; top:".($pin_y-($config['pin_position_y'])).";\" title=\"header=[".$pin_headline."] body=[".$pin_text."<p><small>".$lang['pin_from']."<br />".$pin_user_name."<br />(".$pin_date.")".$admin_pin_links."</small></p>] fade=[on] fadespeed=[0.06] requireclick=[off] singleclickstop=[on] doubleclickstop=[off]\"></a>\n";
}
}
$pin_image .= "<script src=\"".TEMPLATE_PATH."/pin_images.js\"></script> \n";
$pin_image .= "</div>\n";
$pin_image .= "</div>\n";
}
$site_template->register_vars(array(
"pin_image" => $pin_image,
"pin_window_height" => $pin_window_height,
"pin_image_show" => $pin_image_show,
"lang_pin_info" => $lang['pin_info'],
"pin_image_show_info" => $pin_image_show_info,
"lang_pin_info_access" => $lang['pin_info_access'],
"pin_image_show_access" => $pin_image_show_access,
"url_pin_images" => $site_sess->url(ROOT_PATH."pin_images.php?pin=1"),
"lang_pin_post" => $lang['pin_post']
));
unset($pin_image);
//-----------------------------------------------------
//--- End mod: pin images -----------------------------
//-----------------------------------------------------
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
//######################################### Start MOD: Calendar Print #####################################################
"calendar_print_button_popup" => $calendar_print_button_popup,
"lang_calendar_image_tip" => $lang['calendar_image_tip'],
"lang_calendar_help" => $lang['calendar_help'],
"lang_calendar_paper_tip" => $lang['calendar_paper_tip'],
"lang_calendar_select_mounth_tip" => $lang['calendar_select_mounth_tip'],
"lang_calendar_remind_tip" => $lang['calendar_remind_tip'],
"lang_calendar_print_tip_1" => $lang['calendar_print_tip_1'],
"lang_calendar_print_tip_2" => $lang['calendar_print_tip_2'],
//########################################### End MOD: Calendar Print #####################################################
"lang_category" => $lang['category'],
"lang_added_by" => $lang['added_by'],
"lang_description" => $lang['description'],
"lang_keywords" => $lang['keywords'],
"lang_date" => $lang['date'],
"lang_hits" => $lang['hits'],
"lang_downloads" => $lang['downloads'],
"lang_rating" => $lang['rating'],
"lang_votes" => $lang['votes'],
"lang_author" => $lang['author'],
"lang_comment" => $lang['comment'],
"lang_prev_image" => $lang['prev_image'],
"lang_next_image" => $lang['next_image'],
"lang_file_size" => $lang['file_size']
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>
Edit: Es kommt einfach keine Mail an! Was ist denn da falsch gelaufen?
-
Works perfect :D
I got email from the past
Date: 01.01.1970 01:00 8O
-
vraxor, thank you very much!!
works perfect! good job!!! :thumbup: :thumbup:
-
Hi to all.
Why admins do not receive comments for their images?
I'm using 1.7.4
Thanks.
UPDATE : Fix it . Thanks
-
Maybe admin's email is wrong?
-
Nice mod. Thank you very much.
-
Hi There
I have installed this MOD, however the e- mails are turning out like this:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0
Arial;}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 Dear
\{user_name\},\par
\par
someone posted a comment on \{image_name\} at \{site_name\}.\par
To view the comment go to: \{image_url\}\par
Date: \{comment_date\}\par
\par
Best regards, \{site_name\}\par
}
I am using 1.7.6
Best wishes,
Nick
-
There are obviously a lot of sharp people in here but I have a simple question. Most of the mods I have reviewed carry on in response for an extensive length with multiple postings on corrections. Is this mod with all changes and corrections listed in any one place? This is a great idea and I am sure it works as well as the suggested modifications to the MOD.
It would probably take less than 15 minutes to add this mod but not when you have to run back and forth and read all the postings and clarifications or corrections or am I reading the comments wrong?
-
Hello and welcome to 4images forum.
Unfortunately you are probably reading it right...at least in this particular case. Most recent mods are getting updated in the original instructions as fixes posted in the comments.
In this particular case it seems to be the author no longer active on this forum and you probably need go through the comments to get the whole mod...
However if you feel so generous, you could collect the needed changes and we'll gladly update the original instructions for future users ;)
-
Hallo zusammen.
Ich bekomme diesen MOD nicht ans laufen mit 4images 1.7.6 und dem Iceberg Template - in der Detailansicht wird nur noch eine weiße Seite ausgegeben. Warum nur? Das wäre der erste MOD, Konflikte dürften keine bestehen.
------
Hi there.
For some reason I don't know I can't get this MOD running with 4images 1.7.6 and the Iceberg template - in details page only a white page ist printed. But why? It's the first MOD, conflicts should not be there.
:oops:
-
Mod ist in 1.7.7 eingebaut, bekomme aber keine Mail ?
-----
Did the modification in version 1.7.7 tested. But I receive no e-mail. Would that someone, perhaps to version 1.7.7 rewrite?
-
I Used this Code:
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/img".$id;
$sql = "SELECT user_allowmailcomments FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = '".$recipient_name."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowmailcomments = ($row['user_allowmailcomments']);
if ($image_row['user_id'] != $user_info['user_id'] && $user_allowmailcomments == 1) {
$current_time = time();
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
"comment_text" =>(stripslashes($comment_text)),
"comment_headline"=>(stripslashes($comment_headline)),
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
//----------------------------------------------------
If someone writes a comment, the following error:
An unexpected error occured. Please try again later.
There is also no e-mail!
-
And what kind of error shows when posted as admin?
also that message is covered in our error messages section An unexpected error occured. Please try again later (http://www.4homepages.de/forum/index.php?topic=24177.0).
-
Hi Benny,
der Mod funktioniert bei mir ohne Probleme in der 1.77. Kontrolliere bitte mal deine Userverwaltung und die hinterlegte E- Mailadresse.
-
And what kind of error shows when posted as admin?
also that message is covered in our error messages section An unexpected error occured. Please try again later (http://www.4homepages.de/forum/index.php?topic=24177.0).
This
Bad SQL Query: SELECT user_allowmailcomments FROM 4images_users WHERE user_name = 'Benny'
Unknown column 'user_allowmailcomments' in 'field list'
If the administrator saves a comment, then no errors and there will be no e-mail sent!
Hi Benny,
der Mod funktioniert bei mir ohne Probleme in der 1.77. Kontrolliere bitte mal deine Userverwaltung und die hinterlegte E- Mailadresse.
Was meinst du mit der Userverwaltung?
Und es ist meine E-Mail Adresse hinterlegt zu 100% korrekt ist, habe ich auch schon nachgesehen!
-
user_allowmailcomments is not part of this mod...you'll need add that field into 4images_users table manually. add it as TINYINT(1) :
ALTER TABLE `4images_users` ADD `user_allowmailcomments` TINYINT( 1 ) NOT NULL ;
-
Thanks Vano,
but there is still no e-mail. There is simply no e-mail sent!
Hi Vano, would you have this code may take a look? I think in the code does not error.
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
$msg = $lang['comment_success'];
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/img".$id;
$sql = "SELECT user_allowmailcomments FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = '".$recipient_name."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowmailcomments = ($row['user_allowmailcomments']);
if ($image_row['user_id'] != $user_info['user_id'] && $user_allowmailcomments == 1) {
$current_time = time();
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
"comment_text" =>(stripslashes($comment_text)),
"comment_headline"=>(stripslashes($comment_headline)),
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
//----------------------------------------------------
}
}
unset($row);
unset($spam_row);
}
//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
-
Please help me :(
-
Hi All.
I don't receive any comment_mail.
#
193.43.222.3 - - [22/Aug/2009:14:26:14 -0700] "POST /ajaxcomments.php?l=ukrainian&js&commentbg=1&l=ukrainian HTTP/1.1" 200 1409 "http://xxx.com/img653.htm?l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
#
193.43.222.3 - - [22/Aug/2009:14:26:35 -0700] "GET /admin/email.php?action=emailusers&l=ukrainian HTTP/1.1" 200 5281 "http://xxx.com/admin/index.php?action=nav&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
193.43.222.3 - - [22/Aug/2009:14:26:35 -0700] "GET /admin/email.php?action=emailusers&l=ukrainian HTTP/1.1" 200 5281 "http://xxx.com/admin/index.php?action=nav&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
#
193.43.222.3 - - [22/Aug/2009:14:26:40 -0700] "GET /admin/settings.php?action=modifysettings&l=ukrainian HTTP/1.1" 200 5538 "http://xxx.com/admin/index.php?action=nav&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
#
193.43.222.3 - - [22/Aug/2009:14:26:40 -0700] "GET /admin/settings.php?action=modifysettings&l=ukrainian HTTP/1.1" 200 5538 "http://xxx.com/admin/index.php?action=nav&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
#
193.43.222.3 - - [22/Aug/2009:14:26:46 -0700] "GET /admin/email.php?action=emailusers&l=ukrainian HTTP/1.1" 200 5281 "http://xxx.com/admin/index.php?action=nav&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
#
193.43.222.3 - - [22/Aug/2009:14:26:47 -0700] "GET /admin/email.php?action=emailusers&l=ukrainian HTTP/1.1" 200 5281 "http://xxx.com/admin/index.php?action=nav&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
But when I sent email from ACP
#
193.43.222.3 - - [22/Aug/2009:14:38:58 -0700] "POST /admin/email.php?l=ukrainian HTTP/1.1" 200 1446 "http://xxx.com/admin/email.php?action=emailusers&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
#
What's wrong?
-
Hi to all.
Why admins do not receive comments for their images?
I'm using 1.7.4
Thanks.
UPDATE : Fix it . Thanks
I have the same issue. My email address is set correctly.
Do I need to set anything related to mail? like SMTP, its off at the moment.
-
can you send/receive any kind of emails from your 4images?
-
can you send/receive any kind of emails from your 4images?
Thanks for the hint V@no, I'm using admin and the email was set in the settings but not under the user settings.
-
thanks for this mod but how i can set Character set in commant_email ?
-
Yep, the same thing - the mail is not sent... while all the other site letters are sent and received fine (account activation emails, new uploads notifiers for admins etc)
:(
-
I`ve installed MOD [Ajax comments....], e-mail is not sending to users...
THIS MOD NOT WOKING WITH INSTALLED [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)
When i deleted this mod, it works perfectly...
Thanks for this important mod
-
yep, doesnt work. i got AJAX commenting is well. Its a shame 50% of good MODS come from users and the other 50% from admins
:cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry:
-
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21) (http://www.4homepages.de/forum/index.php?topic=23866.msg149347#msg149347)
-
Using v1.7.7
Pleased to report this MOD does work.
Note: did not work when a user posted on an admin-uploaded image but did work when one user commented on another user's uploaded image.
Hit me up if you want to see my files.
- Brian