Example #1
0
 function getThemesList($prepend_default = true)
 {
     $list = array();
     if ($prepend_default) {
         $list['default'] = 'default';
     }
     $dir = get_template_directory() . "/css/themes";
     if (is_dir($dir)) {
         $hdir = @opendir($dir);
         if ($hdir) {
             while (($file = readdir($hdir)) !== false) {
                 $pi = pathinfo($dir . '/' . $file);
                 if (substr($file, 0, 1) == '.' || is_dir($dir . '/' . $file) || $pi['extension'] != 'css') {
                     continue;
                 }
                 $key = themerex_substr($file, 0, themerex_strrpos($file, '.'));
                 $list[$key] = themerex_strtoproper(str_replace('_', ' ', $key));
             }
             @closedir($hdir);
         }
     }
     return $list;
 }
                }
            }
        }
    }
}
//excerpt
if ($post_data['post_protected']) {
    echo balanceTags($post_data['post_excerpt']);
} else {
    if ($post_data['post_excerpt'] && $post_data['post_format'] == 'link') {
        echo balanceTags('<a href="' . $post_data['post_link'] . '">' . $post_data['post_excerpt'] . '</a>');
    } else {
        if ($post_data['post_excerpt']) {
            ?>
			<div class="post<?php 
            echo themerex_strtoproper($post_data['post_format']);
            ?>
">
				<?php 
            echo balanceTags($post_data['post_excerpt']);
            ?>
			</div>
			<?php 
        }
    }
}
if ($side_bar != 'wide') {
    //postshare
    echo getPostShare(get_custom_option('set_post_info', null, $post_data['post_id']), $post_data);
    //read more
    $show_all = !isset($postinfo_buttons) || !is_array($postinfo_buttons);
Example #3
0
 function getListFiles($folder, $ext = '', $only_names = false)
 {
     if (themerex_substr($folder, 0, 1) != '/') {
         $folder = '/' . $folder;
     }
     $list = array();
     if (is_dir(get_stylesheet_directory() . $folder)) {
         $dir = get_stylesheet_directory() . $folder;
         $url = get_stylesheet_directory_uri() . $folder;
     } else {
         $dir = get_template_directory() . $folder;
         $url = get_template_directory_uri() . $folder;
     }
     if (is_dir($dir)) {
         $hdir = @opendir($dir);
         if ($hdir) {
             while (($file = readdir($hdir)) !== false) {
                 $pi = pathinfo($dir . '/' . $file);
                 if (substr($file, 0, 1) == '.' || is_dir($dir . '/' . $file) || !empty($ext) && $pi['extension'] != $ext) {
                     continue;
                 }
                 $key = themerex_substr($file, 0, themerex_strrpos($file, '.'));
                 if (themerex_substr($key, -4) == '.min') {
                     $key = themerex_substr($file, 0, themerex_strrpos($key, '.'));
                 }
                 $list[$key] = $only_names ? themerex_strtoproper(str_replace('_', ' ', $key)) : $url . '/' . $file;
             }
             @closedir($hdir);
         }
     }
     return $list;
 }
        ?>
					<span class="separator">|</span>
					<span class="post_cats"><?php 
        echo $post_data['post_categories_links'];
        ?>
</span>
					<?php 
    }
    ?>
				</div>
			</div>
		</div>
	</article>
