Plugin Directory

Changeset 587957


Ignore:
Timestamp:
08/20/2012 08:19:34 PM (13 years ago)
Author:
dgilfoy
Message:

changed output to proper way

Location:
ivycat-announcements/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ivycat-announcements/trunk/Read.ME

    r377057 r587957  
    44Tags: announcements, bulletins, role based
    55Requires at least: 3.1
    6 Tested up to: 3.1
    7 Stable tag: 1.0.1
     6Tested up to: 3.4.1
     7Stable tag: 1.0.2
    88
    99==Short Description ==
  • ivycat-announcements/trunk/classes/ivycat_announcements.php

    r377036 r587957  
    77   
    88    var $today;
     9    protected $output;
    910    static $instance;
    1011   
     
    1415    function __construct(){
    1516        self::$instance = $this;
     17        $this->output = '';
    1618        $this->today = current_time( 'timestamp' );
    1719        self::set_shortcodes();
     
    3436        if( !$atts ):
    3537            self::display_announcements();
     38            return $this->output;
    3639        else:
    3740            if( array_key_exists( 'id', $atts ) ):
    38                 self::get_announcement( $atts['id'] );
     41                return self::get_announcement( $atts['id'] );
    3942            elseif( array_key_exists( 'group', $atts ) ):
    40                 self::get_announcements_by_group( $atts['group'] );
     43                return self::get_announcements_by_group( $atts['group'] );
    4144            endif;
    4245        endif;
     
    4750 */   
    4851    function get_announcement($id){
    49        
     52        $output = '';
    5053        $postdata = get_post( $id, ARRAY_A );
    5154        if( is_array( $postdata ) ):
    5255            $data[0] = (object) $postdata;
    53             echo '<div class="ivycat_annc_container">';
    54             self::output_posts( $data );
    55             echo '</div>';
     56            $output .= '<div class="ivycat_annc_container">'. self::output_posts( $data ) . '</div>';
    5657        endif;
     58        return $output;
    5759    }
    5860   
     
    181183*/   
    182184    function output_posts( $data, $grp=false ){
    183        
    184185        if( is_object( $data[0] ) ):
    185186            foreach( $data as $row ){
     
    200201                            update_post_meta( $row->ID, 'active', 'n' );
    201202                        }else{  // otherwise print content.
    202                             echo "<p>".$row->post_content."</p>";
     203                            $this->output .= '<div class="ic-announcement">'.$row->post_content.'</div>';
    203204                        }
    204205                    }
     
    208209           
    209210        endif;
     211        return $this->output;
    210212    }
    211213   
  • ivycat-announcements/trunk/ivycat_announce.php

    r394758 r587957  
    55Description: A plugin that displays announcements on pages and posts. They can be scheduled so that they are only displayed between
    66specified dates/times. Utilizes custom post types. Requires WordPress 3.1 for use of multiple taxonomy querying.
    7 Author: dgilfoy, ivycat
    8 Version: 1.0.1
     7Author: dgilfoy, ivycat, sewmyheadon
     8Version: 1.0.2
    99Author URI: http://www.ivycat.com
    1010**/
Note: See TracChangeset for help on using the changeset viewer.