public function theme_showblogroll( $theme ) { //read plugin options $theme->blogroll_title= Options::get( strtolower( get_class( $this ) ) . ':title' ); $links= Options::get( strtolower( get_class( $this ) ) . ':links' ); $max= Options::get( strtolower( get_class( $this ) ) . ':max'); $randomize= Options::get( strtolower( get_class ( $this ) ) . ':random' ); //set default values if options not set if ( empty( $max ) ) $max= 6; if ( empty( $random ) ) $random= false ; if (!isset($theme->blogroll_title)) $theme->blogroll_title='Blogroll'; if ( $randomize ) shuffle( $links ); $theme->blogroll_links= array(); foreach( $links as $link ) { $link= strip_tags($link); $props= explode( '|', $link ); if ( !isset( $props[2] ) ) { $props[2]= ''; } $theme->blogroll_links[]= array( 'title'=>$props[0], 'url'=>$props[1], 'rel'=>$props[2] ); if ( $max != 0 ) { if ( $max <= 1 ) break; $max--; } } #Utils::debug($theme->blogroll_links); return $theme->fetch( 'blogroll' ); } public function action_init() { $this->add_template('blogroll', dirname(__FILE__) . '\blogroll.php'); }