コード例 #1
0
ファイル: Widget_Old.php プロジェクト: TheReaCompany/pooplog
 function init()
 {
     global $wp_version;
     global $advman_engine;
     $ads = $advman_engine->getAds();
     if (!empty($ads)) {
         $widgets = array();
         foreach ($ads as $id => $ad) {
             if (!empty($ad->name)) {
                 $i = substr(md5($ad->name), 0, 10);
                 $widgets[$i] = $ad;
             }
         }
         foreach ($widgets as $id => $ad) {
             $n = __('Ad: ', 'advman') . $ad->name;
             $description = __('An ad from the Advertising Manager plugin');
             $args = array('name' => $n, 'description' => $description);
             if (function_exists('wp_register_sidebar_widget')) {
                 //$id, $name, $output_callback, $options = array()
                 wp_register_sidebar_widget("advman-{$id}", $n, array('Advman_Widget', 'widget'), $args, $ad->name);
                 wp_register_widget_control("advman-{$id}", $n, array('Advman_Widget', 'widget_control'), null, null, $ad->name);
             } elseif (function_exists('register_sidebar_module')) {
                 register_sidebar_module($n, array('Advman_Widget', 'sbm_widget'), "advman-{$id}", $args);
                 register_sidebar_module_control($n, array('Advman_Widget', 'widget_control'), "advman-{$id}");
             }
         }
     }
 }
コード例 #2
0
ファイル: search.php プロジェクト: 64kbytes/stayinba
<?php

function search_sidebar_module($args)
{
    extract($args);
    echo $before_module . $before_title . $title . $after_title;
    include TEMPLATEPATH . '/searchform.php';
    echo $after_module;
}
register_sidebar_module('Search', 'search_sidebar_module', 'sb-search');
コード例 #3
0
ファイル: php.php プロジェクト: 64kbytes/stayinba
<?php

function php_sidebar_module($args)
{
    extract($args);
    echo $before_module . $before_title . $title . $after_title;
    eval(' ?>' . sbm_get_option('code') . '<?php ');
    echo $after_module;
}
function php_sidebar_module_control()
{
    if (isset($_POST['php_module_code'])) {
        sbm_update_option('code', stripslashes($_POST['php_module_code']));
    }
    ?>
		<p>
			<label for="php-module-code"><?php 
    _e('Module\'s code:', 'k2_domain');
    ?>
</label><br />
			<textarea id="php-module-code" name="php_module_code" rows="6" cols="30"><?php 
    echo wp_specialchars(htmlspecialchars(sbm_get_option('code'), ENT_QUOTES), 1);
    ?>
</textarea>
		</p>
	<?php 
}
register_sidebar_module('Text, HTML and PHP', 'php_sidebar_module', 'sb-php');
register_sidebar_module_control('Text, HTML and PHP', 'php_sidebar_module_control');
コード例 #4
0
ファイル: categories.php プロジェクト: 64kbytes/stayinba
<?php

function categories_sidebar_module($args)
{
    extract($args);
    echo $before_module . $before_title . $title . $after_title;
    ?>
	<ul>
		<?php 
    if (function_exists('wp_list_categories')) {
        wp_list_categories('title_li=&show_count=1&hierarchical=0');
    } else {
        list_cats(0, '', 'name', 'asc', '', 1, 0, 1, 1, 1, 1, 0, '', '', '', '', '');
    }
    ?>
	</ul>
	<?php 
    echo $after_module;
}
register_sidebar_module('Category List', 'categories_sidebar_module', 'sb-categories');
コード例 #5
0
ファイル: flickr.php プロジェクト: 64kbytes/stayinba
<?php