<?php 
} else {
    $dir = themerex_strtoproper(get_custom_option('hover_style', null, $post_data['post_id']));
    ?>
	<article class="isotopeElement <?php 
    echo 'post_format_' . $post_data['post_format'] . 'hover_' . $dir . ($dir == 'Book' ? ' bookShowWrap' : '') . ($opt['number'] % 2 == 0 ? ' even' : ' odd') . ($opt['number'] == 0 ? ' first' : '') . ($opt['number'] == $opt['posts_on_page'] ? ' last' : '') . ($opt['add_view_more'] ? ' viewmore' : '') . (get_custom_option('show_filters') == 'yes' ? ' flt_' . join(' flt_', get_custom_option('filter_taxonomy') == 'categories' ? $post_data['post_categories_ids'] : $post_data['post_tags_ids']) : '');
    ?>
">
		<div class="hover hover<?php 
    echo $dir;
    ?>
Show">
			<?php 
    if ($post_data['post_thumb']) {
        ?>
				<div class="thumb"><?php 
        echo $post_data['post_thumb'];
        ?>
Example #5
0
    function build_page()
    {
        $subject = $message = $attach = $group = $sender_name = $sender_email = '';
        $subscribers_update = $subscribers_delete = $subscribers_clear = false;
        $subscribers = array();
        if (isset($_POST['emailer_subject'])) {
            do {
                // Check nonce
                if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], __FILE__)) {
                    $this->error = __('Incorrect WP-nonce data! Operation canceled!', 'themerex');
                    break;
                }
                // Get post data
                $subject = isset($_POST['emailer_subject']) ? $_POST['emailer_subject'] : '';
                if (empty($subject)) {
                    $this->error = __('Subject can not be empty! Operation canceled!', 'themerex');
                    break;
                }
                $message = isset($_POST['emailer_message']) ? $_POST['emailer_message'] : '';
                if (empty($message)) {
                    $this->error = __('Message can not be empty! Operation canceled!', 'themerex');
                    break;
                }
                $attach = isset($_FILES['emailer_attachment']['tmp_name']) && file_exists($_FILES['emailer_attachment']['tmp_name']) ? $_FILES['emailer_attachment']['tmp_name'] : '';
                $group = isset($_POST['emailer_group']) ? $_POST['emailer_group'] : '';
                $subscribers = isset($_POST['emailer_subscribers']) ? $_POST['emailer_subscribers'] : '';
                if (!empty($subscribers)) {
                    $subscribers = explode("\n", str_replace(array(';', ','), array("\n", "\n"), $subscribers));
                } else {
                    $subscribers = array();
                }
                if (count($subscribers) == 0) {
                    $this->error = __('Subscribers lists are empty! Operation canceled!', 'themerex');
                    break;
                }
                $sender_name = !empty($_POST['emailer_sender_name']) ? $_POST['emailer_sender_name'] : get_bloginfo('name');
                $sender_email = !empty($_POST['emailer_sender_email']) ? $_POST['emailer_sender_email'] : '';
                if (empty($sender_email)) {
                    $sender_email = get_theme_option('contact_email');
                }
                if (empty($sender_email)) {
                    $sender_email = get_bloginfo('admin_email');
                }
                if (empty($sender_email)) {
                    $this->error = __('Sender email is empty! Operation canceled!', 'themerex');
                    break;
                }
                $headers = 'From: ' . $sender_name . ' <' . $sender_email . '>' . "\r\n";
                $subscribers_update = isset($_POST['emailer_subscribers_update']);
                $subscribers_delete = isset($_POST['emailer_subscribers_delete']);
                $subscribers_clear = isset($_POST['emailer_subscribers_clear']);
                // Send email
                add_filter('wp_mail_content_type', array($this, 'set_html_content_type'));
                $new_list = array();
                $list = array();
                $cnt = 0;
                $mail = get_theme_option('mail_function');
                foreach ($subscribers as $email) {
                    $email = trim(chop($email));
                    if (empty($email)) {
                        continue;
                    }
                    if (!preg_match('/[\\.\\-_A-Za-z0-9]+?@[\\.\\-A-Za-z0-9]+?[\\ .A-Za-z0-9]{2,}/', $email)) {
                        continue;
                    }
                    $list[] = $email;
                    $cnt++;
                    if ($cnt >= $this->max_recipients_in_one_letter) {
                        @$mail($list, $subject, $message, $headers, $attach);
                        if ($subscribers_update && $group != 'none') {
                            $new_list = array_merge($new_list, $list);
                        }
                        $list = array();
                        $cnt = 0;
                    }
                }
                if ($cnt > 0) {
                    @$mail($list, $subject, $message, $headers, $attach);
                    if ($subscribers_update && $group != 'none') {
                        $new_list = array_merge($new_list, $list);
                    }
                    $list = array();
                    $cnt = 0;
                }
                remove_filter('wp_mail_content_type', array($this, 'set_html_content_type'));
                $add_msg = '';
                if ($subscribers_update && $group != 'none') {
                    $rez = array();
                    if (count($this->subscribers[$group]) > 0) {
                        foreach ($this->subscribers[$group] as $k => $v) {
                            if (!$subscribers_clear && !empty($v)) {
                                $rez[$k] = $v;
                            }
                        }
                    }
                    if (count($new_list) > 0) {
                        foreach ($new_list as $v) {
                            $rez[$v] = '';
                        }
                    }
                    $this->subscribers[$group] = $rez;
                    update_option('emailer_subscribers', $this->subscribers);
                    $add_msg = __(' The subscriber list is updated', 'themerex');
                } else {
                    if ($subscribers_delete && $group != 'none') {
                        unset($this->subscribers[$group]);
                        update_option('emailer_subscribers', $this->subscribers);
                        $add_msg = __(' The subscriber list is cleared', 'themerex');
                    }
                }
                $this->success = __('E-Mail was send successfull!', 'themerex') . $add_msg;
            } while (false);
        }
        ?>
		<div class="trx_emailer">
			<h2 class="trx_emailer_title"><?php 
        _e('ThemeREX Emailer', 'themerex');
        ?>
