Пример #1
0
 function widget($args, $instance)
 {
     global $wpdb;
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? ' ' : $instance['title']);
     $group = empty($instance['group']) ? 'Group' : $instance['group'];
     $size = empty($instance['size']) ? 'Group' : $instance['size'];
     define('MYPLUGIN_PATH', get_settings('siteurl') . '/wp-content/plugins/ggroups');
     // Before the widget
     echo $before_widget;
     print '<link rel="stylesheet" href="' . MYPLUGIN_PATH . '/ggroup.css" type="text/css" media="screen" />';
     echo '<div id="ggroup-wrap">';
     // The title
     echo '<div class="gimage">';
     echo $before_title;
     //			echo('<img src="'.PLUGINDIR.'/ggroups/googlegroups.png"><br />');
     echo $title . $after_title;
     echo '</div><br/>';
     echo '<div id="gtext">';
     //$site = "http://groups.google.com/group/".$group."/feed/rss_v2_0_msgs.xml";
     include_once ABSPATH . WPINC . '/rss.php';
     wp_rss('http://groups.google.com/group/' . $group . '/feed/rss_v2_0_msgs.xml', 7);
     echo '</div>';
     echo '<div class="gjoin"><a href="http://groups.google.com/group/' . $group . '/subscribe">Join ' . $title . '!</a></div>';
     //		echo '<div style="text-align:center;padding:10px;">' . parseRDF($site) .
     //		'<br />' .
     //	$size .
     //"</div>";
     echo '</div>';
     //end ggroup-wrap
     echo $after_widget;
 }
Пример #2
0
    function widget($args, $instance)
    {
        extract($args);
        extract($instance);
        $group = empty($instance['group']) ? 'Group' : $instance['group'];
        $size = empty($instance['size']) ? 'Group' : $instance['size'];
        // Before the widget
        echo $before_widget;
        print '<link rel="stylesheet" href="' . ggp_path . '/google-groups.css" type="text/css" media="screen" />';
        ?>

    <div id="google-groups-wrap">
      <div class="gimage">
      <?php 
        if (!empty($instance['title'])) {
            ?>
 
        <h2 class="title">
          <a target="_blank" href="http://groups.google.com/group/nodejs-es">
          <?php 
            echo $title;
            ?>
          </a>
        </h2>
      <?php 
        }
        ?>
      </div>

      <div id="google-groups-feeds"
      <?php 
        include_once ABSPATH . WPINC . '/rss.php';
        wp_rss(ggp_api_host . $group . '/feed/rss_v2_0_msgs.xml', 7);
        ?>
      </div>

      <form action="http://groups.google.com/group/nodejs-es/boxsubscribe" id="google-subscribe">
        <div id="google-subscribe-input">
          <label>Email:&nbsp;
            <input type="text" name="email" id="google-subscribe-email" />
            <input type="submit" name="go" value="Subscribirse" />
          </label>
        </div>
      </form>
    </div>

  <?php 
        echo $after_widget;
        ?>

  <?php 
    }
Пример #3
0
function showhash($data)
{
    global $post;
    include_once ABSPATH . WPINC . '/rss.php';
    $post_id = $post->ID;
    $twitt_hash = get_post_meta($post_id, 'twitt_hash');
    if (!empty($twitt_hash)) {
        echo '<strong>Søk etter Twitter Hash Tags (#)&nbsp;</strong>: ';
        $value_rss = '';
        for (reset($twitt_hash); list($key, $value) = each($twitt_hash);) {
            $value_rss .= $value;
            $value_rss .= '+OR+';
            echo '<a href="http://search.twitter.com/search?q=%23' . $value . '">#' . $value . '</a>&nbsp; - &nbsp; ';
        }
        echo "<br/><br/>Eller sjekk ut hva andre sier om dette...<br/>";
        wp_rss('http://search.twitter.com/search.atom?q=%23' . $value_rss . '', 5);
    } else {
        echo "Denne posten har ingen registrerte Twitter hash tags";
    }
}
Пример #4
0
 public static function feed($atts = null, $content = null)
 {
     $atts = shortcode_atts(array('url' => get_bloginfo_rss('rss2_url'), 'limit' => 3, 'class' => ''), $atts, 'feed');
     if (!function_exists('wp_rss')) {
         include_once ABSPATH . WPINC . '/rss.php';
     }
     ob_start();
     echo '<div class="su-feed' . su_ecssc($atts) . '">';
     wp_rss($atts['url'], $atts['limit']);
     echo '</div>';
     $return = ob_get_contents();
     ob_end_clean();
     return $return;
 }