function flickr_sidebar_module($args)
{
    extract($args);
    echo $before_module . $before_title . $title . $after_title;
    ?>
		<span class="metalink"><a href="http://flickr.com/services/feeds/photos_public.gne?id=<?php 
    echo get_option('flickrRSS_flickrid');
    ?>
&amp;format=rss_200" title="<?php 
    _e('RSS Feed for flickr', 'k2_domain');
    ?>
" class="feedlink"><img src="<?php 
    bloginfo('template_directory');
    ?>
/images/feed.png" alt="RSS" /></a></span>

		<div>
			<?php 
    get_flickrRSS();
    ?>
		</div>
	<?php 
    echo $after_module;
}
if (function_exists('get_flickrRSS')) {
    register_sidebar_module('Flickr', 'flickr_sidebar_module', 'sb-flickr');
}
コード例 #6
0
ファイル: latest_comments.php プロジェクト: 64kbytes/stayinba
</label> <input id="recent-comments-module-hide-trackbacks" name="latest_comments_module[hide_trackbacks]" type="checkbox"<?php 
    if (sbm_get_option('hide_trackbacks')) {
        ?>
 checked="checked"<?php 
    }
    ?>
 /></p>

	<?php 
    if (function_exists('blc_latest_comments')) {
        ?>
		<p><label for="recent-comments-module-new-color"><?php 
        _e('Newest color:', 'k2_domain');
        ?>
</label> <input id="recent-comments-module-new-color" name="latest_comments_module[new_color]" type="text" value="<?php 
        echo sbm_get_option('new_color');
        ?>
" size="7" /></p>

		<p><label for="recent-comments-module-old-color"><?php 
        _e('Oldest color:', 'k2_domain');
        ?>
</label> <input id="recent-comments-module-old-color" name="latest_comments_module[old_color]" type="text" value="<?php 
        echo sbm_get_option('old_color');
        ?>
" size="7" /></p>
	<?php 
    }
}
register_sidebar_module('Latest Comments', 'latest_comments_sidebar_module', 'sb-comments' . (function_exists('blc_latest_comments') ? ' sb-comments-blc' : ''), array('num_posts' => 5, 'num_comments' => 10, 'hide_trackbacks' => false, 'new_color' => '#444444', 'old_color' => '#cccccc'));
register_sidebar_module_control('Latest Comments', 'latest_comments_sidebar_module_control');
コード例 #7
0
ファイル: rss.php プロジェクト: 64kbytes/stayinba
        sbm_update_option('icon', $_POST['rss_module_icon']);
    }
    if (isset($_POST['rss_module_num_items'])) {
        sbm_update_option('num_items', $_POST['rss_module_num_items']);
    }
    ?>
		<p><label for="rss-module-feed"><?php 
    _e('RSS feed\'s URL:', 'k2_domain');
    ?>
</label> <input id="rss-module-feed" name="rss_module_feed" type="text" value="<?php 
    echo sbm_get_option('feed');
    ?>
" /></p>
		<p><label for="rss-module-icon"><?php 
    _e('RSS feed\'s icon:', 'k2_domain');
    ?>
</label> <input id="rss-module-icon" name="rss_module_icon" type="text" value="<?php 
    echo sbm_get_option('icon');
    ?>
" /></p>
		<p><label for="rss-module-num-items"><?php 
    _e('Number of items:', 'k2_domain');
    ?>
</label> <input id="rss-module-num-items" name="rss_module_num_items" type="text" value="<?php 
    echo sbm_get_option('num_items');
    ?>
" size="2" /></p>
	<?php 
}
register_sidebar_module('RSS', 'rss_sidebar_module', 'sb-feed', array('num_items' => '10'));
register_sidebar_module_control('RSS', 'rss_sidebar_module_control');
コード例 #8
0
ファイル: calendar.php プロジェクト: 64kbytes/stayinba
<?php