</h2>
			<div class="trx_emailer_result">
				<?php 
        if (!empty($this->error)) {
            ?>
				<div class="error">
					<p><?php 
            echo esc_html($this->error);
            ?>
</p>
				</div>
				<?php 
        }
        ?>
				<?php 
        if (!empty($this->success)) {
            ?>
				<div class="updated">
					<p><?php 
            echo esc_html($this->success);
            ?>
</p>
				</div>
				<?php 
        }
        ?>
			</div>
	
			<form id="trx_emailer_form" action="#" method="post" enctype="multipart/form-data">

				<input type="hidden" value="<?php 
        echo esc_attr($this->nonce);
        ?>
" name="nonce" />

				<div class="trx_emailer_block">
					<fieldset class="trx_emailer_block_inner">
						<legend> <?php 
        _e('Letter data', 'themerex');
        ?>
 </legend>
						<div class="trx_emailer_fields">
							<div class="trx_emailer_field trx_emailer_subject">
								<label for="emailer_subject"><?php 
        _e('Subject:', 'themerex');
        ?>
</label>
								<input type="text" value="<?php 
        echo esc_attr($subject);
        ?>
" name="emailer_subject" id="emailer_subject" />
							</div>
							<div class="trx_emailer_field trx_emailer_attachment">
								<label for="emailer_attachment"><?php 
        _e('Attachment:', 'themerex');
        ?>
</label>
								<input type="file" name="emailer_attachment" id="emailer_attachment" />
							</div>
							<div class="trx_emailer_field trx_emailer_message">
								<?php 
        wp_editor($message, 'emailer_message', array('wpautop' => false, 'textarea_rows' => 10));
        ?>
								
							</div>
						</div>
					</fieldset>
				</div>
	
				<div class="trx_emailer_block">
					<fieldset class="trx_emailer_block_inner">
						<legend> <?php 
        _e('Subscribers', 'themerex');
        ?>
 </legend>
						<div class="trx_emailer_fields">
							<div class="trx_emailer_field trx_emailer_group">
								<label for="emailer_group"><?php 
        _e('Select group:', 'themerex');
        ?>
</label>
								<select name="emailer_group" id="emailer_group">
									<option value="none"<?php 
        echo esc_attr($group == 'none' ? ' selected="selected"' : '');
        ?>
><?php 
        _e('- Select group -', 'themerex');
        ?>
