vitnet

complaint.php

Nov 7th, 2014
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.82 KB | None | 0 0
  1. Открыть файл engine/ajax/complaint.php
  2.  
  3. Найти:
  4.  
  5. } elseif ($_POST['action'] == "news") {
  6.  
  7.     if( !$is_logged ) die( "error" );
  8.  
  9.     ....
  10.    
  11.     ....
  12.  
  13.     $db->query( "INSERT INTO ....
  14.  
  15. }
  16.  
  17.  
  18. Добавить ниже:
  19.  
  20. elseif( $_POST['action'] == "news_g" ) {
  21.     if( !$id OR !$text) die( "error" );
  22.  
  23.     $row = $db->super_query( "SELECT id FROM " . PREFIX . "_post WHERE id='{$id}'" );
  24.    
  25.     if( !$row['id'] ) die("Operation not Allowed");
  26.  
  27.     include_once ENGINE_DIR . '/classes/mail.class.php';
  28.     $mail = new dle_mail( $config, true );
  29.  
  30.     $text = $db->safesql( $text );
  31.    
  32.     $field = convert_unicode( $_POST['field'], $config['charset'] );
  33.     $field = $is_logged ? $member_id['name'] : ($field ? $field : "No name");
  34.  
  35.     $url = $config['http_home_url'] . "index.php?newsid=" . $row['id'];
  36.     $mail->send( $config['admin_mail'], "Уведомление о отсутствии видео на сайте", "Нет видео по адресу: " . $url . "<br /><br />Отправитель: " . $field . "<br /><br />Текст: " . $text );
  37.    
  38. }
  39.  
  40. _______________________________________________________________________________
  41.  
  42. Идем сюда engine/classes/js/dle_js.js
  43.  
  44. Найти:
  45.  
  46. function AddComplaint(a,c){var b={};b[dle_act_lang[3]]=function(){$(this).dialog("close")};b[dle_p_send]=function(){if(1>$("#dle-promt-text").val().length)$("#dle-promt-text").addClass("ui-state-error");else{var b=$("#dle-promt-text").val();$(this).dialog("close");$("#dlepopup").remove();$.post(dle_root+"engine/ajax/complaint.php",{id:a,text:b,action:c},function(a){"ok"==a?DLEalert(dle_p_send_ok,dle_info):DLEalert(a,dle_info)})}};$("#dlepopup").remove();$("body").append("<div id='dlepopup' title='"+
  47. dle_complaint+"' style='display:none'><br /><textarea name='dle-promt-text' id='dle-promt-text' class='ui-widget-content ui-corner-all' style='width:97%;height:100px; padding: .4em;'></textarea></div>");$("#dlepopup").dialog({autoOpen:!0,width:500,dialogClass:"modalfixed",buttons:b});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"])}
  48.  
  49.  
  50. Заменить на:
  51.  
  52. /*function AddComplaint(a,c){var b={};b[dle_act_lang[3]]=function(){$(this).dialog("close")};b[dle_p_send]=function(){if(1>$("#dle-promt-text").val().length)$("#dle-promt-text").addClass("ui-state-error");else{var b=$("#dle-promt-text").val();$(this).dialog("close");$("#dlepopup").remove();$.post(dle_root+"engine/ajax/complaint.php",{id:a,text:b,action:c},function(a){"ok"==a?DLEalert(dle_p_send_ok,dle_info):DLEalert(a,dle_info)})}};$("#dlepopup").remove();$("body").append("<div id='dlepopup' title='"+
  53. dle_complaint+"' style='display:none'><br /><textarea name='dle-promt-text' id='dle-promt-text' class='ui-widget-content ui-corner-all' style='width:97%;height:100px; padding: .4em;'></textarea></div>");$("#dlepopup").dialog({autoOpen:!0,width:500,dialogClass:"modalfixed",buttons:b});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"])}*/
  54.  
  55. function AddComplaint(a,c,d) {
  56.     var b = {};
  57.     var t = "";
  58.     if(d) {
  59.         t = "Сериалы: указать сезон/серию.";
  60.     } else {
  61.         t = dle_complaint;
  62.     }
  63.     b[dle_act_lang[3]] = function() {
  64.         $(this).dialog("close");
  65.     };
  66.     b[dle_p_send] = function() {
  67.         if( 1 > $("#dle-promt-text").val().length ) {
  68.             $("#dle-promt-text").addClass("ui-state-error");
  69.         } else {
  70.             var b = $("#dle-promt-text").val();
  71.             var d = $("#dle-promt-field").val();
  72.             $(this).dialog("close");
  73.             $("#dlepopup").remove();
  74.             $.post(dle_root + "engine/ajax/complaint.php", {id:a, text:b, action:c, field:d}, function(a) {
  75.                 "ok" == a ? DLEalert(dle_p_send_ok, dle_info) : DLEalert(a, dle_info);
  76.             });
  77.         }
  78.     }
  79.     $("#dlepopup").remove();
  80.     $("body").append("<div id='dlepopup' title='"+t+"' style='display:none'><br />\
  81.         <input type='text' id='dle-promt-field' class='ui-widget-content ui-corner-all' placeholder='Контакты для связи с вами' style='width:97%; padding: .4em;' /><br /><br />\
  82.         <textarea name='dle-promt-text' id='dle-promt-text' class='ui-widget-content ui-corner-all' style='width:97%; height:100px; padding: .4em;'></textarea>\
  83.     </div>");
  84.     $("#dlepopup").dialog({autoOpen:!0, width:500, dialogClass:"modalfixed", buttons:b});
  85.     $(".modalfixed.ui-dialog").css({position:"fixed"});
  86.     $("#dlepopup").dialog("option","position",["0","0"]);
  87. }
  88.  
  89. _______________________________________________________________________________
  90.  
  91. В нужном месте прописать:
  92.  
  93. <a href="javascript:AddComplaint('{news-id}', 'news_g', '1')">Изъяли видео!</a>
  94.  
  95. Готово!
  96.  
  97. В случае возникновения вопросов, пожалуйста, обращайтесь
  98.  
  99. Автор: Виктор (vitnet)
  100. Сайт:  http://quantum-soft.ru/
  101. Связь: 80-60-715
  102. Благодарность: R115600417591
Advertisement
Add Comment
Please, Sign In to add comment