Initial Git import

This commit is contained in:
Stefan Kalscheuer 2015-09-18 11:05:56 +02:00
commit 2692f2bd0c
25 changed files with 2399 additions and 0 deletions

BIN
images/dashicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
images/rss.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,43 @@
<?php
/**
* @package Dashboard
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Add to Right Now Widget
*
* @return void
*/
function wplt_dashboard_right_now() {
$total_files = wp_count_posts( 'wplt_tick' );
echo '<tr>';
echo '<td class="first b b-tags"><a href="edit.php?post_type=wplt_tick">' . $total_files->publish . '</a></td>';
echo '<td class="t tags"><a href="edit.php?post_type=wplt_tick">' . __( 'Ticks', 'wplt2' ) . '</a></td>';
echo '</tr>';
}
add_action( 'right_now_content_table_end' , 'wplt_dashboard_right_now' );
/**
* Register dashboard widgets
*
* @return void
*/
function wplt_register_dashboard_widgets() {
wp_add_dashboard_widget( 'wplt_dashboard_downloads', __( 'Download Stats', 'wplt2' ), 'wplt_dashboard_downloads_widget' );
}
//add_action( 'wp_dashboard_setup', 'wplt_register_dashboard_widgets' );
/**
* Ticks Dashboard Widget
*
* @access private
* @since 1.0
* @return void
*/
function wplt_dashboard_ticks_widget() {
echo 'Content to follow...';
}

View File

@ -0,0 +1,99 @@
<?php
/**
* @package Media Button
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Display Media Button
*
* @param string $content existing media buttons
*
* @return string $content + $output
*/
function wplt_media_button( $context ) {
if( get_post_type() != 'wplt_download' ) {
return $context . '<a href="#" id="sdm-media-button" class="button add-download" data-editor="content" title="Add Download"><span class="wp-media-buttons-icon"></span>Add Download</a>';
}
}
add_filter( 'media_buttons_context', 'wplt_media_button' );
/**
* Add Modal Window to Footer
*
* @return void
*/
function wplt_media_modal() {
global $wplt_options;
$downloads = new WP_Query( 'post_type=wplt_download&nopaging=true&orderby=title&order=ASC' );
?>
<div id="sdm-download-modal" style="display: none">
<div class="media-modal">
<a id="sdm-download-modal-close" class="media-modal-close" href="#" title="Close"><span class="media-modal-icon"></span></a>
<div class="media-modal-content">
<div class="media-frame-title">
<h1><?php _e( 'Insert Download', 'simple-downloads' ); ?></h1>
</div>
<div class="left-panel">
<div class="sdm-download-list">
<ul id="selectable_list">
<?php
while ( $downloads->have_posts() ) {
$downloads->the_post();
echo '<li data-ID="' . get_the_ID() . '">';
echo '<strong>' . get_the_title() . '</strong>';
echo '<span class="download_url">' . get_post_meta( get_the_ID(), '_wplt_file_url', true ) . '</span>';
echo '</li>';
}
?>
</ul>
</div>
</div>
<div class="right-panel">
<div class="download-details" style="display: none">
<h3><?php _e( 'Download Details', 'simple-downloads' ); ?></h3>
<label for="sdm-download-text"><?php _e( 'Text', 'simple-downloads' ); ?>:</label>
<input type="text" name="sdm-download-text" id="sdm-download-text" value="<?php echo $wplt_options['default_text']; ?>"/>
<label for="sdm-download-style"><?php _e( 'Style', 'simple-downloads' ); ?>:</label>
<select name="sdm-download-style" id="sdm-download-style">
<?php
$styles = wplt_get_shortcode_styles();
$default_style = $wplt_options['default_style'];
foreach( $styles as $key => $value ) {
$selected = ( $default_style == $key ? ' selected="selected"' : '' );
echo '<option value="' . $key . '" ' . $selected . '>' . $value . '</option>';
}
?>
</select>
<div class="sdm-download-color-container">
<label for="sdm-download-color"><?php _e( 'Color', 'simple-downloads' ); ?>:</label>
<select name="sdm-download-color" id="sdm-download-color">
<?php
$colors = wplt_get_shortcode_colors();
$default_color = $wplt_options['default_color'];
foreach( $colors as $key => $value ) {
$selected = ( $default_color == $key ? ' selected="selected"' : '' );
echo '<option value="' . $key . '" ' . $selected . '>' . $value . '</option>';
}
?>
</select>
</div>
<input id="sdm-download-button" type="button" value="<?php _e( 'Insert Download', 'simple-downloads' ); ?>" class="button-primary" />
<input id="sdm-filesize-button" type="button" value="<?php _e( 'Insert File Size', 'simple-downloads' ); ?>" class="button" />
<input id="sdm-count-button"type="button" value="<?php _e( 'Insert Download Count', 'simple-downloads' ); ?>" class="button" />
</div>
</div>
</div>
</div>
<div class="media-modal-backdrop"></div>
</div>
<?php
}
add_action( 'admin_footer', 'wplt_media_modal' );

View File