</option>
									<?php 
        if (count($this->subscribers) > 0) {
            foreach ($this->subscribers as $gr => $list) {
                echo '<option value="' . $gr . '"' . ($group == $gr ? ' selected="selected"' : '') . '>' . themerex_strtoproper($gr) . '</option>';
            }
        }
        ?>
								</select>
								<input type="checkbox" name="emailer_subscribers_update" id="emailer_subscribers_update" value="1"<?php 
        echo esc_attr($subscribers_update ? ' checked="checked"' : '');
        ?>
 /><label for="emailer_subscribers_update" class="inline" title="<?php 
        _e('Update the subscribers list for selected group', 'themerex');
        ?>
"><?php 
        _e('Update', 'themerex');
        ?>
</label>
								<input type="checkbox" name="emailer_subscribers_clear" id="emailer_subscribers_clear" value="1"<?php 
        echo esc_attr($subscribers_clear ? ' checked="checked"' : '');
        ?>
 /><label for="emailer_subscribers_clear" class="inline" title="<?php 
        _e('Clear this group from not confirmed emails after send', 'themerex');
        ?>
"><?php 
        _e('Clear', 'themerex');
        ?>
</label>
								<input type="checkbox" name="emailer_subscribers_delete" id="emailer_subscribers_delete" value="1"<?php 
        echo esc_attr($subscribers_delete ? ' checked="checked"' : '');
        ?>
 /><label for="emailer_subscribers_delete" class="inline" title="<?php 
        _e('Delete this group after send', 'themerex');
        ?>
"><?php 
        _e('Delete', 'themerex');
        ?>
</label>
							</div>
							<div class="trx_emailer_field trx_emailer_subscribers2">
								<label for="emailer_subscribers" class="big"><?php 
        _e('List of recipients:', 'themerex');
        ?>
</label>
								<textarea name="emailer_subscribers" id="emailer_subscribers"><?php 
        echo join("\n", $subscribers);
        ?>
</textarea>
							</div>
							<div class="trx_emailer_field trx_emailer_sender_name">
								<label for="emailer_sender_name"><?php 
        _e('Sender name:', 'themerex');
        ?>
</label>
								<input type="text" name="emailer_sender_name" id="emailer_sender_name" value="<?php 
        echo esc_attr($sender_name);
        ?>
" /><br />
							</div>
							<div class="trx_emailer_field trx_emailer_sender_email">
								<label for="emailer_sender_email"><?php 
        _e('Sender email:', 'themerex');
        ?>
</label>
								<input type="text" name="emailer_sender_email" id="emailer_sender_email" value="<?php 
        echo esc_attr($sender_email);
        ?>
" />
							</div>
						</div>
					</fieldset>
				</div>
	
				<div class="trx_emailer_buttons">
					<a href="#" id="trx_emailer_send"><?php 
        echo _e('Send', 'themerex');
        ?>
</a>
				</div>
	
			</form>
		</div>
		<?php 
    }
Example #6
0
						</section>
					</div>
				</footer>
				<?php 
}
?>

				<?php 
