Plugin Directory

Changeset 430679


Ignore:
Timestamp:
08/30/2011 12:49:59 PM (14 years ago)
Author:
IWEBIX
Message:
 
Location:
wp-newsticker/trunk
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • wp-newsticker/trunk/newsticker.php

    r150846 r430679  
    33Plugin Name: WP-Newsticker
    44Plugin URI: http://www.iwebix.de/wp-newsticker-newsticker-plugin-fuer-wordpress/
    5 Description: Wp-Newsticker is a plugin to show your recent Posts sliding through your website!
    6 Version: 1.0
     5Description: WP-Newsticker is a plugin to show your recent Posts sliding through your website!
     6Version: 2.0
    77Author: Dennis Nissle
    88Author URI: http://www.iwebix.de
    99*/
    1010
    11 function newsticker_js() {
    12     $gallery_path =  get_bloginfo('wpurl')."/wp-content/plugins/wp-newsticker/";
    13     $galleryscript = "<script type=\"text/javascript\" src=\"".$gallery_path."scripts/newsticker.js\"></script>";
    14     echo($galleryscript);
     11$wp_news_options_page = get_option('siteurl') . '/wp-admin/admin.php?page=wp-newsticker/options.php';
     12
     13function wp_news_options_page() {
     14   
     15    add_options_page('WP-Newsticker Options', 'WP-Newsticker', 10, 'wp-newsticker/options.php');
     16   
    1517}
    16 add_action('wp_head', 'newsticker_js');
    17 // Content Word Limit
    18 function limitcontent($num) {
    19     $link = get_permalink();
    20     $ending = '...';
    21     $theContent = get_the_content();
    22     $output = preg_replace('/<img[^>]+./','', $theContent);
    23     $limit = $num+1;
    24     $content = explode(' ', $output, $limit);
    25     array_pop($content);
    26     $content = implode(" ",$content).$ending;
    27     $imgBeg = strpos($theContent, '<img');
    28     $post = substr($theContent, $imgBeg);
    29     $imgEnd = strpos($post, '>');
    30     $postOutput = substr($post, 0, $imgEnd+1);
    31     $result = preg_match('/width="([0-9]*)" height="([0-9]*)"/', $postOutput, $matches);
    32     if ($result) {
    33         $pagestring = $matches[0];
    34         $postOutput = str_replace($pagestring, "", $postOutput);
    35     }
    36     if(stristr($postOutput,'<img src=')) { echo '<a href="'.$link.'">'.$postOutput."</a>".$content; } else {
    37         echo $content;
     18
     19add_action('admin_menu', 'wp_news_options_page');
     20
     21function wp_news_add_content_scripts() {
     22   
     23    if ( !is_admin() ) {
     24        wp_register_script('jquery.newsticker', WP_PLUGIN_URL . '/wp-newsticker/scripts/jquery.newsticker.js', '', '' );
     25        wp_enqueue_script('jquery.newsticker');
    3826    }
    3927}
    4028
    41 $theContent = get_the_content();
     29add_action('wp_enqueue_scripts', 'wp_news_add_content_scripts');
     30
     31function wp_news_cut_content_feat($wp_news_text, $wp_news_chars, $wp_news_points = "...") {
     32   
     33    $wp_news_length = strlen($wp_news_text);
     34   
     35    if($wp_news_length <= $wp_news_chars) {
     36       
     37        return $wp_news_text;
     38   
     39    } else {
     40       
     41        return substr($wp_news_text, 0, $wp_news_chars)." ".$wp_news_points;
     42       
     43    }
     44   
     45}
     46
     47function wp_news_insert_content($wp_news_atts, $wp_news_content = null) {
     48   
     49    include (ABSPATH . '/wp-content/plugins/wp-newsticker/news.php');
     50   
     51}
     52
     53add_shortcode("newsticker", "wp_news_insert_content");
     54
     55function wp_news_add_script() {
     56   
     57    $wp_news_slide_speed = get_option('wp_news_slide_speed');
     58       
     59        if(empty($wp_news_slide_speed)) {
     60               
     61                $wp_news_slide_speed = 40;
     62               
     63        }
     64   
     65    $script = '<script type="text/javascript">
     66   
     67        divScroller("scroll-h", "h", '.$wp_news_slide_speed.', 6000);
     68         
     69    </script>';
     70   
     71    echo $script;
     72   
     73}
     74
     75add_action('wp_footer', 'wp_news_add_script');
     76
    4277?>
  • wp-newsticker/trunk/readme.txt

    r180908 r430679  
    22Contributors: IWEBIX, Dennis Nissle
    33Donate link: http://www.iwebix.de
    4 Tags: newsticker, wp-newsticker, newsticker wordpress
     4Tags: newsticker, wp-newsticker, newsticker wordpress, ticker, slider, sliding text, text, post
    55Requires at least: 2.6
    6 Tested up to: 2.8
     6Tested up to: 3.2
    77Stable tag: trunk
    88
    9 WP-Newsticker is a nice javascript Newsticker it shows 5 most recent Blog Posts with Date, Title (Permalink) and description.
     9WP-Newsticker is a nice javascript Newsticker that show your featured (or latest) posts/pages in a nice flewing ticker.
    1010
    1111== Description ==
    1212
    13 Wp-Newsticker provides a **powerfull** and nice javascript Newsticker for Wordpress. It can be integrated anywhere on your Blog/Website. This Newsticker shows up the last 5 Posts from your Blog. This is a very nice solution to everybody who wants to have some kind of a magazin style. The following functions are integrated:
     13WP-Newsticker provides a **powerfull** and nice javascript Newsticker for Wordpress. It can be implemented anywhere on your Blog/Website. This Newsticker shows your featured content (Set it via Admin Panel). This is a very nice solution to everybody who wants to have some kind of a magazin style. The following functions are integrated:
    1414
    1515* nice sliding text from right to left
    16 * date of the post
    17 * title with permalink to article
    18 * excerpt of the post containing 8 words
     16* Post date/link/title/small description
     17* Admin Panel to adjust style, speed, order of posts, maximum posts/pages etc.
    1918
    20 Check out the DEMO at <a href="http://www.iwebix.de/" target="_blank" title="webdesign">webdesign</a>
     19Check out the <a href="http://preview.wp-themix.org/plugins/wp-newsticker/" target="_blank">DEMO</a> at <a href="http://www.iwebix.de/" target="_blank" title="webdesign">webdesign</a>
    2120
    2221== Installation ==
    2322
    24231. Upload /wp-newsticker/ to your Plugin directory (wp-content/plugins/)
    25 2. Go to the 'Plugins' Page of your Administration Area and activate the Plugin
    26 3. Place `<?php include (ABSPATH . '/wp-content/plugins/wp-newsticker/wp-newsticker.php'); ?>` in your templates.
     242. Activate the Plugin
     253. Use shortcode [newsticker] anywhere in content or place `<?php include (ABSPATH . '/wp-content/plugins/wp-newsticker/news.php'); ?>` in your templates.
    2726
    2827== Frequently Asked Questions ==
     
    3433= Where can I edit the width and height? =
    3534
    36 You can edit the width and height in /wp-content/plugins/wp-newsticker/wp-newsticker.php
     35Width is set to 100% of your container's width. You can adjust it in news.php.
    3736
    3837== Screenshots ==
     
    40391. This is how the Newsticker looks right under the menu.
    4140
     412. Admin Panel
     42
    4243== Changelog ==
     44
     45= 2.0 =
     46* Added Admin Panel
     47* New Options
     48* Optimizing Styling
     49* Fixed Bugs
     50* Security Update
    4351
    4452= 1.0 =
Note: See TracChangeset for help on using the changeset viewer.