<!-- Social Profile --> <div class="custom-box"> <div class="column one-sixth"> <label><?php _e('Social Profile', 'dt_themes'); ?> </label> </div> <div class="column five-sixth last"> <?php $d = array_key_exists("teacher-social", $teacher_settings) ? $teacher_settings['teacher-social'] : array(); $sociables_icons_path = plugin_dir_path(__FILE__); $x = explode("designthemes-core-features", $sociables_icons_path); $sociables_icons_path = $x[0] . 'designthemes-core-features/shortcodes/images/sociables'; $sociables = DTCoreShortcodesDefination::dtListImages($sociables_icons_path); $i = 1; foreach ($sociables as $k => $sociable) { if (!strpos($sociable, '@')) { if ($i === 3) { $class = "column one-third last"; $i = 1; } else { $class = "column one-third"; $i++; } $v = array_key_exists($k, $d) ? $d[$k] : ""; ?> <div class="<?php echo $class; ?>
/** * * @param unknown $attrs * @param string $content * @return string */ function dt_sc_team($attrs, $content = null) { $dir_path = plugin_dir_path(__FILE__) . "images/sociables/"; $sociables_icons = DTCoreShortcodesDefination::dtListImages($dir_path); $sociables = array_values($sociables_icons); $attributes = array('name' => '', 'image' => 'http://placehold.it/300', 'role' => '', 'alt' => '', 'title' => ''); foreach ($sociables as $sociable) { $attributes[$sociable] = ''; } extract(shortcode_atts($attributes, $attrs)); $content = DTCoreShortcodesDefination::dtShortcodeHelper($content); $image = "<img src='{$image}' alt='{$alt}' title='{$title}' />"; $name = empty($name) ? "" : "<h5>{$name}</h5>"; $role = empty($role) ? "" : "<h6>{$role}</h6>"; $s = ""; $path = plugin_dir_url(__FILE__) . "images/sociables/"; foreach ($sociables as $sociable) { $img = array_search($sociable, $sociables_icons); $class = explode(".", $img); $class = $class[0]; $s .= empty(${$sociable}) ? "" : "<li class='{$class}'><a href='{${$sociable}}' target='_blank'> <img src='{$path}hover/{$img}' alt='{$sociable}'/> <img src='{$path}{$img}' alt='{$sociable}'/> </a></li>"; } $s = !empty($s) ? "<div class='dt-sc-social-icons'><ul>{$s}</ul></div>" : ""; $out = "<div class='dt-sc-team'>"; $out .= "\t<div class='image'>{$image}</div>"; $out .= ' <div class="team-details">'; $out .= $name . $role . $content . $s; $out .= ' </div>'; $out .= '</div>'; return $out; }
/** * * @param unknown $attrs * @param string $content * @return string */ function dt_sc_team($attrs, $content = null) { $dir_path = plugin_dir_path(__FILE__) . "images/sociables/"; $sociables_icons = DTCoreShortcodesDefination::dtListImages($dir_path); $sociables = array_values($sociables_icons); $attributes = array('name' => '', 'image' => 'http://placehold.it/182x208', 'role' => '', 'alt' => __('Please specify image url', 'dt_themes'), 'title' => __('Please specify image url', 'dt_themes'), 'animation' => 'fadeInUp'); foreach ($sociables as $sociable) { $attributes[$sociable] = ''; } extract(shortcode_atts($attributes, $attrs)); $image = "<img src='{$image}' alt='{$alt}' title='{$title}' class='thumb-image' />"; $danimation = !empty($animation) ? " data-animation='{$animation}' " : " "; $danimate = !empty($animation) ? " animate " : " "; $name = empty($name) ? "" : "<h5>{$name}</h5>"; $role = empty($role) ? "" : "<span>{$role}</span>"; $content = DTCoreShortcodesDefination::dtShortcodeHelper($content); $s = ""; $path = plugin_dir_url(__FILE__) . "images/sociables/"; foreach ($sociables as $sociable) { $img = array_search($sociable, $sociables_icons); $s .= empty(${$sociable}) ? "" : "<li><a href='{${$sociable}}' class='{$sociable}'></a></li>"; } $out = "<div class='dt-sc-team {$danimate}' {$danimation}>\n <figure class='ca5533team-thumb'>\n <img title='' alt='' src='" . plugin_dir_url(__FILE__) . "images/hexa-bg.png' class='dt-sc-item-mask'>\n {$image}\n </figure>\n <div class='dt-sc-team-content'>\n \t{$name}\n {$role}\n <p>{$content}</p>\n </div>\n\t\t\t\t\t\t\t\t<ul class='dt-sc-social-icon'>\n\t\t\t\t\t\t\t\t{$s}\n\t\t\t\t\t\t\t\t</ul>\n </div>"; return $out; }