4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Acidgod on October 12, 2005, 01:22:56 PM
-
This is a littel Tutorial to use the PMv2 Mod (http://www.4homepages.de/forum/index.php?topic=6692.0) to inform Image owner over new Comments.
1. Open details.php and find
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
2. Add below
$sql = "SELECT 'user_id', 'image_thumb_file', 'cat_id' FROM ".IMAGES_TABLE." WHERE image_id = $id";
$user_id = $site_db->query($sql);
$user_id = $image_row['user_id'];
if ($image_row['user_id'] != $user_info['user_id']) {
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
$image_name_url = "[url=".$image_url."]".$image_name."[/url]";
if (!empty($image_row['image_thumb_file'])) {
$cat_id = $image_row['cat_id'];
$image_thumb_file = $image_row['image_thumb_file'];
$thumb = $site_sess->url(ROOT_PATH."data/thumbnails/".$cat_id."/".$image_thumb_file);
$thumb = "[url=".$image_url."][img]".$thumb."[/img][/url]";
} else {
$thumb = "";
}
$pm_from = 0; //Hier bitte die user_id vom Absender angeben
$pm_type = 5;
$pm_bbcode = 1;
$pm_smiles = 1;
$pm_sig = "-- \n Mit freundlichen Grüßen, \n euer Picsforfree.de Team";
$pm_message = "Das folgende Bild hat ein Kommentar von ".$user_name." erhalten: \n\n [B]Bild:[/B] ".$image_name_url."\n".$thumb." \n\n [B]Überschrift:[/B] ".$comment_headline." \n [B]Kommentar:[/B] ".$comment_text."\n\n".$pm_sig;
$pm_subject = "\"".$image_name."\" hat ein Kommentar von ".$user_name." erhalten";
$sql = "INSERT INTO ".PM_TABLE."
(pm_date, pm_to, pm_from, pm_subject, pm_type, pm_text, pm_bbcode, pm_html, pm_ip, pm_smiles)
VALUES
('".time()."', $user_id, $pm_from, '".$pm_subject."', $pm_type, '".$pm_message."', $pm_bbcode, 0, '".$session_info['session_ip']."', $pm_smiles)";
$result = $site_db->query($sql);
}
Thats all... (o:
-
hi Acidgod,
bin begeistert von der Idee und der Umsetzung ... dein MOD arbeitet tadellos ... :D
Danke mawenzi
-
eine kleine Ergänzung :
wenn man in der PM gleich ein klickbares Vorschaubild (Thumbnail) mit anzeigen lassen möchte,
dann wäre nur [thumb=".$id."] hinzuzufügen,
bzw. wäre die folgende Codezeile :
$pm_message = "Das folgende Bild hat ein Kommentar von ".$user_name." erhalten: \n\n [B]Bild:[/B] [url=".$images_url."]".$image_name."[/url] \n [B]Überschrift:[/B] ".$comment_headline." \n [B]Kommentar:[/B] ".$comment_text."\n\n -- \n Mit freundlichen Grüßen, \n ";
gegen diese Codezeile auszutauschen :
$pm_message = "Das folgende Bild hat ein Kommentar von ".$user_name." erhalten: \n\n [B]Bild:[/B] [url=".$image_url."]".$image_name."[/url] \n \n [thumb=".$id."] \n\n [B]Überschrift:[/B] ".$comment_headline." \n [B]Kommentar:[/B] ".$comment_text."\n\n -- \n Mit freundlichen Grüßen, \n ";
Nochmals ... Klasse MOD ... und danke Acidgod !
PS. der kleine Schreibfehler $images_url ... richtig : $image_url wird mit der ausgetauschten Codezeile gleich berichtigt.
mawenzi
-
Also das mit dem Thumb klappt bei mir so nicht... (o:
Aber ich habe noch eine If Abfrage hinzugefügt und jetzt bekommt man keine PN wenn man seine eigenen Bilder kommentiert.
-
Die Funktion [thumb=xxxx] bringt der erweiterte BB-Tag-Editor mit !
Mehr dazu kannst du hier (http://www.4homepages.de/forum/index.php?topic=6692.msg38310#msg38310) und in den folgenden Beiträgen nachlesen.
mawenzi
-
So habe die Thumbnails jetzt auch mit eingebaut ohne das man den BBCode Mod miteinbauen muss... (o:
-
I only get a pm but no email when a comment was given to a file - my email notify for pm´s is on!
by Flo2005
-
Thats right...
I think its enought wenn the User comes back an see where is a new comment.
You also can combine this with the "eMail to owner of images..." Mod
-
Okay - that´s a good idea - thanks a lot!
-
One thing:
Is it possible that the user can turn it on/off in the control panel when a comment is posted :?:
cya by Flo2005
-
Not jet...
But you can use the user_allowemails Field for this...
-
Also das mit dem Thumb klappt bei mir so nicht... (o:
Aber ich habe noch eine If Abfrage hinzugefügt und jetzt bekommt man keine PN wenn man seine eigenen Bilder kommentiert.
könntest du diese vielleicht noch posten?
-
Habe es oben gleich mit eingebaut... (o:
-
wunderbar!
hab gestern den pm mod installiert und dein script.
benutze die pm funktion von phpbb aber - die von vano (mit deinen csript) ist jetzt das nachrichtensystem - user werden nur über neu kommentierte bilder informiert :)
-
Flo:
One thing:
Is it possible that the user can turn it on/off in the control panel when a comment is posted
cya by Flo2005
--------------------------------------------------------------------------------
Acidgod: Not jet...
But you can use the user_allowemails Field for this...
Also man kann diese Funktion nicht mit "Emails von Administratoren erhalten" abschalten, was muss an der Emailfunktion geändert werden?
Users cannot turn off the pm function with "user_allowemails" when comment is post, what must I change to realize this?
Flo2005
-
Also am besten wäre es bestimmt ein Feld zu dem Kontrollmenü hinzuzufügen...
Anleitungen gibt es dafür ja mehr als genug.
Traust Du es Dir zu das zu machen?
Wenn ja dann baue ich dir die Abfrage hier mit ein... (o:
-
Das Feld könnte ich in die member_editprofile.html einbauen, aber ich muss da ja auch bestimmt php Dateien bearbeiten und ggf. eine Tabelle i.d. Datenbank anlegen, oder?
Hast Du zufällig ein Link zu einer solchen Anleitung parat?
Danke im Voraus by Flo2005
-
Weisst Du wie man ein Feld in der DB anlegt?
Wenn ja dann sollte das helfen...
http://www.4homepages.de/forum/index.php?topic=747.msg3277#msg3277
Aber nutze bitte ein Radio Button als auswahl... (o:
Und die Ausgabe in der Detail.html ist natürlich überflüssig...
-
Okay danke! Also so viel Ahnung habe ich leider nicht, aber ich werde es versuchen (danke für den Link)!
Da ich dafür bestimmt mehr Zeit benötige, werde ich den MOD vorerst ohne diese Funktion online stellen.
Danke nochmals by Flo2005
-
thx works great
can I add check box to user panel ?
edit : I resolve it (like receive email when PM - new field in DB)
-------------------------------------------------------------------------------
but again i have problem
i receive PM but when i click on it
site works but over i see
DB Error: Bad SQL Query: SELECT COUNT(pm_id) AS total FROM 4images_pm WHERE pm_from = AND (pm_type = 2 OR pm_type = 0)
You have an error in your SQL syntax near 'AND (pm_type = 2 OR pm_type = 0)' at line 3
please help !
code is like it was :/ i change nothing
i dont know with one code fragment should i paste here
-
verwende den mod nochimmer, jetzt komme ich einmal mit einem problem - und mit einer weiterführenden idee
problem: hat ein user im bildtitel ein ' geschrieben bekommt man beim kommentarposten einen sql fehler :/
edit: das ist der fehler:
DB Error: Bad SQL Query: INSERT INTO 4images_pm (pm_date, pm_to, pm_from, pm_subject, pm_type, pm_text, pm_bbcode, pm_html, pm_ip, pm_smiles) VALUES ('1136821809', 7, 2, '"Let's Zeitung zerfetz'" hat ein Kommentar erhalten', 5, 'Das folgende Bild hat ein Kommentar erhalten: [B]Bild:[/B] [url=http://www.hobby-fotografen.com/details.php?image_id=1578]Let's Zeitung zerfetz'[/url] [url=http://www.hobby-fotografen.com/details.php?image_id=1578][img]./data/thumbnails/16/1578.jpg[/img][/url] [B]Überschrift:[/B] [B]Kommentar:[/B] nur wegen dem fernsehprogramm :D netter kleiner, also können wir davon ausgehen das da jetzt öfter fotos von ihm auftauchen? *g* lg -- Mit freundlichen Grüßen, euer hobby-fotografen.com Team', 1, 0, 'd5e52692', 1)
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 's Zeitung zerfetz'" hat ein Kommentar erhalten', 5, 'Das folgen
idee: wäre es möglich diese funktion auf alle user auszuweiten? ich stelle mir das so vor - der user kann einen button klicken, somit wird die user_id des users in ein extrafeld in der images tabelle geschrieben. wird nun ein neues kommentar geschrieben werden die user_ids der user ausgelsen die sich eingetragen haben und diese bekommen dann auch eine pm.
ich traue es mir leider nochnicht wirklich zu das selbst zu schreiben. habe zwar ein paar modifikationen an meiner page selbst gemacht (einfaches creditsystem - rahmen per css die der user selbst definieren kann), das geht für mich dann aber doch zuweit :/ (würde aber helfen wo es nur geht :D)
-
Hi,
also ne an/aus Funktion wäre echt nicht schlecht. Suche das auch noch für den Mail Mod bei neuen Kommentaren. Lies sich irgendwie nicht einbauen. Vielleicht hat das ja schon jemand in Angriff genommen ;)
-
doesn't exist any way to make it work for old PMS ?
:wink:
-
If some one could help me I would ge gratefull
mod works but I discover my "pm" or "not pm" radio button wont work withot little addons in code :?
I mean data is put in DB but I dont know how tu put working "if" to code
field name is comments_to_pm (1/0) and its in users table
I need something like
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
below
if comments_to_pm=1 {
here whole code from first page
}
-
great MOD - thanks ! :)
-
one more idea
when someone post comment...
in PM we receive info who send this PM
$pm_from = 1;
where 1 is user id
in most cases user_id 1 is gallery admin
what should i change to show in PM....
pm from "system" (or something simmiliar like "comment") without reply button and link to user profile
PS. maybe someone could help with code problem from 2 post ago
-
do it like this:
if ($user_info['comments_to_pm']) {
here whole code from first page
}
for your notify problem.
-
doesn't exist any way to make it work for old PMS ?
:wink:
anyone ??? 8O
-
do it like this:
if ($user_info['comments_to_pm']) {
here whole code from first page
}
for your notify problem.
hmmmmmm in this case it take from DB info about comments_to_pm field from comment's autor not image owner
-
oh, you are right.
you should use:
if ($image_row['user_id']) {
here whole code from first page
}
$image_row['user_id'] is the image owner's user_id
-
oh, you are right.
you should use:
if ($image_row['user_id']) {
here whole code from first page
}
$image_row['user_id'] is the image owner's user_id
hmmmm i dont understeand :cry:
it takes user_id field not comments_to_pm and (correct me if im wrong) it takes it from image table not users
-
but again i have problem
i receive PM but when i click on it
site works but over i see
Quote
DB Error: Bad SQL Query: SELECT COUNT(pm_id) AS total FROM 4images_pm WHERE pm_from = AND (pm_type = 2 OR pm_type = 0)
You have an error in your SQL syntax near 'AND (pm_type = 2 OR pm_type = 0)' at line 3
please help !
code is like it was :/ i change nothing
i dont know with one code fragment should i paste here
@Zyga: how did you solve the problem? (i´ve the same Error-Message)
Thx Frobman
-
but again i have problem
i receive PM but when i click on it
site works but over i see
Quote
DB Error: Bad SQL Query: SELECT COUNT(pm_id) AS total FROM 4images_pm WHERE pm_from = AND (pm_type = 2 OR pm_type = 0)
You have an error in your SQL syntax near 'AND (pm_type = 2 OR pm_type = 0)' at line 3
please help !
code is like it was :/ i change nothing
i dont know with one code fragment should i paste here
@Zyga: how did you solve the problem? (i´ve the same Error-Message)
Thx Frobman
sorry but I do nothing it just start works few days later
I dont know how can I help
-
Im getting this error as others have
DB Error: Bad SQL Query: SELECT COUNT(pm_id) AS total FROM 4images_pm WHERE pm_from = AND (pm_type = 2 OR pm_type = 0)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (pm_type = 2 OR pm_type = 0)' at line 3
any help?
thanks
-
Im getting this error as others have
DB Error: Bad SQL Query: SELECT COUNT(pm_id) AS total FROM 4images_pm WHERE pm_from = AND (pm_type = 2 OR pm_type = 0)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (pm_type = 2 OR pm_type = 0)' at line 3
any help?
thanks
Which PHP Version is running on your server?
I´ll remember :? you have to change something in pm.php when you´re running PHP5
-
Yea.. im running PhP5
correct this part:
$pm_from = 0; //Hier bitte die user_id vom Absender angeben
'
do i change that to a 1?
-
Thank you it looks to be working. And Thanks for the quick responce
8)
Is there any way to change it so the Pm is sent from the commenter?
-
hi zusammen,
wäre es möglich bei pm_from anstatt immer den admin zu nehmen
die entsprechende id des absenders zu nehmen?
und wenn es ein gast ist, auch gast im der kopfzeile erscheint....
gruss ivan
Hbe es mir auch gerade eingebaut, und finde auch das dort die ID des Absenders reingehört.
Über eine Lösung würde ich mich freuen
Danke
Harald