Ejemplo n.º 1
0
function get_post_custom_for_listing_page($pid, $paten_str, $fields_name = '')
{
    global $wpdb, $custom_post_meta_db_table_name;
    $sql = "select * from {$custom_post_meta_db_table_name} where is_active=1 and show_on_listing=1 ";
    if ($fields_name) {
        $fields_name = '"' . str_replace(',', '","', $fields_name) . '"';
        $sql .= " and htmlvar_name in ({$fields_name}) ";
    }
    $sql .= " order by sort_order asc,admin_title asc";
    $post_meta_info = $wpdb->get_results($sql);
    $return_str = '';
    $search_arr = array('{#TITLE#}', '{#VALUE#}');
    $replace_arr = array();
    if ($post_meta_info) {
        foreach ($post_meta_info as $post_meta_info_obj) {
            if ($post_meta_info_obj->site_title) {
                $replace_arr[] = $post_meta_info_obj->site_title;
            }
            if ($post_meta_info_obj->ctype != 'upload') {
                //$image_var = get_post_meta($pid,$post_meta_info_obj->htmlvar_name,true);
                $image_var = "<img src='" . templ_thumbimage_filter(get_post_meta($pid, $post_meta_info_obj->htmlvar_name, true), 100, 100) . "' width='100' heigh='100'/>";
                $replace_arr = array($post_meta_info_obj->site_title, $image_var);
                $replace_arr = array($post_meta_info_obj->site_title, get_post_meta($pid, $post_meta_info_obj->htmlvar_name, true));
                if (get_post_meta($pid, $post_meta_info_obj->htmlvar_name, true)) {
                    $return_str .= str_replace($search_arr, $replace_arr, $paten_str);
                }
            }
        }
    }
    return $return_str;
}
function get_custom_usermeta_single_page($pid, $paten_str, $fields_name = '')
{
    global $wpdb, $custom_usermeta_db_table_name;
    $sql = "select * from {$custom_usermeta_db_table_name} where is_active=1 and show_on_detail=1 ";
    if ($fields_name) {
        $fields_name = '"' . str_replace(',', '","', $fields_name) . '"';
        $sql .= " and htmlvar_name in ({$fields_name}) ";
    }
    $sql .= " and ctype!='upload' and ctype!='texteditor' order by sort_order asc,admin_title asc";
    $post_meta_info = $wpdb->get_results($sql);
    $return_str = '';
    $search_arr = array('{#TITLE#}', '{#VALUE#}');
    $replace_arr = array();
    if ($post_meta_info) {
        foreach ($post_meta_info as $user_meta_info_obj) {
            if ($user_meta_info_obj->site_title) {
                $replace_arr[] = $user_meta_info_obj->site_title;
            }
            if ($user_meta_info_obj->ctype == 'upload') {
                //$image_var = get_usermeta($pid,$user_meta_info_obj->htmlvar_name,true);
                $image_var = "<img src='" . templ_thumbimage_filter(get_usermeta($pid, $user_meta_info_obj->htmlvar_name, true), 100, 100) . "'/>";
                $replace_arr = array($user_meta_info_obj->site_title, $image_var);
            }
            if ($user_meta_info_obj->ctype == 'multicheckbox') {
                $val_category = get_usermeta($pid, $user_meta_info_obj->htmlvar_name, true);
                if (is_array($val_category)) {
                    $val_category_value = implode(",", $val_category);
                } else {
                    $val_category_value = $val_category;
                }
                $replace_arr = array($user_meta_info_obj->site_title, $val_category_value);
                $return_str .= str_replace($search_arr, $replace_arr, $paten_str);
            } else {
                $replace_arr = array($user_meta_info_obj->site_title, get_usermeta($pid, $user_meta_info_obj->htmlvar_name, true));
                if (get_usermeta($pid, $user_meta_info_obj->htmlvar_name, true)) {
                    $return_str .= str_replace($search_arr, $replace_arr, $paten_str);
                }
            }
        }
    }
    return $return_str;
}
Ejemplo n.º 3
0
                		<input type="hidden" name="did" value="<?php 
echo $did;
?>
" />
              
            </div>   
                    
			
            
            <!-- BOF Listing -->
			    <div class="content_left">
					<?php 
if ($_SESSION['file_name'] != "" || $_REQUEST['dealsession_image'] != "") {
    ?>
						<img src="<?php 
    echo templ_thumbimage_filter($_SESSION['file_name'], 285, 275);
    ?>
" />
					<?php 
} else {
    ?>
						<img src="<?php 
    echo get_template_directory_uri() . "/images/no-image.png";
    ?>
" width="285" height="275" alt="" />
					<?php 
}
?>
                </div>

                 <div class="content_right">