/**
 * PRO - new theme options panel (customize for your child theme)
 * 
 * @author Tim Bednar 
 * @version v2.0
 * @since v1.0
*/
function ashford_theme_options_pro_version()
{
    echo '<div id="ashford_promo" style="background-color:#EEE;border:1px solid #CCC;padding:10px;">';
    echo '<h3>You own and are running a premium Ashford theme</h3>';
    echo '<p style="margin-bottom:20px;">As an owner of an Ashford premium theme, please make sure that <a href="mailto:tim.bednar@gmail.com">Tim Bednar</a> has added you to the <a href="http://groups.google.com/group/ashford-pro-cohort">Ashford Pro Cohort Google Group</a> for unlimited support and release updates. <strong>If you choose not to belong to this group</strong>, you will not have access to support or upgrade information for Ashford Pro.</p>';
    include_once ABSPATH . WPINC . '/rss.php';
    wp_rss('http://feeds.feedburner.com/ashfordwordpresstheme', 3);
    echo '<p id="ashford_promo_buttons" style="padding-top:10px;text-align:center"><a href="http://ashford.turtleinteractive.com/support"  target="_blank" class="button">Support</a> <a href="http://feeds.feedburner.com/ashfordwordpresstheme"  target="_blank" class="button">Get RSS Feed</a> <a href="http://ashford.turtleinteractive.com/store?utm_source=Ashford%2BCode&utm_medium=Link&utm_content=Visit%2BAshford%2BStore&utm_campaign=Theme%2BOptions" target="_blank" class="button">Theme Store</a> <a href="https://twitter.com/ashfordwptheme" class="button">Ashford on Twitter</a></p></div>';
    echo '<style type="text/css">span.disable{display:none;}</style>';
}
Пример #6
0
function add_blogfeed($atts)
{
    extract(shortcode_atts(array("feed" => '', "num" => ''), $atts));
    return wp_rss($feed, $num);
}
Пример #7
0
function hmt_admin()
{
    global $themename, $shortname, $options, $baseversion, $thisversion, $subtitle;
    if ($_REQUEST['saved']) {
        echo '<div id="message" class="updated fade"><p><strong>' . $themename . ' Theme settings saved.</strong></p></div>';
    }
    if ($_REQUEST['reset']) {
        echo '<div id="message" class="updated fade"><p><strong>' . $themename . ' Theme settings reset.</strong></p></div>';
    }
    ?>
	
	<div class="wrap">
	
	<h2><img src="<?php 
    echo bloginfo('template_url');
    ?>
/images/mappy-wp-bw-45-web.png" align="absbottom" width="47px" height="45px" />&nbsp;<?php 
    echo $themename;
    ?>
 Options</h2>
	
		<div style="width:965px;"> 
	
			<div style="float:left">
			<form method="post">
			
				<?php 
    // if we are in preset mode then we have to do some fancy footwork to bring the preset mode turner-off-er up to the top of the options page
    $preset_mode_already_shown = FALSE;
    $this_mode = hmt_get_option(hmt_preset_mode_activated);
    if ($this_mode == "ON" || $this_mode == "") {
        $preset_mode = TRUE;
        $show_next_time = FALSE;
        ?>
					
				<div id="message" class="updated fade">
					<p><span style="color:#F00"><strong>Preset Mode</strong></span> is activated. To activate <strong>Full Widget Mode</strong> (recommended) and activate all Widget Positions turn off Preset Mode below :)
				</div>
				
				<?php 
    }
    ?>
	
					
				<?php 
    foreach ($options as $value) {
        // Loop through the options array and display all the options in a form for editing.
        switch ($value['type']) {
            /* This is the left column of the options page
            -------------------------------------------------------------- */
            /* Open
            -------------------------------------------------------------- */
            case "open":
                ?>
						<table class="widefat" cellspacing="0" style="width:600px;"><tbody>
			 
					<?php 
                break;
                /* Close
                -------------------------------------------------------------- */
            /* Close
            -------------------------------------------------------------- */
            case "close":
                ?>
						</tbody></table>
						<br />
					<?php 
                break;
                /* Title
                -------------------------------------------------------------- */
            /* Title
            -------------------------------------------------------------- */
            case "title":
                ?>
						<thead>
							<tr>
								<th colspan="2" scope="col">
									<?php 
                echo $value['name'];
                ?>
 
									<div style="float:right">
										<input name="save" type="submit" value="Save" class="button-primary"/>
										<input type="hidden" name="action" value="save" />
									</div>
								</th>
							</tr>
						</thead>
					<?php 
                break;
                /* Text
                -------------------------------------------------------------- */
            /* Text
            -------------------------------------------------------------- */
            case 'text':
                ?>
						<tr>
							<td width="250px"><strong><?php 
                echo $value['name'];
                ?>
</strong><br />
								<small><a href="http://heatmaptheme.com/<?php 
                echo $subtitle;
                ?>
/version-<?php 
                echo $baseversion;
                ?>
/<?php 
                echo $value['userguide'];
                ?>
/"><strong>[User Guide]</strong></a></small><br /><br />
								<?php 
                echo $value['desc'];
                ?>
							</td>
							<td width="350px">
								<input style="width:340px; font-size:11px;" name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" type="text" value="<?php 
                if (get_option($value['id']) != "") {
                    echo htmlspecialchars(stripslashes(get_option($value['id'])));
                } else {
                    echo $value['std'];
                }
                ?>
" />
							</td>
						</tr>
			
					<?php 
                break;
                /* Text Area
                -------------------------------------------------------------- */
            /* Text Area
            -------------------------------------------------------------- */
            case 'textarea':
                ?>
 
						<tr>
							<td width="250px"><strong><?php 
                echo $value['name'];
                ?>
</strong><br />
								<small><a href="http://heatmaptheme.com/<?php 
                echo $subtitle;
                ?>
/version-<?php 
                echo $baseversion;
                ?>
/<?php 
                echo $value['userguide'];
                ?>
/"><strong>[User Guide]</strong></a></small><br /><br />
								<?php 
                echo $value['desc'];
                ?>
							</td>
							<td width="350px">
							<textarea name="<?php 
                echo $value['id'];
                ?>
" style="width:340px; height:120px; font-size:11px;" cols="" rows=""><?php 
                if (get_option($value['id']) != "") {
                    echo stripslashes(htmlspecialchars(get_option($value['id'])));
                } else {
                    echo $value['std'];
                }
                ?>
</textarea>
							</td> 
						</tr>
						
					<?php 
                break;
                /* Checkbox
                -------------------------------------------------------------- */
            /* Checkbox
            -------------------------------------------------------------- */
            case 'checkbox':
                ?>
						<tr>
							<td width="250px"><strong><?php 
                echo $value['name'];
                ?>
</strong><br />
								<small><a href="http://heatmaptheme.com/<?php 
                echo $subtitle;
                ?>
/version-<?php 
                echo $baseversion;
                ?>
/<?php 
                echo $value['userguide'];
                ?>
/"><strong>[User Guide]</strong></a></small><br /><br />
								<?php 
                echo $value['desc'];
                ?>
							</td>
							<td width="350px">
								<?php 
                if (get_option($value['id'])) {
                    $checked = "checked=\"checked\"";
                } else {
                    $checked = "";
                }
                ?>
								<input type="checkbox" name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" value="true" <?php 
                echo $checked;
                ?>
 />
							</td>
						</tr>
			
					<?php 
                break;
                /* Selection - a bit of a hack on this one - just using the select for preset mode in this case... I'll neaten this whole area of code up later I promise ;)
                -------------------------------------------------------------- */
            /* Selection - a bit of a hack on this one - just using the select for preset mode in this case... I'll neaten this whole area of code up later I promise ;)
            -------------------------------------------------------------- */
            case 'select':
                if ($preset_mode == TRUE && !$preset_mode_already_shown || $show_next_time == TRUE) {
                    ?>
			
					<table class="widefat" cellspacing="0" style="width:600px;"><tbody>
					
					<thead>
						<tr>
							<th colspan="2" scope="col">
								<?php 
                    echo 'Preset Mode';
                    ?>
 
								<div style="float:right">
									<input name="save" type="submit" value="Save" class="button-primary"/>
									<input type="hidden" name="action" value="save" />
								</div>
							</th>
						</tr>
					</thead>
					
					<tr>
						<td width="250px"><strong><?php 
                    echo $value['name'];
                    ?>
</strong><br />
						<small><a href="http://heatmaptheme.com/<?php 
                    echo $subtitle;
                    ?>
/version-<?php 
                    echo $baseversion;
                    ?>
/<?php 
                    echo $value['userguide'];
                    ?>
/"><strong>[User Guide]</strong></a></small><br /><br />
						<?php 
                    echo $value['desc'];
                    ?>
						
						</td>
						
						<td width="350px"><select style="width:100px;" name="<?php 
                    echo $value['id'];
                    ?>
" id="<?php 
                    echo $value['id'];
                    ?>
"><?php 
                    foreach ($value['options'] as $option) {
                        ?>
<option<?php 
                        if (get_settings($value['id']) == $option) {
                            echo ' selected="selected"';
                        } elseif ($option == $value['std']) {
                            echo ' selected="selected"';
                        }
                        ?>
><?php 
                        echo $option;
                        ?>
</option><?php 
                    }
                    ?>
</select></td>
					</tr>
					
					</tbody></table>
					<br />
					
					<?php 
                }
                $preset_mode_already_shown = TRUE;
                if ($preset_mode == FALSE) {
                    $show_next_time = TRUE;
                }
                break;
                /* Ad Combo box
                -------------------------------------------------------------- */
            /* Ad Combo box
            -------------------------------------------------------------- */
            case 'ad-combo':
                ?>
 
						<tr>
							<td width="250px">
							

							<input style="width:200px; font-size:11px; font-weight:bold;" name="<?php 
                echo $value['id'] . '_name';
                ?>
" id="<?php 
                echo $value['id'] . '_name';
                ?>
" type="text" value="<?php 
                if (get_option($value['id'] . '_name') != "") {
                    echo get_option($value['id'] . '_name');
                } else {
                    echo $value['name'];
                }
                ?>
" /><br />
							
								<?php 
                foreach ($value['checkbox'] as $checkbox_name => $checkbox_setting) {
                    $this_key = $value['id'] . '_' . $checkbox_name;
                    $this_setting = get_option($this_key);
                    if ($this_setting == '') {
                        $checked = "";
                    } else {
                        $checked = "checked=\"checked\"";
                    }
                    ?>
									
									<input type="checkbox" name="<?php 
                    echo $this_key;
                    ?>
" id="<?php 
                    echo $this_key;
                    ?>
" value="true" <?php 
                    echo $checked;
                    ?>
 /> <label for="<?php 
                    echo $this_key;
                    ?>
"><?php 
                    echo $checkbox_name;
                    ?>
</label><br />
								<?php 
                }
                ?>
								<small><a href="http://heatmaptheme.com/<?php 
                echo $subtitle;
                ?>
/version-<?php 
                echo $baseversion;
                ?>
/<?php 
                echo $value['userguide'];
                ?>
/"><strong>[User Guide]</strong></a></small><br />	
							</td>
							<td width="350px">
							
							<textarea name="<?php 
                echo $value['id'];
                ?>
" style="width:340px; height:120px; font-size:11px;" cols="" rows=""><?php 
                if (get_option($value['id']) != "") {
                    echo stripslashes(htmlspecialchars(get_option($value['id'])));
                } else {
                    echo $value['std'];
                }
                ?>
</textarea>
							</td> 
						</tr>
						
					<?php 
                break;
        }
    }
    ?>
	
