-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 751b5d0
Showing
8 changed files
with
951 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |
Oops, something went wrong.