Ejemplo n.º 4
0
    function widget($args, $instance)
    {
        // prints the widget
        extract($args, EXTR_SKIP);
        $title = empty($instance['title']) ? '&nbsp;' : apply_filters('widget_title', $instance['title']);
        $category = empty($instance['category']) ? '' : apply_filters('widget_category', $instance['category']);
        $post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
        $user_db_table_name = get_user_table();
        $status_deal = empty($instance['status_deal']) ? '' : apply_filters('widget_status_deal', $instance['status_deal']);
        ?>
		<h3 class="deal_widget_title"><?php 
        _e($title, 'templatic');
        ?>
 <small> ( <a href="<?php 
        echo site_url();
        ?>
/?ptype=taxonomy_all_deal_tab" class="b_viewalldeal"><?php 
        _e(VIEW_ALL_DEAL, 'templatic');
        ?>
</a> ) </small> </h3>
		<span class="flip_postion"></span>
		<div class="deals_widget">
  <!-- BOF Loop -->
			<?php 
        templ_page_title_above();
        //page title above action hook
        ?>
			<?php 
        $destination_path = site_url() . '/wp-content/uploads/';
        ?>
			<script type="text/javascript" src="<?php 
        bloginfo('template_directory');
        ?>
/js/timer.js"></script>
 <?php 
        global $wp_query, $post, $wpdb;
        $current_term = $wp_query->get_queried_object();
        if ($current_term->name) {
            $ptitle = $current_term->name;
        }
        ?>
			<div id="loop" class="<?php 
        if (get_option('ptttheme_view_opt') == 'Grid View') {
            echo 'grid';
        } else {
            echo 'list clear';
        }
        ?>
 ">
    <!-- BOF All Deal -->
<?php 
        global $wpdb, $transection_db_table_name;
        $targetpage = site_url("?ptype=deals");
        $postmeta_db_table_name = $wpdb->prefix . "postmeta";
        $post_db_table_name = $wpdb->prefix . "posts";
        $total_deals = mysql_query("select p.* from {$post_db_table_name} p where p.post_type = 'seller' and p.post_status = 'publish' ");
        $total_pages = mysql_num_rows($total_deals);
        $recordsperpage = $post_number;
        $pagination = $_REQUEST['pagination'];
        if ($pagination == '') {
            $pagination = 1;
        }
        $strtlimit = ($pagination - 1) * $recordsperpage;
        $endlimit = $strtlimit + $recordsperpage;
        if ($category) {
            $category = "'" . str_replace(",", "','", $category) . "'";
            $sqlsql = " and p.ID in (select tr.object_id from {$wpdb->term_relationships} tr join {$wpdb->term_taxonomy} t on t.term_taxonomy_id=tr.term_taxonomy_id where t.term_id in ({$category})  )";
        }
        $dealcnt_sql = $wpdb->get_results("select p.* from {$post_db_table_name} p where p.post_type = 'seller' and p.post_status = 'publish' {$sqlsql} ORDER BY ID DESC  limit {$strtlimit},{$recordsperpage} ");
        if (count($dealcnt_sql) > 0) {
            $pcount = 0;
            foreach ($dealcnt_sql as $post) {
                if ($status_deal == 'all') {
                    $expired = get_post_meta($post->ID, 'is_expired', true) == '1' || get_post_meta($post->ID, 'is_expired', true) == '0';
                } else {
                    $expired = get_post_meta($post->ID, 'is_expired', true) == '0';
                }
                if ($status_deal == 'all') {
                    $pcount++;
                    if (get_post_meta($post->ID, 'enddate', true) != '0') {
                        deal_expire_process($post->ID);
                    }
                    $coupon_website = get_post_meta($post->ID, 'coupon_website', true);
                    $owner_name = get_post_meta($post->ID, 'owner_name', true);
                    $our_price = get_post_meta($post->ID, 'our_price', true);
                    $current_price = get_post_meta($post->ID, 'current_price', true);
                    $sellsql = "select count(*) from {$transection_db_table_name} where post_id=" . $post->ID . " and status=1";
                    $totdiff = $current_price - $our_price;
                    $percent = $totdiff * 100;
                    $percentsave = $percent / $current_price;
                    $sellsqlinfo = $wpdb->get_var($sellsql);
                    if (get_post_meta($post->ID, 'enddate', true) != '0') {
                        if (get_post_meta($post->ID, 'coupon_end_date_time', true) != "") {
                            $date = get_post_meta($post->ID, 'coupon_end_date_time', true);
                            $tardate = date("F d, Y H:i:s", get_post_meta($post->ID, 'coupon_end_date_time', true));
                            $targatedate = date("d-m-y H:i:s", get_post_meta($post->ID, 'coupon_end_date_time', true));
                            $tardate1 = date("F d, Y", get_post_meta($post->ID, 'coupon_end_date_time', true));
                            $enddate1 = date("Y-m-d H:i:s", get_post_meta($post->ID, 'coupon_end_date_time', true));
                            if (date("Y-m-d H:i:s") >= $enddate1 && get_post_meta($post->ID, 'enddate', true) != '0') {
                                if (get_post_meta($post->ID, 'is_expired', true) == '0' || get_post_meta($post->ID, 'is_expired', true) == '') {
                                    update_post_meta($post->ID, 'is_expired', '1');
                                }
                            }
                        } else {
                            if (get_post_meta($post->ID, 'enddate', true) != '0' && get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo) {
                                if (get_post_meta($post->ID, 'is_expired', true) == '0' || get_post_meta($post->ID, 'is_expired', true) == '') {
                                    update_post_meta($post->ID, 'is_expired', '1');
                                }
                            }
                        }
                    }
                    $stdate = date("F d, Y H:i:s", get_post_meta($post->ID, 'coupon_start_date_time', true));
                    $no_of_coupon = get_post_meta($post->ID, 'no_of_coupon', true);
                    ?>
					<div <?php 
                    post_class('post posts_deals');
                    ?>
 id="post_<?php 
                    the_ID();
                    ?>
" >
						<div class="product_image "> <a href="<?php 
                    the_permalink();
                    ?>
">
<?php 
                    if (get_post_meta($post->ID, 'file_name', true) != "") {
                        ?>
								<img src="<?php 
                        echo templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 260, 180);
                        ?>
" alt="" />
<?php 
                    } else {
                        ?>
								<img src="<?php 
                        echo get_template_directory_uri() . "/images/no-image.png";
                        ?>
" width="260" height="180" alt="" />
<?php 
                    }
                    ?>
						</a></div>
						<div class="product_image grid_img"> <a href="<?php 
                    the_permalink();
                    ?>
">
<?php 
                    if (get_post_meta($post->ID, 'file_name', true) != "") {
                        ?>
								<img src="<?php 
                        echo templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 280, 180);
                        ?>
" alt="" />
<?php 
                    } else {
                        ?>
									<div class="noimg"><?php 
                        _e('Image <br />not available', 'templatic');
                        ?>
</div>
<?php 
                    }
                    ?>
						</a> </div>
						<div class="content_right content_right_inner"><span class="title_grey"><?php 
                    _e(PROVIDE_BY, 'templatic');
                    ?>
</span>
<?php 
                    $user_db_table_name = get_user_table();
                    $user_data = $wpdb->get_row("select * from {$user_db_table_name} where ID = '" . $post->post_author . "'");
                    ?>
							<a href="<?php 
                    echo get_author_posts_url($post->post_author);
                    ?>
" class="top_lnk" title="<?php 
                    echo $user_data->display_name;
                    ?>
"><?php 
                    echo get_post_meta($post->ID, 'owner_name', true);
                    ?>
</a>
							<h3><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    echo $post->post_title;
                    ?>
</a></h3>
							<div class="grid_price"><span class="strike_rate"><?php 
                    _e('Our Price :', 'templatic');
                    ?>
 <s><?php 
                    echo get_currency_sym();
                    echo $current_price;
                    ?>
</s></span> <span class="rate"><?php 
                    _e('Offer Price :', 'templatic');
                    ?>
 <?php 
                    echo get_currency_sym();
                    echo $our_price;
                    ?>
</span> </div>
							<?php 
                    if (date("Y-m-d H:i:s") >= $enddate1 || strtotime($stdate) >= strtotime($tardate) || get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo) {
                        if (get_post_meta($post->ID, 'is_expired', true) == '1') {
                            ?>
									<div class="i_expire"><?php 
                            echo THIS_DEAL;
                            ?>
<span><?php 
                            echo EXPIRED;
                            ?>
</span> <?php 
                            echo ON;
                            ?>
 <span><?php 
                            echo $tardate1;
                            ?>
</span></div>
<?php 
                        }
                        if (get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo && get_post_meta($post->ID, 'is_expired', true) != '1') {
                            ?>
					<div class="i_start"><span><?php 
                            echo "Is Sold Out";
                            ?>
</span></div>
					<?php 
                        }
                    } else {
                        if (get_post_meta($post->ID, 'coupon_end_date_time', true)) {
                            ?>
									<div class="deal_time_box">
										<div class="time_line"> </div>
											<div id="countdowncontainer_<?php 
                            _e($post->ID, 'templatic');
                            ?>
"></div>
											<div class="fr" id="fr_<?php 
                            echo $post->ID;
                            ?>
">
												<div class="price_main"> <span class="strike_rate"><?php 
                            echo get_currency_sym();
                            echo $current_price;
                            ?>
</span> <span class="rate"><?php 
                            echo get_currency_sym();
                            echo $our_price;
                            ?>
</span> </div>
												<?php 
                            if (get_post_meta($post->ID, 'coupon_type', true) == 1) {
                                ?>
												<a href="<?php 
                                echo get_post_meta($post->ID, 'coupon_link', true);
                                ?>
" title="<?php 
                                echo BUY_NOW;
                                ?>
" class="btn_buy" target="_blank"><?php 
                                echo BUY_NOW;
                                ?>
</a>
												<?php 
                            } else {
                                ?>
												<a href="<?php 
                                echo get_option('siteurl');
                                ?>
/?ptype=buydeal&amp;did=<?php 
                                _e($post->ID, 'templatic');
                                ?>
" title="<?php 
                                echo BUY_NOW;
                                ?>
" class="btn_buy"><?php 
                                echo BUY_NOW;
                                ?>
</a>
												<?php 
                            }
                            ?>
											</div>
											<?php 
                            $targatedate = explode(' ', $targatedate);
                            $tar_date = explode('-', $targatedate[0]);
                            $tar_time = explode(':', $targatedate[1]);
                            $timezone = get_option('ptthemes_time_offset');
                            $exp_year = explode(',', $tardate1);
                            ?>
											<script>
											displayTZCountDown(setTZCountDown('<?php 
                            echo $tar_date[1];
                            ?>
','<?php 
                            echo $tar_date[0];
                            ?>
','<?php 
                            echo $tar_time[0];
                            ?>
','<?php 
                            echo $timezone;
                            ?>
','<?php 
                            echo $exp_year[1];
                            ?>
'),'countdowncontainer_<?php 
                            _e($post->ID, 'templatic');
                            ?>
','fr_<?php 
                            echo $post->ID;
                            ?>
','<?php 
                            echo $tardate1;
                            ?>
');
											</script>
									</div>
<?php 
                        }
                    }
                    ?>
							<ul class="rate_summery">
								<li class="rate_current_price"><span><?php 
                    echo CURRENT_PRICE;
                    ?>
</span> <strong><small><?php 
                    echo get_currency_sym();
                    ?>
</small><?php 
                    echo $current_price;
                    ?>
</strong></li>
								<li class="rate_our_price"><span><?php 
                    echo OUR_PRICE;
                    ?>
</span> <strong><small><?php 
                    echo get_currency_sym();
                    ?>
</small><?php 
                    echo $our_price;
                    ?>
</strong></li>
								<li class="rate_percentage"><span><?php 
                    echo YOU_SAVE;
                    ?>
</span> <strong><?php 
                    echo @number_format($percentsave, 2);
                    ?>
%</strong></li>
								<li class="bdr_none rate_item_sold"><span><?php 
                    echo ITEMS_SOLD;
                    ?>
</span> <strong><?php 
                    echo $sellsqlinfo;
                    ?>
</strong>
							</ul>
<?php 
                    $post_categories = wp_get_post_terms($post->ID, 'seller_category');
                    if ($post_categories[1] != "") {
                        ?>
								<div class="post_cats clearfix">
<?php 
                        the_taxonomies(array('before' => '<span class="categories">', 'sep' => '</span><span class="tags">', 'after' => '</span>'));
                        ?>
								</div>
<?php 
                    }
                    if (get_post_meta($post->ID, 'enddate', true) == '0' && get_option('ptttheme_view_opt') != 'Grid View' && get_post_meta($post->ID, 'status', true) == '1') {
                        ?>
		<?php 
                        if (get_post_meta($post->ID, 'coupon_type', true) == 1) {
                            ?>
						<a href="<?php 
                            echo get_post_meta($post->ID, 'coupon_link', true);
                            ?>
" title="<?php 
                            echo BUY_NOW;
                            ?>
" class="btn_buy_deal" target="_blank"><?php 
                            echo BUY_NOW;
                            ?>
</a>
		<?php 
                        } else {
                            ?>
						<a href="<?php 
                            echo get_option('siteurl');
                            ?>
/?ptype=buydeal&amp;did=<?php 
                            _e($post->ID, 'templatic');
                            ?>
" title="<?php 
                            echo BUY_NOW;
                            ?>
" class="btn_buy_deal"><?php 
                            echo BUY_NOW;
                            ?>
</a>
		<?php 
                        }
                    }
                    if (get_post_meta($post->ID, 'is_expired', true) != 1 && get_option('ptttheme_view_opt') == 'Grid View') {
                        if (get_post_meta($post->ID, 'coupon_type', true) == 1) {
                            ?>
								 <a href="<?php 
                            echo get_post_meta($post->ID, 'coupon_link', true);
                            ?>
" title="<?php 
                            echo BUY_NOW;
                            ?>
" class="btn_buy_grid"><?php 
                            echo BUY_NOW;
                            ?>
</a>
								
<?php 
                        } else {
                            ?>
								<a href="<?php 
                            echo get_option('siteurl');
                            ?>
/?ptype=buydeal&amp;did=<?php 
                            _e($post->ID, 'templatic');
                            ?>
" title="<?php 
                            echo BUY_NOW;
                            ?>
" class="btn_buy_grid"><?php 
                            echo BUY_NOW;
                            ?>
</a>
<?php 
                        }
                    }
                    ?>
							<div class="text_content"  id="content_<?php 
                    _e($post->ID, 'templatic');
                    ?>
"><?php 
                    echo "" . $post->post_excerpt . "";
                    ?>
<a href="<?php 
                    the_permalink();
                    ?>
" class="readmore_link"><?php 
                    _e(get_option('ptthemes_content_excerpt_readmore'));
                    ?>
</a></div>
						</div>
					</div>
<?php 
                    $page_layout = templ_get_page_layout();
                    if ($pcount == 3) {
                        $pcount = 0;
                        ?>
						<div class="hr clear"></div>
<?php 
                    }
                } else {
                    if (get_post_meta($post->ID, 'is_expired', true) != 1) {
                        $pcount++;
                        if (get_post_meta($post->ID, 'enddate', true) != '0') {
                            deal_expire_process($post->ID);
                        }
                        $coupon_website = get_post_meta($post->ID, 'coupon_website', true);
                        $owner_name = get_post_meta($post->ID, 'owner_name', true);
                        $our_price = get_post_meta($post->ID, 'our_price', true);
                        $current_price = get_post_meta($post->ID, 'current_price', true);
                        $sellsql = "select count(*) from {$transection_db_table_name} where post_id=" . $post->ID . " and status=1";
                        $totdiff = $current_price - $our_price;
                        $percent = $totdiff * 100;
                        $recordsperpage = $post_number;
                        $percentsave = $percent / $current_price;
                        $sellsqlinfo = $wpdb->get_var($sellsql);
                        if (get_post_meta($post->ID, 'enddate', true) != '0') {
                            if (get_post_meta($post->ID, 'coupon_end_date_time', true) != "") {
                                $date = get_post_meta($post->ID, 'coupon_end_date_time', true);
                                $tardate = date("F d, Y H:i:s", get_post_meta($post->ID, 'coupon_end_date_time', true));
                                $targatedate = date("d-m-y H:i:s", get_post_meta($post->ID, 'coupon_end_date_time', true));
                                $tardate1 = date("F d, Y", get_post_meta($post->ID, 'coupon_end_date_time', true));
                                $enddate1 = date("Y-m-d H:i:s", get_post_meta($post->ID, 'coupon_end_date_time', true));
                                if (date("Y-m-d H:i:s") >= $enddate1 && get_post_meta($post->ID, 'enddate', true) != '0') {
                                    if (get_post_meta($post->ID, 'is_expired', true) == '0' || get_post_meta($post->ID, 'is_expired', true) == '') {
                                        update_post_meta($post->ID, 'is_expired', '1');
                                    }
                                }
                            } else {
                                if (get_post_meta($post->ID, 'enddate', true) != '0' && get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo) {
                                    if (get_post_meta($post->ID, 'is_expired', true) == '0' || get_post_meta($post->ID, 'is_expired', true) == '') {
                                        update_post_meta($post->ID, 'is_expired', '1');
                                    }
                                }
                            }
                        }
                        $stdate = date("F d, Y H:i:s", get_post_meta($post->ID, 'coupon_start_date_time', true));
                        $no_of_coupon = get_post_meta($post->ID, 'no_of_coupon', true);
                        ?>
						<div <?php 
                        post_class('post posts_deals');
                        ?>
 id="post_<?php 
                        the_ID();
                        ?>
" >
							<div class="product_image "> <a href="<?php 
                        the_permalink();
                        ?>
">
<?php 
                        if (get_post_meta($post->ID, 'file_name', true) != "") {
                            ?>
									<img src="<?php 
                            echo templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 260, 180);
                            ?>
" alt="" />
<?php 
                        } else {
                            ?>
									<img src="<?php 
                            echo get_template_directory_uri() . "/images/no-image.png";
                            ?>
" width="260" height="180" alt="" />
<?php 
                        }
                        ?>
							</a> </div>
							<div class="product_image grid_img"> <a href="<?php 
                        the_permalink();
                        ?>
">
<?php 
                        if (get_post_meta($post->ID, 'file_name', true) != "") {
                            ?>
									<img src="<?php 
                            echo templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 280, 180);
                            ?>
" alt="" />
<?php 
                        } else {
                            ?>
									<div class="noimg"> <?php 
                            _e('Image <br /> not available', 'templatic');
                            ?>
</div>
<?php 
                        }
                        ?>
							</a> </div>
							<div class="content_right content_right_inner"><?php 
                        if (get_option('ptthemes_listing_author') != 'No') {
                            ?>
        
                   <span class="title_grey"><?php 
                            echo PROVIDE_BY;
                            ?>
 </span>
					<?php 
                            $user_db_table_name = get_user_table();
                            $user_data = $wpdb->get_row("select * from {$user_db_table_name} where ID = '" . $post->post_author . "'");
                            ?>
					
					<a href="<?php 
                            echo get_author_posts_url($post->post_author);
                            ?>
" class="top_lnk" title="<?php 
                            echo $user_data->display_name;
                            ?>
"><?php 
                            echo get_post_meta($post->ID, 'owner_name', true);
                            ?>
</a>
					<?php 
                        }
                        ?>
								<h3><a href="<?php 
                        the_permalink();
                        ?>
"><?php 
                        echo $post->post_title;
                        ?>
</a></h3>
								<div class="grid_price"><span class="strike_rate"><?php 
                        _e(OUR_PRICES, 'templatic');
                        ?>
<s><?php 
                        echo get_currency_sym();
                        echo $current_price;
                        ?>
</s></span> <span class="rate"><?php 
                        _e(OFFER_PRICE, 'templatic');
                        ?>
 <?php 
                        echo get_currency_sym();
                        echo $our_price;
                        ?>
</span>
							</div>
<?php 
                        if (get_post_meta($post->ID, 'enddate', true) != '0' || get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo) {
                            if (date("Y-m-d H:i:s") >= $enddate1 || get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo) {
                                if (get_post_meta($post->ID, 'is_expired', true) == '1') {
                                    if (get_post_meta($post->ID, 'is_expired', true) == '0') {
                                        update_post_meta($post->ID, 'is_expired', '1');
                                    }
                                    ?>
									<div class="i_expire"><?php 
                                    echo THIS_DEAL;
                                    ?>
<span><?php 
                                    echo EXPIRED;
                                    ?>
</span> <?php 
                                    echo ON;
                                    ?>
 <span><?php 
                                    echo $tardate1;
                                    ?>
</span></div>
<?php 
                                }
                                if (get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo && get_post_meta($post->ID, 'is_expired', true) != '1') {
                                    ?>
					<div class="i_start"><span><?php 
                                    echo "Is Sold Out";
                                    ?>
</span></div>
					<?php 
                                }
                            } else {
                                if (get_post_meta($post->ID, 'coupon_end_date_time', true)) {
                                    ?>
									<div class="deal_time_box">
										<div class="time_line"> </div>
										<div id="countdowncontainer_<?php 
                                    _e($post->ID, 'templatic');
                                    ?>
"></div>
										
										<div class="fr" id="fr_<?php 
                                    echo $post->ID;
                                    ?>
">
											<div class="price_main"> <span class="strike_rate"><?php 
                                    echo get_currency_sym();
                                    echo $current_price;
                                    ?>
</span> <span class="rate"><?php 
                                    echo get_currency_sym();
                                    echo $our_price;
                                    ?>
</span> </div>
<?php 
                                    if (get_post_meta($post->ID, 'coupon_type', true) == 1) {
                                        ?>
												<a href="<?php 
                                        echo get_post_meta($post->ID, 'coupon_link', true);
                                        ?>
" title="<?php 
                                        _e(BUY_NOW, 'templatic');
                                        ?>
" class="btn_buy" target="_blank"><?php 
                                        _e(BUY_NOW, 'templatic');
                                        ?>
</a>
<?php 
                                    } else {
                                        ?>
												<a href="<?php 
                                        echo get_option('siteurl');
                                        ?>
/?ptype=buydeal&amp;did=<?php 
                                        _e($post->ID, 'templatic');
                                        ?>
" title="<?php 
                                        _e(BUY_NOW, 'templatic');
                                        ?>
" class="btn_buy"><?php 
                                        _e(BUY_NOW, 'templatic');
                                        ?>
</a>
<?php 
                                    }
                                    ?>
										</div>
										 <?php 
                                    $targatedate = explode(' ', $targatedate);
                                    $tar_date = explode('-', $targatedate[0]);
                                    $tar_time = explode(':', $targatedate[1]);
                                    $timezone = get_option('ptthemes_time_offset');
                                    $exp_year = explode(',', $tardate1);
                                    ?>
											<script>
											displayTZCountDown(setTZCountDown('<?php 
                                    echo $tar_date[1];
                                    ?>
','<?php 
                                    echo $tar_date[0];
                                    ?>
','<?php 
                                    echo $tar_time[0];
                                    ?>
','<?php 
                                    echo $timezone;
                                    ?>
','<?php 
                                    echo $exp_year[1];
                                    ?>
'),'countdowncontainer_<?php 
                                    _e($post->ID, 'templatic');
                                    ?>
','fr_<?php 
                                    echo $post->ID;
                                    ?>
','<?php 
                                    echo $tardate1;
                                    ?>
');
											</script>
									</div>
<?php 
                                }
                            }
                        }
                        ?>
        <ul class="rate_summery">
          <li class="rate_current_price"><span>
            <?php 
                        echo CURRENT_PRICE;
                        ?>
            </span> <strong><small><?php 
                        echo get_currency_sym();
                        ?>
</small><?php 
                        echo $current_price;
                        ?>
</strong></li>
          <li class="rate_our_price"><span>
            <?php 
                        echo OUR_PRICE;
                        ?>
            </span> <strong><small><?php 
                        echo get_currency_sym();
                        ?>
</small><?php 
                        echo $our_price;
                        ?>
</strong></li>
          <li class="rate_percentage"><span>
            <?php 
                        echo YOU_SAVE;
                        ?>
            </span> <strong><?php 
                        echo @number_format($percentsave, 2);
                        ?>
%</strong></li>
          <li class="bdr_none rate_item_sold"><span>
            <?php 
                        echo ITEMS_SOLD;
                        ?>
            </span> <strong><?php 
                        echo $sellsqlinfo;
                        ?>
</strong> </li>
        </ul>
        <?php 
                        if (templ_is_show_post_category()) {
                            ?>
        <div class="post_cats clearfix">
          <?php 
                            the_taxonomies(array('before' => '<span class="categories">', 'sep' => '</span><span class="tags">', 'after' => '</span>'));
                            ?>
        </div>
        <?php 
                        }
                        ?>
		<?php 
                        if (get_post_meta($post->ID, 'enddate', true) == '0' && get_option('ptttheme_view_opt') != 'Grid View' && get_post_meta($post->ID, 'status', true) == '1' && get_post_meta($post->ID, 'is_expired', true) == '0') {
                            ?>
		<?php 
                            if (get_post_meta($post->ID, 'coupon_type', true) == 1) {
                                ?>
						<a href="<?php 
                                echo get_post_meta($post->ID, 'coupon_link', true);
                                ?>
" title="<?php 
                                echo BUY_NOW;
                                ?>
" class="btn_buy_deal" target="_blank"><?php 
                                echo BUY_NOW;
                                ?>
</a>
		<?php 
                            } else {
                                ?>
						<a href="<?php 
                                echo get_option('siteurl');
                                ?>
/?ptype=buydeal&amp;did=<?php 
                                _e($post->ID, 'templatic');
                                ?>
" title="<?php 
                                echo BUY_NOW;
                                ?>
" class="btn_buy_deal"><?php 
                                echo BUY_NOW;
                                ?>
</a>
		<?php 
                            }
                        }
                        ?>
        <?php 
                        if (get_post_meta($post->ID, 'is_expired', true) != 1) {
                            if (get_post_meta($post->ID, 'coupon_type', true) == 1) {
                                ?>
        <a href="<?php 
                                echo get_post_meta($post->ID, 'coupon_link', true);
                                ?>
" onclick="" title="<?php 
                                echo BUY_NOW;
                                ?>
" class="btn_buy_grid"><?php 
                                echo BUY_NOW;
                                ?>
</a>
        <?php 
                            } else {
                                ?>
				 <a href="<?php 
                                echo get_option('siteurl');
                                ?>
/?ptype=buydeal&amp;did=<?php 
                                _e($post->ID, 'templatic');
                                ?>
" title="<?php 
                                echo BUY_NOW;
                                ?>
" class="btn_buy_grid"><?php 
                                echo BUY_NOW;
                                ?>
</a>
		<?php 
                            }
                        }
                        ?>
        <div class="text_content"  id="content_<?php 
                        _e($post->ID, 'templatic');
                        ?>
">
          <?php 
                        echo "" . $post->post_excerpt . "";
                        ?>
          <a href="<?php 
                        the_permalink();
                        ?>
" class="readmore_link">
          <?php 
                        _e(get_option('ptthemes_content_excerpt_readmore'));
                        ?>
          </a> </div>
      </div>
    </div>
    <?php 
                        $page_layout = templ_get_page_layout();
                        if ($pcount == 3) {
                            $pcount = 0;
                            ?>
    <div class="hr clear"></div>
 <?php 
                        }
                    }
                }
            }
        }
        ?>
    <!-- EOF All Deal -->
  </div>
</div>
<!--  CONTENT AREA END -->
<?php 
    }