@ -0,0 +1,219 @@
<?php
/**
* @package Meta-Boxes
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Register meta boxes
*
* @return void
*/
function wplt_register_meta_boxes() {
// File
add_meta_box( 'wplt_file', __( 'File', 'wplt2' ), 'wplt_meta_box_file', 'wplt_download', 'normal', 'high' );
// Stats
add_meta_box( 'wplt_stats', __( 'Download Stats', 'wplt2' ), 'wplt_meta_box_stats', 'wplt_download', 'side', 'core' );
}
add_action( 'add_meta_boxes', 'wplt_register_meta_boxes' );
/**
* Add correct enc type for non-ajax uploads
*
* @return void
*/
function wplt_form_enctype() {
if( get_post_type() == 'wplt_download' ) {
echo ' enctype="multipart/form-data"';
}
}
add_action( 'post_edit_form_tag', 'wplt_form_enctype' );
/**
* Render file meta box
*
* @param object $post current post object
*
* @return void
*/
function wplt_meta_box_file( $post ) {
$file_url = get_post_meta( $post->ID, '_wplt_file_url', true );
$file_size = get_post_meta( $post->ID, '_wplt_file_size', true );
global $post;
$plupload_init = array(
'runtimes' => 'html5, silverlight, flash, html4',
'browse_button' => 'plupload-browse-button',
'container' => 'plupload-container',
'file_data_name' => 'async-upload',
'multiple_queues' => false,
'max_file_size' => wp_max_upload_size() . 'b',
'url' => admin_url( 'admin-ajax.php' ),
'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
'filters' => array( array( 'title' => __( 'Allowed Files' ), 'extensions' => '*' ) ),
'multipart' => true,
'urlstream_upload' => true,
// additional post data to send to our ajax hook
'multipart_params' => array(
'_ajax_nonce' => wp_create_nonce( 'wplt_download_upload' ),
'action' => 'wplt_download_upload',
'post_id' => $post->ID
),
);
// Pass to plupload
$plupload_init = apply_filters( 'plupload_init', $plupload_init );
?>
<script type="text/javascript">
var plupload_args = <?php echo json_encode( $plupload_init ); ?>;
</script>
<div id="plupload-container" class="hide-if-no-js">
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row">
File URL:
</th>
<td id="plupload-file">
<?php echo ($file_url !== '' ? $file_url : '-----' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
File Size:
</th>
<td id="plupload-file-size">
<?php echo ($file_size !== '' ? wplt_human_filesize( $file_size ) : '-----' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
</th>
<td>
<input id="plupload-browse-button" type="button" value="<?php _e( 'Select File', 'wplt2' ); ?>" class="button" />
<input id="plupload-upload-button" type="button" value="<?php _e( 'Upload', 'wplt2' ); ?>" class="button" style="display: none" />
<a id="plupload-cancel-button" href="#" style="display: none">Cancel</a>
<p class="description"><?php printf( __( 'Maximum file size: %s.', 'wplt2' ), wplt_human_filesize( wp_max_upload_size() ) ); ?></p>
<div id="plupload-progress" style="display: none">
<div class="bar" style="width: 0%"></div>
<div class="percent"><p>Uploading...</p></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="plupload-container" class="hide-if-js">
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row">
File URL:
</th>
<td id="plupload-file">
<?php echo ($file_url !== '' ? $file_url : '-----' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
File Size:
</th>
<td id="plupload-file-size">
<?php echo ($file_size !== '' ? wplt_human_filesize( $file_size ) : '-----' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
</th>
<td>
<label for="async-upload"><?php _e( 'Upload', 'wplt2' ); ?>:</label>
<input type="file" name="async-upload" id="async-upload" />
<p class="description"><?php printf( __( 'Maximum file size: %s.', 'wplt2' ), wplt_human_filesize( wp_max_upload_size() ) ); ?></p> </td>
</tr>
</tbody>
</table>
</div>
<?php
}
/**
* Save file metabox
*
* @param object $post current post object
*
* @return void
*/
function wplt_meta_box_file_save( $post_id ) {
// First check we have file present
if( isset( $_FILES['async-upload'] ) && $_FILES['async-upload']['size'] > 0 ) {
// Set upload dir
add_filter( 'upload_dir', 'wplt_set_upload_dir' );
// Upload the file
$file = wp_handle_upload( $_FILES['async-upload'], array( 'test_form' => false ) );
// Check for success
if( isset( $file['file'] ) ) {
// Post ID
$post_id = $_REQUEST['post_id'];
// Add/update post meta
update_post_meta( $post_id, '_wplt_file_url', $file['url'] );
update_post_meta( $post_id, '_wplt_file_size', $_FILES['async-upload']['size'] );
update_post_meta( $post_id, '_wplt_file_type', $file['type'] );
}
}
}
add_action( 'save_post', 'wplt_meta_box_file_save' );
/**
* Render stats meta box
*
* @param object $post current post object
*
* @return void
*/
function wplt_meta_box_stats( $post ) {
$file_count = get_post_meta( $post->ID, '_wplt_file_count', true );
?>
<div id="sdm-file-stats-container">
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row">
<label for="wplt_file_count"><?php _e( 'Count' , 'wplt2' ); ?>:</label>
</th>
<td>
<input type="text" name="wplt_file_count" class="text-small" value="<?php echo ($file_count !== '' ? $file_count : 0 ); ?>" />
</td>
</tr>
</tbody>
</table>
</div>
<?php
}
/**
* Save stats meta box
*
* @param int $post_id current post id
*
* @return void
*/
function wplt_meta_box_stats_save( $post_id ) {
if( isset( $_POST['wplt_file_count'] ) ) {
update_post_meta( $post_id, '_wplt_file_count', strip_tags( trim( $_POST['wplt_file_count'] ) ) );
}
}
add_action( 'save_post', 'wplt_meta_box_stats_save' );

View File

@ -0,0 +1,151 @@
<?php
/**
* @package Settings Page
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Register settings page
*
* @return void
*/
function wplt_register_page_settings() {
add_submenu_page( 'edit.php?post_type=wplt_tick', 'Liveticker2 ' . __( 'Settings', 'wplt2' ), __( 'Settings', 'wplt2' ), 'manage_options', 'wplt_settings', 'wplt_render_page_settings' );
}
add_action( 'admin_menu', 'wplt_register_page_settings' );
/**
* Register settings API
*
* @return void
*/
function wplt_register_settings() {
register_setting( 'wplt_settings', 'wplt2', 'wplt_validate_settings' );
// Form sections
add_settings_section( 'wplt_settings_general', __( 'General', 'wplt2' ), 'wplt_settings_general_section', __FILE__ );
add_settings_section( 'wplt_settings_uninstall', __( 'Uninstall', 'wplt2' ), 'wplt_settings_uninstall_section', __FILE__ );
// Form fields
add_settings_field( 'enable_css', __( 'Default CSS Styles', 'wplt2' ), 'wplt_settings_enable_css_field', __FILE__, 'wplt_settings_general' );
add_settings_field( 'reset_settings', __( 'Reset Settings', 'wplt2' ), 'wplt_settings_reset_settings_field', __FILE__, 'wplt_settings_uninstall' );
}
add_action( 'admin_init', 'wplt_register_settings' );
/**
* Validate settings callback
*
* @return void
*/
function wplt_validate_settings( $input ) {
$defaults = wplt_get_default_options();
$parsed = wp_parse_args( $input, $defaults );
// Fix empty default text textbox
if( trim( $input['default_text'] == '' ) ) {
$parsed['default_text'] = $defaults['default_text'];
}
return $parsed;
}
/**
* Render settings page
*
* @return void
*/
function wplt_render_page_settings() {
?>
<div class="wrap">
<div id="icon-options-general" class="icon32"><br></div>
<h2>Liveticker <?php _e( 'Settings', 'wplt2' ); ?></h2>
<?php if ( isset( $_GET['settings-updated'] ) ) {
echo '<div class="updated"><p>' . __( 'Settings updated successfully.', 'wplt2' ) . '</p></div>';
} ?>
<form action="options.php" method="post">
<?php
settings_fields( 'wplt_settings' );
do_settings_sections( __FILE__ );
?>
<p class="submit">
<input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes">
</p>
</form>
</div>
<?php
}
/**
* Render general section
*
* @return void
*/
function wplt_settings_general_section() {
return;
}
/**
* Render uninstall section
*
* @return void
*/
function wplt_settings_uninstall_section() {
return;
}
/**
* Render enable css field
*
* @return void
*/
function wplt_settings_enable_css_field() {
global $wplt_options;
$checked = $wplt_options['enable_css'];
echo '<label for="wp-liveticker2[enable_css]">';
echo '<input type="checkbox" name="wp-liveticker2[enable_css]" value="1" ' . checked( $checked, 1, false ) . ' /> ';
echo __( 'Enable', 'wplt2' );
echo '</label>';
echo '<p class="description">' . __( 'Disable this option to remove the default button styling and the Delightful Downloads CSS file.', 'wplt2' ) . '</p>';
}
/**
* Render default style field
*
* @return void
*/
function wplt_settings_default_style_field() {
global $wplt_options;
$styles = wplt_get_shortcode_styles();
$default_style = $wplt_options['default_style'];
echo '<select name="simple-downloads[default_style]">';
foreach( $styles as $key => $value ) {
$selected = ( $default_style == $key ? ' selected="selected"' : '' );
echo '<option value="' . $key . '" ' . $selected . '>' . $value . '</option>';
}
echo '</select>';
echo '<p class="description">' . __( 'The default display style.', 'wplt2' ) . '</p>';
}
/**
* Render reset settings field
*
* @return void
*/
function wplt_settings_reset_settings_field() {
global $wplt_options;
$checked = $wplt_options['reset_settings'];
echo '<label for="simple-downloads[reset_settings]">';
echo '<input type="checkbox" name="simple-downloads[reset_settings]" value="1" ' . checked( $checked, 1, false ) . ' /> ';
echo __( 'Enable', 'wplt2' );
echo '<p class="description">' . __( 'Reset plugin settings on re-activation.', 'wplt2' ) . '</p>';
echo '</label>';
}

View File

@ -0,0 +1,73 @@
<?php
/**
* @package Post Types Columns
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Download post type column headings
*
* @param array $columns default columns registered by WordPress
*
* @return void
*/
function wplt_tick_column_headings( $columns ) {
return array(
'cb' => '<input type="checkbox" />',
'title' => __( 'Title', 'wplt2' ),
'author' => __( 'Author', 'wplt2' ),
'wplt_ticker' => __( 'Ticker', 'wplt2'),
'date' => __( 'Date', 'wplt2' )
);
}
//add_filter( 'manage_wplt_tick_posts_columns', 'wplt_tick_column_headings' );
/**
* Download post type column contents
*
* @param array $column_name current column
* @param int $post_id current post id provided by WordPress
*
* @return void
*/
function wplt_tick_column_contents( $column_name, $post_id ) {
// Title column
if( $column_name == 'file' ) {
$path = get_post_meta( $post_id, '_wplt_file_url', true );
echo wplt_download_filename( $path );
}
}
add_action( 'manage_wplt_tick_posts_custom_column', 'wplt_tick_column_contents', 10, 2 );
/**
* Download post type sortable columns filter
*
* @param array $columns as set above
*
* @return void
*/
function wplt_tick_column_sortable( $columns ) {
$columns['ticks'] = 'ticks';
return $columns;
}
add_filter( 'manage_edit-wplt_tick_sortable_columns', 'wplt_tick_column_sortable' );
/**
* Download post type sortable columns action
*
* @param array $query
*
* @return void
*/
function wplt_tick_column_orderby( $query ) {
$orderby = $query->get( 'orderby');
if( $orderby == 'ticks' ) {
$query->set('meta_key','_wplt_file_count');
$query->set('orderby','meta_value_num');
}
}
add_action( 'pre_get_posts', 'wplt_tick_column_orderby' );

47
includes/ajax.php Normal file
View File

@ -0,0 +1,47 @@
<?php
/**
* @package Ajax
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Process Ajax upload file
*
* @return void
*/
function wplt_ajax_get_new_ticks() {
check_ajax_referer( 'wplt_ajax_get_new_ticks' );
// timestamp for request
$slug = $_REQUEST['sl'];
$time = $_REQUEST['ts'];
if($slug) {
// get new ticks from database
$args = array( 'post_type' => 'wplt_tick',
'posts_per_page' => '-1',
'tax_query' => array(
array( 'taxonomy' => 'wplt_ticker',
'field' => 'slug',
'terms' => $slug
)
)
);
$wp_query = new WP_Query($args);
while ($wp_query->have_posts()) : $wp_query->the_post();
$output .= '<li class="wplt_tick">
<p><span class="wplt_tick_time">'.get_the_time('d.m.Y H.i').'</span>
<span class="wplt_tick_title">'.get_the_title().'</span></p>
<p class="wplt_tick_content">'.get_the_content().'</p></li>';
endwhile;
// Echo success response
echo $output;
}
die();
}
//add_action( 'wp_ajax_wplt_download_upload', 'wplt_download_upload_ajax' );

199
includes/css/admin.css Normal file
View File

@ -0,0 +1,199 @@
/* Post Type Columns */
.wp-list-table .column-downloads,
.wp-list-table .column-file,
.wp-list-table .column-shortcode,
.wp-list-table .column-ip,
.wp-list-table .column-ddate {
width: 15%;
}
/* Download Modal Window */
#sdm-download-modal .media-modal-content {
padding: 20px;
}
#sdm-download-modal .media-modal-content .media-frame-title {
position: static;
margin: -20px -20px 0 -20px;
border-bottom: 1px solid #dfdfdf;
}
.media-modal-content .left-panel {
position: absolute;
top: 45px;
bottom: 0;
left: 0;
width: 66%;
overflow: auto;
}
.media-modal-content .right-panel {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 20%;
padding: 45px 5% 10px 5%;
border-left: 1px solid #dfdfdf;
background-color: whiteSmoke;
}
.sdm-download-list ul {
margin: 0 20px;
}
.sdm-download-list {
margin: 20px 0;
}
.sdm-download-list ul li {
margin: 10px 0;
padding: 5px;
border: 1px solid #dfdfdf;
}
.sdm-download-list ul li.ui-selected {
box-shadow: 0 0 0 1px white,0 0 0 5px #1E8CBE;
}
.sdm-download-list .download_url {
display: block;
margin-top: 3px;
color: gray;
}
.right-panel .download-details h3 {
font-weight: bold;
text-transform: uppercase;
font-size: 12px;
color: #777;
text-shadow: 0 1px 0 white;
margin: 0 0 8px;
}
.right-panel .download-details label {
display: block;
margin: 10px 0 5px;
color: #999;
}
.right-panel .download-details input[type=text] {
display: block;
width: 100%;
padding: 6px 8px;
}
.right-panel .download-details select {
display: block;
margin: 0 auto;
width: 100%;
}
.right-panel .download-details #sdm-download-button {
margin-top: 30px;
}
.right-panel .download-details input[type=button] {
display: block;
margin: 0 auto;
width: 100%;
height: auto;
margin-top: 10px;
padding: 10px 0;
font-size: 16px;
}
/* Meta Box File Buttons */
#plupload-browse-button, #plupload-upload-button {
margin-right: 4px;
}
a#plupload-cancel-button {
padding: 1px 2px;
border-bottom: 1px solid red;
color: red;
text-decoration: none;
}
a#plupload-cancel-button:hover {
background-color: red;
color: white;
}
/* Meta Box File Progress */
#plupload-progress {
position: relative;
margin-top: 10px;
width: 100%;
height: 30px;
border: 1px solid #ddd;
}
#plupload-progress .bar {
height: 30px;
background-color: rgba(255, 255, 255, 0.5);
}
#plupload-progress .percent {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 30px;
text-align: center;
font-size: 20px;
font-weight: bold;
line-height: 30px;
color: #ddd;
}
#plupload-progress .percent p {
margin: 0;
}
/* Meta Box File Success */
#plupload-container .success {
color: green;
}
#plupload-container .error {
color: red;
}
/* Menu Icon */
#menu-posts-sdm_download .wp-menu-image {
background: transparent url("/wp-content/plugins/simple-downloads/includes/images/menu.png") no-repeat;
background-position: 0 -35px !important;
}
#menu-posts-sdm_download:hover .wp-menu-image, #menu-posts-sdm_download.wp-has-current-submenu .wp-menu-image {
background-position: 0 -3px !important;
}
/* Media Button */
#sdm-media-button {
padding-left: .4em;
}
#sdm-media-button span.wp-media-buttons-icon {
background: transparent url("/wp-content/plugins/simple-downloads/includes/images/media-button.png") no-repeat;
background-position: -1px 0;
}
@media only screen and (-Webkit-min-device-pixel-ratio: 1.5),
only screen and (-moz-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min-device-pixel-ratio: 1.5) {
/* Menu Icon */
#menu-posts-sdm_download .wp-menu-image {
background-image: url("/wp-content/plugins/simple-downloads/includes/images/menu@x2.png");
background-size: 28px 64px !important;
}
/* Media Button */
#sdm-media-button span.wp-media-buttons-icon {
background-image: url("/wp-content/plugins/simple-downloads/includes/images/media-button@x2.png");
background-size: 16px 16px !important;
}
}