// ---------------- Footer sidebar ----------------------
if (get_custom_option('show_sidebar_footer') == 'yes') {
    global $THEMEREX_CURRENT_SIDEBAR;
    $THEMEREX_CURRENT_SIDEBAR = 'footer';
    $style = get_custom_option('sidebar_footer_style');
    ?>
				<footer class="footerWrap footerStyle<?php 
    echo themerex_strtoproper($style);
    ?>
">
					<div class="main footerWidget widget_area">
						<?php 
    do_action('before_sidebar');
    if (!dynamic_sidebar(get_custom_option('sidebar_footer'))) {
        // Put here html if user no set widgets in sidebar
    }
    ?>
					</div>
				</footer><!-- ./blackStyle -->
				<?php 
}
?>
function sc_price_table($atts, $content = null)
{
    if (in_shortcode_blogger()) {
        return '';
    }
    extract(shortcode_atts(array("id" => "", "align" => "", "count" => 1, "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts));
    $s = ($top !== '' ? 'padding-top:' . $top . 'px;' : '') . ($bottom !== '' ? 'padding-bottom:' . $bottom . 'px;' : '') . ($left !== '' ? 'margin-left:' . $left . 'px;' : '') . ($right !== '' ? 'margin-right:' . $right . 'px;' : '');
    global $THEMEREX_sc_price_table_counter;
    $THEMEREX_sc_price_table_counter = 0;
    $count = max(1, $count);
    return '<div' . ($id ? ' id="' . $id . '"' : '') . ' class="sc_pricing_table columns_' . $count . ($align && $align != 'none' ? ' align' . themerex_strtoproper($align) : '') . '"' . (!empty($s) ? ' style="' . $s . '"' : '') . '>' . do_shortcode($content) . '</div>';
}
Example #8
0
function sc_price_table($atts, $content = null)
{
    if (in_shortcode_blogger()) {
        return '';
    }
    extract(shortcode_atts(array("id" => "", "class" => "", "align" => "", "count" => 1, "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts));
    $s = getStyleString($top, $right, $bottom, $left);
    global $THEMEREX_sc_price_table_counter;
    $THEMEREX_sc_price_table_counter = 0;
    $count = max(1, $count);
    return '<div' . ($id ? ' id="' . $id . '"' : '') . ' class="sc_pricing_table columns_' . $count . ($align && $align != 'none' ? ' align' . themerex_strtoproper($align) : '') . (!empty($class) ? ' ' . $class : '') . '"' . ($s != '' ? ' style="' . $s . '"' : '') . '>' . do_shortcode($content) . '</div>';
}
				</div>
				<?php 
        if ($opt['hover'] == 'circle effect8') {
            ?>
				</div>
				<?php 
        }
        ?>
				</div></a></div>

		<?php 
    } else {
        ?>

			<div class="hover hover<?php 
        echo themerex_strtoproper($opt['hover']);
        ?>
Show">
				<?php 
        if ($post_data['post_thumb']) {
            ?>
					<div class="thumb"><?php 
            echo $post_data['post_thumb'];
            ?>
</div>
				<?php 
        } else {
            if ($post_data['post_gallery']) {
                echo $post_data['post_gallery'];
            } else {
                if ($post_data['post_video']) {
"><?php 
        echo esc_html($post_data['post_title']);
        ?>
</a></h4><?php 
    } else {
        ?>
<h4><?php 
        echo esc_html($post_data['post_title']);
        ?>
</h4><?php 
    }
}
if ($post_data['post_excerpt']) {
    ?>
						<div class="post_format_wrap post<?php 
    echo esc_attr(themerex_strtoproper($post_data['post_format']));
    ?>
">
							<?php 
    echo in_array($post_data['post_format'], array('quote', 'link', 'chat')) ? $post_data['post_excerpt'] : getShortString($post_data['post_excerpt'], isset($opt['descr']) ? $opt['descr'] : get_custom_option('post_excerpt_maxlength' . ($columns > 1 ? '_masonry' : '')));
    ?>
						</div>
					<?php 
}
?>
					<?php 
if (!isset($opt['info']) || $opt['info']) {
    if (get_custom_option('show_post_info') == 'yes') {
        ?>
							<div class="bog_post_info infoPost">
								<span class="datePost"><a href="<?php 
Example #11
0
<?php

/**
 * The Sidebar containing the main widget areas.
 */
if (in_array(get_custom_option('show_sidebar_main'), array('left', 'right'))) {
    $style = get_custom_option('sidebar_main_style');
    ?>
<div id="sidebar_main" class="widget_area sidebar_main sidebar sidebarStyle<?php 
    echo esc_attr(themerex_strtoproper($style));
    ?>
" role="complementary">
	<?php 
    do_action('before_sidebar');
    global $THEMEREX_CURRENT_SIDEBAR;
    $THEMEREX_CURRENT_SIDEBAR = 'main';
    if (!dynamic_sidebar(get_custom_option('sidebar_main'))) {
        // Put here html if user no set widgets in sidebar
    }
    ?>
</div>
<?php 
}
Example #12
0
function sc_price_table($atts, $content = null)
{
    if (in_shortcode_blogger()) {
        return '';
    }
    extract(shortcode_atts(array("id" => "", "align" => "", "count" => 1, "style" => "1", "color" => "green", "indent" => "no", "top" => "", "bottom" => "", "left" => "", "right" => "", "width" => ""), $atts));
    $s = ($top !== '' ? 'margin-top:' . $top . 'px;' : '') . ($bottom !== '' ? 'margin-bottom:' . $bottom . 'px;' : '') . ($left !== '' ? 'margin-left:' . $left . 'px;' : '') . ($right !== '' ? 'margin-right:' . $right . 'px;' : '') . ($width !== '' ? 'width:' . $width . 'px;' : '');
    $c = ($align && $align != 'none' ? ' sc_align_' . themerex_strtoproper($align) : '') . ($style != '' ? ' sc_pricing_table_style_' . $style : ' sc_pricing_table_style_1');
    global $THEMEREX_sc_price_table_columns;
    $THEMEREX_sc_price_table_columns = $count = max(1, min(12, $count));
    return '<div' . ($id ? ' id="sc_price_table_' . $id . '"' : '') . ' class="sc_pricing_table_' . $color . ' sc_pricing_table' . $c . '"' . ($s != '' ? ' style="' . $s . '"' : '') . '>' . '<div class="sc_columns_' . $count . ($indent == 'yes' ? ' sc_columns_indent' : '') . '">' . do_shortcode($content) . '</div>' . '</div>';
}
Example #13
0
 function showShareSocialLinks($args)
 {
     $args = array_merge(array('post_id' => 0, 'post_link' => '', 'post_title' => '', 'post_descr' => '', 'post_thumb' => '', 'use_icons' => false, 'counters' => false, 'direction' => 'horizontal', 'style' => 'block', 'caption' => '', 'popup' => true, 'share' => array(), 'echo' => true), $args);
     global $THEMEREX_share_social_list;
     if (count($args['share']) == 0 || implode('', $args['share'][0]) == '') {
         return '';
     }
     // $args['share'] = $THEMEREX_share_social_list;
     $output = $args['style'] == 'block' ? '<div class="post_info post_info_bottom"><div class="share-social share-dir-' . $args['direction'] . '">' . ($args['caption'] != '' ? '<span class="share-caption">' . $args['caption'] . '</span>' : '') : '<ul class="share-social' . ($args['style'] == 'drop' ? ' shareDrop' : '') . '">';
     foreach ($args['share'] as $s => $data) {
         if (!empty($data['icon'])) {
             $s = basename($data['icon']);
             foreach ($THEMEREX_share_social_list as $k => $d) {
                 $pattern = '/' . $k . '/';
                 $preg = preg_match($pattern, $s);
                 if ($preg == 1) {
                     $s = $k;
                     break;
                 }
             }
         }
         $link = str_replace(array('{id}', '{link}', '{title}', '{descr}', '{image}'), array(urlencode($args['post_id']), urlencode($args['post_link']), urlencode(strip_tags($args['post_title'])), urlencode(strip_tags($args['post_descr'])), urlencode($args['post_thumb'])), empty($data['url']) && isset($THEMEREX_share_social_list[$s]['url']) && !empty($THEMEREX_share_social_list[$s]['url']) ? $THEMEREX_share_social_list[$s]['url'] : $data['url']);
         $output .= (in_array($args['style'], array('list', 'drop')) ? '<li>' : '') . '<a href="' . ($args['popup'] ? '#' : esc_attr($link)) . '" class="' . $data['icon'] . ' social_icons share-item' . ($args['use_icons'] ? ' ' . $data['icon'] : '') . '"' . ($args['popup'] ? ' onclick="window.open(\'' . $link . '\', \'_blank\', \'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=480, height=400, toolbar=0, status=0\'); return false;"' : ' target="_blank"') . ($args['counters'] ? ' data-count="' . $s . '"' : '') . '>' . ($args['style'] == 'drop' ? themerex_strtoproper($s) : '') . '</a>' . (in_array($args['style'], array('list', 'drop')) ? '</li>' : '');
     }
     $output .= $args['style'] == 'block' ? '</div></div>' : '</ul>';
     if ($args['echo']) {
         echo balanceTags($output);
     }
     return $output;
 }