Ejemplo n.º 5
0
        ?>
</small><?php 
        echo get_post_meta($post->ID, 'our_price', true);
        ?>
</strong></div>
	</div>
	</div>
  <div class="product_image grid_img"> <a href="<?php 
        the_permalink();
        ?>
">
    <?php 
        if (get_post_meta($post->ID, 'file_name', true) != "") {
            ?>
    <img src="<?php 
            echo templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 280, 180);
            ?>
" width="280" height="180" alt="" />
    <?php 
        } else {
            ?>
    <div class="noimg"> <?php 
            echo IMAGE_NOT_AVAILABLE;
            ?>
</div>
    <?php 
        }
        ?>
    </a> </div>
  <div class="content_right content_right_inner">
Ejemplo n.º 6
0
    foreach ($dealcnt_sql as $total_deals_obj) {
        ?>
				<li>
					<div class="posts_deal">	
						<div class="product_image"><a href="#" onclick="viewtransaction(<?php 
        echo $UID;
        ?>
,<?php 
        echo $total_deals_obj->ID;
        ?>
)">
			<?php 
        if (get_post_meta($total_deals_obj->ID, 'file_name', true) != "") {
            ?>
							<img src="<?php 
            echo templ_thumbimage_filter(get_post_meta($total_deals_obj->ID, 'file_name', true), 145, 160);
            ?>
" width="145" height="160" alt="deal image" />
			<?php 
        } else {
            ?>
							<img src="<?php 
            echo get_template_directory_uri() . "/images/no-image.png";
            ?>
" width="145" height="160" alt="deal image" />
			<?php 
        }
        ?>