function calendar_sidebar_module($args)
{
    extract($args);
    echo $before_module . $before_title . $title . $after_title;
    get_calendar();
    echo $after_module;
}
register_sidebar_module('Calendar', 'calendar_sidebar_module', 'sb-calendar');
コード例 #9
0
ファイル: ec3_sidebar_module.php プロジェクト: smoobs/sjh
}
function ec3_k2mod_list_control()
{
    if (isset($_POST['ec3_module_limit'])) {
        sbm_update_option('limit', $_POST['ec3_module_limit']);
    }
    ?>
  <p>
   <label for="ec3-module-num-events">
    <?php 
    _e('Number of events:', 'ec3');
    ?>
   </label>
   <input id="ec3-module-num-events" name="ec3_module_limit"
    type="text" value="<?php 
    echo sbm_get_option('limit');
    ?>
" size="4" />
  </p>
  <p>
   <a href="options-general.php?page=ec3_admin">
    <?php 
    _e('Go to Event Calendar Options', 'ec3');
    ?>
.
   </a>
  </p>
  <?php 
}
register_sidebar_module(__('Upcoming Events', 'ec3'), 'ec3_k2mod_list', '', array('limit' => 5));
register_sidebar_module_control(__('Upcoming Events', 'ec3'), 'ec3_k2mod_list_control');
コード例 #10
0
ファイル: aboutcurrent.php プロジェクト: 64kbytes/stayinba
</p>

		<?php 
        }
        echo $after_module;
    }
}
function about_sidebar_module_control()
{
    if (isset($_POST['about_module_blurp'])) {
        sbm_update_option('aboutblurp', $_POST['about_module_blurp']);
    }
    ?>
		<p>
			<label for="about-module-blurp"><?php 
    _e('About Text:', 'k2_domain');
    ?>
</label><br />
			<textarea id="about-module-blurp" name="about_module_blurp" rows="6" cols="30"><?php 
    echo wp_specialchars(htmlspecialchars(stripslashes(sbm_get_option('aboutblurp')), ENT_QUOTES), 1);
    ?>
</textarea><br />
			<small><?php 
    _e('Enter a blurp about yourself here, and it will show up on the frontpage. Deleting the content disables the about blurp.', 'k2_domain');
    ?>
</small>
		</p>
	<?php 
}
register_sidebar_module('About Current Page', 'about_sidebar_module', 'sb-about', array('aboutblurp' => ''));
register_sidebar_module_control('About Current Page', 'about_sidebar_module_control');
コード例 #11
0
ファイル: meta.php プロジェクト: 64kbytes/stayinba
    ?>
" title="<?php 
    _e('Syndicate this site using RSS 2.0');
    ?>
"><?php 
    _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>');
    ?>
</a></li>
		<li><a href="<?php 
    bloginfo('comments_rss2_url');
    ?>
" title="<?php 
    _e('The latest comments to all posts in RSS');
    ?>
"><?php 
    _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>');
    ?>
</a></li>
		<li><a href="http://wordpress.org/" title="<?php 
    _e('Powered by Wordpress, state-of-the-art semantic personal publishing platform.');
    ?>
">WordPress</a></li>
		<?php 
    wp_meta();
    ?>
	</ul>
	<?php 
    echo $after_module;
}
register_sidebar_module('Meta Information', 'meta_sidebar_module', 'sb-meta');
コード例 #12
0
ファイル: wptagcloud.php プロジェクト: 64kbytes/stayinba
<?php

if (function_exists('wp_tag_cloud')) {
    function wptagcloud_sidebar_module($args)
    {
        extract($args);
        echo $before_module . $before_title . $title . $after_title;
        if (function_exists('UTW_ShowWeightedTagSetAlphabetical')) {
            echo 'test1234';
            UTW_ShowWeightedTagSetAlphabetical("coloredsizedtagcloud");
        } else {
            if (function_exists('wp_tag_cloud')) {
                wp_tag_cloud('format=list');
            }
        }
        echo $after_module;
    }
    function wptagcloud_sidebar_module_control()
    {
        if (isset($_POST['wptagcloud_module_blurp'])) {
            sbm_update_option('wptagcloud', $_POST['wptagclod_module_blurp']);
        }
    }
    register_sidebar_module('Tag Cloud', 'wptagcloud_sidebar_module', 'sb-wptagcloud', array('wptagcloud' => ''));
    register_sidebar_module_control('Tag Cloud', 'wptagcloud_sidebar_module_control');
}
コード例 #13
0
ファイル: monthly.php プロジェクト: 64kbytes/stayinba
<?php

