Skip to content

Commit

Permalink
upload source code
Browse files Browse the repository at this point in the history
  • Loading branch information
unrelaxby committed Feb 4, 2017
0 parents commit 751b5d0
Show file tree
Hide file tree
Showing 8 changed files with 951 additions and 0 deletions.
Empty file added install.txt
Empty file.
44 changes: 44 additions & 0 deletions tv_series_install.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

require_once 'engine/api/api.class.php';


// CREATE TABLES
$dle_api->db->query("CREATE TABLE IF NOT EXISTS `".PREFIX."_tv_series` (
`id` int(11) NOT NULL,
`news_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`release_date` datetime DEFAULT NULL,
`number` int(6) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
");

$dle_api->db->query("CREATE TABLE IF NOT EXISTS `".PREFIX."_tv_series_file_sharing` (
`id` varchar(100) NOT NULL,
`icon` varchar(200) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");

$dle_api->db->query("CREATE TABLE IF NOT EXISTS `".PREFIX."_tv_series_links` (
`id` int(11) NOT NULL,
`series_id` int(11) NOT NULL,
`lang` varchar(10) NOT NULL,
`file_sharing_id` varchar(100) NOT NULL,
`url` varchar(255) NOT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `dle_tv_series_links_series_id` (`series_id`,`lang`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
");

// Install module to admin
$dle_api->install_admin_module('tv_series', 'TV Series - сериалы в полной новости', 'Модуль позволяет выводить в полной новости сериалы', 'tv_series.png');

echo 'TV Series successfully installed! All ok!';
66 changes: 66 additions & 0 deletions upload/engine/classes/sdopFields.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
(function( $ ){

$.fn.dopField = function() {

var inp = '<span class="dop-fld"><input type="text" class="vals ck edit" style="width:625px;">\
<input type="button" value="+" class="add" title="добавить">\
<input type="button" value="-" class="remove" title="удалить"></span>';

return this.each(function() {

var $this = $(this);

var origInput = $this;
var vals = origInput.val().split(',');


origInput.wrap('<span class="ins-holder" style="margin-bottom:5px" />')

var wrapper = origInput.closest('.ins-holder');

$.each(vals, function(i, el){
var input = $(inp);
$('.vals', input).val(el);
wrapper.append(input);
});

$(wrapper).on('click', '.add', function(){
wrapper.append(inp);
recalc();
});

$(wrapper).on('click', '.remove', function(){
if (wrapper.find('.dop-fld').length > 1) {
$(this).closest('.dop-fld').remove();
recalc();
}
});

$(wrapper).on('blur', '.vals', function(){
recalc();
});

$(wrapper).on('keypress', '.vals', function(){
recalc();
});

var recalc = function(){
var tmpValues = [];
$.each($('.vals', wrapper), function(){
var valvalue = $(this).val();
if (valvalue != '') tmpValues.push(valvalue);
});
origInput.val(tmpValues.join(','));
}

origInput.prop('type', 'hidden');

});

};
})( jQuery );


$(function(){
$('.sseries').dopField();
});
Loading

0 comments on commit 751b5d0

Please sign in to comment.