View File

@ -0,0 +1,168 @@
/* Button style by http://www.joepettersson.com/css3-buttons/ */
.download-button {
display: inline-block;
font-size: 12px;
text-decoration: none!important;
font-family: Helvetica, Arial, sans serif;
padding: 8px 12px;
border-radius: 3px;
-moz-border-radius: 3px;
box-shadow: inset 0px 0px 2px #fff;
-o-box-shadow: inset 0px 0px 2px #fff;
-webkit-box-shadow: inset 0px 0px 2px #fff;
-moz-box-shadow: inset 0px 0px 2px #fff;
}
.download-button:active {
box-shadow: inset 0px 0px 3px #999;
-o-box-shadow: inset 0px 0px 3px #999;
-webkit-box-shadow: inset 0px 0px 3px #999;
-moz-box-shadow: inset 0px 0px 3px #999;
}
/* The styles for the grey button */
.button-grey {
color: #444;
border: 1px solid #d0d0d0;
background-image: -moz-linear-gradient(#ededed, #e1e1e1);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e1e1e1), to(#ededed));
background-image: -webkit-linear-gradient(#ededed, #e1e1e1);
background-image: -o-linear-gradient(#ededed, #e1e1e1);
text-shadow: 1px 1px 1px #fff;
background-color: #e1e1e1;
}
.button-grey:hover {
border: 1px solid #b0b0b0;
background-image: -moz-linear-gradient(#e1e1e1, #ededed);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ededed), to(#e1e1e1));
background-image: -webkit-linear-gradient(#e1e1e1, #ededed);
background-image: -o-linear-gradient(#e1e1e1, #ededed);
background-color: #ededed;
}
.button-grey:active {border: 1px solid #666;}
/* The styles for the red button */
.button-red {
color: #923c47;
border: 1px solid #d96d7c;
background-image: -moz-linear-gradient(#f997b0, #f6677b);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f6677b), to(#f997b0));
background-image: -webkit-linear-gradient(#f997b0, #f6677b);
background-image: -o-linear-gradient(#f997b0, #f6677b);
text-shadow: 1px 1px 1px #fdbcc7;
background-color: #f6677b;
}
.button-red:hover {
border: 1px solid #c75964;
background-image: -moz-linear-gradient(#f6677b, #f997b0);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f997b0), to(#f6677b));
background-image: -webkit-linear-gradient(#f6677b, #f997b0);
background-image: -o-linear-gradient(#f6677b, #f997b0);
background-color: #f997b0;
}
.button-red:active {border: 1px solid #ab3e4b;}
/* The styles for the blue button */
.button-blue {
color: #41788c;
border: 1px solid #6fb1c7;
background-image: -moz-linear-gradient(#aae5f7, #73d0f1);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#73d0f1), to(#aae5f7));
background-image: -webkit-linear-gradient(#aae5f7, #73d0f1);
background-image: -o-linear-gradient(#aae5f7, #73d0f1);
text-shadow: 1px 1px 1px #bfeafb;
background-color: #73d0f1;
}
.button-blue:hover {
border: 1px solid #4690ad;
background-image: -moz-linear-gradient(#73d0f1, #aae5f7);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#aae5f7), to(#73d0f1));
background-image: -webkit-linear-gradient(#73d0f1, #aae5f7);
background-image: -o-linear-gradient(#73d0f1, #aae5f7);
background-color: #aae5f7;
}
.button-blue:active {border: 1px solid #3b778b;}
/* The styles for the green button */
.button-green {
color: #5a742d;
border: 1px solid #95b959;
background-image: -moz-linear-gradient(#cae387, #a5cb5e);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#a5cb5e), to(#cae387));
background-image: -webkit-linear-gradient(#cae387, #a5cb5e);
background-image: -o-linear-gradient(#cae387, #a5cb5e);
text-shadow: 1px 1px 1px #dff4bc;
background-color: #a5cb5e;
}
.button-green:hover {
border: 1px solid #687e30;
background-image: -moz-linear-gradient(#a5cb5e, #cae387);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#cae387), to(#a5cb5e));
background-image: -webkit-linear-gradient(#a5cb5e, #cae387);
background-image: -o-linear-gradient(#a5cb5e, #cae387);
background-color: #cae387;
}
.button-green:active {border: 1px solid #506320;}
/* The styles for the black button */
.button-black {
color: #fff;
border: 1px solid #4d4d4d;
background-image: -moz-linear-gradient(#656565, #454545);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#454545), to(#656565));
background-image: -webkit-linear-gradient(#656565, #454545);
background-image: -o-linear-gradient(#656565, #454545);
text-shadow: 1px 1px 1px #6d6d6d;
background-color: #454545;
}
.button-black:hover {
border: 1px solid #363636;
background-image: -moz-linear-gradient(#454545, #656565);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#656565), to(#454545));
background-image: -webkit-linear-gradient(#454545, #656565);
background-image: -o-linear-gradient(#454545, #656565);
background-color: #656565;
}
.button-black:active {border: 1px solid #000;}
/* The styles for the yellow button */
.button-yellow {
color: #986a39;
border: 1px solid #e6b650;
background-image: -moz-linear-gradient(#ffd974, #febf4d);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#febf4d), to(#ffd974));
background-image: -webkit-linear-gradient(#ffd974, #febf4d);
background-image: -o-linear-gradient(#ffd974, #febf4d);
text-shadow: 1px 1px 1px #fbe5ac;
background-color: #febf4d;
}
.button-yellow:hover {
border: 1px solid #c1913d;
background-image: -moz-linear-gradient(#febf4d, #ffd974);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ffd974), to(#febf4d));
background-image: -webkit-linear-gradient(#febf4d, #ffd974);
background-image: -o-linear-gradient(#febf4d, #ffd974);
background-color: #ffd974;
}
.button-yellow:active {border: 1px solid #936b26;}
/* The styles for the purple button */
.button-purple {
color: #7e5d7c;
border: 1px solid #cd93c6;
background-image: -moz-linear-gradient(#e9c4e3, #d798d1);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#d798d1), to(#e9c4e3));
background-image: -webkit-linear-gradient(#e9c4e3, #d798d1);
background-image: -o-linear-gradient(#e9c4e3, #d798d1);
text-shadow: 1px 1px 1px #f1ceef;
background-color: #d798d1;
}
.button-purple:hover {
border: 1px solid #886382;
background-image: -moz-linear-gradient(#d798d1, #e9c4e3);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e9c4e3), to(#d798d1));
background-image: -webkit-linear-gradient(#d798d1, #e9c4e3);
background-image: -o-linear-gradient(#d798d1, #e9c4e3);
background-color: #e9c4e3;
}
.button-purple:active {border: 1px solid #6a4664;}

View File

@ -0,0 +1,12 @@
ul.wplt_ticker{list-style-type:none;}
li.wplt_tick{background-color:#F5F5F5;margin:0.1em;padding:0.1em 0.3em;}
li.wplt_tick p{margin:0.3em;}
span.wplt_tick_time{color:#002C58;font-size:0.7em;font-style:italic;}
span.wplt_tick_title{color:#002C58;font-weight:bold;margin-left:0.5em;}
p.wplt_tick_content{margin-top:-0.7em;text-indent:0.5em;}
ul.wplt_widget{list-style-type:none;margin-top:-0.5em;}
ul.wplt_widget li{text-align:left;}
span.wplt_widget_time{font-size:0.7em;font-style:italic;}
span.wplt_widget_content{color:#002C58;text-indent:0.2em;}
span.wplt_widget_content_new{color:#800000;text-indent:0.2em;}
p.wplt_widget_link{text-align:right;}

19
includes/functions.php Normal file
View File

@ -0,0 +1,19 @@
<?php
/**
* @package Functions
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Returns default options
*
* @return array
*/
function wplt_get_default_options() {
return array(
'enable_css' => 1,
'reset_settings' => 0 z
);
}

BIN
includes/images/rss.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,71 @@
jQuery( document ).ready( function( $ ){
var uploader = new plupload.Uploader( plupload_args );
// User clicks upload
$( '#plupload-upload-button' ).click( function( e ) {
$( '#plupload-upload-button' ).fadeOut( 'fast' );
$( '#plupload-cancel-button' ).fadeOut( 'fast' );
$( '#plupload-progress' ).slideDown( 'fast', function() {
uploader.start();
} );
e.preventDefault();
} );
// User clicks cancel
$( '#plupload-cancel-button' ).click( function( e ) {
// Empty queue
uploader.splice();
e.preventDefault();
$( '#plupload-file' ).html( '----' );
$( '#plupload-file-size' ).html( '----' );
$( '#plupload-browse-button' ).removeAttr( 'disabled' );
$( '#plupload-upload-button' ).fadeOut( 'fast' );
$( '#plupload-cancel-button' ).fadeOut( 'fast' );
} );
// Init
uploader.init();
// File added to queue
uploader.bind('FilesAdded', function( up, files ) {
plupload.each( files, function( file ) {
$( '#plupload-file' ).html( file.name );
$( '#plupload-file-size' ).html( plupload.formatSize( file.size ) );
} );
$( '#plupload-browse-button' ).attr( 'disabled', 'disabled' );
$( '#plupload-upload-button' ).fadeIn( 'fast' );
$( '#plupload-cancel-button' ).fadeIn( 'fast' );
up.refresh();
} );
// Error
uploader.bind( 'Error', function( up, err ) {
$( '#plupload-file' ).html( '<span class="error">' + err.message + '</span>' );
$( '#plupload-file-size' ).html( '----' );
up.refresh();
} );
// Progress bar
uploader.bind( 'UploadProgress', function( up, file ) {
$( '#plupload-progress .bar' ).css( 'width', file.percent + '%' );
$( '#plupload-progress .percent' ).html( '<p>' + file.percent + '%</p>' );
} );
// File uploaded
uploader.bind( 'FileUploaded', function( up, file, response ) {
$( '#plupload-browse-button' ).removeAttr( 'disabled' );
$( '#plupload-upload-button' ).fadeOut( 'fast' );
$( '#plupload-cancel-button' ).fadeOut( 'fast' );
$( '#plupload-progress' ).slideUp( 'fast' );
$( '#plupload-file' ).html( '<span class="success">' + response.response + '</span>' );
} );
} );

92
includes/js/admin-post.js Normal file
View File

@ -0,0 +1,92 @@
jQuery( document ).ready( function( $ ){
var download_id;
// Display download modal
$( '#sdm-media-button' ).click( function( e ) {
$( '#sdm-download-modal' ).show();
e.preventDefault();
} );
// Close download modal
$( '#sdm-download-modal-close' ).click( function( e ) {
$( '#sdm-download-modal' ).hide();
e.preventDefault();
} );
$( '.media-modal-backdrop' ).click( function() {
$( '#sdm-download-modal' ).hide();
} );
// Hide/show color select
if( $( '#sdm-download-style' ).val() == 'button' ) {
$( '.sdm-download-color-container' ).show();
}
else {
$( '.sdm-download-color-container' ).hide();
}
// Hide/show color select on change
$( '#sdm-download-style' ).change( function() {
if( $( '#sdm-download-style' ).val() == 'button' ) {
$( '.sdm-download-color-container' ).slisdmwn();
}
else {
$( '.sdm-download-color-container' ).slideUp();
}
} );
// Selectable list items
var selectableOpts = {
selected: function( e, ui ) {
download_id = $( ui.selected ).attr( 'data-ID' );
$( '.download-details' ).show();
}
};
// Set selectable item
$( '#selectable_list' ).selectable( selectableOpts );
// Download insert button
$( '#sdm-download-button' ).click( function() {
var download_text = $( '#sdm-download-text' ).val();
var download_style = $( '#sdm-download-style' ).val();
var download_color = $( '#sdm-download-color' ).val();
// Check if button and add color
if( download_style == 'button' ) {
color = ' color="' + download_color + '"'
}
else {
color = ''
}
// Add to editor
window.send_to_editor( '[download id=' + download_id + ' text="' + download_text + '" style="' + download_style + '"' + color + ']' );
// Hide modal
$( '#sdm-download-modal' ).hide();
} );
// Download filesize button
$( '#sdm-filesize-button' ).click( function() {
// Add to editor
window.send_to_editor( '[download_size id=' + download_id + ']' );
// Hide modal
$( '#sdm-download-modal' ).hide();
} );
// Download count button
$( '#sdm-count-button' ).click( function() {
// Add to editor
window.send_to_editor( '[download_count id=' + download_id + ']' );
// Hide modal
$( '#sdm-download-modal' ).hide();
} );
} );

78
includes/post-types.php Normal file
View File

@ -0,0 +1,78 @@
<?php
/**
* @package Post Types
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Register tick post type
*
* @return void
*/
function wplt_tick_post_type() {
$args = array(
'labels' => array(
'name' => __( 'Ticks', 'wplt2' ),
'singular_name' => __( 'Tick', 'wplt2' ),
'add_new' => __( 'Add New', 'wplt2' ),
'add_new_item' => __( 'Add New Tick', 'wplt2' ),
'edit_item' => __( 'Edit Tick', 'wplt2' ),
'new_item' => __( 'New Tick', 'wplt2' ),
'all_items' => __( 'All Ticks', 'wplt2' ),
'view_item' => __( 'View Tick', 'wplt2' ),
'search_items' => __( 'Search Ticks', 'wplt2' ),
'not_found' => __( 'No Ticks found', 'wplt2' ),
'not_found_in_trash' => __( 'No Ticks found in Trash', 'wplt2' ),
'parent_item_colon' => '',
'menu_name' => __( 'Liveticker', 'wplt2' )
),
'public' => false,
'show_ui' => true,
'show_in_menu' => true,
'menu_icon' => 'dashicons-rss',
'capability_type' => 'post',
'supports' => array( 'title', 'editor', 'author'),
'taxonomies' => array('wplt_ticker')
);
register_post_type( 'wplt_tick', $args );
}
add_action( 'init', 'wplt_tick_post_type' );
/**
* Register custom taxamony (category)
*
* @return void
*/
//hook into the init action and call create_book_taxonomies when it fires
add_action( 'init', 'wplt_ticker_taxonomy', 0 );
//create two taxonomies, genres and writers for the post type "book"
function wplt_ticker_taxonomy()
{
// Add new taxonomy, make it hierarchical (like categories)
$labels = array(
'name' => _x( 'Ticker', 'taxonomy general name' ),
'singular_name' => _x( 'Ticker', 'taxonomy singular name' ),
'search_items' => __( 'Search Tickers', 'wplt2' ),
'all_items' => __( 'All Tickers', 'wplt2' ),
'parent_item' => __( 'Parent Ticker', 'wplt2' ),
'parent_item_colon' => __( 'Parent Ticker:', 'wplt2' ),
'edit_item' => __( 'Edit Ticker', 'wplt2' ),
'update_item' => __( 'Update Ticker', 'wplt2' ),
'add_new_item' => __( 'Add New Ticker', 'wplt2' ),
'new_item_name' => __( 'New Ticker', 'wplt2' ),
'menu_name' => __( 'Ticker', 'wplt2' ),
);
register_taxonomy('wplt_ticker',array('wplt_tick'), array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
));
}

65
includes/rss.php Normal file
View File

@ -0,0 +1,65 @@
<?php
/**
* @package Scripts
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Hook RSS function
* @return void
*/
if (strpos($_SERVER['REQUEST_URI'], '/feed/liveticker/') !== false) {
$args = array();
$args['ticker_slug'] = substr($_SERVER['SCRIPT_NAME'], 1);
wplt_print_feed($args);
exit;
}
function wplt_print_feed( $arguments ) {
$args = array( 'post_type' => 'wplt_tick',
'tax_query' => array(
array( 'taxonomy' => 'wplt_ticker',
'field' => 'slug',
'terms' => $arguments['ticker_slug']
)
)
);
global $wpdb;
$sql = "SELECT `ID`, DATE_FORMAT(`post_date`,'%a, %d %b %Y %T') AS `post_date_rfc`, `post_content`, `post_title` FROM `".$wpdb->prefix."posts` WHERE `post_type` = 'wplt_tick' AND `post_status` = 'publish' ORDER BY `post_date` DESC;";
$entries = $wpdb->get_results($sql);
date_default_timezone_set("Europe/Berlin");
// modify header information
header("Content-Type: application/rss+xml; charset=UTF-8");
// generate file head
$rss = '<?xml version="1.0" encoding="UTF-8"?>';
$rss .= '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">';
$rss .= '<channel><title>Lager Live</title>';
$rss .= '<link>http://'.$_SERVER['SERVER_NAME'].'/lagerticker</link>';
$rss .= '<atom:link href="http://'.$_SERVER['SERVER_NAME'].''.$_SERVER['REQUEST_URI'].'" rel="self" type="application/rss+xml" />';
$rss .= '<description></description>';
$rss .= '<language>de-de</language>';
$rss .= '<pubDate>'.date("r").'</pubDate>';
// build entries
foreach ( $entries as $entry ) {
//print_r($entry);
$rss .= '<item><title>'.mb_convert_encoding($entry->post_title, "ISO-8859-1", "UTF-8") .'</title>';
$rss .= '<link>http://www.dpsg-hardenberg.org/lagerticker</link>';
$rss .= '<pubDate>'.$entry->post_date_rfc.' '.date('O').'</pubDate>';
$rss .= '<description><![CDATA['.utf8_encode(mb_convert_encoding($entry->post_content, "ISO-8859-1", "UTF-8")).']]></description></item>';
}
// generate document foot
$rss .= '</channel></rss>';
print $rss;
}

55
includes/scripts.php Normal file
View File

@ -0,0 +1,55 @@
<?php
/**
* @package Scripts
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Register scripts and styles
*
* @param string $page current page
*
* @return bool
*/
function wplt_enqueue_scripts( $page ) {
global $wplt_options;
// Register frontend CSS
wp_register_style( 'wplt-css', WPLT_PLUGIN_URL . 'includes/css/wp-liveticker2.css', '', '1.0', 'all' );
// Enqueue frontend CSS if option is enabled
if( $wplt_options['enable_css'] ) {
wp_enqueue_style( 'wplt-css' );
}
}
add_action( 'wp_enqueue_scripts', 'wplt_enqueue_scripts' );
/**
* Register admin scripts and style
*
* @param string $page current page
*
* @return bool
*/
function wplt_admin_enqueue_scripts( $page ) {
// Register scripts
wp_register_script( 'wplt-admin-js-post', WPLT_PLUGIN_URL . 'includes/js/admin-post.js', array( 'jquery', 'jquery-ui-selectable' ), '1.0', true );
wp_register_script( 'wplt-admin-js-post-download', WPLT_PLUGIN_URL . 'includes/js/admin-post-download.js', array( 'jquery', 'plupload-all' ), '1.0', true );
// Enqueue on all admin pages
wp_enqueue_style( 'wplt-admin-css', WPLT_PLUGIN_URL . 'includes/css/admin.css' );
// Enqueue on wplt_download post add/edit screen
if( in_array( $page, array( 'post.php', 'post-new.php', 'post-edit.php' ) ) && get_post_type() == 'wplt_download' ) {
wp_enqueue_script( 'plupload-all' );
wp_enqueue_script( 'wplt-admin-js-post-tick' );
}
// Enqueue on all other add/edit screen
if( in_array( $page, array( 'post.php', 'post-new.php', 'post-edit.php', 'page.php' ) ) && get_post_type() != 'wplt_download' ) {
wp_enqueue_script( 'wplt-admin-js-post' );
}
}
//add_action( 'admin_enqueue_scripts', 'wplt_admin_enqueue_scripts' );

68
includes/shortcodes.php Normal file
View File

@ -0,0 +1,68 @@
<?php
/**
* @package Shortcodes
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Allow shortcodes in widgets
*/
add_filter( 'widget_text', 'do_shortcode' );
add_filter( 'wp_ajax_get_new_ticks', array( $this, 'wplt_ajax_get_new_ticks' ) );
/**
* Output Liveticker
*
* @param array atts shortcode options
*
* @return string
*/
function wplt_shortcode_ticker_show( $atts ) {
global $wplt_options;
/*$wplt_ticker_options = array();
extract(
shortcode_atts( array(
'id' => $wplt_ticker_options['id'],
'count' => $wplt_ticker_options['count'],
'order' => $wplt_ticker_options['order']
), $atts )
);*/
if($atts[0])
{
if(!$atts[1]) $atts[1] = -1;
$output .= '<ul class="wplt_ticker">';
$args = array( 'post_type' => 'wplt_tick',
'posts_per_page' => $atts[1],
'tax_query' => array(
array( 'taxonomy' => 'wplt_ticker',
'field' => 'slug',
'terms' => $atts[0]
)
)
);
$wp_query = new WP_Query($args);
while ($wp_query->have_posts()) : $wp_query->the_post();
$output .= '<li class="wplt_tick">
<p><span class="wplt_tick_time">'.get_the_time('d.m.Y H.i').'</span>
<span class="wplt_tick_title">'.get_the_title().'</span></p>
<p class="wplt_tick_content">'.get_the_content().'</p></li>';
endwhile;
$output .= '</ul>';
$output .= '<a href="/feed/liveticker/lager-live"><img class="wplt_rss" src="/wp-content/plugins/wp-liveticker2/images/rss.jpg" alt="RSS" /></a>';
}
return $output;
}
add_shortcode( 'liveticker', 'wplt_shortcode_ticker_show' );

128
includes/widget.php Normal file
View File

@ -0,0 +1,128 @@
<?php
class wplt_widget extends WP_Widget {
function wplt_widget() {
parent::WP_Widget( false, $name = 'Liveticker' );
}
function widget( $args, $instance ) {
extract( $args );
$title = apply_filters( 'wplt_catlit', $instance['title'] );
$category = apply_filters( 'wplt_catlit', $instance['category'] );
$count = apply_filters( 'wplt_catlit', $instance['count'] );
$link = apply_filters( 'wplt_catlit', $instance['link'] );
$highlight = apply_filters( 'wplt_catlit', $instance['highlight'] );
$highlight_time = apply_filters( 'wplt_catlit', $instance['highlight_time'] );
$ajax = apply_filters( 'wplt_catlit', $instance['ajax'] );
?>
<?php
echo $before_widget;
?>
<?php
if ($title) {
echo $before_title . $title . $after_title;
}
?>
<ul class="wplt_widget">
<?php
$args = array( 'post_type' => 'wplt_tick',
'tax_query' => array(
array( 'taxonomy' => 'wplt_ticker',
'field' => 'slug',
'terms' => $category,
)
)
);
$wp_query = new WP_Query($args);
while ($wp_query->have_posts()) : $wp_query->the_post();
?>
<li><span class="wplt_widget_time"><?php echo get_the_time('d.m.Y - H.i'); ?></span><span class="wplt_widget_content<?php if($highlight=="1" && get_the_time('U') > (time()-$highlight_time)) echo '_new'; ?>"><br /><?php echo the_title(); ?></span></li>
<?php
if( $count > 0 && ++$cnt == $count ) break;
endwhile;
?>
</ul>
<?php
if ($link)
print '<p class="wplt_widget_link"><a href="'.$link.'">'.__( 'show all', 'wplt2' ).'...</a></p>';
echo $after_widget;
?>
<?php
}
function update( $new_instance, $old_instance ) {
return $new_instance;
}
function form( $instance ) {
$title = esc_attr( $instance['title'] );
$category = esc_attr( $instance['category'] );
$count = esc_attr( $instance['count'] );
$link = esc_attr( $instance['link'] );
$highlight = esc_attr( $instance['highlight'] );
$highlight_time = esc_attr( $instance['highlight_time'] );
$ajax = esc_attr( $instance['ajax'] );
$categories = get_terms('wplt_ticker', 'orderby=name&order=ASC');
?>
<table>
<tr>
<td><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label></td>
<td><input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></td>
</tr>
<tr>
<td> <label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Ticker:', 'wplt2' ); ?></label></td>
<td>
<select id="<?php echo $this->get_field_id( 'category' ); ?>" name="<?php echo $this->get_field_name( 'category' ); ?>">
<?php foreach ($categories as $cat) {
echo '<option value="'.$cat->slug.'"'; if($category==$cat->slug) echo ' selected="selected"'; echo '>'.$cat->name.'</option>';
} ?>
</select>
</td>
</tr>
<tr>
<td><label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e( 'Number of Ticks:', 'wplt2' ); ?></label></td>
<td>
<select id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>">
<option value="0"<?php if($count==0) echo ' selected="selected"' ?>><?php _e('all','wplt2');?></option>
<option value="1"<?php if($count==1) echo ' selected="selected"' ?>>1</option><option value="2"<?php if($count==2) echo ' selected="selected"' ?>>2</option>
<option value="3"<?php if($count==3) echo ' selected="selected"' ?>>3</option><option value="4"<?php if($count==4) echo ' selected="selected"' ?>>4</option>
<option value="5"<?php if($count==5) echo ' selected="selected"' ?>>5</option><option value="6"<?php if($count==6) echo ' selected="selected"' ?>>6</option>
<option value="7"<?php if($count==7) echo ' selected="selected"' ?>>7</option><option value="8"<?php if($count==8) echo ' selected="selected"' ?>>8</option>
<option value="9"<?php if($count==9) echo ' selected="selected"' ?>>9</option><option value="10"<?php if($count==10) echo ' selected="selected"' ?>>10</option>
</select>
</td>
</tr>
<tr>
<td><label for="<?php echo $this->get_field_id( 'link' ); ?>"><?php _e( 'Link (optional):', 'wplt2' ); ?></label></td>
<td><input class="widefat" id="<?php echo $this->get_field_id( 'link' ); ?>" name="<?php echo $this->get_field_name( 'link' ); ?>" type="text" value="<?php echo $link; ?>" /></td>
</tr>
<tr>
<td><label for="<?php echo $this->get_field_id( 'highlight' ); ?>"><?php _e( 'Highlight new:', 'wplt2' ); ?></label></td>
<td><input class="widefat" id="<?php echo $this->get_field_id( 'highlight' ); ?>" name="<?php echo $this->get_field_name( 'highlight' ); ?>" type="checkbox" value="1" <?php if($highlight=="1") echo ' checked="checked"'; ?> /></td>
</tr>
<tr>
<td><label for="<?php echo $this->get_field_id( 'highlight_time' ); ?>"><?php _e( 'Highlight time [s]:', 'wplt2' ); ?></label></td>
<td><input class="widefat" id="<?php echo $this->get_field_id( 'highlight_time' ); ?>" name="<?php echo $this->get_field_name( 'highlight_time' ); ?>" type="text" value="<?php echo $highlight_time; ?>" /></td>
</tr>
<tr>
<td><label for="<?php echo $this->get_field_id( 'ajax' ); ?>"><?php _e( 'Auto refresh:', 'wplt2' ); ?></label></td>
<td><input class="widefat" id="<?php echo $this->get_field_id( 'ajax' ); ?>" name="<?php echo $this->get_field_name( 'ajax' ); ?>" type="checkbox" value="1"<?php if($ajax=="1") echo ' checked="checked"'; ?> disabled="disabled" /> <small><?php _e( '(enables ajax)', 'wplt2' ); ?></small></td>
</tr>
</table>
<?php
}
}
add_action( 'widgets_init', 'wplt_widget_init' );
function wplt_widget_init() {
register_widget( 'wplt_widget' );
}

BIN
lang/wplt2-de_DE.mo Normal file

Binary file not shown.

331
lang/wplt2-de_DE.po Normal file
View File

@ -0,0 +1,331 @@
msgid ""
msgstr ""
"Project-Id-Version: wplt2\n"
"POT-Creation-Date: 2014-08-11 21:26+0100\n"
"PO-Revision-Date: 2014-08-11 21:26+0100\n"
"Last-Translator: Stefan Kalscheuer\n"
"Language-Team: \n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.4\n"
"X-Poedit-KeywordsList: __;_x;_e\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-SearchPath-0: ../includes\n"
#: ../includes/post-types.php:17 ../includes/admin/dashboard.php:19
msgid "Ticks"
msgstr "Ticks"
#: ../includes/post-types.php:18
msgid "Tick"
msgstr "Tick"
#: ../includes/post-types.php:19
msgid "Add New"
msgstr "Neu"
#: ../includes/post-types.php:20
msgid "Add New Tick"
msgstr "Neuer Tick"
#: ../includes/post-types.php:21
msgid "Edit Tick"
msgstr "Tick bearbeiten"
#: ../includes/post-types.php:22
msgid "New Tick"
msgstr "Neuer Tick"
#: ../includes/post-types.php:23
msgid "All Ticks"
msgstr "Alle Ticks"
#: ../includes/post-types.php:24
msgid "View Tick"
msgstr "Ticks anzeigen"
#: ../includes/post-types.php:25
msgid "Search Ticks"
msgstr "Ticks suchen"
#: ../includes/post-types.php:26
msgid "No Ticks found"
msgstr "Keine Ticks gefunden"
#: ../includes/post-types.php:27
msgid "No Ticks found in Trash"
msgstr "Keine Ticks im Papierkorb gefunden"
#: ../includes/post-types.php:29
msgid "Liveticker"
msgstr "Liveticker"
#: ../includes/post-types.php:58 ../includes/post-types.php:59
#: ../includes/post-types.php:68 ../includes/admin/post-types-columns.php:21
msgid "Ticker"
msgstr "Ticker"
#: ../includes/post-types.php:60
msgid "Search Tickers"
msgstr "Ticker suchen"
#: ../includes/post-types.php:61
msgid "All Tickers"
msgstr "Alle Ticker"
#: ../includes/post-types.php:62
msgid "Parent Ticker"
msgstr "Übergeordneter Ticker"
#: ../includes/post-types.php:63
msgid "Parent Ticker:"
msgstr "Übergeordneter Ticker:"
#: ../includes/post-types.php:64
msgid "Edit Ticker"
msgstr "Ticker bearbeiten"
#: ../includes/post-types.php:65
msgid "Update Ticker"
msgstr "Ticker aktualisieren"
#: ../includes/post-types.php:66
msgid "Add New Ticker"
msgstr "Neuen Ticker hinzufügen"
#: ../includes/post-types.php:67
msgid "New Ticker"
msgstr "Neuer Ticker"
#: ../includes/widget.php:51
msgid "show all"
msgstr "alle anzeigen"
#: ../includes/widget.php:75
msgid "Title:"
msgstr "Titel:"
#: ../includes/widget.php:79
msgid "Ticker:"
msgstr "Ticker:"
#: ../includes/widget.php:89
msgid "Number of Ticks:"
msgstr "Anzahl der Einträge:"
#: ../includes/widget.php:92
msgid "all"
msgstr "Alle"
#: ../includes/widget.php:102
msgid "Link (optional):"
msgstr "Link (optional):"
#: ../includes/widget.php:106
msgid "Highlight new:"
msgstr "Neue hervorheben:"
#: ../includes/widget.php:110
msgid "Highlight time [s]:"
msgstr "Hervorhebungszeit [s]:"
#: ../includes/widget.php:114
msgid "Auto refresh:"
msgstr "Autom. aktualisieren:"
#: ../includes/widget.php:115
msgid "(enables ajax)"
msgstr "(aktiviert Ajax)"
#: ../includes/admin/dashboard.php:30 ../includes/admin/meta-boxes.php:18
msgid "Download Stats"
msgstr "Download Statistik"
#: ../includes/admin/media-button.php:39 ../includes/admin/media-button.php:87
msgid "Insert Download"
msgstr "Download Einfügen"
#: ../includes/admin/media-button.php:58
msgid "Download Details"
msgstr "Download Details"
#: ../includes/admin/media-button.php:59
msgid "Text"
msgstr "Text"
#: ../includes/admin/media-button.php:61
msgid "Style"
msgstr "Stil"
#: ../includes/admin/media-button.php:74
msgid "Color"
msgstr "Farbe"
#: ../includes/admin/media-button.php:88
msgid "Insert File Size"
msgstr "Dateigröße einfügen"
#: ../includes/admin/media-button.php:89
msgid "Insert Download Count"
msgstr "Download Zähler einfügen"
#: ../includes/admin/meta-boxes.php:16
msgid "File"
msgstr "Datei"
#: ../includes/admin/meta-boxes.php:57
msgid "Allowed Files"
msgstr "Erlaubte Dateien"
#: ../includes/admin/meta-boxes.php:101
msgid "Select File"
msgstr "Datei auswählen"
#: ../includes/admin/meta-boxes.php:102 ../includes/admin/meta-boxes.php:139
msgid "Upload"
msgstr "Upload"
#: ../includes/admin/meta-boxes.php:104 ../includes/admin/meta-boxes.php:141
#, php-format
msgid "Maximum file size: %s."
msgstr "Maximale Dateigröße: %s."
#: ../includes/admin/meta-boxes.php:194
msgid "Count"
msgstr "Anzahl"
#: ../includes/admin/post-types-columns.php:19
msgid "Title"
msgstr "Titel"
#: ../includes/admin/post-types-columns.php:20
msgid "Author"
msgstr "Autor"
#: ../includes/admin/post-types-columns.php:22
msgid "Date"
msgstr "Datum"
#: ../includes/admin/page-settings.php:15
#: ../includes/admin/page-settings.php:64
msgid "Settings"
msgstr "Einstellungen"
#: ../includes/admin/page-settings.php:28
msgid "General"
msgstr "Allgemein"
#: ../includes/admin/page-settings.php:29
msgid "Uninstall"
msgstr "Deinstalliern"
#: ../includes/admin/page-settings.php:32
msgid "Default CSS Styles"
msgstr "Standard CSS Style"
#: ../includes/admin/page-settings.php:33
msgid "Reset Settings"
msgstr "Einstellungen zurücksetzen"
#: ../includes/admin/page-settings.php:66
msgid "Settings updated successfully."
msgstr "Einstellungen erfolgreich aktualisiert"
#: ../includes/admin/page-settings.php:111
#: ../includes/admin/page-settings.php:148
msgid "Enable"
msgstr "Aktivieren"
#: ../includes/admin/page-settings.php:113
msgid ""
"Disable this option to remove the default button styling and the Delightful "
"Downloads CSS file."
msgstr ""
"Deaktiviere diese Option, um den Standard Style und die CSS Datei zu "
"entfernen."
#: ../includes/admin/page-settings.php:133
msgid "The default display style."
msgstr " "
#: ../includes/admin/page-settings.php:149
msgid "Reset plugin settings on re-activation."
msgstr " "
#~ msgid "Category"
#~ msgstr "Kategorie"
#~ msgid "Search Categories"
#~ msgstr "Kategorien suchen"
#~ msgid "All Categories"
#~ msgstr "Alle Kategorien"
#~ msgid "Edit Category"
#~ msgstr "Kategorie bearbeiten"
#~ msgid "Add New Category"
#~ msgstr "Neue Kategorie"
#~ msgid "New Category Name"
#~ msgstr "Neuer Kategorie Name"
#~ msgid "File does not exist: "
#~ msgstr "Datei existiert nicht:"
#~ msgid "File does not exist!"
#~ msgstr "Datei existiert nicht!"
#~ msgid "Invalid download: "
#~ msgstr "Ungültiger Download"
#~ msgid "Invalid download."
#~ msgstr "Ungültiger Download"
#~ msgid "User does not have permission to access file."
#~ msgstr "Benutzer hat keine Rechte, auf die Datie zuzugreifen"
#~ msgid "Please login to download this file!"
#~ msgstr "Bitte einloggen zum Herunterladen der Datei!"
#~ msgid "Shortcodes"
#~ msgstr "Shortcodes"
#~ msgid "Members Download"
#~ msgstr "Mitglieder Download"
#~ msgid "Non-Members Redirect"
#~ msgstr "Nicht-Mitglieder Weiterleitung"
#~ msgid "Default Text"
#~ msgstr "Standard Text"
#~ msgid "Default Style"
#~ msgstr "Standard Style"
#~ msgid "Default Color"
#~ msgstr "Standard Farbe"
#~ msgid "Member Only"
#~ msgstr "Nur Mitglieder"
#~ msgid "Allow only logged in users to download files."
#~ msgstr "Erlaube nur andemeldeten Benutzern, die Datei herunterzuladen."
#~ msgid ""
#~ "The page to redirect non-logged in users when attempting to download a "
#~ "file. If no page is selected a default error will be displayed."
#~ msgstr ""
#~ "DIe Seite, auf die nicht angemeldete Benutzer weitergeleitet werden, wenn "
#~ "die versuchen eine Datei herunterzuladen."
#~ msgid ""
#~ "The default text displayed on link and button styles shortcode. Use %title"
#~ "% to automatically insert download title."
#~ msgstr " "
#~ msgid "The default button color."
#~ msgstr " "

339
license.txt Normal file
View File

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

48
readme.txt Normal file
View File

@ -0,0 +1,48 @@
=== WP-Liveticker 2 ===
Contributors: stkl
Tags: liveticker, feed, rss
Requires at least: 3.8
Tested up to: 3.9.2
Stable tag: beta
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
A simple liveticker plugin for WordPress.
== Description ==
WP-Liveticker 2 is a simple liveticker plugin for WordPress. Easily add multiple livetickers, add them to posts with shortcode or use them as Widget.
= Features =
+ Handle multiple Tickers.
+ RSS feed capability.
+ Shortcode to display liveticker.
+ Ability to customise through CSS.
+ Add ticker to sidebar widgets.
+ Localization support.
== Installation ==
1. Upload `wp-liveticker2` to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to Liveticker menu to start.
== Frequently asked questions ==
= How do I display a liveticker on my post/page? =
Use the shortcode [liveticker2 id="slug"].
== Screenshots ==
1. Downloads overview screen.
2. Add new download screen.
3. Logs overview screen.
4. Shortcode generator.
5. Example shortcodes.
6. Settings screen.
== Changelog ==
= 1.0 =
+ Initial stable plugin release.

94
wp-liveticker2.php Normal file
View File

@ -0,0 +1,94 @@
<?php
/**
* Plugin Name: WP Liveticker 2
* Description: A simple Liveticker for Wordpress.
* Version: 0.3 beta
* Author: Stefan Kalscheuer
* Author URI: http://www.stklblog.de
* Text Domain: wplt2
* Domain Path: /lang
* License: GPL2
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @package Main
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Constants
*/
if( !defined( 'WPLT_VERSION' ) )
define( 'WPLT_VERSION', '0.1' );
if( !defined( 'WPLT_PLUGIN_URL' ) )
define( 'WPLT_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
if( !defined( 'WPLT_PLUGIN_DIR' ) )
define( 'WPLT_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
/**
* Localization
*/
function WPLT_localization() {
load_plugin_textdomain( 'wplt2', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
}
add_action( 'plugins_loaded', 'WPLT_localization' );
/**
* Options
*/
global $wplt_options;
$wplt_options = get_option( 'wplt2' );
/**
* Include required plugin files
*/
include_once( WPLT_PLUGIN_DIR . 'includes/functions.php' );
include_once( WPLT_PLUGIN_DIR . 'includes/post-types.php' );
include_once( WPLT_PLUGIN_DIR . 'includes/scripts.php' );
include_once( WPLT_PLUGIN_DIR . 'includes/rss.php' );
include_once( WPLT_PLUGIN_DIR . 'includes/shortcodes.php' );
include_once( WPLT_PLUGIN_DIR . 'includes/widget.php' );
if( is_admin() ) {
// include_once( WPLT_PLUGIN_DIR . 'includes/admin/ajax.php' );
// include_once( WPLT_PLUGIN_DIR . 'includes/admin/dashboard.php' );
// include_once( WPLT_PLUGIN_DIR . 'includes/admin/media-button.php' );
// include_once( WPLT_PLUGIN_DIR . 'includes/admin/meta-boxes.php' );
include_once( WPLT_PLUGIN_DIR . 'includes/admin/page-settings.php' );
include_once( WPLT_PLUGIN_DIR . 'includes/admin/post-types-columns.php' );
}
/**
* On activation
*/
function WPLT_activation() {
global $WPLT_options;
// Add default settings to database
$defaults = WPLT_get_default_options();
if( $WPLT_options['reset_settings'] ) {
update_option( 'wplt2', $defaults );
}
else {
add_option( 'wplt2', $defaults );
}
}
register_activation_hook( __FILE__, 'WPLT_activation' );