function months_sidebar_module($args)
{
    extract($args);
    echo $before_module . $before_title . $title . $after_title;
    ?>
	<ul>
		<?php 
    wp_get_archives('type=monthly');
    ?>
	</ul>
<?php 
    echo $after_module;
}
register_sidebar_module('Monthly Archive', 'months_sidebar_module', 'sb-months');
コード例 #14
0
ファイル: asides.php プロジェクト: 64kbytes/stayinba
            /* Edit Link */
            edit_post_link(__('Edit', 'k2_domain'), '<span class="entry-edit">', '</span>');
            ?>
			</div>
			<?php 
        }
        /* end asides loop */
        ?>
		</div>
<?php 
        echo $after_module;
    }
    /* end asides check */
}
function asides_sidebar_module_control()
{
    if (isset($_POST['asides_module_num_posts'])) {
        sbm_update_option('num_posts', $_POST['asides_module_num_posts']);
    }
    ?>
		<p><label for="asides-module-num-posts"><?php 
    _e('Number of posts:', 'k2_domain');
    ?>
</label> <input id="asides-module-num-posts" name="asides_module_num_posts" type="text" value="<?php 
    echo sbm_get_option('num_posts');
    ?>
" size="2" /></p>
	<?php 
}
register_sidebar_module('Asides', 'asides_sidebar_module', 'sb-asides', array('num_posts' => 3));
register_sidebar_module_control('Asides', 'asides_sidebar_module_control');
 function register_widget($name, $args)
 {
     if (function_exists('wp_register_sidebar_widget')) {
         //$id, $name, $output_callback, $options = array()
         wp_register_sidebar_widget('adsensem-' . $name, "Ad#{$name}", array('adsensem', 'widget'), $args, $name);
         wp_register_widget_control('adsensem-' . $name, "Ad#{$name}", array('adsensem', 'widget_control'), $args, $name);
     } else {
         if (function_exists('register_sidebar_module')) {
             register_sidebar_module('Ad #' . $name, 'adsensem_sbm_widget', 'adsensem-' . $name, $args);
             register_sidebar_module_control('Ad #' . $name, array('adsensem', 'widget_control'), 'adsensem-' . $name);
         }
     }
 }
コード例 #16
0
ファイル: related_posts.php プロジェクト: 64kbytes/stayinba
<?php

function related_posts_sidebar_module($args)
{
    extract($args);
    if (is_single() and !defined('K2_NOT_FOUND')) {
        echo $before_module . $before_title . $title . $after_title;
        ?>
			<ul>
				<?php 
        related_posts();
        ?>
			</ul>
		<?php 
        echo $after_module;
    }
}
if (function_exists('related_posts')) {
    register_sidebar_module('Related Posts', 'related_posts_sidebar_module', 'sb-related');
}
コード例 #17
0
ファイル: wpsb-opt-in.php プロジェクト: alx/barceloneta
function wpsb_widget_init()
{
    global $wp_version;
    if (!function_exists('register_sidebar_widget')) {
        return;
    }
    function wpsb_widget($args)
    {
        extract($args);
        echo $before_widget . $before_title;
        echo get_option('wpsb_widget_title');
        echo $after_title;
        wpsb_opt_in();
        echo $after_widget;
    }
    function wpsb_widget_control()
    {
        $title = get_option('wpsb_widget_title');
        if ($_POST['wpsb_submit']) {
            $title = stripslashes($_POST['wpsb_widget_title']);
            update_option('wpsb_widget_title', $title);
        }
        echo '<p>Title:<input  style="width: 200px;" type="text" value="';
        echo $title . '" name="wpsb_widget_title" id="wpsb_widget_title" /></p>';
        echo '<input type="hidden" id="wpsb_submit" name="wpsb_submit" value="1" />';
    }
    $width = 300;
    $height = 100;
    if ('2.2' == $wp_version || !function_exists('wp_register_sidebar_widget')) {
        register_sidebar_widget('WP Sendblaster Opt-in', 'wpsb_widget');
        register_widget_control('WP Sendblaster Opt-in', 'wpsb_widget_control', $width, $height);
    } else {
        // v2.2.1+
        $size = array('width' => $width, 'height' => $height);
        $class = array('classname' => 'wpsb_opt_in');
        // css classname
        wp_register_sidebar_widget('wpsb', 'WP Sendblaster Opt-in', 'wpsb_widget', $class);
        wp_register_widget_control('wpsb', 'WP Sendblaster Opt-in', 'wpsb_widget_control', $size);
    }
    if (function_exists('register_sidebar_module')) {
        $class = array('classname' => 'wpsb_opt_in');
        // css classname
        register_sidebar_module('WP Sendblaster Opt-in', 'wpsb_widget', '', $class);
        register_sidebar_module_control('WP Sendblaster Opt-in', 'wpsb_widget_control');
    }
}
コード例 #18
0
ファイル: links.php プロジェクト: 64kbytes/stayinba
<?php