</a>
							<div class="mp_deal_price">
								<div class="mp_current_price"><span class="mp_redline"></span><?php 
Ejemplo n.º 7
0
            ?>
				<div class="posts_deal">
			
					<li><div class="product_image">
					<a href="#" onclick="viewtransaction(<?php 
            echo $UID;
            ?>
,<?php 
            echo $total_deals_obj->ID;
            ?>
)">
					<?php 
            if (get_post_meta($total_deals_obj->ID, 'file_name', true) != "") {
                ?>
							<img src="<?php 
                echo templ_thumbimage_filter($destination_path . get_post_meta($total_deals_obj->ID, 'file_name', true), 165, 180);
                ?>
" width="165" height="180" alt="" />
						<?php 
            } else {
                if (is_super_admin($UID)) {
                    echo display_deal_image($total_deals_obj->ID, 'thumbnail');
                } else {
                    ?>
							<img src="<?php 
                    echo get_template_directory_uri() . "/images/no-image.png";
                    ?>
" width="165" height="180" alt="" />
						<?php 
                }
                ?>
Ejemplo n.º 8
0
function get_order_detailinfo_tableformat($orderId, $isshow_paydetail = 0)
{
    global $Cart, $General, $wpdb, $transection_db_table_name;
    $ordersql = "select * from {$transection_db_table_name} where trans_id=\"{$orderId}\"";
    $orderinfo = $wpdb->get_results($ordersql);
    $orderinfo = $orderinfo[0];
    if ($isshow_paydetail) {
        //$message = '<link rel="stylesheet" type="text/css" href="'.get_stylesheet_directory_uri().'/style.css" media="screen" />';
        $message .= '<style>.address_info {width:400px;}</style>';
    }
    $billing_address = $orderinfo->billing_add;
    $billing_address = str_replace(',', ',<br />', $billing_address);
    $shipping_address = $orderinfo->shipping_add;
    $shipping_address = str_replace(',', ',<br />', $shipping_address);
    $message .= '
				<table width="100%" align="center" cellpadding="0" cellspacing="0" border="0" style="border:0px;">
					<tr>
						<td colspan="2" align="left">		
							<div class="order_info">
								<p> <span class="span"> ' . __('Order Number') . ' </span> : <strong>' . $orderinfo->trans_id . '  </strong>  <br />
									<span class="span"> ' . __('Order Date') . ' </span> : ' . date(get_option('date_format') . ' ' . get_option('time_format'), strtotime($orderinfo->ord_date)) . ' </p>
									<p><span class="span">' . __('Order Status') . '</span>  : <strong>' . fetch_order_status($orderinfo->trans_id) . '</strong> </p>
							</div> <!--order_info -->
						</td>
					</tr>
					<tr>
						<td align="left" valign="top" colspan="2">
							<div class="checkout_address" >
								<div class="address_info address_info2  fl">
									<h3>' . __('User Information') . '</h3>
									<div class="address_row"> <b>' . $orderinfo->billing_name . ' </b></div>
									<div class="address_row">' . $billing_address . ' </div>
								</div>
							</div>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top" colspan="2">
							<div class="checkout_address" >
								<div class="address_info address_info2 fr">
									<h3> ' . __('Shipping Address') . '  </h3>
									<div class="address_row"> <b>' . $orderinfo->shipping_name . '</b></div>
									<div class="address_row">' . $shipping_address . '  </div>
								</div>
							</div><!-- checkout Address -->
						</td>
					</tr>			 
					<tr>
						<td align="left" valign="top" colspan="2">
							<div class="checkout_address" >
								<div class="address_info address_info2 fr">
									<h3> ' . __('Payment Information') . '  </h3>									
									<div class="address_row">' . get_payment_method($orderinfo->payment_method) . '  </div>
								</div>
							</div><!-- checkout Address -->
						 </td>
					</tr>
					<tr>
						 <td align="left" valign="top" colspan="2">
							<div class="address_info address_info2 fr">
								<h3> ' . __('Shipping Information') . '  </h3>									
								<div class="address_row">' . $orderinfo->shipping_method . '  </div>
							</div><!-- checkout Address -->
						 </td>	
					</tr>
				</table><br /><br />
			 
					 
					  
					  <h3>  ' . __('Products Information') . ' </h3>
					 
					  <table width="100%" class="table " >
 					  <tr>
					  <td width="5%" align="left" class="title" ><strong> ' . __('Image') . '</strong></td>
					  <td width="45%" align="left" class="title" ><strong> ' . __('Product Name') . '</strong></td>
					  <td width="23%" align="left" class="title" ><strong> ' . __('Qty') . '</strong></td>
					  <td width="23%" align="left" class="title" ><strong> ' . __('Prsdfice') . '</strong></td>
					  </tr>';
    $prdsql = "select * from {$wpdb->posts} where ID=\"{$orderinfo->post_id}\"";
    $prdsqlinfo = $wpdb->get_results($prdsql);
    if ($prdsqlinfo) {
        foreach ($prdsqlinfo as $prdinfoObj) {
            $data = get_post_meta($prdinfoObj->pid, 'key', true);
            $product_name = $wpdb->get_var("select post_title from {$wpdb->posts} where ID=\"" . $orderinfo->post_id . "\"");
            global $Product;
            $post->ID = $orderinfo->post_id;
            //$product_image_arr = $Product->get_product_image($post);
            //$product_image = $product_image_arr[0];
            get_post_meta($post->ID, 'file_name', true);
            $message .= '<tr>';
            if (get_post_meta($post->ID, 'file_name', true) != "") {
                $message .= '<td class="row1"><a href="' . get_permalink($orderinfo->post_id) . '"><img src="' . templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 75, 75) . '" width=60 height=60 /></a></td>';
            } else {
                $message .= '<td class="row1"><img src="' . get_template_directory_uri() . '/images/no-image.png" width=60 height=60 /></td>';
            }
            $message .= '  <td class="row1" ><strong><a href="' . get_permalink($orderinfo->post_id) . '">' . $product_name . '</a>';
            if ($prdinfoObj->pdesc) {
                $message .= '(' . $prdinfoObj->pdesc . ')';
            }
            if ($data['model']) {
                $message .= '<br>' . __('code : ') . $data['model'];
            }
            $totalprc = $orderinfo->payable_amt;
            $message .= '</strong></td>
									  <td class="row1 " align="left" >1</td>
									  <td class="row1 tprice"  align="left">' . $totalprc . '</td>
									  </tr>';
        }
    }
    if ($orderinfo->discount_amt > 0) {
        $message .= '<tr>
					  <td colspan="4" align="right" class="row1" ><strong> ' . __('Discount Amount') . ' :</strong> </td>
					  <td class="row1 tprice">- ' . $this->get_amount_format($orderinfo->discount_amt) . '</td>
					  </tr>';
    }
    if ($orderinfo->shipping_amt > 0) {
        $message .= '<tr>
					  <td colspan="4" align="right" class="row1" ><strong>' . $orderinfo->shipping_method . '  ' . __('Amount') . ' :</strong> </td>
					  <td class="row1 tprice">+ ' . $this->get_amount_format($orderinfo->shipping_amt) . '</td>
					  </tr>';
    }
    if ($orderinfo->tax_amount > 0) {
        $message .= '<tr>
					  <td colspan="4" align="right" class="row1" ><strong> ' . $orderinfo->tax_desc . ' : </strong></td>
					  <td class="row1 tprice">+ ' . $this->get_amount_format($orderinfo->tax_amount) . '</td>
					  </tr>';
    }
    $message .= '<tr>
					  <td colspan="3" align="right" class="row2" ><strong> ' . __('Total Payable Amount') . ' :</strong>  </td>
					  <td class="total_price" ><strong>' . $orderinfo->payable_amt . " " . get_option('currency_sym') . '</strong></td>
					  </tr>';
    if ($orderinfo->ord_desc_client) {
        $message .= '<tr><td colspan="4" height="10"  align="left" ></td></tr><tr>
					  <td colspan="1"  align="left" ><strong> ' . __('Order&nbsp;Comments') . '&nbsp;:</strong>  </td>
					  <td colspan="3" align="left" >' . nl2br(stripslashes($orderinfo->ord_desc_client)) . '</td>
					  </tr><tr><td colspan="4" height="10"  align="left" ></td></tr>';
    }
    if ($isshow_paydetail) {
        if ($payment_info['paydeltype'] == 'prebanktransfer') {
            $order_id = $order_info['order_id'];
            $order_amt = $order_info['payable_amt'];
            $paymentupdsql = "select option_value from {$wpdb->options} where option_name='payment_method_" . $payment_info['paydeltype'] . "'";
            $paymentupdinfo = $wpdb->get_results($paymentupdsql);
            $paymentInfo = unserialize($paymentupdinfo[0]->option_value);
            $payOpts = $paymentInfo['payOpts'];
            $bankInfo = $payOpts[0]['value'];
            $accountinfo = $payOpts[1]['value'];
            $message .= ' 
						   <p> ' . __('Please transfer amount of') . ' <u>' . $order_payable_amt . '</u>  ' . __('to out bank with following information') . ':</p>
						 <p>  ' . __('payment for Order Number') . ' : ' . $order_id . ' &nbsp;&nbsp;(' . date(get_option('date_format') . ' ' . get_option('time_format'), strtotime($order_info['order_date'])) . ')</p>
						 <p> ' . __('Bank Name') . ' : ' . $bankInfo . '</p>
						 <p> ' . __('Account Number') . ' : ' . $accountinfo . '</p>
						 
						   ';
        }
    }
    $message .= '</table>
					  ';
    return $message;
}
Ejemplo n.º 9
0
                                                            $str .= '<span id="' . $key . '_error"></span>';
                                                        }
                                                    } else {
                                                        if ($val['type'] == 'checkbox') {
                                                            if ($fval) {
                                                                $seled = 'checked="checked"';
                                                            }
                                                            $str = '<input name="' . $key . '" type="checkbox" ' . $val['extra'] . ' value="1" ' . $seled . '>';
                                                            if ($val['is_require']) {
                                                                $str .= '<span id="' . $key . '_error"></span>';
                                                            }
                                                        } else {
                                                            if ($val['type'] == 'upload') {
                                                                $str = '<input name="' . $key . '" type="file" ' . $val['extra'] . ' ' . $uclass . ' value="' . $fval . '" > ';
                                                                if ($fval != '') {
                                                                    $str .= '<img src="' . templ_thumbimage_filter($fval, '&amp;w=121&amp;h=115&amp;zc=1&amp;q=80') . '" alt="" />
				<br />
				<input type="hidden" name="prev_upload" value="' . $fval . '" />
				';
                                                                }
                                                                if ($val['is_require']) {
                                                                    $str .= '<span id="' . $key . '_error"></span>';
                                                                }
                                                            } else {
                                                                if ($val['type'] == 'radio') {
                                                                    $options = $val['options'];
                                                                    if ($options) {
                                                                        $option_values_arr = explode(',', $options);
                                                                        for ($i = 0; $i < count($option_values_arr); $i++) {
                                                                            $seled = '';
                                                                            if ($fval == $option_values_arr[$i]) {
Ejemplo n.º 10
0
function display_deal_grid_image($deal_id, $width = '', $height = '')
{
    $args = array('post_type' => 'attachment', 'numberposts' => 1, 'post_status' => 'inherit', 'post_parent' => $deal_id, 'orderby' => 'DESC', 'post_mime_type' => 'image/%');
    $attachments = get_posts($args);
    if ($attachments) {
        foreach ($attachments as $attachment) {
            ?>
			<img src="<?php 
            echo templ_thumbimage_filter($attachment->guid, $width, $height);
            ?>
" width="<?php 
            echo $width;
            ?>
" height="<?php 
            echo $height;
            ?>
"  alt="" />
			<?php 
        }
    } else {
        ?>
		<div class="noimg"> <?php 
        echo IMAGE_NOT_AVAILABLE;
        ?>
</div>
		<?php 
    }
}
Ejemplo n.º 11
0
    }
    ?>
							
								<input type="hidden" value="<?php 
    echo $_SESSION['deal_image'];
    ?>
" name="dealsession_image"/>
							<?php 
} else {
    if (get_post_meta($edit_deal->ID, 'file_name', true) != '') {
        if (is_super_admin($edit_deal->post_author)) {
            echo display_deal_image($edit_deal->ID, 'thumbnail');
        } else {
            ?>
							<img src="<?php 
            echo templ_thumbimage_filter($destination_path . get_post_meta($edit_deal->ID, 'file_name', true), 168, 180);
            ?>
" width="168" height="180" alt="<?php 
            $edit_deal->post_title;
            ?>
" />
							<?php 
        }
    } else {
        ?>
								<img src="<?php 
        echo get_template_directory_uri() . "/images/no-image2.png";
        ?>
" width="168" height="180" alt="No Image Available" />
								<?php 
    }
Ejemplo n.º 12
0
                                                            $str .= '<span id="' . $key . '_error"></span>';
                                                        }
                                                    } else {
                                                        if ($val['type'] == 'checkbox') {
                                                            if ($fval) {
                                                                $seled = 'checked="checked"';
                                                            }
                                                            $str = '<input name="' . $key . '" type="checkbox" ' . $val['extra'] . ' value="1" ' . $seled . '>';
                                                            if ($val['is_require']) {
                                                                $str .= '<span id="' . $key . '_error"></span>';
                                                            }
                                                        } else {
                                                            if ($val['type'] == 'upload') {
                                                                $str = '<input name="' . $key . '" type="file" ' . $val['extra'] . ' ' . $uclass . ' value="' . $fval . '" > ';
                                                                if ($fval != '') {
                                                                    $str .= '<img src="' . templ_thumbimage_filter($fval, 121, 115) . '" alt="" />
				<br />
				<input type="hidden" name="prev_upload" value="' . $fval . '" />
				';
                                                                }
                                                                if ($val['is_require']) {
                                                                    $str .= '<span id="' . $key . '_error"></span>';
                                                                }
                                                            } else {
                                                                if ($val['type'] == 'radio') {
                                                                    $options = $val['options'];
                                                                    if ($options) {
                                                                        $option_values_arr = explode(',', $options);
                                                                        for ($i = 0; $i < count($option_values_arr); $i++) {
                                                                            $seled = '';
                                                                            if ($fval == $option_values_arr[$i]) {
function mp_insert_image_src_rel_in_head()
{
    global $post;
    if (!is_singular()) {
        return;
    }
    if (get_post_meta($post->ID, 'file_name', true) == "") {
        $default_image = get_template_directory_uri() . "/images/de-beste-deals.png";
        echo '<meta property="og:image" content="' . $default_image . '"/>';
    } else {
        $thumbnail_src = templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 165, 180);
        echo '<meta property="og:image" content="' . esc_attr($thumbnail_src) . '"/>';
    }
}
Ejemplo n.º 14
0
                                                            $str .= '<span id="' . $key . '_error"></span>';
                                                        }
                                                    } else {
                                                        if ($val['type'] == 'checkbox') {
                                                            if ($fval) {
                                                                $seled = 'checked="checked"';
                                                            }
                                                            $str = '<input name="' . $key . '" type="checkbox" ' . $val['extra'] . ' value="1" ' . $seled . '>';
                                                            if ($val['is_require']) {
                                                                $str .= '<span id="' . $key . '_error"></span>';
                                                            }
                                                        } else {
                                                            if ($val['type'] == 'upload') {
                                                                $str = '<input name="' . $key . '" type="file" ' . $val['extra'] . ' ' . $uclass . ' value="' . $fval . '" > ';
                                                                if ($fval != '') {
                                                                    $str .= '<img src="' . templ_thumbimage_filter($fval, 121, 115) . '" width="121" height="115" alt="" />
				<br />
				<input type="hidden" name="prev_upload" value="' . $fval . '" />
				';
                                                                }
                                                                if ($val['is_require']) {
                                                                    $str .= '<span id="' . $key . '_error"></span>';
                                                                }
                                                            } else {
                                                                if ($val['type'] == 'radio') {
                                                                    $options = $val['options'];
                                                                    if ($options) {
                                                                        $option_values_arr = explode(',', $options);
                                                                        for ($i = 0; $i < count($option_values_arr); $i++) {
                                                                            $seled = '';
                                                                            if ($fval == $option_values_arr[$i]) {
Ejemplo n.º 15
0
                $tardate1 = date("F d, Y", get_post_meta($post->ID, 'coupon_end_date_time', true));
                $geo_longitude = get_post_meta($post->ID, 'geo_longitude', true);
                $geo_latitude = get_post_meta($post->ID, 'geo_latitude', true);
                $shhiping_address = get_post_meta($post->ID, 'shhiping_address', true);
                $coupon_type = get_post_meta($post->ID, 'coupon_type', true);
                $no_of_coupon = get_post_meta($post->ID, 'no_of_coupon', true);
                ?>
    <div class="content_left"> <a href="<?php 
                the_permalink();
                ?>
">
      <?php 
                if (get_post_meta($post->ID, 'file_name', true) != "") {
                    ?>
      <img src="<?php 
                    echo templ_thumbimage_filter($destination_url . get_post_meta($post->ID, 'file_name', true), 330, 250);
                    ?>
" alt="" />
      <?php 
                } else {
                    if (is_super_admin($post->post_author)) {
                        echo display_deal_image($post->ID, 'medium');
                    } else {
                        ?>
							<img src="<?php 
                        echo get_template_directory_uri() . "/images/no-image.png";
                        ?>
" width="330" height="250" alt="" />
      		 <?php 
                    }
                    ?>
Ejemplo n.º 16
0
        function widget($args, $instance)
        {
            // prints the widget
            extract($args, EXTR_SKIP);
            echo $before_widget;
            $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
            $category = empty($instance['category']) ? '' : apply_filters('widget_category', $instance['category']);
            $category = empty($instance['category']) ? '' : apply_filters('widget_category', $instance['category']);
            $number = empty($instance['number']) ? '5' : apply_filters('widget_number', $instance['number']);
            $post_type = empty($instance['post_type']) ? 'post' : apply_filters('widget_post_type', $instance['post_type']);
            ?>
			
		 <?php 
            if ($title) {
                ?>
 <h3 class="i_publication"><?php 
                echo $title;
                ?>
 </h3> <?php 
            }
            ?>
					<ul class="latest_posts"> 
			 <?php 
            global $post;
            if ($category) {
                $arg = "&category={$category}";
            }
            $arg = "&post_type={$post_type}";
            $today_special = get_posts('numberposts=' . $number . $arg);
            foreach ($today_special as $post) {
                setup_postdata($post);
                ?>
			<?php 
                $post_images = bdw_get_images($post->ID);
                ?>
	
			<li>
         
        
         <?php 
                if (get_the_post_thumbnail($post->ID)) {
                    ?>
             <a  class="post_img"  href="<?php 
                    the_permalink();
                    ?>
">
             <?php 
                    echo get_the_post_thumbnail($post->ID, array(50, 50), array('class' => ""));
                    ?>
             </a>
            <?php 
                } elseif ($post_images = bdw_get_images($post->ID)) {
                    ?>
             <a  class="post_img" href="<?php 
                    the_permalink();
                    ?>
">
             <img  src="<?php 
                    echo templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 50, 50, 1);
                    ?>
" alt="<?php 
                    the_title();
                    ?>
" title="<?php 
                    the_title();
                    ?>
" width="50" height="50"  /> </a>
            <?php 
                }
                ?>
					
            <h4> <a class="widget-title" href="<?php 
                the_permalink();
                ?>
">
                  <?php 
                the_title();
                ?>
                  </a> <br />  <span class="post_author">by <?php 
                the_author_posts_link();
                ?>
 at <?php 
                echo $post->post_date;
                ?>
  / <?php 
                comments_popup_link(__('No Comments', 'templatic'), __('1 Comment', 'templatic'), __('% Comments', 'templatic'), '', __('Comments Closed', 'templatic'));
                ?>
 </span></h4> 
                  
                  <p> <?php 
                echo bm_better_excerpt(175, '');
                ?>
 <a href="<?php 
                the_permalink();
                ?>
"> <?php 
                _e('more...', 'templatic');
                ?>
 </a></p> 
        </li>
	<?php 
            }
            ?>
				</ul>
		
	<?php 
            echo $after_widget;
        }
Ejemplo n.º 17
0
    $transactiondeal = $wpdb->get_row("select * from {$deal_db_table_name} where deal_id = '" . $_REQUEST['transid'] . "'");
    if ($current_user->data->ID == $deals_res->post_author) {
        echo $dashboard_display;
    } else {
        echo $dashboard_display1;
    }
    ?>
	
		<ul class="deal_listing">	
			<li>
				<div class="posts_deal">							
					<div class="product_image"><a href="#"><?php 
    if (get_post_meta($deals_res->ID, 'file_name', true) != "") {
        ?>
						<img src="<?php 
        echo templ_thumbimage_filter(get_post_meta($deals_res->ID, 'file_name', true), 165, 180);
        ?>
" alt=""/>
			  <?php 
    } else {
        ?>
						<img src="<?php 
        echo get_template_directory_uri() . "/images/no-image.png";
        ?>
" width="165" height="180" alt="" />
			  <?php 
    }
    ?>
</a>
					</div>
					<div class="content">
Ejemplo n.º 18
0
function extra_user_profile_fields($user)
{
    $user_id = $user->ID;
    $user_facebook = get_user_meta($user_id, 'user_facebook', true);
    $user_twitter = get_user_meta($user_id, 'user_twitter', true);
    ?>
<h3><?php 
    echo OTHER_INFO_TEXT;
    ?>
</h3>
 
<table class="form-table">
<tr>
<th><label for="user_facebook"><?php 
    _e("Facebook Link ", 'templatic');
    ?>
</label></th>
<td>
<input type="text" name="user_facebook" id="user_facebook" value="<?php 
    echo esc_attr($user_facebook);
    ?>
" class="textfield" /><br />
</td>
</tr>

<tr>
<th><label for="user_twitter"><?php 
    _e("Twitter Link");
    ?>
</label></th>
<td>
<input type="text" name="user_twitter" id="user_twitter" value="<?php 
    echo esc_attr($user_twitter);
    ?>
" class="textfield" /><br />
</td>
</tr>

<?php 
    global $form_fields_usermeta;
    $validation_info = array();
    $custom_metaboxes = templ_get_usermeta('profile');
    foreach ($form_fields_usermeta as $key => $val) {
        if ($val['on_profile']) {
            $str = '';
            $fval = '';
            $field_val = $key . '_val';
            if (${$field_val}) {
                $fval = ${$field_val};
            } else {
                $fval = $val['default'];
            }
            if ($val['is_require']) {
                $validation_info[] = array('name' => $key, 'espan' => $key . '_error', 'type' => $val['type'], 'text' => $val['label']);
            }
            if ($key) {
                $fval = get_user_meta($user_id, $key, true);
            }
            if ($val['type'] == 'text') {
                $str = '<input name="' . $key . '" type="text" ' . $val['extra'] . ' value="' . $fval . '">';
                if ($val['is_require']) {
                    $str .= '<span id="' . $key . '_error"></span>';
                }
            } elseif ($val['type'] == 'hidden') {
                $str = '<input name="' . $key . '" type="hidden" ' . $val['extra'] . ' value="' . $fval . '">';
                if ($val['is_require']) {
                    $str .= '<span id="' . $key . '_error"></span>';
                }
            } else {
                if ($val['type'] == 'textarea') {
                    $str = '<textarea name="' . $key . '" ' . $val['extra'] . '>' . $fval . '</textarea>';
                    if ($val['is_require']) {
                        $str .= '<span id="' . $key . '_error"></span>';
                    }
                } else {
                    if ($val['type'] == 'texteditor') {
                        $str = $val['tag_before'] . '<textarea name="' . $key . '" ' . $val['extra'] . '>' . $fval . '</textarea>' . $val['tag_after'];
                        if ($val['is_require']) {
                            $str .= '<span id="' . $key . '_error"></span>';
                        }
                    } else {
                        if ($val['type'] == 'file') {
                            $str = '<input name="' . $key . '" type="file" ' . $val['extra'] . ' value="' . $fval . '">';
                            if ($val['is_require']) {
                                $str .= '<span id="' . $key . '_error"></span>';
                            }
                        } else {
                            if ($val['type'] == 'include') {
                                $str = @(include_once $val['default']);
                            } else {
                                if ($val['type'] == 'head') {
                                    $str = '';
                                } else {
                                    if ($val['type'] == 'date') {
                                        $str = '<input name="' . $key . '" type="text" ' . $val['extra'] . ' value="' . get_user_meta($user_id, $key, true) . '">';
                                        $str .= '<img src="' . get_template_directory_uri() . '/images/cal.gif" alt="Calendar"  onclick="displayCalendar(document.userform.' . $key . ',\'yyyy-mm-dd\',this)" style="cursor: pointer;" align="absmiddle" border="0" class="calendar_img" />';
                                        if ($val['is_require']) {
                                            $str .= '<span id="' . $key . '_error"></span>';
                                        }
                                    } else {
                                        if ($val['type'] == 'catselect') {
                                            $term = get_term((int) $fval, CUSTOM_CATEGORY_TYPE1);
                                            $str = '<select name="' . $key . '" ' . $val['extra'] . '>';
                                            $args = array('taxonomy' => CUSTOM_CATEGORY_TYPE1);
                                            $all_categories = get_categories($args);
                                            foreach ($all_categories as $key => $cat) {
                                                $seled = '';
                                                if ($term->name == $cat->name) {
                                                    $seled = 'selected="selected"';
                                                }
                                                $str .= '<option value="' . $cat->name . '" ' . $seled . '>' . $cat->name . '</option>';
                                            }
                                            $str .= '</select>';
                                            if ($val['is_require']) {
                                                $str .= '<span id="' . $key . '_error"></span>';
                                            }
                                        } else {
                                            if ($val['type'] == 'catdropdown') {
                                                $cat_args = array('name' => 'post_category', 'id' => 'post_category_0', 'selected' => $fval, 'class' => 'textfield', 'orderby' => 'name', 'echo' => '0', 'hierarchical' => 1, 'taxonomy' => CUSTOM_CATEGORY_TYPE1);
                                                $cat_args['show_option_none'] = __('Select Category', 'templatic');
                                                $str .= wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args));
                                                if ($val['is_require']) {
                                                    $str .= '<span id="' . $key . '_error"></span>';
                                                }
                                            } else {
                                                if ($val['type'] == 'select') {
                                                    $str = '<select name="' . $key . '" ' . $val['extra'] . '>';
                                                    $option_values_arr = explode(',', $val['options']);
                                                    for ($i = 0; $i < count($option_values_arr); $i++) {
                                                        $seled = '';
                                                        if ($fval == $option_values_arr[$i]) {
                                                            $seled = 'selected="selected"';
                                                        }
                                                        $str .= '<option value="' . $option_values_arr[$i] . '" ' . $seled . '>' . $option_values_arr[$i] . '</option>';
                                                    }
                                                    $str .= '</select>';
                                                    if ($val['is_require']) {
                                                        $str .= '<span id="' . $key . '_error"></span>';
                                                    }
                                                } else {
                                                    if ($val['type'] == 'catcheckbox') {
                                                        $fval_arr = explode(',', $fval);
                                                        $str .= $val['tag_before'] . get_categories_checkboxes_form(CUSTOM_CATEGORY_TYPE1, $fval_arr) . $oval . $val['tag_after'];
                                                        if ($val['is_require']) {
                                                            $str .= '<span id="' . $key . '_error"></span>';
                                                        }
                                                    } else {
                                                        if ($val['type'] == 'catradio') {
                                                            $args = array('taxonomy' => CUSTOM_CATEGORY_TYPE1);
                                                            $all_categories = get_categories($args);
                                                            foreach ($all_categories as $key1 => $cat) {
                                                                $seled = '';
                                                                if ($fval == $cat->term_id) {
                                                                    $seled = 'checked="checked"';
                                                                }
                                                                $str .= $val['tag_before'] . '<input name="' . $key . '" type="radio" ' . $val['extra'] . ' value="' . $cat->name . '" ' . $seled . '> ' . $cat->name . $val['tag_after'];
                                                            }
                                                            if ($val['is_require']) {
                                                                $str .= '<span id="' . $key . '_error"></span>';
                                                            }
                                                        } else {
                                                            if ($val['type'] == 'checkbox') {
                                                                if ($fval) {
                                                                    $seled = 'checked="checked"';
                                                                }
                                                                $str = '<input name="' . $key . '" type="checkbox" ' . $val['extra'] . ' value="1" ' . $seled . '>';
                                                                if ($val['is_require']) {
                                                                    $str .= '<span id="' . $key . '_error"></span>';
                                                                }
                                                            } else {
                                                                if ($val['type'] == 'upload') {
                                                                    $str = '<input name="' . $key . '" type="file" ' . $val['extra'] . ' ' . $uclass . ' value="' . $fval . '" > ';
                                                                    if ($fval != '') {
                                                                        $str .= '<img src="' . templ_thumbimage_filter($fval, '&amp;w=121&amp;h=115&amp;zc=1&amp;q=80') . '" alt="" />
				<br />
				<input type="hidden" name="prev_upload" value="' . $fval . '" />
				';
                                                                    }
                                                                    if ($val['is_require']) {
                                                                        $str .= '<span id="' . $key . '_error"></span>';
                                                                    }
                                                                } else {
                                                                    if ($val['type'] == 'radio') {
                                                                        $options = $val['options'];
                                                                        if ($options) {
                                                                            $option_values_arr = explode(',', $options);
                                                                            for ($i = 0; $i < count($option_values_arr); $i++) {
                                                                                $seled = '';
                                                                                if ($fval == $option_values_arr[$i]) {
                                                                                    $seled = 'checked="checked"';
                                                                                }
                                                                                $str .= $val['tag_before'] . '<input name="' . $key . '" type="radio" ' . $val['extra'] . ' value="' . $option_values_arr[$i] . '" ' . $seled . '> ' . $option_values_arr[$i] . $val['tag_after'];
                                                                            }
                                                                            if ($val['is_require']) {
                                                                                $str .= '<span id="' . $key . '_error"></span>';
                                                                            }
                                                                        }
                                                                    } else {
                                                                        if ($val['type'] == 'multicheckbox') {
                                                                            $options = $val['options'];
                                                                            if ($options) {
                                                                                $chkcounter = 0;
                                                                                $option_values_arr = explode(',', $options);
                                                                                for ($i = 0; $i < count($option_values_arr); $i++) {
                                                                                    $chkcounter++;
                                                                                    $seled = '';
                                                                                    if (in_array($option_values_arr[$i], $fval)) {
                                                                                        $seled = 'checked="checked"';
                                                                                    }
                                                                                    $str .= $val['tag_before'] . '<input name="' . $key . '[]"  id="' . $key . '_' . $chkcounter . '" type="checkbox" ' . $val['extra'] . ' value="' . $option_values_arr[$i] . '" ' . $seled . '> ' . $option_values_arr[$i] . $val['tag_after'];
                                                                                }
                                                                                if ($val['is_require']) {
                                                                                    $str .= '<span id="' . $key . '_error"></span>';
                                                                                }
                                                                            }
                                                                        } else {
                                                                            if ($val['type'] == 'packageradio') {
                                                                                $options = $val['options'];
                                                                                foreach ($options as $okey => $oval) {
                                                                                    $seled = '';
                                                                                    if ($fval == $okey) {
                                                                                        $seled = 'checked="checked"';
                                                                                    }
                                                                                    $str .= $val['tag_before'] . '<input name="' . $key . '" type="radio" ' . $val['extra'] . ' value="' . $okey . '" ' . $seled . '> ' . $oval . $val['tag_after'];
                                                                                }
                                                                                if ($val['is_require']) {
                                                                                    $str .= '<span id="' . $key . '_error"></span>';
                                                                                }
                                                                            } else {
                                                                                if ($val['type'] == 'geo_map') {
                                                                                    do_action('templ_submit_form_googlemap');
                                                                                } else {
                                                                                    if ($val['type'] == 'image_uploader') {
                                                                                        do_action('templ_submit_form_image_uploader');
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if ($val['is_require']) {
                $label = '<label>' . $val['label'] . ' <span>*</span> </label>';
            } else {
                $label = '<label>' . $val['label'] . '</label>';
            }
            $outer_st = "<tr><th>";
            $tag_st = "</th><td>";
            $tag_end = "</td>";
            $outer_end = "</tr>";
            echo $outer_st . $label . $tag_st . $str . $tag_end . $outer_end;
        }
    }
    ?>
</table>
<?php 
}