function dt_sc_newsletter_section($atts, $content = null) { extract(shortcode_atts(array('title' => ''), $atts)); $content = DTCoreShortcodesDefination::dtShortcodeHelper($content); $out = '<section id="newsletter"> <h2 class="border-title aligncenter">' . $title . '</h2> <h6> ' . $content . ' </h6> <form name="frmsubscribe" method="post" class="dt-sc-subscribe-frm"> <input type="email" name="dt_sc_mc_emailid" required="" placeholder="' . __('Your Email Address', 'dt_themes') . '" /> <input type="hidden" name="dt_sc_mc_listid" value="' . stripslashes(dttheme_option('general', 'mailchimp-listid')) . '" /> <input type="submit" name="submit" class="dt-sc-button small" value="' . __('Subscribe', 'dt_themes') . '" /> </form>'; if (isset($_REQUEST['dt_sc_mc_emailid'])) { require_once IAMD_FW . "theme_widgets/mailchimp/MCAPI.class.php"; $mcapi = new MCAPI(dttheme_wp_kses(dttheme_option('general', 'mailchimp-key'))); $list_id = dttheme_option('general', 'mailchimp-listid'); if ($mcapi->listSubscribe($list_id, $_REQUEST['dt_sc_mc_emailid'])) { $msg = '<span class="success-msg">' . __('Success! Check your inbox or spam folder for a message containing a confirmation link.', 'dt_themes') . '</span>'; } else { $msg = '<span class="error-msg"><b>' . __('Error:', 'dt_themes') . '</b> ' . $mcapi->errorMessage . '</span>'; } } if (isset($msg)) { $out .= '<div class="dt_sc_mc_result">' . $msg . '</div>'; } $out .= '</section>'; return $out; }
function widget($args, $instance) { extract($args); echo $before_widget; $title = empty($instance['title']) ? '' : strip_tags($instance['title']); $title = apply_filters('widget_title', $title); $desc = empty($instance['desc']) ? '' : strip_tags($instance['desc']); $list_id = isset($instance['list_id']) ? $instance['list_id'] : ''; if (!empty($title)) { echo $before_title . $title . $after_title; } if (!empty($desc)) { echo "<p>{$desc}</p>"; } if (isset($_REQUEST['mythem_mc_emailid'])) { require_once IAMD_FW . "theme_widgets/mailchimp/MCAPI.class.php"; $mcapi = new MCAPI(dttheme_wp_kses(dttheme_option('general', 'mailchimp-key'))); $merge_vars = array('EMAIL' => $_REQUEST['mythem_mc_emailid']); $list_id = $instance['list_id']; if ($mcapi->listSubscribe($list_id, $_REQUEST['mythem_mc_emailid'], $merge_vars)) { // It worked! $msg = '<span class="success-msg">' . __('Success! Please check your inbox or spam folder.', 'dt_themes') . '</span>'; } else { // An error ocurred, return error message $msg = '<span class="error-msg"><b>' . __('Error:', 'dt_themes') . '</b> ' . $mcapi->errorMessage . '</span>'; } } echo '<form method="post" class="mailchimp-form">'; echo ' <input type="email" placeholder="' . __('Enter Email Address', 'dt_themes') . '" name="mythem_mc_emailid" value="" required/>'; echo "\t<input type='hidden' name='mythem_mc_listid' value='{$list_id}' />"; echo ' <input type="submit" name="submit" class="nl-submit" value="Signup" />'; echo '</form>'; if (isset($msg)) { echo '<span class="zn_mailchimp_result">' . $msg . '</span>'; } echo $after_widget; }
register_sidebar(array('name' => __("Search Sidebar Right", 'dt_themes'), 'id' => 'search-sidebar-right', 'description' => __("Search page sidebar that appears on the right.", "dt_themes"), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>')); } } #404 Page Layout $layout_404 = dttheme_option('specialty', 'not-found-404-layout'); $layout_404 = !empty($layout_404) ? $layout_404 : "content-full-width"; if ($layout_404 != "content-full-width") { if ($layout_404 == "with-left-sidebar" || $layout_404 == "both-sidebar") { register_sidebar(array('name' => __('Not Found ( 404 ) Sidebar Left', 'dt_themes'), 'id' => 'not-found-404-sidebar-left', 'description' => __("404 page sidebar that appears on the left.", "dt_themes"), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>')); } if ($layout_404 == "with-right-sidebar" || $layout_404 == "both-sidebar") { register_sidebar(array('name' => __('Not Found ( 404 ) Sidebar Right', 'dt_themes'), 'id' => 'not-found-404-sidebar-right', 'description' => __("404 page sidebar that appears on the right.", "dt_themes"), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>')); } } #Custom Mega Menu Sidebars $widgets = dttheme_wp_kses(dttheme_option('widgetarea', 'megamenu')); $widgets = is_array($widgets) ? array_unique($widgets) : array(); $widgets = array_filter($widgets); foreach ($widgets as $key => $value) { $id = mb_convert_case($value, MB_CASE_LOWER, "UTF-8"); $id = str_replace(" ", "-", $id); register_sidebar(array('name' => $value, 'id' => $id, 'description' => __("A unique mega menu sidebar that is created in Admin panel", "dt_themes"), 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>')); } #Footer Columnns $footer_columns = dttheme_option('general', 'footer-columns'); dttheme_footer_widgetarea($footer_columns); if (class_exists('woocommerce')) { #Custom Left Sidebars for Product $products = dttheme_option("widgetarea", "left-products"); $products = !empty($products) ? $products : array(); $widget_areas_for_products = array_filter(array_unique($products));
<?php $dt_bp_data = dttheme_option("bp"); $dt_bp_data = is_array($dt_bp_data) ? $dt_bp_data : array(); $dt_per_page = array_key_exists("members-per-page", $dt_bp_data) ? dttheme_wp_kses($dt_bp_data["members-per-page"]) : 10; $dt_per_page - intval($dt_per_page); ?> <?php do_action('bp_before_members_loop'); $columns = $post_class = ""; $members_page_layout = dttheme_option('bp', "members-page-layout"); switch ($members_page_layout) { case "one-half-column": $columns = 2; $post_class = "column dt-sc-one-half"; break; case "one-third-column": $columns = 3; $post_class = "column dt-sc-one-third"; break; case "one-fourth-column": $columns = 4; $post_class = "column dt-sc-one-fourth"; break; default: $columns = 4; $post_class = "column dt-sc-one-fourth"; break; } if (bp_has_members(bp_ajax_querystring('members') . '&per_page=' . $dt_per_page)) {
the_post(); $post_id = get_the_ID(); $dt_assignment_course = get_post_meta($post_id, "dt-assignment-course", true); if (isset($dt_assignment_course) && $dt_assignment_course != '') { ?> <article id="post-<?php the_ID(); ?> " <?php post_class('dt-sc-assignment-single'); ?> > <?php $assignment_subtitle = dttheme_wp_kses(get_post_meta($post_id, "assignment-subtitle", true)); $assignment_maximum_mark = get_post_meta($post_id, "assignment-maximum-mark", true); $assignment_enable_textarea = get_post_meta($post_id, "assignment-enable-textarea", true); $assignment_enable_attachment = get_post_meta($post_id, "assignment-enable-attachment", true); ?> <h2><?php the_title(); ?> </h2> <h5><?php echo $assignment_subtitle; ?> </h5> <?php the_content();
$out .= '</li>'; $j++; } $out .= '</ul>'; } } else { if ($question_type == 'boolean') { $out .= '<div class="dt-boolean">'; $out .= '<input type="radio" name="dt-question-' . $question_id . '" value="true" /> <label>' . __('True', 'dt_themes') . '</label>'; $out .= '<input type="radio" name="dt-question-' . $question_id . '" value="false" /> <label>' . __('False', 'dt_themes') . '</label>'; $out .= '</div>'; } else { if ($question_type == 'gap-fill') { $text_before_gap = dttheme_wp_kses(get_post_meta($question_id, 'text-before-gap', TRUE)); $text_before_gap = !empty($text_before_gap) ? $text_before_gap : ''; $text_after_gap = dttheme_wp_kses(get_post_meta($question_id, 'text-after-gap', TRUE)); $text_after_gap = !empty($text_after_gap) ? $text_after_gap : ''; $out .= '<div class="dt-gapfill">'; $out .= $text_before_gap . ' <input type="text" name="dt-question-' . $question_id . '" value="" class="dt-gap" /> ' . $text_after_gap; $out .= '</div>'; } else { if ($question_type == 'single-line') { $out .= '<input type="text" name="dt-question-' . $question_id . '" value="" />'; } else { if ($question_type == 'multi-line') { $out .= '<textarea name="dt-question-' . $question_id . '"></textarea>'; } } } } }
"></div> <div id="dt-sc-ajax-load-image" style="display:none;"><img src="<?php echo IAMD_BASE_URL . "images/loading.png"; ?> " alt="" /></div> <div id="dt-quiz-questions-container"> <?php if (isset($_REQUEST['dttype']) && $_REQUEST['dttype'] != '') { dt_list_questions_with_answers($dt_lesson_course, $lessons[0]->ID); } else { if (IAMD_USER_ROLE == 's2member_level2' || IAMD_USER_ROLE == 's2member_level3' || IAMD_USER_ROLE == 's2member_level4' || current_user_can($s2_level) || is_user_logged_in() && $private_lesson == '') { $user_id = get_current_user_id(); $dt_gradings = dt_get_user_gradings_array($dt_lesson_course, $lessons[0]->ID, $quiz_id, $user_id); $dt_grade_post = get_posts($dt_gradings); $quiz_duration = dttheme_wp_kses(get_post_meta($quiz_id, "quiz-duration", true)); $quiz_duration = isset($quiz_duration) && $quiz_duration > 0 ? $quiz_duration : 0; if (isset($dt_grade_post[0])) { $grade = get_post_meta($dt_grade_post[0]->ID, "graded", true); if (isset($grade) && $grade != '') { echo '<div class="dt-sc-info-box">' . __('Your quiz have been graded already, please check your dashboard for futher details!', 'dt_themes') . '</div>'; } else { if (dt_can_user_retake_quiz($dt_lesson_course, $lessons[0]->ID, $quiz_id, $user_id)) { if ($quiz_duration > 0) { echo '<p class="dt-sc-info-box">'; echo '<strong>' . __('Note: ', 'dt_themes') . '</strong>'; echo sprintf(__('You have to complete the quiz in %dmin(s). Timer will be triggered once you press the "Start Quiz" button.', 'dt_themes'), $quiz_duration); echo '</p>'; } echo '<a class="dt-sc-button small filled" name="start_quiz" id="dt-start-quiz">' . __('Start Quiz', 'dt_themes') . '</a>'; } else {
if (isset($terms) && !empty($terms)) { $lesson_terms = array(); foreach ($terms as $term) { if ($private_lesson != '') { $lesson_terms[] = $term->name; } else { $lesson_terms[] = '<a href="' . get_term_link($term->slug, 'lesson_complexity') . '">' . $term->name . '</a>'; } } $lesson_terms = join(", ", $lesson_terms); } $lesson_course = get_post_meta($lesson_item->ID, "dt_lesson_course", true); $lesson_course_data = get_post($lesson_course); $lesson_meta_data = get_post_meta($lesson_item->ID, '_lesson_settings'); if (isset($lesson_meta_data[0]['lesson-duration']) && $lesson_meta_data[0]['lesson-duration'] != '') { $duration = dttheme_wp_kses($lesson_meta_data[0]['lesson-duration']) . ' mins'; } else { $duration = ''; } echo '<tr> <td class="lessons-table-course"><a href="' . get_permalink($lesson_course_data->ID) . '">' . $lesson_course_data->post_title . '</a></td> <td class="lessons-table-title"><a href="' . get_permalink($lesson_item->ID) . '">' . $lesson_item->post_title . '</a></td> <td class="lessons-table-type">' . $lesson_terms . '</td> <td class="lessons-table-length">' . $duration . '</td> </tr>'; } echo '</tbody>'; echo '</table>'; } ?>
<div class="bpanel-box"> <div class="box-title"> <h3><?php _e('General', 'dt_themes'); ?> </h3> </div> <div class="box-content"> <div class="column one-third"><label><?php _e('Currency Symbol', 'dt_themes'); ?> </label></div> <div class="column two-third last"> <input name="mytheme[dt_course][currency]" type="text" class="small" value="<?php echo trim(stripslashes(dttheme_wp_kses(dttheme_option('dt_course', 'currency')))); ?> " /> <p class="note"><?php _e('Please set default currency symbol which will be used in front end display', 'dt_themes'); ?> </p> </div> <div class="hr_invisible"> </div> <div class="column one-third"><label><?php _e('Currency Symbol Position', 'dt_themes'); ?> </label></div> <div class="column two-third last">
while (have_posts()) { the_post(); $the_id = get_the_ID(); ?> <article id="post-<?php the_ID(); ?> " <?php post_class('dt-sc-certificate-single'); ?> > <?php $background_image = get_post_meta($post->ID, 'background-image', TRUE); $custom_class = dttheme_wp_kses(get_post_meta($post->ID, 'custom-class', TRUE)); $enable_print = get_post_meta($post->ID, 'enable-print', TRUE); if (is_user_logged_in() && isset($enable_print) && $enable_print != '') { echo '<a href="#" class="dt_print_certificate"><span class="fa fa-print"></span>' . __('Print', 'dt_themes') . '</a>'; } echo '<div class="dt-sc-certificate-container ' . $custom_class . '" style="background-image:' . $background_image . '">'; echo do_shortcode(get_the_content()); echo '</div>'; ?> </article> <?php } }
function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { global $_wp_nav_menu_max_depth; $_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth; ob_start(); $item_id = esc_attr($item->ID); $removed_args = array('action', 'customlink-tab', 'edit-menu-item', 'menu-item', 'page-tab', '_wpnonce'); $original_title = ''; if ('taxonomy' == $item->type) { $original_title = get_term_field('name', $item->object_id, $item->object, 'raw'); if (is_wp_error($original_title)) { $original_title = false; } } elseif ('post_type' == $item->type) { $original_object = get_post($item->object_id); $original_title = get_the_title($original_object->ID); } $classes = array('menu-item menu-item-depth-' . $depth, 'menu-item-' . esc_attr($item->object), 'menu-item-edit-' . (isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] ? 'active' : 'inactive')); $title = $item->title; if (!empty($item->_invalid)) { $classes[] = 'menu-item-invalid'; /* translators: %s: title of menu item which is invalid */ $title = sprintf(__('%s (Invalid)'), $item->title); } elseif (isset($item->post_status) && 'draft' == $item->post_status) { $classes[] = 'pending'; /* translators: %s: title of menu item in draft status */ $title = sprintf(__('%s (Pending)'), $item->title); } $title = !isset($item->label) || '' == $item->label ? $title : $item->label; $submenu_text = ''; if (0 == $depth) { $submenu_text = 'style="display: none;"'; } ?> <li id="menu-item-<?php echo $item_id; ?> " class="<?php echo implode(' ', $classes); ?> "> <dl class="menu-item-bar"> <dt class="menu-item-handle"> <span class="item-title"><span class="menu-item-title"><?php echo esc_html($title); ?> </span> <span class="is-submenu" <?php echo $submenu_text; ?> ><?php _e('sub item'); ?> </span></span> <span class="item-controls"> <span class="item-type"><?php echo esc_html($item->type_label); ?> </span> <span class="item-order hide-if-js"> <a href="<?php echo wp_nonce_url(add_query_arg(array('action' => 'move-up-menu-item', 'menu-item' => $item_id), remove_query_arg($removed_args, admin_url('nav-menus.php'))), 'move-menu_item'); ?> " class="item-move-up"><abbr title="<?php esc_attr_e('Move up'); ?> ">↑</abbr></a> | <a href="<?php echo wp_nonce_url(add_query_arg(array('action' => 'move-down-menu-item', 'menu-item' => $item_id), remove_query_arg($removed_args, admin_url('nav-menus.php'))), 'move-menu_item'); ?> " class="item-move-down"><abbr title="<?php esc_attr_e('Move down'); ?> ">↓</abbr></a> </span> <a class="item-edit" id="edit-<?php echo $item_id; ?> " title="<?php esc_attr_e('Edit Menu Item'); ?> " href="<?php echo isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] ? admin_url('nav-menus.php') : add_query_arg('edit-menu-item', $item_id, remove_query_arg($removed_args, admin_url('nav-menus.php#menu-item-settings-' . $item_id))); ?> "><?php _e('Edit Menu Item'); ?> </a> </span> </dt> </dl> <div class="menu-item-settings" id="menu-item-settings-<?php echo $item_id; ?> "> <?php if ('custom' == $item->type) { ?> <p class="field-url description description-wide"> <label for="edit-menu-item-url-<?php echo $item_id; ?> "> <?php _e('URL'); ?> <br /> <input type="text" id="edit-menu-item-url-<?php echo $item_id; ?> " class="widefat code edit-menu-item-url" name="menu-item-url[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->url); ?> " /> </label> </p> <?php } ?> <p class="description description-thin"> <label for="edit-menu-item-title-<?php echo $item_id; ?> "> <?php _e('Navigation Label'); ?> <br /> <input type="text" id="edit-menu-item-title-<?php echo $item_id; ?> " class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->title); ?> " /> </label> </p> <p class="description description-thin"> <label for="edit-menu-item-attr-title-<?php echo $item_id; ?> "> <?php _e('Title Attribute'); ?> <br /> <input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?> " class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->post_excerpt); ?> " /> </label> </p> <p class="field-link-target description"> <label for="edit-menu-item-target-<?php echo $item_id; ?> "> <input type="checkbox" id="edit-menu-item-target-<?php echo $item_id; ?> " value="_blank" name="menu-item-target[<?php echo $item_id; ?> ]"<?php checked($item->target, '_blank'); ?> /> <?php _e('Open link in a new window/tab'); ?> </label> </p> <p class="field-css-classes description description-thin"> <label for="edit-menu-item-classes-<?php echo $item_id; ?> "> <?php _e('CSS Classes (optional)'); ?> <br /> <input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?> " class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?> ]" value="<?php echo esc_attr(implode(' ', $item->classes)); ?> " /> </label> </p> <p class="field-xfn description description-thin"> <label for="edit-menu-item-xfn-<?php echo $item_id; ?> "> <?php _e('Link Relationship (XFN)'); ?> <br /> <input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?> " class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->xfn); ?> " /> </label> </p> <!-- DesignThemes Custom Code Begins Here--> <?php $value = get_post_meta($item->ID, '_dt-use-as-megamenu', true); ?> <p class="field-dt-use-as-megamenu description description-thin"> <label for="edit-menu-item-dt-use-as-megamenu-<?php echo $item_id; ?> "> <input type="checkbox" id="edit-menu-item-dt-use-as-megamenu-<?php echo $item_id; ?> " value="1" name="dt-use-as-megamenu[<?php echo $item_id; ?> ]"<?php checked($value, 1); ?> /> <?php _e('Use As Mega Menu', 'dt_themes'); ?> </label> </p> <?php $value = get_post_meta($item->ID, '_dt-disable-text', true); ?> <p class="field-dt-disable-text description description-thin"> <label for="edit-menu-item-dt-disable-text-<?php echo $item_id; ?> "> <input type="checkbox" id="edit-menu-item-dt-disable-text-<?php echo $item_id; ?> " value="1" name="dt-disable-text[<?php echo $item_id; ?> ]"<?php checked($value, 1); ?> /> <?php _e('Disable Text', 'dt_themes'); ?> </label> </p> <?php $value = get_post_meta($item->ID, '_dt-disable-link', true); ?> <p class="field-dt-disable-link description description-thin"> <label for="edit-menu-item-dt-disable-link-<?php echo $item_id; ?> "> <input type="checkbox" id="edit-menu-item-dt-disable-link-<?php echo $item_id; ?> " value="1" name="dt-disable-link[<?php echo $item_id; ?> ]"<?php checked($value, 1); ?> /> <?php _e('Disable Link', 'dt_themes'); ?> </label> </p> <?php $value = get_post_meta($item->ID, '_dt-fullwidth', true); ?> <p class="field-dt-fullwidth description description-thin"> <label for="edit-menu-item-dt-fullwidth<?php echo $item_id; ?> "> <input type="checkbox" id="edit-menu-item-dt-fullwidth<?php echo $item_id; ?> " value="1" name="dt-fullwidth[<?php echo $item_id; ?> ]"<?php checked($value, 1); ?> /> <?php _e('Enable Full width', 'dt_themes'); ?> </label> </p> <?php $value = get_post_meta($item->ID, '_dt-custom-content', true); ?> <p class="field-dt-content description description-wide"> <label for="edit-menu-item-dt-content-<?php echo $item_id; ?> "> <?php _e('Custom Content', 'dt_themes'); ?> <br /> <textarea id="edit-menu-item-dt-content-<?php echo $item_id; ?> " class="widefat edit-menu-item-dt-content" rows="3" cols="20" name="dt-content[<?php echo $item_id; ?> ]"><?php echo esc_html($value); // textarea_escaped ?> </textarea> <span class="description"><?php _e('The description will be displayed in the menu if the current theme supports it.', 'dt_themes'); ?> </span> </label> </p> <?php $value = get_post_meta($item->ID, '_dt-columns', true); ?> <p class="field-dt-submenu-column description description-wide"> <label for="edit-menu-item-dt-submenu-column-<?php echo $item_id; ?> "> <?php _e('Sub Menu Column Layout', 'dt_themes'); ?> <br /> <select id="edit-menu-item-dt-submenu-column-<?php echo $item_id; ?> " class="widefat edit-menu-item-dt-submenu-column" name="dt-submenu-column[<?php echo $item_id; ?> ]"> <?php for ($i = 2; $i <= 4; $i++) { ?> <option value="<?php echo $i; ?> " <?php selected($value, $i); ?> ><?php echo $i; ?> </option> <?php } ?> </select> <span class="description"><?php _e('Select where to align the submenu.', 'dt_themes'); ?> </span> </label> </p> <?php $value = get_post_meta($item->ID, "_dt-menu-icon", true); ?> <p class="field-dt-menuicon description description-wide"> <label for="edit-menu-item-dt-menu-icon-<?php echo $item_id; ?> "> <?php _e('Menu Icon', 'dt_themes'); ?> <br/> <input id="edit-menu-item-dt-menu-icon-<?php echo $item_id; ?> " class="widefat edit-menu-item-dt-menu-icon" type="text" name="dt-menu-icon[<?php echo $item_id; ?> ]" value="<?php echo $value; ?> "> <span class="description"><?php _e('Please use font awesome icon ', 'dt_themes'); ?> </span> </label> </p> <?php $selected = get_post_meta($item->ID, '_dt-menu-widget', true); ?> <p class="field-dt-submenu-widget description description-wide"> <label for="edit-menu-item-dt-submenu-widget-<?php echo $item_id; ?> "> <?php _e('Display Widget Area', 'dt_themes'); ?> <br /> <select id="edit-menu-item-dt-submenu-widget-<?php echo $item_id; ?> " class="widefat edit-menu-item-dt-submenu-widget" name="dt-submenu-widget[<?php echo $item_id; ?> ]"> <option value=""><?php _e('Select', 'dt_themes'); ?> </option><?php $widgets = dttheme_wp_kses(dttheme_option('widgetarea', 'megamenu')); $widgets = is_array($widgets) ? array_unique($widgets) : array(); $widgets = array_filter($widgets); foreach ($widgets as $widget) { $id = mb_convert_case($widget, MB_CASE_LOWER, "UTF-8"); $id = str_replace(" ", "-", $id); echo "<option value='{$id}' " . selected($selected, $id, false) . ">{$widget}</option>"; } ?> </select> <span class="description"><?php _e('Select widget area to show.', 'dt_themes'); ?> </span> </label> </p> <?php $value = get_post_meta($item->ID, '_dt-fill-columns', true); ?> <p class="field-dt-widgetarea-column description description-wide"> <label for="edit-menu-item-dt-submenu-column-<?php echo $item_id; ?> "> <?php _e('Fill Widget Area Layout', 'dt_themes'); ?> <br /> <select id="edit-menu-item-dt-widgetarea-column-<?php echo $item_id; ?> " class="widefat edit-menu-item-dt-submenu-column" name="dt-widgetarea-column[<?php echo $item_id; ?> ]"> <option value=""><?php _e('select', 'dt_themes'); ?> </option> <?php for ($i = 2; $i <= 4; $i++) { ?> <option value="<?php echo $i; ?> " <?php selected($value, $i); ?> ><?php echo $i; ?> </option> <?php } ?> </select> <span class="description"><?php _e('Only works if you choose widget area', 'dt_themes'); ?> </span> </label> </p> <!-- DesignThemes Custom Code Ends Here--> <p class="field-move hide-if-no-js description description-wide"> <label> <span><?php _e('Move'); ?> </span> <a href="#" class="menus-move-up"><?php _e('Up one'); ?> </a> <a href="#" class="menus-move-down"><?php _e('Down one'); ?> </a> <a href="#" class="menus-move-left"></a> <a href="#" class="menus-move-right"></a> <a href="#" class="menus-move-top"><?php _e('To the top'); ?> </a> </label> </p> <div class="menu-item-actions description-wide submitbox"> <?php if ('custom' != $item->type && $original_title !== false) { ?> <p class="link-to-original"> <?php printf(__('Original: %s'), '<a href="' . esc_attr($item->url) . '">' . esc_html($original_title) . '</a>'); ?> </p> <?php } ?> <a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?> " href="<?php echo wp_nonce_url(add_query_arg(array('action' => 'delete-menu-item', 'menu-item' => $item_id), admin_url('nav-menus.php')), 'delete-menu_item_' . $item_id); ?> "><?php _e('Remove'); ?> </a> <span class="meta-sep hide-if-no-js"> | </span> <a class="item-cancel submitcancel hide-if-no-js" id="cancel-<?php echo $item_id; ?> " href="<?php echo esc_url(add_query_arg(array('edit-menu-item' => $item_id, 'cancel' => time()), admin_url('nav-menus.php'))); ?> #menu-item-settings-<?php echo $item_id; ?> "><?php _e('Cancel'); ?> </a> </div> <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?> ]" value="<?php echo $item_id; ?> " /> <input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->object_id); ?> " /> <input class="menu-item-data-object" type="hidden" name="menu-item-object[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->object); ?> " /> <input class="menu-item-data-parent-id" type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->menu_item_parent); ?> " /> <input class="menu-item-data-position" type="hidden" name="menu-item-position[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->menu_order); ?> " /> <input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->type); ?> " /> </div><!-- .menu-item-settings--> <ul class="menu-item-transport"></ul> <?php $output .= ob_get_clean(); }
function dttheme_custom_widgetarea_list($id, $selected = "", $class = "mytheme_select", $sidebar) { $name = explode(",", $id); if (count($name) > 1) { $name = "[{$name[0]}][{$name[1]}]"; } else { $name = "[{$name[0]}]"; } $name = $class == "multidropdown" ? "mytheme{$name}[]" : "mytheme{$name}"; $widgets = dttheme_wp_kses(dttheme_option('widgetarea', $sidebar)); $widgets = is_array($widgets) ? array_unique($widgets) : array(); $widgets = array_filter($widgets); $output = "<select name='{$name}' class='{$class}'>"; $output .= "<option value=''>" . __('Select Widget Area', 'dt_themes') . "</option>"; foreach ($widgets as $widget) { $id = mb_convert_case($widget, MB_CASE_LOWER, "UTF-8"); $id = str_replace(" ", "-", $widget); $output .= "<option value='{$id}' " . selected($selected, $id, false) . ">{$widget}</option>"; } $output .= "</select>\n"; return $output; }
/** dttheme_appearance_css() * Objective: * To generate in-line style based on appearance settings in admin panel. **/ function dttheme_appearance_css() { $output = NULL; #Layout Section if (dttheme_option("appearance", "layout") == "boxed") { if (dttheme_option("appearance", "bg-type") == "bg-patterns") { $pattern = dttheme_option("appearance", "boxed-layout-pattern"); $pattern_repeat = dttheme_option("appearance", "boxed-layout-pattern-repeat"); $pattern_opacity = dttheme_option("appearance", "boxed-layout-pattern-opacity"); $disable_color = dttheme_option("appearance", "disable-boxed-layout-pattern-color"); $pattern_color = dttheme_option("appearance", "boxed-layout-pattern-color"); $output .= "body { "; if (!empty($pattern)) { $output .= "background-image:url('" . IAMD_FW_URL . "theme_options/images/patterns/{$pattern}');"; } $output .= "background-repeat:{$pattern_repeat};"; if (empty($disable_color)) { if (!empty($pattern_opacity)) { $color = hex2rgb($pattern_color); $output .= "background-color:rgba({$color['0']},{$color['1']},{$color['2']},{$pattern_opacity}); "; } else { $output .= "background-color:{$pattern_color};"; } } $output .= "}\r\t"; } elseif (dttheme_option("appearance", "bg-type") == "bg-custom") { $bg = dttheme_option("appearance", "boxed-layout-bg"); $bg_repeat = dttheme_option("appearance", "boxed-layout-bg-repeat"); $bg_opacity = dttheme_option("appearance", "boxed-layout-bg-opacity"); $bg_color = dttheme_option("appearance", "boxed-layout-bg-color"); $disable_color = dttheme_option("appearance", "disable-boxed-layout-bg-color"); $bg_position = dttheme_option("appearance", "boxed-layout-bg-position"); $output .= "body { "; if (!empty($bg)) { $output .= "background-image:url({$bg});"; $output .= "background-repeat:{$bg_repeat};"; $output .= "background-position:{$bg_position};"; } if (empty($disable_color)) { if (!empty($bg_opacity)) { $color = hex2rgb($bg_color); $output .= "background-color:rgba({$color['0']},{$color['1']},{$color['2']},{$bg_opacity});"; } else { $output .= "background-color:{$bg_color};"; } } $output .= "}\r\t"; } } #Layout Section #Menu Section $disable_menu = dttheme_option("appearance", "disable-menu-settings"); if (empty($disable_menu)) { $font_type = dttheme_option("appearance", "menu-font-type"); $style = dttheme_option("appearance", "menu-standard-font-style"); if (!empty($font_type)) { #Menu Font: Standard $font = dttheme_option("appearance", "menu-standard-font"); } else { #Menu Font: Google $font = dttheme_option("appearance", "menu-font"); } $size = dttheme_option("appearance", "menu-font-size"); $primary_color = dttheme_option("appearance", "menu-primary-color"); $secondary_color = dttheme_option("appearance", "menu-secondary-color"); if (!empty($font) || (!empty($primary_color) and $primary_color != "#") || !empty($size)) { $output .= "#main-menu ul.menu li a, #main-menu ul li.menu-item-simple-parent ul li a { "; if (!empty($font)) { $output .= "font-family:{$font},sans-serif; "; } if (!empty($primary_color) && $primary_color != '#') { $output .= "color:{$primary_color}; "; } if (!empty($size) and $size > 0) { $output .= "font-size:{$size}px; "; } if (!empty($style)) { $output .= "font-style: {$style}"; } $output .= "}\r\t"; if (!empty($size) and $size > 0) { $size = $size - 2; $output .= " #main-menu ul.sub-menu li a, #main-menu ul li.menu-item-simple-parent ul li a { font-size:{$size}px; }\r\t"; } } if (!empty($secondary_color) and $secondary_color != "#") { $output .= "#main-menu ul li.menu-item-simple-parent ul li a:hover, #main-menu > ul > li > a:hover, #main-menu ul.menu li a:hover { "; $output .= "color:{$secondary_color} !important; "; $output .= "}\r\t"; $output .= "#main-menu > ul > li.current_page_item, #main-menu > ul > li.current_page_ancestor, #main-menu > ul > li.current-menu-item, #main-menu > ul > li.current-menu-ancestor, ul.dt-sc-tabs-frame li a.current, #main-menu ul li.menu-item-simple-parent ul, .megamenu-child-container{ border-top-color:{$secondary_color}}\r\t"; } $menu_border_color = dttheme_option("appearance", "menu-border-color"); $output .= "#main-menu > ul > li.current_page_item > a, #main-menu > ul > li.current_page_ancestor > a, #main-menu > ul > li.current-menu-item > a, #main-menu > ul > li.current-menu-ancestor > a, #main-menu > ul > li.current_page_item > a:hover, #main-menu > ul > li.current_page_ancestor > a:hover, #main-menu > ul > li.current-menu-item > a:hover, #main-menu > ul > li.current-menu-ancestor > a:hover, #main-menu > ul > li.current_page_item:hover > a, #main-menu > ul > li.current_page_ancestor:hover > a, #main-menu > ul > li.current-menu-item:hover > a, #main-menu > ul > li.current-menu-ancestor:hover > a { border: 2px solid {$menu_border_color}; }"; } #Menu Section End #Body Section $disable_boddy_settings = dttheme_option("appearance", "disable-boddy-settings"); if (empty($disable_boddy_settings)) { $font_type = dttheme_option("appearance", "body-font-type"); $style = dttheme_option("appearance", "body-standard-font-style"); if (!empty($font_type)) { #Body Font: Standard $body_font = dttheme_option("appearance", "body-standard-font"); } else { #Body Font: Google $body_font = dttheme_option("appearance", "body-font"); } $body_font_size = dttheme_option("appearance", "body-font-size"); $body_font_color = dttheme_option("appearance", "body-font-color"); $body_primary_color = dttheme_option("appearance", "body-primary-color"); $body_secondary_color = dttheme_option("appearance", "body-secondary-color"); if (!empty($body_font) || (!empty($body_font_color) and $body_font_color != "#") || !empty($body_font_size)) { $output .= "body {"; if (!empty($body_font)) { $output .= "font-family:{$body_font} , sans-serif; "; } if (!empty($body_font_color) && $body_font_color != '#') { $output .= "color:{$body_font_color}; "; } if (!empty($body_font_size)) { $output .= "font-size:{$body_font_size}px; "; } if (!empty($style)) { $output .= "font-style: {$style}"; } $output .= "}\r\t"; } if ((!empty($body_primary_color) and $body_primary_color != "#") || (!empty($body_secondary_color) and $body_secondary_color != "#")) { if (!empty($body_primary_color) && $body_primary_color != '#') { $output .= "a, .entry-details .entry-metadata p a { color:{$body_primary_color}; }"; } if (!empty($body_secondary_color) && $body_secondary_color != '#') { $output .= "a:hover, .entry-details .entry-metadata p a:hover { color:{$body_secondary_color}; }"; } } } #Body Section End #Footer Section $disable_footer = dttheme_option("appearance", "disable-footer-settings"); if (empty($disable_footer)) { #Footer Title $font_type = dttheme_option("appearance", "footer-title-font-type"); $style = dttheme_option("appearance", "footer-title-standard-font-style"); if (!empty($font_type)) { #Footer Title Font : Standard Font $footer_title_font = dttheme_option("appearance", "footer-title-standard-font"); } else { #Footer Title Font : Google Font $footer_title_font = dttheme_option("appearance", "footer-title-font"); } $footer_title_font_color = dttheme_option("appearance", "footer-title-font-color"); $footer_title_font_size = dttheme_option("appearance", "footer-font-size"); $footer_primary_color = dttheme_option("appearance", "footer-primary-color"); $footer_secondary_color = dttheme_option("appearance", "footer-secondary-color"); $footer_bg_color = dttheme_option("appearance", "footer-bg-color"); $copyright_bg_color = dttheme_option("appearance", "copyright-bg-color"); if (!empty($footer_title_font) || (!empty($footer_title_font_color) and $footer_title_font_color != "#") || !empty($footer_title_font_size)) { $output .= "#footer .widget h1.widgettitle, #footer .widget h2.widgettitle, #footer .widget h3.widgettitle, #footer .widget h4.widgettitle, #footer .widget h5.widgettitle, #footer .widget h6.widgettitle, #footer .tweetbox h3.widgettitle a {"; if (!empty($footer_title_font)) { $output .= "font-family:{$footer_title_font}; "; } if (!empty($footer_title_font_color) && $footer_title_font_color != '#') { $output .= "color:{$footer_title_font_color}; "; } if (!empty($footer_title_font_size)) { $output .= "font-size:{$footer_title_font_size}px; "; } if (!empty($style)) { $output .= "font-style: {$style}"; } $output .= "}\r\t"; } if ((!empty($footer_primary_color) and $footer_primary_color != "#") || (!empty($footer_secondary_color) and $footer_secondary_color != "#")) { if (!empty($footer_primary_color) && $footer_primary_color != '#') { $output .= "#footer .widget ul li a, #footer .entry-details .entry-metadata p a span, #footer .widget ul li a, #footer .widget_categories ul li a, #footer .widget.widget_recent_entries .entry-metadata .tags a, #footer .categories a, .copyright a, #footer .widget a, #footer .widget ul.tweet_list a, #footer .copyright .copyright-info a, #footer .footer-links a { color:{$footer_primary_color}; }"; } if (!empty($footer_secondary_color) && $footer_secondary_color != '#') { $output .= "#footer h1 a:hover, #footer h2 a:hover, #footer h3 a:hover, #footer h4 a:hover, #footer h5 a:hover, #footer h6 a:hover, #footer .widget ul li a:hover, #footer .widget.widget_recent_entries .entry-metadata .tags a:hover, #footer .categories a:hover, #footer .copyright .copyright-info a:hover, #footer .widget a:hover { color:{$footer_secondary_color}; }"; } } #Footer Content $font_type = dttheme_option("appearance", "footer-content-font-type"); $style = dttheme_option("appearance", "footer-content-standard-font-style"); if (!empty($font_type)) { #Footer Title Font : Standard Font $footer_content_font = dttheme_option("appearance", "footer-content-standard-font"); } else { #Footer Title Font : Google Font $footer_content_font = dttheme_option("appearance", "footer-content-font"); } $footer_content_font_color = dttheme_option("appearance", "footer-content-font-color"); $footer_content_font_size = dttheme_option("appearance", "footer-content-font-size"); if (!empty($footer_content_font) || (!empty($footer_content_font_color) and $footer_content_font_color != "#") || !empty($footer_content_font_size)) { $output .= "#footer .widget.widget_recent_entries .entry-metadata .author, #footer .widget.widget_recent_entries .entry-meta .date, #footer label, #footer .widget ul li, #footer .widget ul li:hover, .copyright, #footer .widget.widget_recent_entries .entry-metadata .tags, #footer .categories, #footer .widget p {"; if (!empty($footer_content_font)) { $output .= "font-family:{$footer_content_font} !important; "; } if (!empty($footer_content_font_color) && $footer_content_font_color != '#') { $output .= "color:{$footer_content_font_color} !important; "; } if (!empty($footer_content_font_size)) { $output .= "font-size:{$footer_content_font_size}px !important; "; } if (!empty($style)) { $output .= "font-style: {$style}"; } $output .= "}\r\t"; } if (!empty($footer_bg_color) and $footer_bg_color != "#") { $output .= "#footer .footer-widgets-wrapper { background: {$footer_bg_color}; }"; } if (!empty($copyright_bg_color) and $copyright_bg_color != "#") { $output .= "#footer .copyright { background: {$copyright_bg_color}; }"; } } #Footer Section End #Typography Settings $disable_typo = dttheme_option("appearance", "disable-typography-settings"); if (empty($disable_typo)) { for ($i = 1; $i <= 6; $i++) { $font_type = dttheme_option("appearance", "H{$i}-font-type"); $style = dttheme_option("appearance", "H{$i}-standard-font-style"); if (!empty($font_type)) { #Menu Font: Standard $font = dttheme_option("appearance", "H{$i}-standard-font"); } else { #Menu Font: Google $font = dttheme_option("appearance", "H{$i}-font"); } $color = dttheme_option("appearance", "H{$i}-font-color"); $size = dttheme_option("appearance", "H{$i}-size"); if (!empty($font) || (!empty($color) and $color != "#") || !empty($size)) { $output .= "H{$i} {"; if (!empty($font)) { $output .= "font-family:{$font}; "; } if (!empty($color) && $color != '#') { $output .= "color:{$color}; "; } if (!empty($size)) { $output .= "font-size:{$size}px; "; } $output .= "}\r\t"; } } } #Typography Settings end #404 Settings $disable_404_settings = dttheme_option("specialty", "disable-404-font-settings"); if (empty($disable_404_settings)) { $font = dttheme_option("specialty", "message-font"); $color = dttheme_option("specialty", "message-font-color"); $size = dttheme_option("specialty", "message-font-size"); if (!empty($font) || (!empty($color) and $color != "#") || !empty($size)) { $output .= "div.error-info { "; if (!empty($font)) { $output .= "font-family:{$font}; "; } if (!empty($color) && $color != '#') { $output .= "color:{$color}; "; } if (!empty($size)) { $output .= "font-size:{$size}px; "; } $output .= "}\r\t"; $output .= "div.error-info h1, div.error-info h2, div.error-info h3,div.error-info h4,div.error-info h5,div.error-info h6 { "; if (!empty($font)) { $output .= "font-family:{$font}; "; } if (!empty($color) && $color != '#') { $output .= "color:{$color}; "; } $output .= "}\r\t"; } } #404 Settings end #custom CSS if (dttheme_option('integration', 'enable-custom-css')) { $css = dttheme_option('integration', 'custom-css'); $output .= dttheme_wp_kses(stripcslashes($css)); } #custom CSS eND if (!empty($output)) { $output = "\r" . '<style type="text/css">' . "\r\t" . $output . "\r" . '</style>' . "\r"; echo $output; } }
"><?php echo do_shortcode(get_option('blogname')); ?> </a></h2><?php } ?> </div> <!-- **Contact Details** --> <div class="contact-details"> <p class="phone-no"> <span class="fa fa-phone"> </span> <?php echo dttheme_wp_kses(dttheme_option('general', 'h4-phoneno')); ?> </p> <?php $email = dttheme_wp_kses(dttheme_option('general', 'h4-emailid')); $email = !empty($email) ? $email : get_option('admin_email'); ?> <p class="mail"> <span class="fa fa-envelope-o"> </span> <a href="mailto:<?php echo $email; ?> " title=""><?php echo $email; ?> </a> </p> </div><!-- **Contact Details - End** --> </div><!-- container end --> <!-- **Main Menu Wrapper** --> <div class="main-menu-wrapper"> <div class="container">
function dt_generate_certificate() { if (!wp_verify_nonce($_REQUEST['nonce'], "dt_certificate_nonce")) { exit; } $out = ''; $certificate_id = $_REQUEST['certificate_id']; $args = array('post_type' => 'dt_certificates', 'p' => $certificate_id); $the_query = new WP_Query($args); if ($the_query->have_posts()) { while ($the_query->have_posts()) { $the_query->the_post(); $post_id = get_the_ID(); $background_image = get_post_meta($post_id, 'background-image', TRUE); $custom_class = dttheme_wp_kses(get_post_meta($post_id, 'custom-class', TRUE)); $custom_css = dttheme_wp_kses(get_post_meta($post_id, 'custom-css', TRUE)); $enable_print = get_post_meta($post_id, 'enable-print', TRUE); if (isset($enable_print) && $enable_print != '') { $out .= '<a href="#" class="dt_print_certificate"><span class="fa fa-print"></span>' . __('Print', 'dt_themes') . '</a>'; } $out .= '<div class="dt-sc-certificate-container ' . $custom_class . '" style="background:url(' . $background_image . ')">'; $out .= do_shortcode(get_the_content()); $out .= '</div>'; if (!empty($custom_css)) { $output = "\r" . '<style type="text/css">' . "\r" . $custom_css . "\r" . '</style>' . "\r"; $out .= $output; } } } if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { echo $out; } else { header("Location: " . $_SERVER["HTTP_REFERER"]); } die; }
function dt_get_course_badges_count($course_id) { $students = array_merge(get_users(array('role' => 's2member_level1')), get_users(array('role' => 's2member_level2')), get_users(array('role' => 's2member_level3')), get_users(array('role' => 's2member_level4'))); $enable_badge = get_post_meta($course_id, 'enable-badge', true); $i = 0; if (isset($enable_badge) && $enable_badge != '') { $badge_percentage = dttheme_wp_kses(get_post_meta($course_id, 'badge-percentage', true)); foreach ($students as $student) { $student_id = $student->data->ID; $course_percent = dt_get_course_percentage($course_id, $student_id); if ($course_percent > 0 && $course_percent >= $badge_percentage) { $i++; } } } return $i; }
function dt_woocommerce_product_count() { $shop_product_per_page = dttheme_wp_kses(trim(stripslashes(dttheme_option('woo', 'shop-product-per-page')))); $shop_product_per_page = !empty($shop_product_per_page) ? $shop_product_per_page : 10; return $shop_product_per_page; }
function dt_get_user_course_overview($post_per_page, $curr_page) { $user_id = get_current_user_id(); $user_info = get_userdata($user_id); $ccaps = array(); if (IAMD_USER_ROLE == 's2member_level1') { foreach ($user_info->allcaps as $cap => $cap_enabled) { if (preg_match("/^access_s2member_ccap_cid_/", $cap)) { $ccaps[] = preg_replace("/^access_s2member_ccap_cid_/", "", $cap); } } } else { if (IAMD_USER_ROLE == 's2member_level2' || IAMD_USER_ROLE == 's2member_level3' || IAMD_USER_ROLE == 's2member_level4') { $ccaps = dt_get_all_paid_courses(); } } $dt_start = ($curr_page - 1) * $post_per_page; $dt_end = $dt_start + $post_per_page; $courses_cnt = count($ccaps); $course_ids_arr = dt_get_user_graded_course(); $free_course = array_diff($course_ids_arr, $ccaps); $ccaps = array_merge($ccaps, $free_course); if (isset($ccaps) && is_array($ccaps)) { echo '<table border="0" cellpadding="0" cellspacing="10" style="width:100%;"> <thead> <tr> <th scope="col">' . __('#', 'dt_themes') . '</th> <th scope="col" class="dt-sc-align-left">' . __('Course', 'dt_themes') . '</th> <th scope="col" class="dt-sc-align-left">' . __('Lesson', 'dt_themes') . '</th> <th scope="col">' . __('Grade', 'dt_themes') . '</th> <th scope="col">' . __('Status', 'dt_themes') . '</th> <th scope="col">' . __('Option', 'dt_themes') . '</th> </tr> </thead> <tbody>'; $i = 0; foreach ($ccaps as $course_id) { if ($i >= $dt_start && $i < $dt_end) { $course_args = array('post_type' => 'dt_courses', 'p' => $course_id); $course = get_posts($course_args); $course_status = dt_get_users_course_status($course_id, ''); if ($course_status) { $course_overall_status = '<div class="dt-sc-course-completed"> <span class="fa fa-check-circle"></span>' . __('Completed', 'dt_themes') . '</div>'; $course_percent = dt_get_course_percentage($course_id, '') . '%'; } else { $course_overall_status = '<div class="dt-sc-course-pending"> <span class="fa fa-clock-o fa-rotate-90"></span>' . __('Pending', 'dt_themes') . '</div>'; $course_percent = ''; } $starting_price = dttheme_wp_kses(get_post_meta($course_id, 'starting-price', true)); if (in_array($course_id, $free_course) & $starting_price != '') { $notyet_text = ' <span class="dt-sc-not-purchased">(' . __('Not yet purchased', 'dt_themes') . ')</span>'; } elseif (in_array($course_id, $free_course) & $starting_price == '') { $notyet_text = ' <span class="dt-sc-not-purchased">(' . __('Free', 'dt_themes') . ')</span>'; } else { $notyet_text = ''; } echo '<tr> <td>' . ($i + 1) . '</td> <td class="dt-sc-course-name"><a href="' . get_permalink($course_id) . '">' . $course[0]->post_title . '</a>' . $notyet_text . '</td> <td> </td> <td>' . $course_percent . '</td> <td>' . $course_overall_status . '</td> <td> </td> </tr>'; $lesson_args = array('sort_order' => 'ASC', 'sort_column' => 'menu_order', 'post_type' => 'dt_lessons', 'posts_per_page' => -1, 'meta_key' => 'dt_lesson_course', 'meta_value' => $course_id); $lessons_array = get_posts($lesson_args); foreach ($lessons_array as $lesson) { $user_option = ''; $lesson_id = $lesson->ID; $quiz_id = get_post_meta($lesson_id, "lesson-quiz", true); if (!isset($quiz_id) || $quiz_id == '') { $quiz_id = -1; } $dt_gradings = dt_get_user_gradings_array($course_id, $lesson_id, $quiz_id, $user_id); $dt_grade_post = get_posts($dt_gradings); if (isset($dt_grade_post[0])) { $dt_grade_post_id = $dt_grade_post[0]->ID; $graded = get_post_meta($dt_grade_post_id, "graded", true); if (isset($graded) && $graded != '') { $user_status = '<div class="dt-sc-course-completed"> <span class="fa fa-check-circle"></span>' . __('Completed', 'dt_themes') . '</div>'; if ($quiz_id != -1 && $quiz_id != '') { $user_option = '<a href="' . get_permalink($quiz_id) . '?dttype=viewquiz" class="dt-sc-button small">' . __('View Quiz', 'dt_themes') . '</a>'; } $grade = get_post_meta($dt_grade_post_id, "marks-obtained-percent", true); $grade = $grade . '%'; } else { $grade = ''; $user_status = '<div class="dt-sc-course-notgraded"> <span class="fa fa-trophy"></span>' . __('Not yet graded', 'dt_themes') . '</div>'; if (dt_can_user_retake_quiz($course_id, $lesson_id, $quiz_id, $user_id)) { $user_option = '<a href="' . get_permalink($quiz_id) . '" class="dt-sc-button small">' . __('Retake Quiz', 'dt_themes') . '</a>'; } } } else { $grade = ''; $user_status = '<div class="dt-sc-course-pending"> <span class="fa fa-clock-o fa-rotate-90"></span>' . __('Pending', 'dt_themes') . '</div>'; if (isset($quiz_id) && $quiz_id > 0) { $user_option = '<a href="' . get_permalink($quiz_id) . '" class="dt-sc-button small">' . __('Take Quiz', 'dt_themes') . '</a>'; } } echo '<tr> <td> </td> <td> </td> <td class="dt-sc-lesson-name"><a href="' . get_permalink($lesson_id) . '">' . $lesson->post_title . '</a></td> <td class="dt-sc-grade-percent">' . $grade . '</td> <td>' . $user_status . '</td> <td>' . $user_option . '</td> </tr>'; } $assignment_args = array('post_type' => 'dt_assignments', 'posts_per_page' => -1, 'meta_query' => array()); $assignment_args['meta_query'][] = array('key' => 'dt-assignment-course', 'value' => $course_id, 'compare' => '=', 'type' => 'numeric'); $assignment_array = get_posts($assignment_args); foreach ($assignment_array as $assignment) { $assignment_id = $assignment->ID; $dtgradings = array('post_type' => 'dt_gradings', 'meta_query' => array()); $dtgradings['meta_query'][] = array('key' => 'dt-user-id', 'value' => $user_id, 'compare' => '=', 'type' => 'numeric'); $dtgradings['meta_query'][] = array('key' => 'dt-course-id', 'value' => $course_id, 'compare' => '=', 'type' => 'numeric'); $dtgradings['meta_query'][] = array('key' => 'dt-assignment-id', 'value' => $assignment_id, 'compare' => '=', 'type' => 'numeric'); $dtgradings['meta_query'][] = array('key' => 'grade-type', 'value' => 'assignment', 'compare' => '='); $dtgradings_post = get_posts($dtgradings); if (isset($dtgradings_post) && !empty($dtgradings_post)) { $dtgradings_id = $dtgradings_post[0]->ID; $marks_obtained_percent = get_post_meta($dtgradings_id, "marks-obtained-percent", true); $graded = get_post_meta($dtgradings_id, "graded", true); if (isset($graded) && $graded != '') { $user_status = '<div class="dt-sc-course-completed"> <span class="fa fa-check-circle"></span>' . __('Completed', 'dt_themes') . '</div>'; $grade = $marks_obtained_percent . '%'; } else { $user_status = '<div class="dt-sc-course-notgraded"> <span class="fa fa-check-circle"></span>' . __('Not yet graded', 'dt_themes') . '</div>'; $grade = ''; } } else { $grade = ''; $user_status = '<div class="dt-sc-course-pending"> <span class="fa fa-clock-o fa-rotate-90"></span>' . __('Pending', 'dt_themes') . '</div>'; } echo '<tr> <td> </td> <td> </td> <td class="dt-sc-assignment-name"><a href="' . get_permalink($assignment_id) . '">' . get_the_title($assignment_id) . '</a></td> <td>' . $grade . '</td> <td>' . $user_status . '</td> <td><a href="' . get_permalink($assignment_id) . '" class="dt-sc-button small">' . __('View Assignment', 'dt_themes') . '</a></td> </tr>'; } } $i++; } if ($i == 0) { echo '<tr><td colspan="6">' . __('You haven\'t purchased any course!', 'dt_themes') . '</td></tr>'; } echo '</tbody></table>'; echo dtthemes_ajax_pagination($post_per_page, $curr_page, $courses_cnt, 0); } }
$dt_lesson_course = get_post_meta($post->ID, "dt_lesson_course", true); $s2_level = "access_s2member_ccap_cid_{$dt_lesson_course}"; $lesson_meta_data = get_post_meta($post->ID, '_lesson_settings'); $lesson_teacher = $lesson_duration = ''; $private_lesson = !empty($lesson_meta_data[0]['private-lesson']) ? $lesson_meta_data[0]['private-lesson'] : ''; $lesson_teacher = get_post_meta($id, "lesson-teacher", true); if ($lesson_teacher != '') { $teacher_data = get_post($lesson_teacher); if ($private_lesson != '') { $lesson_teacher = '<p> <i class="fa fa-user"></i> ' . $teacher_data->post_title . '</p>'; } else { $lesson_teacher = '<p> <i class="fa fa-user"></i> <a href="' . get_permalink($teacher_data->ID) . '">' . $teacher_data->post_title . '</a></p>'; } } if (isset($lesson_meta_data[0]['lesson-duration']) && $lesson_meta_data[0]['lesson-duration'] != '') { $lesson_duration .= '<p> <i class="fa fa-clock-o"> </i>' . dttheme_wp_kses($lesson_meta_data[0]['lesson-duration']) . __(' mins ', 'dt_themes') . '</p>'; } if (isset($lesson_meta_data[0]['private-lesson']) && $lesson_meta_data[0]['private-lesson'] != '') { if (current_user_can($s2_level)) { $private_lesson = ''; } else { $private_lesson = 'class="dt-hidden-lesson"'; } } else { $private_lesson = ''; } $terms = get_the_terms($post->ID, 'lesson_complexity'); $lesson_terms = ''; if (isset($terms) && !empty($terms)) { $lesson_terms = array(); foreach ($terms as $term) {
} $dt_grade_post = get_posts($dt_gradings); $dt_grade_post_id = $dt_grade_post[0]->ID; $graded = get_post_meta($dt_grade_post_id, "graded", true); if (isset($dt_grade_post[0]) && isset($graded) && $graded != '') { $dt_tooltip_dir = ' dt-sc-tooltip-right'; $dt_tooltip_title = 'title="' . __('Completado', 'dt_themes') . '"'; $dt_lesson_status = 'dt-lesson-complete'; } else { $dt_tooltip_dir = ''; $dt_tooltip_title = ''; $dt_lesson_status = ''; } echo '<li class="' . $dt_lesson_status . $current_cls . '"><a href="' . get_permalink($lesson_item->ID) . '" class="dt-sc-lesson-menu-name ' . $dt_tooltip_dir . '" ' . $dt_tooltip_title . '>' . $lesson_item->post_title . '</a>'; $lesson_datas = get_post_meta($lesson_item->ID, '_lesson_settings', true); $duration = isset($lesson_datas['lesson-duration']) ? dttheme_wp_kses($lesson_datas['lesson-duration']) : 0; if ($duration > 0) { $hours = floor($duration / 60); $mins = $duration % 60; if ($hours == 0) { $duration = $mins . __(' minutos ', 'dt_themes'); } elseif ($hours == 1) { $duration = $hours . __(' hora ', 'dt_themes') . $mins . __(' minutos ', 'dt_themes'); } else { $duration = $hours . __(' horas ', 'dt_themes') . $mins . __(' minutos ', 'dt_themes'); } echo '<div class="dt-sc-lesson-menu-duration"> <i class="fa fa-clock-o"> </i>' . $duration . '</a></div>'; } echo '</li>'; } echo '</ul>';
if ($course_status) { echo '<div class="dt-sc-course-completed"> <span class="fa fa-check-circle"> </span> ' . __('Completed', 'dt_themes') . '</div>'; } echo '</div>'; } else { ?> <?php $starting_price = dttheme_wp_kses(get_post_meta(get_the_ID(), 'starting-price', true)); if ($starting_price != '') { ?> <span class="dt-sc-course-price"> <span class="amount"> <?php if (dttheme_option('dt_course', 'currency-position') == 'after-price') { echo $starting_price . dttheme_wp_kses(dttheme_option('dt_course', 'currency')); } else { echo dttheme_wp_kses(dttheme_option('dt_course', 'currency')) . $starting_price; } ?> </span> </span> <?php } else { ?> <span class="dt-sc-course-price"> <span class="amount"> <?php echo __('Free', 'dt_themes'); ?> </span> </span> <?php } ?> <?php }
"><?php if (have_posts()) { while (have_posts()) { the_post(); get_template_part('framework/loops/content', 'page'); } } ?> </section><!-- ** Primary Section End ** --><?php if ($show_sidebar) { if ($show_right_sidebar) { ?> <!-- Secondary Right --> <section id="secondary-right" class="secondary-sidebar <?php echo $sidebar_class; ?> "><?php get_sidebar('right'); ?> </section><?php } } #Bottom code section $dttheme_integration = $dttheme_options['integration']; if (isset($dttheme_integration['enable-single-page-bottom-code'])) { echo dttheme_wp_kses(stripslashes($dttheme_integration['single-page-bottom-code'])); } ?> <?php get_footer();
echo $container_middle; if (array_key_exists("sub-title", $portfolio_settings)) { echo '<h3>' . dttheme_wp_kses($portfolio_settings["sub-title"]) . '</h3>'; } the_content(); ?> <div class="project-details"> <?php if (isset($portfolio_settings["client-name"])) { ?> <p> <span> <?php _e("Client", "dt_themes"); ?> : </span> <?php echo dttheme_wp_kses($portfolio_settings["client-name"]); ?> </p> <?php } the_terms($post->ID, 'portfolio_entries', '<p> <span>' . __(" Category", "dt_themes") . ' : </span> ', ', ', '</p>'); ?> <p> <span> <?php _e("Date", "dt_themes"); ?> : </span> <?php the_date("d M Y"); ?> </p> </div>
</div><?php } ?> <div class="copyright"> <div class="container"><?php if (!empty($dttheme_general['show-copyrighttext'])) { echo '<div class="copyright-info">'; echo dttheme_wp_kses(stripslashes($dttheme_general['copyright-text'])); echo '</div>'; } ?> <?php echo do_shortcode('[dt_sc_social /]'); ?> </div> </div> </footer><!-- **Footer - End** --> </div><!-- **Inner Wrapper - End** --> </div><!-- **Wrapper - End** --> <?php if (is_singular() and comments_open()) { wp_enqueue_script('comment-reply'); } if (dttheme_option('integration', 'enable-body-code') != '') { echo '<script type="text/javascript">' . dttheme_wp_kses(stripslashes(dttheme_option('integration', 'body-code'))) . '</script>'; } wp_footer(); ?> </body> </html>
$text_before_gap = dttheme_wp_kses(get_post_meta($question_id, 'text-before-gap', TRUE)); $text_before_gap = !empty($text_before_gap) ? $text_before_gap : ''; $text_gap = dttheme_wp_kses(get_post_meta($question_id, 'gap', TRUE)); $text_gap = !empty($text_gap) ? $text_gap : ''; $text_after_gap = dttheme_wp_kses(get_post_meta($question_id, 'text-after-gap', TRUE)); $text_after_gap = !empty($text_after_gap) ? $text_after_gap : ''; $answers = $text_before_gap . ' <strong>' . $text_gap . '</strong> ' . $text_after_gap; $correct_answer = $text_gap; } else { if ($question_type == 'single-line') { $answers = ''; $correct_answer = dttheme_wp_kses(get_post_meta($question_id, 'singleline-answer', TRUE)); } else { if ($question_type == 'multi-line') { $answers = ''; $correct_answer = dttheme_wp_kses(get_post_meta($question_id, 'multiline-answer', TRUE)); } } } } } } $question_name = 'dt-question-' . $question_id; $user_answer = get_post_meta($post->ID, $question_name, TRUE); if (is_array($user_answer)) { $user_answer = implode('<br />', $user_answer); } $question_grade = get_post_meta($post_id, 'question-id-' . $question_id . '-grade', true); //echo $question_grade.'<br>'; echo '<tr id="dt-row-' . $question_id . '"> <td>' . $i . '</td>
function widget($args, $instance) { extract($args); global $post; $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); $_post_count = (int) $instance['_post_count']; $_post_categories = ""; if (!empty($instance['_post_categories']) && is_array($instance['_post_categories'])) { $_post_categories = array_filter($instance['_post_categories']); } elseif (!empty($instance['_post_categories'])) { $_post_categories = explode(",", $instance['_post_categories']); } $_enable_course_image = $instance['_enable_course_image'] == 1 ? 1 : 0; $arg = array('posts_per_page' => $_post_count, 'post_type' => 'dt_courses', 'orderby' => 'menu_order', 'order' => 'ASC'); $arg = empty($_post_categories) ? $arg : array('posts_per_page' => $_post_count, 'tax_query' => array(array('taxonomy' => 'course_category', 'field' => 'id', 'operator' => 'IN', 'terms' => $_post_categories)), 'orderby' => 'menu_order', 'order' => 'ASC'); echo $before_widget; if (!empty($title)) { echo $before_title . $title . $after_title; } echo "<div class='recent-course-widget'><ul>"; query_posts($arg); if (have_posts()) { while (have_posts()) { the_post(); $title = strlen(get_the_title()) > 20 ? substr(get_the_title(), 0, 15) . "..." : get_the_title(); echo "<li>"; if (1 == $_enable_course_image) { if (has_post_thumbnail()) { $image_url = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'dt-course-widget'); echo '<img src="' . $image_url[0] . '" alt="' . get_the_title() . '" width="' . $image_url[1] . '" height="' . $image_url[2] . '" />'; } else { echo '<img src="http://placehold.it/110x90&text=Image" alt="' . get_the_title() . '" />'; } } echo "<h6><a href='" . get_permalink() . "'>{$title}</a></h6>"; $course_settings = get_post_meta(get_the_ID(), '_course_settings'); $starting_price = dttheme_wp_kses(get_post_meta(get_the_ID(), 'starting-price', true)); if ($starting_price != '') { echo '<span class="dt-sc-course-price"> <span class="amount">'; if (dttheme_option('dt_course', 'currency-position') == 'after-price') { echo $starting_price . dttheme_wp_kses(dttheme_option('dt_course', 'currency')); } else { echo dttheme_wp_kses(dttheme_option('dt_course', 'currency')) . $starting_price; } echo '</span> </span>'; } echo "</li>"; } } else { echo "<li>" . __('No Course Entries found', 'dt_themes') . "</li>"; } wp_reset_query(); echo "</ul></div>"; echo $after_widget; }
foreach ($payment_data as $payment) { $course = get_post($payment['course_id']); $out .= '<tr> <td class="aligncenter">' . $i . '</td> <td class="aligncenter">' . $course->post_title . '</td> <td class="aligncenter">' . $payment['purchases'] . '</td> <td class="aligncenter">' . $payment['starting_price'] . '</td> <td class="aligncenter">' . $payment['commission'] . '</td> <td class="aligncenter">' . $payment['topay'] . '</td> </tr>'; $total = $total + $payment['topay']; $i++; } if ($total > 0) { $out .= '<tr> <td colspan="6"> </td> </tr>'; $out .= '<tr> <td colspan="5" class="alignright"><strong>' . __('Total (' . dttheme_wp_kses(dttheme_option('dt_course', 'currency')) . ')', 'dt_themes') . '</strong></td> <td>' . $total . '</td> </tr>'; } $out .= '</table>'; echo $out; } ?> </div> </div>
"><?php get_sidebar('left'); ?> </section><?php } } ?> <!-- ** Primary Section ** --> <section id="primary" class="<?php echo $page_layout; ?> "> <div class="error-info"> <?php echo dttheme_wp_kses(stripcslashes(dttheme_option('specialty', '404-message'))); ?> <a href="<?php echo home_url(); ?> " title="" class="dt-sc-button small"><?php _e('Volver a la página de Inicio', 'dt_themes'); ?> </a> </div> </section><!-- ** Primary Section End ** --><?php if ($show_sidebar) { if ($show_right_sidebar) { ?> <!-- Secondary Right --> <section id="secondary-right" class="secondary-sidebar <?php