function links_sidebar_module($args)
{
    extract($args);
    echo $before_module . $before_title . $title . $after_title;
    ?>
	<ul>
		<?php 
    wp_list_bookmarks('title_before=<h4>&title_after=</h4>');
    ?>
	</ul>
	<?php 
    echo $after_module;
}
register_sidebar_module('Links', 'links_sidebar_module', 'sb-links');
コード例 #19
0
ファイル: latest_posts.php プロジェクト: 64kbytes/stayinba
function latest_posts_sidebar_module_control()
{
    if (isset($_POST['latest_posts_module'])) {
        sbm_update_option('hide_asides', isset($_POST['latest_posts_module']['hide_asides']));
        if (isset($_POST['latest_posts_module']['num_posts'])) {
            sbm_update_option('num_posts', $_POST['latest_posts_module']['num_posts']);
        }
    }
    ?>
		<p><label for="latest-posts-module-num-posts"><?php 
    _e('Number of posts:', 'k2_domain');
    ?>
</label> <input id="latest-posts-module-num-posts" name="latest_posts_module[num_posts]" type="text" value="<?php 
    echo sbm_get_option('num_posts');
    ?>
" size="2" /></p>

		<p><label for="latest-posts-module-hide-asides"><?php 
    _e('Exclude Asides from list:', 'k2_domain');
    ?>
</label> <input id="latest-posts-module-hide-asides" name="latest_posts_module[hide_asides]" type="checkbox"<?php 
    if (sbm_get_option('hide_asides')) {
        ?>
 checked="checked"<?php 
    }
    ?>
 /></p>
	<?php 
}
register_sidebar_module('Latest Posts', 'latest_posts_sidebar_module', 'sb-latest', array('num_posts' => 10, 'hide_asides' => false));
register_sidebar_module_control('Latest Posts', 'latest_posts_sidebar_module_control');
コード例 #20
0
ファイル: navigation.php プロジェクト: 64kbytes/stayinba
    if (is_attachment()) {
        ?>
		<div class="sb-pagemenu">
			<a href="<?php 
        echo get_permalink($post->post_parent);
        ?>
" rev="attachment"><?php 
        printf(__('Back to \'%s\'', 'k2_domain'), get_the_title($post->post_parent));
        ?>
</a>
		</div>
	<?php 
    }
}
function nav_sidebar_module_control()
{
    if (isset($_POST['nav_sidebar_module_custom_title'])) {
        sbm_update_option('custom_title', $_POST['nav_sidebar_module_custom_title']);
    }
    ?>
		<p><label for="nav-sidebar-module-custom-title"><?php 
    _e('Navigation heading:', 'k2_domain');
    ?>
</label> <input id="nav-sidebar-module-custom-title" name="nav_sidebar_module_custom_title" type="text" value="<?php 
    echo sbm_get_option('custom_title');
    ?>
" size="30" /></p>
	<?php 
}
register_sidebar_module('Page Menu', 'nav_sidebar_module', 'sb-pagemenu', array('custom_title' => __('%s Subpages', 'k2_domain')));
register_sidebar_module_control('Page Menu', 'nav_sidebar_module_control');