<?php 
    /* Submit and Reset Buttons
    -------------------------------------------------------------- */
    ?>
			 
				<p class="submit">
					<input name="save" type="submit" value="Save changes" class="button-primary"/>
					<input type="hidden" name="action" value="save" />
				</p>
			</form>
			
			<form method="post">
				<p class="submit">
				<input name="reset" type="submit" value="Reset" class="button-secondary" />
				<input type="hidden" name="action" value="reset" />
			</p>
			</form>
			
			</div>
			
			
			<div style="float:left">
			

				
<?php 
    /* This is the right column of the options page
    -------------------------------------------------------------- */
    ?>
				
				<table class="widefat" cellspacing="0" style="width:350px; margin-left:15px;">
				
					<tbody> 
						<thead>
							<tr>
								<th colspan="2" scope="col">
									Latest News from <a href="http://heatmaptheme.com">HeatMapTheme.com</a>
								</th>
							</tr>
						</thead>
					
							<tr>
								<td width="350px">
									<?php 
    include_once ABSPATH . WPINC . '/rss.php';
    wp_rss('http://heatmaptheme.com/feed', 3);
    ?>
	
								</td>
							</tr>
					
					</tbody>
				</table>
				
				<br />
				
				<table class="widefat" cellspacing="0" style="width:350px; margin-left:15px;">
				
					<tbody> 
						<thead>
							<tr>
								<th colspan="2" scope="col">
									HeatMap Theme <a href="http://heatmaptheme.com/adsense-theme-for-wordpress/version-2/positioning-adsense-widgets-on-your-blog/" target="_blank">Widget Positions</a>
								</th>
							</tr>
						</thead>
					
							<tr>
								<td width="350px">
								
									<center><a href="http://heatmaptheme.com/adsense-theme-for-wordpress/version-2/positioning-adsense-widgets-on-your-blog/" target="_blank"><img src="<?php 
    echo bloginfo('template_url');
    ?>
