title = __("Misc Shortcodes", "dagsopt"); $this->pluginname = $ns->pluginname; $this->file = $ns->file; $this->ns = $ns; } function start() { add_filter('the_content', array(&$this, 'CSV_Parse')); add_filter('the_content', array(&$this, 'CSV_Parse2')); add_shortcode('acc-page', array(&$this, 'getpage')); add_shortcode('posts', array(&$this, 'r_get_posts')); add_shortcode('domposts', array(&$this, 'r_get_dom_posts')); } function r_get_dom_posts($atts, $content = null) { extract(shortcode_atts(array( "num" => '5', "cols" => '1', "cat" => '', "tpl" => 'default', "wrap" => 'box', ), $atts)); global $post, $r_get_posts_excluded, $r_get_posts_cat_collect; $oldpost = $post; if (defined("DOM_SLUG")) { $caten = get_category_by_slug(DOM_SLUG); } else { $caten = get_category_by_slug($cat); } $ret = ''; if ($caten) { $catid = $caten->cat_ID; } else { $catid = 3; } $r_get_posts_cat_collect[] = $catid; $myposts = get_posts('numberposts=' . $num . '&order=DESC&orderby=post_date&category=' . $catid . "&exclude=" . implode(",", $r_get_posts_excluded)); ob_start(); ob_clean(); $myposts_length = count($myposts); $myposts_index = 0; foreach ($myposts as $post): $r_get_posts_excluded[] = $post->ID; setup_postdata($post); if (file_exists(TEMPLATEPATH . '/tpl_' . $tpl . '.php')) { include TEMPLATEPATH . '/tpl_' . $tpl . '.php'; } else { if (file_exists(TEMPLATEPATH . '/tpl_default.php')) { include TEMPLATEPATH . '/tpl_default.php'; } else { include dirname(__file__) . '/tpl_default.php'; } } $myposts_index++; endforeach; if (isset($_REQUEST['debug'])) { echo ("atts:" . print_r($atts, true) . "\n"); echo ("CAT:" . $cat . "\n"); echo ("caten:" . print_r($caten, true) . "\n"); echo ("posts:" . print_r($myposts, true) . "\n"); echo ("r_get_posts_cat_collect:" . print_r($r_get_posts_cat_collect, true) . "\n"); echo ("r_get_posts_excluded:" . print_r($r_get_posts_excluded, true) . "\n"); } $ret = ob_get_contents(); ob_clean(); $ret = '
' . implode("
", $tt) . '
'; $sa .= $heads[$y]; $sa .= ' | '; } $sa .= '
---|
';
$tt = explode("\n", $row[$y]);
if (count($tt) > 1) {
$sa .= '' . array_shift($tt) . ' '; } $sa .= implode(" ", $tt); $sa .= ' | ';
}
$sa .= '