示例#1
0
function axiom_sc_socials($atts, $content = null)
{
    if (axiom_sc_in_shortcode_blogger()) {
        return '';
    }
    extract(axiom_sc_html_decode(shortcode_atts(array("size" => "small", "socials" => "", "custom" => "no", "id" => "", "class" => "", "animation" => "", "css" => "", "top" => "", "bottom" => "", "left" => "", "right" => "", "quantity" => ""), $atts)));
    $css .= axiom_get_css_position_from_values($top, $right, $bottom, $left);
    global $AXIOM_GLOBALS;
    $AXIOM_GLOBALS['sc_social_icons'] = false;
    $style = 'icons';
    if (!empty($socials)) {
        $allowed = explode('|', $socials);
        $list = array();
        for ($i = 0; $i < count($allowed); $i++) {
            $s = explode('=', $allowed[$i]);
            if (!empty($s[1]) && $style != 'icons') {
                $list[] = array('icon' => axiom_get_socials_url($s[0]), 'url' => $s[1]);
            } else {
                $list[] = array('icon' => $s[0], 'url' => $s[1]);
            }
        }
        if (count($list) > 0) {
            $AXIOM_GLOBALS['sc_social_icons'] = $list;
        }
    } else {
        if (axiom_sc_param_is_off($custom)) {
            $content = do_shortcode($content);
        }
    }
    if ($AXIOM_GLOBALS['sc_social_icons'] === false) {
        $AXIOM_GLOBALS['sc_social_icons'] = axiom_get_custom_option('social_icons');
    }
    $output = axiom_prepare_socials($AXIOM_GLOBALS['sc_social_icons'], $style, $quantity);
    $output = $output ? '<div' . ($id ? ' id="' . esc_attr($id) . '"' : '') . ' class="sc_socials sc_socials_size_' . esc_attr($size) . (!empty($class) ? ' ' . esc_attr($class) : '') . '"' . ($css != '' ? ' style="' . esc_attr($css) . '"' : '') . (!axiom_sc_param_is_off($animation) ? ' data-animation="' . esc_attr(axiom_sc_get_animation_classes($animation)) . '"' : '') . '>' . $output . '</div>' : '';
    return apply_filters('axiom_shortcode_output', $output, 'trx_socials', $atts, $content);
}
示例#2
0
 function axiom_show_user_socials($args)
 {
     $args = array_merge(array('author_id' => 0, 'allowed' => array(), 'size' => 'small', 'style' => 'icons', 'echo' => true), is_array($args) ? $args : array('author_id' => $args));
     // If send one number parameter - use it as author's ID
     $output = '';
     $upload_info = wp_upload_dir();
     $upload_url = $upload_info['baseurl'];
     $social_list = axiom_get_theme_option('social_icons');
     $list = array();
     foreach ($social_list as $soc) {
         $sn = basename($soc['icon']);
         $sn = $args['style'] == 'icons' ? axiom_substr($sn, axiom_strrpos($sn, '-') + 1) : axiom_substr($sn, 0, axiom_strrpos($sn, '.'));
         if (($pos = axiom_strrpos($sn, '_')) !== false) {
             $sn = axiom_substr($sn, 0, $pos);
         }
         if (count($args['allowed']) == 0 || in_array($sn, $args['allowed'])) {
             $link = get_the_author_meta('user_' . $sn, $args['author_id']);
             if ($link) {
                 $icon = $args['style'] == 'icons' || axiom_strpos($soc['icon'], $upload_url) !== false ? $soc['icon'] : axiom_get_socials_url(basename($soc['icon']));
                 $list[] = array('icon' => $icon, 'url' => $link);
             }
         }
     }
     if (count($list) > 0) {
         $output = '<div class="sc_socials sc_socials_size_' . esc_attr($args['size']) . '">' . trim(axiom_prepare_socials($list, $args['style'])) . '</div>';
         if ($args['echo']) {
             echo $output;
         }
     }
     return $output;
 }
示例#3
0
文件: login.php 项目: pcuervo/odc
					<label for="rememberme"><?php 
_e('Remember me', 'axiom');
?>
</label>
				</div>
				<div class="popup_form_field submit_field"><input type="submit" class="submit_button" value="<?php 
_e('Login', 'axiom');
?>
"></div>
			</form>
		</div>
		<div class="form_right">
			<div class="login_socials_title"><?php 
_e('You can login using your social profile', 'axiom');
?>
</div>
			<div class="login_socials_list sc_socials sc_socials_size_tiny">
				<?php 
$list = array(array('icon' => axiom_get_socials_url('facebook'), 'url' => '#'), array('icon' => axiom_get_socials_url('twitter'), 'url' => '#'), array('icon' => axiom_get_socials_url('gplus'), 'url' => '#'));
echo trim(axiom_prepare_socials($list));
?>
			</div>
			<div class="login_socials_problem"><a href="#"><?php 
_e('Problem with login?', 'axiom');
?>
</a></div>
			<div class="result message_block"></div>
		</div>
	</div>	<!-- /.login_wrap -->
</div>		<!-- /.popup_login -->