/images/preset-images/widget-layout-small.gif" align="absbottom" width="150px" height="173px"  alt="View Widget Positions User Guide"/></a></center> 
								
						<?php 
    /*		<center><a href="http://heatmaptheme.com"><img src="<?php echo bloginfo('template_url'); ?>/images/mappy-wp-bw-250-web.png" align="absbottom" width="250px" height="181px" /></a></center> */
    ?>
								</td>
							</tr>
					
					</tbody>
				</table>
				
				
				<br />
			
				<table class="widefat" cellspacing="0" style="width:350px; margin-left:15px;">
				
					<tbody> 
						<thead>
							<tr>
								<th colspan="2" scope="col">
									Base Theme Info
								</th>
							</tr>
						</thead>
					
							<tr>
								<td width="150px">
									Author:<br />
									Theme Name:<br />
									Base Version:<br />
									This Version:
								</td>
								<td width="200px">
									<a href="http://stuartwider.com">Stuart Wider</a><br />
									<?php 
    echo $themename;
    ?>
<br />
									<?php 
    echo $baseversion;
    ?>
<br />
									<?php 
    echo $thisversion;
    ?>
								</td>
							</tr>
					
					</tbody>
				</table>
				
				<br />
			
				<?php 
    $ct = current_theme_info();
    if ($ct->parent_theme != '') {
        // if the current theme is a child theme then display extra details form the current theme array.
        ?>
				
				<table class="widefat" cellspacing="0" style="width:350px; margin-left:15px;">
				
					<tbody> 
						<thead>
							<tr>
								<th colspan="2" scope="col">
									Child Theme Info
								</th>
							</tr>
						</thead>
					
							<tr>
								<td width="150px">
									Author:<br />
									Theme Name:<br />
									Version:
								</td>
								<td width="200px">
									<?php 
        echo $ct->author . '<br />';
        echo $ct->name . '<br />';
        echo $ct->version;
        ?>
								</td>
							</tr>
					
					</tbody>
				</table>
				<br />
				
				<?php 
    }
    ?>
				
				<table class="widefat" cellspacing="0" style="width:350px; margin-left:15px;">
				
					<tbody> 
						<thead>
							<tr>
								<th colspan="2" scope="col">
									&copy; Copyright, Licensing and Trademarks
								</th>
							</tr>
						</thead>
					
							<tr>
								<td width="350px">
									<p><a href="http://heatmaptheme.com">HeatMap Theme</a> is copyright <a href="http://stuartwider.com">Stuart Wider</a> 2009 and distributed under the GPL3 License.</p>
									<?php 
    if ($ct->parent_theme != '') {
        ?>
<p>Child Themes are copyright of their respective Authors.</p><?php 
    }
    ?>
									<p>Google Adsense, Analytics, FeedBurner and Custom Search are trademarks of Google Inc.</p>
								</td>
							</tr>
					
					</tbody>
				
					
				</table>
				
			</div>
			
		
		</div>
		
<?php 
}
Пример #8
0
function scd_rss($atts)
{
    extract(shortcode_atts(array("feed" => 'http://', "num" => '1'), $atts));
    return wp_rss($feed, $num);
}
Пример #9
0
function readRss($atts, $content)
{
    extract(shortcode_atts(array("feed" => 'http://', "num" => '1'), $atts));
    return wp_rss($feed, $num);
}