MOD - PW po dodaniu nowego komentarzaoryginalny tytuł
PM to owner of image when Comment ist posted Autor:
Acidgod Jest to rozszerzenie modyfikacji
MOD - Prywatne wiadomości + BBcode2 Modyfikacja ma na celu, automatyczne powiadamianie właściciel zdjęcia, o nowych komentarzach.
Otwórz plik
details.php, odszukaj
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
i za nim dodaj
$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 = 1; //Tutaj wpisz u?ytkownika-nadawc? user_id,
$pm_type = 5;
$pm_bbcode = 1;
$pm_smiles = 1;
$pm_sig = "----------------------------------------- \n [B]Serdecznie pozdrawiam[/B], \n [I]admin an-net24.com andreoid[/I]";
$pm_message = "Nast?puj?ce zdj?cie otrzyma?o nowy komentarz od ".$user_name."\n [B]Zdj?cie:[/B] ".$image_name_url."\n".$thumb." \n\n [B]Nag??wek:[/B] ".$comment_headline." \n [B]Komentarz:[/B] ".$comment_text."\n\n".$pm_sig;
$pm_subject = "\"".$image_name."\" otrzyma?(o) komentarz od ".$user_name." ";
$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);
}