Author Topic: [Mod] Notify Comments and Images  (Read 10180 times)

0 Members and 1 Guest are viewing this topic.

Rembrandt

  • Guest
[Mod] Notify Comments and Images
« on: May 19, 2011, 03:17:12 PM »
Hi!

Members can notify Comments and Images to admin.
This is my version.

1.) copy the "attention.png" in your "template/images" folder.

2.) create a new file, call it "notify_comment.html" and store in your lang/email folder.
(deutsch)

Ein Kommentar wurde auf 
"{site_name}" gemeldet.

Member {report_userhat einen Kommentar von {reported_usergemeldet.
----
Das ist die Nachricht: {message_text}
----
Gemeldeter Kommentar:
{
comment_text}
----
Link zu dem Kommentar:
{
link_comment}

Mit freundlichen Grüßen,
{
site_name}

(english)

A Comment was reported to 
"{site_name}".

Member {report_userhas reported a comment by {reported_user}.
----
This is the Message: {message_text}
----
Reported Comment:
{
comment_text}
----
Link to the Comment:
{
link_comment}

Best regards,
{
site_name}


3.) create a new file, call it "notify_image.html" and store in your lang/email folder.
(deutsch)

Ein Bild wurde auf 
"{site_name}" gemeldet.

Member {report_userhat das Bild {image_namevon {reported_usergemeldet.
----
Das ist die Nachricht:
{
message_text}
----
Link zu dem Bild:
{
link_image}

Mit freundlichen Grüßen,
{
site_name}

(english)

One image was reported to 
"{site_name}".

Member {report_userhas reported the image of {image_name reported_user}.

----
This is the Message:
{
message_text}
----
Link to the Image:
{
link_image}

Best regards,
{
site_name}


4.) search in your lang/main.php "?>" insert above:
(deutsch)

$lang
['notify_comment'] = "Kommentar Melden";
$lang['notify_image'] = "Bild Melden";
$lang['message_send'] = "Danke, ihre Nachricht wurde erfolgreich versendet!";
$lang['no_message'] = " -- Keine Nachricht. -- ";

(english)

$lang
['notify_comment'] = "Notify Comment";
$lang['notify_image'] = "Notify Image";
$lang['message_send'] = "Thank you, your message has been successfully sent!";
$lang['no_message'] = " -- No Message. -- ";


5.) search in root/details.php:

$random_cat_image 
= (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" get_random_image($cat_id);

insert above:

$report_image 
= ($user_info['user_level'] > USER_AWAITING) ? $site_sess->url(ROOT_PATH."member.php?action=report&image_id=".$image_row['image_id']."&report_user_id=".$user_info['user_id']) :"";
$site_template->register_vars("notify_image",($user_info['user_level'] > USER_AWAITING) ? "<a href=\"javascript:void(0)\" onclick=\"window.open('$report_image')\"><img src=\"".get_gallery_image("attention.png")."\" border=\"0\" alt=\"".$lang['notify_image']."\" /></a>""");

5.1) search:

      $site_template
->register_vars(array(
        
"comment_id" => $comment_row[$i]['comment_id'],

replace:

//################ Start Mod Notfiy Comment and Images #############################      
      
$report_comment = ($user_info['user_level'] > USER_AWAITING) ? $site_sess->url(ROOT_PATH."member.php?action=report&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id']."&amp;report_user_id=".$user_info['user_id']) :"";
//################ End Mod Notfiy Comment and Images ###############################
      
$site_template->register_vars(array(
        
"notify_comment" => ($user_info['user_level'] > USER_AWAITING) ? "<a href=\"javascript:void(0)\" onclick=\"window.open('$report_comment')\"><img src=\"".get_gallery_image("attention.png")."\" border=\"0\" alt=\"".$lang['notify_comment']."\" /></a>""",//##Mod Notfiy Comment and Images ##
        
"comment_id" => $comment_row[$i]['comment_id'],


6.) search in root/member:

//-----------------------------------------------------
//--- Clickstream -------------------------------------

insert above:

// ################# Start Notify ###################################
if ($action == "report") {
   if ((
$user_info['user_level'] <= USER_AWAITING)) {
    
redirect($url);
  }

  
$comment_id = (isset($HTTP_POST_VARS['comment_id']))? intval($HTTP_POST_VARS['comment_id']) :intval($HTTP_GET_VARS['comment_id']);
  
$image_id = (isset($HTTP_POST_VARS['image_id']))? intval($HTTP_POST_VARS['image_id']) :intval($HTTP_GET_VARS['image_id']);
  
$report_user_id = (isset($HTTP_POST_VARS['report_user_id']))? intval($HTTP_POST_VARS['report_user_id']) :intval($HTTP_GET_VARS['report_user_id']);
  
  
$site_template->register_vars(array(
    
"lang_notify_comment" => (!empty($comment_id)) ? $lang['notify_comment'] : $lang['notify_image'],
    
"lang_submit" => $lang['submit'],
    
"lang_reset" => $lang['reset'],
    
"comment_id" => $comment_id,
    
"image_id" => $image_id,
    
"report_user_id" => $report_user_id,
  ));
  
  
$txt_clickstream = (!empty($comment_id)) ? $lang['notify_comment'] : $lang['notify_image'];
  
$content $site_template->parse_template("member_notify");
}

if (
$action == "send_report") {
   if ((
$user_info['user_level'] <= USER_AWAITING)) {
    
redirect($url);
  }
  
  
$close "<script language=\"JavaScript\">setTimeout('self.close()',2500);</script>";
  
$comment_id = (isset($HTTP_POST_VARS['comment_id']))? intval($HTTP_POST_VARS['comment_id']) :intval($HTTP_GET_VARS['comment_id']);
  
$image_id = (isset($HTTP_POST_VARS['image_id']))? intval($HTTP_POST_VARS['image_id']) :intval($HTTP_GET_VARS['image_id']);
  
$report_user_id = (isset($HTTP_POST_VARS['report_user_id']))? intval($HTTP_POST_VARS['report_user_id']) :intval($HTTP_GET_VARS['report_user_id']);
  
  
$message_text = (!empty($HTTP_POST_VARS['message_text'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['message_text'])): $lang['no_message'];
  
$subject = (!empty($comment_id)) ? $lang['notify_comment'] : $lang['notify_image'];  
  
$body = (!empty($comment_id)) ? "notify_comment" "notify_image";
  
$where = (!empty($comment_id)) ? "c.comment_id = $comment_id AND i.image_id = c.image_id" "i.image_id = $image_id ";
   
    
$sql "SELECT c.comment_id,c.comment_text, c.image_id, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.""user_name")."
          FROM ("
.COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
          WHERE 
$where ";
    
$comment_row $site_db->query_firstrow($sql);
    
    include(
ROOT_PATH.'includes/email.php');
    
$site_email = new Email();

    
$site_email->set_to($config['site_email']);
    
$site_email->set_subject($subject);
    
    
$site_email->register_vars(array(
      
"link_comment" => "".$site_sess->url($script_url."/details.php?image_id=".$comment_row['image_id']."#comment".$comment_row['comment_id'])."",
      
"link_image" => "".$site_sess->url($script_url."/details.php?image_id=".$image_id)."",
      
"image_name" => '"'.$comment_row['image_name'].'"',
      
"message_text" => $message_text,
      
"reported_user" => '"'.$comment_row['user_name'].'"'//böse
      
"report_user" => '"'.$user_info['user_name'].'"',
      
"comment_text" => format_text(stripslashes($comment_row['comment_text']),2),
      
"site_name" => $config['site_name']
    ));
    
    
$site_email->set_body($body$config['language_dir_default']);
    
$site_email->send_email(); 

    
$site_template->register_vars(array(
      
"lang_submit" => $lang['submit'],
      
"lang_reset" => $lang['reset'],
      
"lang_notify_comment" => $lang['notify_comment'],
      
"close" => $close,
    ));
    
    
$txt_clickstream = (!empty($comment_id)) ? $lang['notify_comment'] : $lang['notify_image'];     
    
$content "";

    
$msg $lang['message_send'].$close;
}
// ################# End Notify ###################################


7.) create a new file call it "member_notify.html" and store it in your template folder.
Code: [Select]
<form method="post" action="{url_member}" onsubmit="button.disabled=true;">
  <table width="100%" border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td valign="top" class="head1">
        <table width="100%" border="0" cellpadding="4" cellspacing="0">
          <tr>
            <td class="row2" valign="top">{lang_notify_comment}:</td>
            <td class="row2" valign="top">
              <textarea  class="textarea" rows="2" name="message_text"></textarea>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  <p align="center">
  <input type="hidden" name="action" value="send_report">
  <input type="hidden" name="comment_id" value="{comment_id}">
  <input type="hidden" name="image_id" value="{image_id}">
  <input type="hidden" name="report_user_id" value="{report_user_id}">
  <input type="submit" name="button" value="{lang_submit}" class="button" >
  <input type="reset" value="{lang_reset}" class="button" >
  </p>
</form>
<!-- <p style="text-align:center"><a  class="maincat"  href="#" target="_self" onClick="window.close()">Schliessen</a></p>  -->
{close}

8.) search in your template/details.html:
Code: [Select]
{lightbox_button}&nbsp;&nbsp;{postcard_button}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{download_button}&nbsp;&nbsp;{download_zip_button}
and replace:
Code: [Select]
{lightbox_button}&nbsp;&nbsp;{postcard_button}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{download_button}&nbsp;&nbsp;{download_zip_button}&nbsp;&nbsp;{notify_image}

9.) search in your template/comment_bit.html:
Code: [Select]
{comment_user_icq_button}insert below:
Code: [Select]
{notify_comment}

mfg Andi
« Last Edit: June 23, 2011, 08:18:05 PM by Rembrandt »

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [Mod] Notify Comments and Images
« Reply #1 on: May 22, 2011, 08:44:16 PM »
Andy,
ändere mal unter Position 4 (englisch) diese Zeile

$lang['message_send'] = "Thank you, your message has been successfully sent!;

in dieses

$lang['message_send'] = "Thank you, your message has been successfully sent!";

LG



Danke Harald




Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: [Mod] Notify Comments and Images
« Reply #2 on: January 06, 2014, 12:58:20 AM »
Wenn ein Bild erfolgreich gemeldet wird, kommt die Nachricht das es erfolgreich war und dann wird meine Seite immer geschlossen...?
Woran kann das liegen?

Lag an dem Close.
« Last Edit: January 06, 2014, 01:37:54 AM by Sumale.my »