示例#1
0
 function render($atts, $content = null)
 {
     if (empty($atts['custom_title'])) {
         $atts['custom_title'] = 'Weather';
     }
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     if (empty($td_column_number)) {
         $td_column_number = td_util::vc_get_column_number();
         // get the column width of the block from the page builder API
     }
     $buffy = '';
     //output buffer
     $buffy .= '<div class="' . $this->get_block_classes() . '">';
     //get the block title
     $buffy .= $this->get_block_title();
     $buffy .= '<div id=' . $this->block_uid . ' class="td-weather-wrap td_block_inner td-column-' . $td_column_number . '">';
     $buffy .= td_weather::render_generic($atts, $this->block_uid);
     $buffy .= '</div>';
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
示例#2
0
<div class="td-header-sp-top-menu">


	<?php 
// show the weather if needed
if (td_util::get_option('tds_weather_top_menu') == 'show') {
    $atts['w_location'] = td_util::get_option('tds_weather_location_top_menu');
    $atts['w_units'] = td_util::get_option('tds_weather_units_top_menu');
    // render the weather
    echo td_weather::render_generic($atts, 'td_top_weather_uid', 'top_bar_template');
}
// show the date and time if needed
if (td_util::get_option('tds_data_top_menu') == 'show') {
    $tds_data_time = td_util::get_option('tds_data_time_format');
    if ($tds_data_time == '') {
        $tds_data_time = 'l, F j, Y';
    }
    echo '<div class="td_data_time">';
    echo date_i18n(stripslashes($tds_data_time));
    echo '</div>';
}
//show login widget
if (td_util::get_option('tds_login_sign_in_widget') == 'show') {
    //test if user is logd in or not
    if (is_user_logged_in()) {
        //get current logd in user data
        global $current_user;
        //<span class="td-sp-ico-logout"></span>
        echo '<ul class="top-header-menu td_ul_logout">
                        <li class="menu-item">' . get_avatar($current_user->ID, 20) . '<a href="' . get_author_posts_url($current_user->ID) . '" class="td_user_logd_in">' . $current_user->display_name . '</a><i class="td-icon-logout"></i>' . '</li>