barbass: удаляем лишние файлы

parent 33275c21
......@@ -3,7 +3,7 @@
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Май 10 2012 г., 17:20
-- Время создания: Май 16 2012 г., 17:20
-- Версия сервера: 5.1.56
-- Версия PHP: 5.3.10
......@@ -25,12 +25,11 @@ SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- Структура таблицы `admins`
--
DROP TABLE IF EXISTS `admins`;
CREATE TABLE IF NOT EXISTS `admins` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_user` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=20 ;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ;
-- --------------------------------------------------------
......@@ -38,18 +37,16 @@ CREATE TABLE IF NOT EXISTS `admins` (
-- Структура таблицы `messages`
--
DROP TABLE IF EXISTS `messages`;
CREATE TABLE IF NOT EXISTS `messages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_site` int(11) NOT NULL,
`link` text NOT NULL COMMENT 'Ссылка на страницу',
`error_text` varchar(100) NOT NULL COMMENT 'Выделенный текст ',
`email` varchar(150) DEFAULT NULL COMMENT 'email отправителя',
`comment` varchar(50) DEFAULT NULL COMMENT 'комментарий пользователя',
`datetime` datetime NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '1: исправлена, 0: нет',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Сообщения' AUTO_INCREMENT=222 ;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Сообщения' AUTO_INCREMENT=241 ;
-- --------------------------------------------------------
......@@ -57,14 +54,13 @@ CREATE TABLE IF NOT EXISTS `messages` (
-- Структура таблицы `responsible`
--
DROP TABLE IF EXISTS `responsible`;
CREATE TABLE IF NOT EXISTS `responsible` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_site` int(11) NOT NULL,
`id_user` int(11) NOT NULL,
`status` tinyint(1) NOT NULL COMMENT 'Возможность отписать себя с рассылки',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Зависимость сайтов и ответственных' AUTO_INCREMENT=18 ;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Зависимость сайтов и ответственных' AUTO_INCREMENT=22 ;
-- --------------------------------------------------------
......@@ -72,7 +68,6 @@ CREATE TABLE IF NOT EXISTS `responsible` (
-- Структура таблицы `sites`
--
DROP TABLE IF EXISTS `sites`;
CREATE TABLE IF NOT EXISTS `sites` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`site` varchar(150) NOT NULL COMMENT 'Формат: mysite.ru',
......@@ -85,7 +80,6 @@ CREATE TABLE IF NOT EXISTS `sites` (
-- Структура таблицы `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(150) NOT NULL,
......@@ -94,4 +88,4 @@ CREATE TABLE IF NOT EXISTS `users` (
`lastname` varchar(20) NOT NULL,
`datetime` datetime NOT NULL COMMENT 'Дата добавления',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Ответственные за сайты' AUTO_INCREMENT=38 ;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Ответственные за сайты' AUTO_INCREMENT=44 ;
......@@ -372,5 +372,5 @@ hgfgjhfgm,hgfhnfghnlfghlgfhgflhfghklgfhkghkgfhkgfkhhjkgfhklfghjh
h gjhfgm,hgfhnfghnlfghlgfhgflhfghklgfhkghkgfhkgfkhhjkgfhklfghjh
fg<br>gjhfgm,hg
</div>
<script src="etersoft_typos2.js"></script>
<script src="etersoft_typos.js"></script>
</body>
/* Плагин: сервис опечаток от компании Etersoft
* email: info@etersoft.ru
* автор: barbass@etersoft.ru
* дата: 2012-04-18
*/
//////////////////////////////////////////////////////
window.document.onkeydown = function(e) {
if (e.ctrlKey==1 && e.keyCode == 13) {
ETY.control_panel();
}
}
var ETY = {
time: 0, //время последнего запроса
server_url: "http://barbass.pubsandbox.eterhost.ru/typos/server.php",
select_text: "",
//Выделенный текст
get_select_text: function() {
var text = String(window.getSelection()).trim().substr(0, 50);
if (typeof(text) == 'undefined') {
text = "";
}
return text;
},
control_panel: function() {
if (document.getElementById("e_typos_div").style.display == "block") {
this.close();
} else {
this.div();
ETY.select_text = ETY.get_select_text();
}
},
div: function() {
//Определяем на какой позиции X, Y всплывет элемент
var top = window.pageYOffset + window.innerHeight/3;
var left = window.pageXOffset + window.innerWidth/3;
document.getElementById("e_typos_div").style.top = top + "px";
document.getElementById("e_typos_div").style.left = left + "px";
document.getElementById("e_typos_error").style.display = "none";
//document.getElementById("e_typos_user_text").style.display = "none";
document.getElementById("e_typos_comment").value = "";
document.getElementById("e_typos_div").style.display = "block";
},
close: function() {
document.getElementById("e_typos_div").style.display = "none";
},
post_data: function() {
var this_url = window.location.href; //Текущая страница
var post_text;
if (ETY.select_text == "") {
post_text = ETY.get_select_text();
} else {
post_text = ETY.select_text;
}
var new_text = ETY.get_select_text();
if (new_text != ETY.select_text && new_text.length != 0) {
post_text = new_text;
}
//Выделенный текст
var user_comment = document.getElementById("e_typos_comment").value.trim().substr(0, 50);
if (user_comment == '') {
user_comment = "";
}
if (post_text.length == 0) {
this.error("red", "Вы ничего не выделили");
} else if (post_text.length < 5) {
this.error("red", "Выделенный текст слишком короток");
} else if (post_text.length > 30) {
this.error("red", "Выделенный текст слишком длинный");
} else {
ETY.select_text = post_text;
//Ajax-запрос
this.ajax_query(this.server_url+"?e_typos_url="+this_url+"&e_typos_comment="+user_comment+"&e_typos_error_text="+post_text);
}
},
//Отправка запроса
ajax_query: function(url) {
this.error("black", "Идет отправка данных...");
var XHR = window.XDomainRequest || window.XMLHttpRequest;
request = new XHR;
//Если не поддерживаются кроссдоменные запросы
if (request.withCredentials == undefined) {
var old_url = window.location.href;
newWin = window.open(url, '_blank');
window.parent.focus();
//setTimeout('newWin.close()', 1000);
this.error("green", "Спасибо за ваше внимание");
window.setTimeout('ETY.close()', 2000);
return false;
}
var result = this.timer();
if (result == 0) {
this.error("red", "Не отправляйте данные часто");
return false;
} else {
this.time = this.now_time();
this.set_storage("etersoft_typos/"+window.location.hostname+"", this.time);
}
request.open("POST", url, true);
request.onload = function() {
var data = request.responseText.split(' ');
switch (data[0]) {
case '10robot':
ETY.error("red", "Есть подозрения что вы робот");
break;
case '10dataerror':
ETY.error("red", "Данные некорректны");
break;
case '10siteerror':
ETY.error("red", "Данный сайт не поддерживается");
break;
case '10emailerror':
ETY.error("red", "Сервер не смог отправить письмо");
break;
case '10win':
ETY.error("green", "Спасибо за ваше внимание");
window.setTimeout('ETY.close()', 2000);
break;
case '10inserterror':
ETY.error("red", "Ошибка добавления данных");
break;
case '10servererror':
ETY.error("red", "На сервере произошла ошибка");
break;
default:
ETY.error("red", "На сервере произошла ошибка");
break;
}
}
request.onerror = function() {
ETY.error("red", "Ошибка отправки данных. Повторите позже");
this.time = 0;
}
request.send();
},
error: function(color, text) {
document.getElementById("e_typos_error").style.display = "block";
document.getElementById("e_typos_error").innerHTML = text;
document.getElementById("e_typos_error").style.color = color;
document.getElementById("e_typos_error").style.borderColor = color;
},
text: function(text) {
document.getElementById("e_typos_user_text").style.display = "block";
document.getElementById("e_typos_user_text").innerHTML = "Ваш текст: "+text;
},
timer: function() {
var sec = this.now_time();
var time_s = this.get_storage("etersoft_typos/"+window.location.hostname+"");
if (time_s != 0) {
this.time = time_s;
}
if (this.now_time() - parseFloat(this.time) < 60000) {
return 0;
} else {
return 1;
}
},
now_time: function() {
var day = new Date();
var sec = day.getTime();
return sec;
},
get_storage: function(key) {
if (window['localStorage'] != null) {
if (!localStorage.getItem(key+"")) {
return 0;
} else {
var data = localStorage.getItem(key+"");
return data;
}
} else {
return 0;
}
},
set_storage: function(key, data) {
if (window['localStorage'] != null) {
localStorage.setItem(key+"", data);
}
}
}
<?php
define('_CMN_YES','Да');
define('_CMN_NO','Нет');
define('_PN_PAGE','Страница');
define('_PN_OF','из');
define('_PN_START','[В начало]');
define('_PN_PREVIOUS','[Пред]');
define('_PN_NEXT','[След]');
define('_PN_END','[В конец]');
define('_PN_DISPLAY_NR','На странице #');
define('_PN_RESULTS','Результаты');
define('_JAN','Январь');
define('_FEB','Февраль');
define('_MAR','Март');
define('_APR','Апрель');
define('_MAY','Май');
define('_JUN','Июнь');
define('_JUL','Июль');
define('_AUG','Август');
define('_SEP','Сентябрь');
define('_OCT','Октябрь');
define('_NOV','Ноябрь');
define('_DEC','Декабрь');
global $config_absolute_path;
/**
* Copy the named array content into the object as properties
* only existing properties of object are filled. when undefined in hash, properties wont be deleted
* @param array the input array
* @param obj byref the object to fill of any class
* @param string
* @param boolean
*/
function mosBindArrayToObject( $array, &$obj, $prefix=NULL, $checkSlashes=true ) {
if (!is_array( $array ) || !is_object( $obj )) {
return (false);
}
if ($prefix) {
foreach (get_object_vars($obj) as $k => $v) {
if (isset($array[$prefix . $k ])) {
$obj->$k = ($checkSlashes && get_magic_quotes_gpc()) ? stripslashes( $array[$k] ) : $array[$k];
}
}
} else {
foreach (get_object_vars($obj) as $k => $v) {
if (isset($array[$k])) {
$obj->$k = ($checkSlashes && get_magic_quotes_gpc()) ? stripslashes( $array[$k] ) : $array[$k];
}
}
}
return true;
}
// ----------------------------------------------------------------------------------
class mosHTML {
function makeOption( $value, $text='' ) {
$obj = new stdClass;
$obj->value = $value;
$obj->text = trim( $text ) ? $text : $value;
return $obj;
}
/**
* Generates an HTML select list
* @param array An array of objects
* @param string The value of the HTML name attribute
* @param string Additional HTML attributes for the <select> tag
* @param string The name of the object variable for the option value
* @param string The name of the object variable for the option text
* @param mixed The key that is selected
* @returns string HTML for the select list
*/
function selectList( &$arr, $tag_name, $tag_attribs, $key, $text, $selected=NULL ) {
reset( $arr );
$html = "\n<select name=\"$tag_name\" $tag_attribs>";
for ($i=0, $n=count( $arr ); $i < $n; $i++ ) {
$k = $arr[$i]->$key;
$t = $arr[$i]->$text;
$id = @$arr[$i]->id;
$extra = '';
$extra .= $id ? " id=\"" . $arr[$i]->id . "\"" : '';
if (is_array( $selected )) {
foreach ($selected as $obj) {
$k2 = $obj->$key;
if ($k == $k2) {
$extra .= " selected=\"selected\"";
break;
}
}
} else {
$extra .= ($k == $selected ? " selected=\"selected\"" : '');
}
$html .= "\n\t<option value=\"".$k."\"$extra>" . $t . "</option>";
}
$html .= "\n</select>\n";
return $html;
}
function yesnoSelectList( $tag_name, $tag_attribs, $selected, $yes=_CMN_YES, $no=_CMN_NO ) {
$arr = array(
mosHTML::makeOption( '0', $no ),
mosHTML::makeOption( '1', $yes ),
);
return mosHTML::selectList( $arr, $tag_name, $tag_attribs, 'value', 'text', $selected );
}
}
function mosRedirect( $url, $msg='' ) {
// specific filters
$iFilter = new InputFilter();
$url = $iFilter->process( $url );
$msg = $iFilter->process( $msg );
if ($iFilter->badAttributeValue( array( 'href', $url ))) {
$url = $GLOBALS['mosConfig_live_site'];
}
if (trim( $msg )) {
if (strpos( $url, '?' )) {
$url .= '&mosmsg=' . urlencode( $msg );
} else {
$url .= '?mosmsg=' . urlencode( $msg );
}
}
if (headers_sent()) {
echo "<script>document.location.href='$url';</script>\n";
} else {
@ob_end_clean(); // clear output buffer
header( "Location: $url" );
}
exit();
}
define( "_MOS_NOTRIM", 0x0001 );
define( "_MOS_ALLOWHTML", 0x0002 );
function mosGetParam( &$arr, $name, $def=null, $mask=0 ) {
$return = null;
if (isset( $arr[$name] )) {
if (is_string( $arr[$name] )) {
if (!($mask&_MOS_NOTRIM)) {
$arr[$name] = trim( $arr[$name] );
}
if (!($mask&_MOS_ALLOWHTML)) {
$arr[$name] = strip_tags( $arr[$name] );
}
if (!get_magic_quotes_gpc()) {
$arr[$name] = addslashes( $arr[$name] );
}
}
return $arr[$name];
} else {
return $def;
}
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment