Esempio n. 1
0
    function PricerrTheme_get_post_fnc()
    {
        if ($arr[0] == "winner") {
            $pay_this_me = 1;
        }
        if ($arr[0] == "unpaid") {
            $unpaid = 1;
        }
        $ending = get_post_meta(get_the_ID(), 'ending', true);
        $sec = $ending - time();
        $closed = get_post_meta(get_the_ID(), 'closed', true);
        $post = get_post(get_the_ID());
        $featured = get_post_meta(get_the_ID(), 'featured', true);
        $img_class = "image_class_pst";
        global $current_user;
        $post = get_post(get_the_ID());
        get_currentuserinfo();
        $uid = $current_user->ID;
        $prc = pricerrtheme_get_show_price2(get_post_meta(get_the_ID(), 'price', true), 2);
        ?>
				<div class="post" id="post-<?php 
        the_ID();
        ?>
">
                
                <?php 
        if ($featured == "1") {
            ?>
                <div class="featured"></div>
                <?php 
        }
        ?>
                
                <div class="padd10_1">
                <div class="image_holder">
                <a href="<?php 
        the_permalink();
        ?>
"><img width="102" height="72" class="<?php 
        echo $img_class;
        ?>
" 
                src="<?php 
        echo PricerrTheme_get_first_post_image(get_the_ID(), 102, 72);
        ?>
" /></a>
                
               
                </div>
                <div  class="title_holder" > <div class="ttl_holder_down">
                     <h2><?php 
        $days_needed = get_post_meta(get_the_ID(), 'max_days', true);
        $instant = get_post_meta(get_the_ID(), 'instant', true);
        if ($instant == 1) {
            echo '<span class="instant_job_spn">' . __('Instant Delivery', 'PricerrTheme') . '</span>';
        } else {
            if ($days_needed == 1) {
                echo '<span class="express_job_spn">' . __('Express', 'PricerrTheme') . '</span>';
            }
        }
        ?>
                        
                        <a class="title_of_job" href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="Permanent Link to <?php 
        the_title();
        ?>
">
                        <?php 
        echo ucfirst(strtolower($post->post_title));
        ?>
</a> </h2></div>
                        
                        
    
                        
                        <p class="mypostedon">
						<?php 
        $usr = get_userdata($post->post_author);
        $flag = strtoupper(PricerrTheme_get_user_country($post->post_author)) . " " . PricerrTheme_get_user_flag($post->post_author);
        //----------------------------
        $reg = $usr->user_registered;
        $joined = PricerrTheme_prepare_seconds_to_words(time() - strtotime($reg));
        //----------------------------
        $max_days = get_post_meta(get_the_ID(), "max_days", true);
        $instant = get_post_meta(get_the_ID(), 'instant', true);
        if ($instant == "1") {
            $del = __("Instant", "PricerrTheme");
        } else {
            if ($max_days == 1) {
                $del = __("24Hrs", "PricerrTheme");
            } else {
                $del = sprintf(__("%s days", "PricerrTheme"), $max_days);
            }
        }
        ?>
 
                    
                    <?php 
        echo sprintf(__("by <a href='%s' class='title_of_job2'>%s</a>", 'PricerrTheme'), PricerrTheme_get_user_profile_link($usr->user_login), $usr->user_login);
        ?>
 &nbsp; &nbsp;    
					<?php 
        echo sprintf(__('<span class="spn_txt_diff">From</span>: %s', 'PricerrTheme'), $flag);
        ?>
 &nbsp; &nbsp; 	
                    <?php 
        echo sprintf(__('<span class="spn_txt_diff">Joined</span>: %s', 'PricerrTheme'), $joined);
        ?>
 &nbsp; &nbsp; 	 
					<?php 
        //echo sprintf(__('<span class="spn_txt_diff">Delivery</span>: %s','PricerrTheme'), $del);
        ?>
                       
               </p>
                       
                  
                  
                  
                        
                        
               
                      
                       </div> 
                       
                       <div class="order_now_new_btn">
                       <a href="<?php 
        echo get_permalink($pid);
        ?>
" class="order_now_new"><?php 
        echo sprintf(__('Reserve', 'PricerrTheme'), $prc);
        ?>
</a>
                       </div>
                       
                       
                     </div> </div> 
                     
                   
<?php 
    }
Esempio n. 2
0
function PricerrTheme_my_account_priv_mess_area_function()
{
    global $current_user;
    get_currentuserinfo();
    $uid = $current_user->ID;
    $myuid = $current_user->ID;
    //-------------------------------------
    global $wpdb, $wp_rewrite, $wp_query;
    $third_page = $_GET['priv_act'];
    if (empty($third_page)) {
        $third_page = 'home';
    }
    $using_perm = PricerrTheme_using_permalinks();
    if ($using_perm) {
        $privurl_m = get_permalink(get_option('PricerrTheme_my_account_priv_mess_page_id')) . "/?";
    } else {
        $privurl_m = get_bloginfo('siteurl') . "/?page_id=" . get_option('PricerrTheme_my_account_priv_mess_page_id') . "&";
    }
    ?>
		<div id="content">
        <div class="my_box3">
            	<div class="padd10">
        <div class="box_title3"><?php 
    _e("Private Messages", 'PricerrTheme');
    ?>
</div>       
        
       
            	<div class="padd10">
                <a href="<?php 
    echo $privurl_m;
    ?>
" class="green_btn"><?php 
    _e("Messaging Home", "PricerrTheme");
    ?>
</a>
                <a href="<?php 
    echo $privurl_m;
    ?>
priv_act=send" class="green_btn"><?php 
    _e("Send New Message", "PricerrTheme");
    ?>
</a>
                <a href="<?php 
    echo $privurl_m;
    ?>
priv_act=inbox" class="green_btn"><?php 
    _e("Inbox", "PricerrTheme");
    global $current_user;
    get_currentuserinfo();
    $rd = PricerrTheme_get_unread_number_messages($current_user->ID);
    if ($rd > 0) {
        echo ' (' . $rd . ')';
    }
    ?>
</a>
                <a href="<?php 
    echo $privurl_m;
    ?>
priv_act=sent-items" class="green_btn"><?php 
    _e("Sent Items", "PricerrTheme");
    ?>
</a>
                
                </div> </div> </div>
        
        <div class="clear10"></div>
        
        <?php 
    if ($third_page == 'home') {
        ?>
        
        
		<!-- page content here -->	
			
   			<div class="my_box3">
            	<div class="padd10">
            
            	<div class="box_title"><?php 
        _e("Latest Received Messages", "PricerrTheme");
        ?>
</div>
                <div class="box_content">  
                <?php 
        global $wpdb;
        $s = "select * from " . $wpdb->prefix . "job_pm where user='******' AND show_to_destination='1' order by id desc limit 4";
        $r = $wpdb->get_results($s);
        if (count($r) > 0) {
            echo '<table width="100%">';
            echo '<tr>';
            echo '<td>' . __('From User', 'PricerrTheme') . '</td>';
            echo '<td>' . __('Subject', 'PricerrTheme') . '</td>';
            echo '<td>' . __('Date', 'PricerrTheme') . '</td>';
            echo '<td>' . __('Options', 'PricerrTheme') . '</td>';
            echo '</tr>';
            foreach ($r as $row) {
                if ($row->rd == 0) {
                    $cls = 'bold_stuff';
                } else {
                    $cls = '';
                }
                $user = get_userdata($row->initiator);
                echo '<tr>';
                echo '<td class="' . $cls . '"><a href="' . PricerrTheme_get_user_profile_link($user->user_login) . '">' . $user->user_login . '</a></td>';
                echo '<td class="' . $cls . '">' . $row->subject . '</td>';
                echo '<td class="' . $cls . '">' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>';
                echo '<td><a href="' . $privurl_m . 'priv_act=read-message&id=' . $row->id . '">' . __('Read', 'PricerrTheme') . '</a>  | 
						<a href="' . $privurl_m . 'priv_act=delete-message&id=' . $row->id . '&return=home">' . __('Delete', 'PricerrTheme') . '</a></td>';
                echo '</tr>';
            }
            echo '</table>';
        } else {
            _e('No messages here.', 'PricerrTheme');
        }
        ?>
      
                </div>
 				</div></div>

            
            <!--#######-->
            
            <div class="clear10"></div>
            
 
            <div class="my_box3">
            	<div class="padd10">
            	<div class="box_title"><?php 
        _e("Latest Sent Items", "PricerrTheme");
        ?>
</div>
                <div class="box_content">  
                <?php 
        global $wpdb;
        $s = "select * from " . $wpdb->prefix . "job_pm where initiator='{$myuid}'  AND show_to_source='1' order by id desc limit 4";
        $r = $wpdb->get_results($s);
        if (count($r) > 0) {
            echo '<table width="100%">';
            echo '<tr>';
            echo '<td>' . __('To User', 'PricerrTheme') . '</td>';
            echo '<td>' . __('Subject', 'PricerrTheme') . '</td>';
            echo '<td>' . __('Date', 'PricerrTheme') . '</td>';
            echo '<td>' . __('Options', 'PricerrTheme') . '</td>';
            echo '</tr>';
            foreach ($r as $row) {
                //if($row->rd == 0) $cls = 'bold_stuff';
                //else
                $cls = '';
                $user = get_userdata($row->user);
                echo '<tr>';
                echo '<td class="' . $cls . '"><a href="' . PricerrTheme_get_user_profile_link($user->user_login) . '">' . $user->user_login . '</a></td>';
                echo '<td class="' . $cls . '">' . $row->subject . '</td>';
                echo '<td class="' . $cls . '">' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>';
                echo '<td><a href="' . $privurl_m . 'priv_act=read-message&id=' . $row->id . '">' . __('Read', 'PricerrTheme') . '</a> | 
						<a href="' . $privurl_m . 'priv_act=delete-message&id=' . $row->id . '&return=home">' . __('Delete', 'PricerrTheme') . '</a></td>';
                echo '</tr>';
            }
            echo '</table>';
        } else {
            _e('No messages here.', 'PricerrTheme');
        }
        ?>
      
                </div>   </div>   </div>
         
             
            
            
		<!-- page content here -->	
			
        <?php 
    } elseif ($third_page == 'inbox') {
        ?>
        
        
		<!-- page content here -->	
			
            
            	<div class="my_box3">
            	<div class="padd10">
            
            	<div class="box_title"><?php 
        _e("Inbox", "PricerrTheme");
        ?>
</div>
                <div class="box_content">  
                <?php 
        global $wpdb;
        $nrpostsPage = 12;
        $page = $_GET['pj'];
        if (empty($page)) {
            $page = 1;
        }
        $querystr2 = "select id from " . $wpdb->prefix . "job_pm where user='******' AND show_to_destination='1'";
        $pageposts2 = $wpdb->get_results($querystr2, OBJECT);
        $total_count = count($pageposts2) == 0 ? 1 : count($pageposts2);
        $my_page = $page;
        $pages_curent = $page;
        //-----------------------------------------------------------------------
        $totalPages = $total_count > 0 ? ceil($total_count / $nrpostsPage) : 0;
        $pagess = $totalPages;
        $s = "select * from " . $wpdb->prefix . "job_pm where user='******' AND show_to_destination='1' order by id desc LIMIT " . $nrpostsPage * ($page - 1) . "," . $nrpostsPage;
        $r = $wpdb->get_results($s);
        if (count($r) > 0) {
            echo '<table width="100%">';
            echo '<tr>';
            echo '<td>' . __('From User', 'PricerrTheme') . '</td>';
            echo '<td>' . __('Subject', 'PricerrTheme') . '</td>';
            echo '<td>' . __('Date', 'PricerrTheme') . '</td>';
            echo '<td>' . __('Options', 'PricerrTheme') . '</td>';
            echo '</tr>';
            foreach ($r as $row) {
                if ($row->rd == 0) {
                    $cls = 'bold_stuff';
                } else {
                    $cls = '';
                }
                $user = get_userdata($row->initiator);
                echo '<tr>';
                echo '<td class="' . $cls . '"><a href="' . PricerrTheme_get_user_profile_link($user->user_login) . '">' . $user->user_login . '</a></td>';
                echo '<td class="' . $cls . '">' . $row->subject . '</td>';
                echo '<td class="' . $cls . '">' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>';
                echo '<td><a href="' . $privurl_m . 'priv_act=read-message&id=' . $row->id . '">' . __('Read', 'PricerrTheme') . '</a>  | 
						<a href="' . $privurl_m . 'priv_act=delete-message&id=' . $row->id . '&return=inbox">' . __('Delete', 'PricerrTheme') . '</td>';
                echo '</tr>';
            }
            echo '</table>';
            ?>
                    
                    
					 <div class="nav">
                     <?php 
            $batch = 10;
            //ceil($page / $nrpostsPage );
            $end = $batch * $nrpostsPage;
            if ($end > $pagess) {
                $end = $pagess;
            }
            $start = $end - $nrpostsPage + 1;
            if ($start < 1) {
                $start = 1;
            }
            $links = '';
            $raport = ceil($my_page / $batch) - 1;
            if ($raport < 0) {
                $raport = 0;
            }
            $start = $raport * $batch + 1;
            $end = $start + $batch - 1;
            $end_me = $end + 1;
            $start_me = $start - 1;
            if ($end > $totalPages) {
                $end = $totalPages;
            }
            if ($end_me > $totalPages) {
                $end_me = $totalPages;
            }
            if ($start_me <= 0) {
                $start_me = 1;
            }
            $previous_pg = $page - 1;
            if ($previous_pg <= 0) {
                $previous_pg = 1;
            }
            $next_pg = $pages_curent + 1;
            if ($next_pg > $totalPages) {
                $next_pg = 1;
            }
            //PricerrTheme_get_browse_jobs_link($job_tax, $job_category, 'new', $page)
            if ($my_page > 1) {
                echo '<a href="' . PricerrTheme_get_browse_pm_link($previous_pg) . '"><< ' . __('Previous', 'PricerrTheme') . '</a>';
                echo '<a href="' . PricerrTheme_get_browse_pm_link($start_me) . '"><<</a>';
            }
            //------------------------
            //echo $start." ".$end;
            for ($i = $start; $i <= $end; $i++) {
                if ($i == $pages_curent) {
                    echo '<a class="activee" href="#">' . $i . '</a>';
                } else {
                    echo '<a href="' . PricerrTheme_get_browse_pm_link($i) . '">' . $i . '</a>';
                }
            }
            //----------------------
            if ($totalPages > $my_page) {
                echo '<a href="' . PricerrTheme_get_browse_pm_link($end_me) . '">>></a>';
            }
            if ($page < $totalPages) {
                echo '<a href="' . PricerrTheme_get_browse_pm_link($next_pg) . '">' . __('Next', 'PricerrTheme') . ' >></a>';
            }
            ?>
                     </div> <?php 
        } else {
            _e('No messages here.', 'PricerrTheme');
        }
        ?>
      
                </div>
                </div>
                </div>
            
            
		<!-- page content here -->	
			
        <?php 
    } elseif ($third_page == 'sent-items') {
        ?>
        
        
		<!-- page content here -->	
			
            
            	<div class="my_box3">
            	<div class="padd10">
            
            	<div class="box_title"><?php 
        _e("Sent Items", "PricerrTheme");
        ?>
</div>
                <div class="box_content">  
                <?php 
        global $wpdb;
        $nrpostsPage = 12;
        $page = $_GET['pj'];
        if (empty($page)) {
            $page = 1;
        }
        $querystr2 = "select id from " . $wpdb->prefix . "job_pm where initiator='{$myuid}'  AND show_to_source='1'";
        $pageposts2 = $wpdb->get_results($querystr2, OBJECT);
        $total_count = count($pageposts2) == 0 ? 1 : count($pageposts2);
        $my_page = $page;
        $pages_curent = $page;
        //-----------------------------------------------------------------------
        $totalPages = $total_count > 0 ? ceil($total_count / $nrpostsPage) : 0;
        $pagess = $totalPages;
        $s = "select * from " . $wpdb->prefix . "job_pm where initiator='{$myuid}'  AND show_to_source='1' order by id desc LIMIT " . $nrpostsPage * ($page - 1) . "," . $nrpostsPage;
        $r = $wpdb->get_results($s);
        if (count($r) > 0) {
            echo '<table width="100%">';
            echo '<tr>';
            echo '<td>' . __('To User', 'PricerrTheme') . '</td>';
            echo '<td>' . __('Subject', 'PricerrTheme') . '</td>';
            echo '<td>' . __('Date', 'PricerrTheme') . '</td>';
            echo '<td>' . __('Options', 'PricerrTheme') . '</td>';
            echo '</tr>';
            foreach ($r as $row) {
                //if($row->rd == 0) $cls = 'bold_stuff';
                //else
                $cls = '';
                $user = get_userdata($row->user);
                echo '<tr>';
                echo '<td class="' . $cls . '"><a href="' . PricerrTheme_get_user_profile_link($user->user_login) . '">' . $user->user_login . '</a></td>';
                echo '<td class="' . $cls . '">' . $row->subject . '</td>';
                echo '<td class="' . $cls . '">' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>';
                echo '<td><a href="' . $privurl_m . 'priv_act=read-message&id=' . $row->id . '">' . __('Read', 'PricerrTheme') . '</a> |  
						<a href="' . $privurl_m . 'priv_act=delete-message&id=' . $row->id . '&return=outbox">' . __('Delete', 'PricerrTheme') . '</a></td>';
                echo '</tr>';
            }
            echo '</table>';
            ?>
                    
                    <div class="nav">
                     <?php 
            $batch = 10;
            //ceil($page / $nrpostsPage );
            $end = $batch * $nrpostsPage;
            if ($end > $pagess) {
                $end = $pagess;
            }
            $start = $end - $nrpostsPage + 1;
            if ($start < 1) {
                $start = 1;
            }
            $links = '';
            $raport = ceil($my_page / $batch) - 1;
            if ($raport < 0) {
                $raport = 0;
            }
            $start = $raport * $batch + 1;
            $end = $start + $batch - 1;
            $end_me = $end + 1;
            $start_me = $start - 1;
            if ($end > $totalPages) {
                $end = $totalPages;
            }
            if ($end_me > $totalPages) {
                $end_me = $totalPages;
            }
            if ($start_me <= 0) {
                $start_me = 1;
            }
            $previous_pg = $page - 1;
            if ($previous_pg <= 0) {
                $previous_pg = 1;
            }
            $next_pg = $pages_curent + 1;
            if ($next_pg > $totalPages) {
                $next_pg = 1;
            }
            //PricerrTheme_get_browse_jobs_link($job_tax, $job_category, 'new', $page)
            if ($my_page > 1) {
                echo '<a href="' . PricerrTheme_get_browse_pm_link2($previous_pg) . '"><< ' . __('Previous', 'PricerrTheme') . '</a>';
                echo '<a href="' . PricerrTheme_get_browse_pm_link2($start_me) . '"><<</a>';
            }
            //------------------------
            //echo $start." ".$end;
            for ($i = $start; $i <= $end; $i++) {
                if ($i == $pages_curent) {
                    echo '<a class="activee" href="#">' . $i . '</a>';
                } else {
                    echo '<a href="' . PricerrTheme_get_browse_pm_link2($i) . '">' . $i . '</a>';
                }
            }
            //----------------------
            if ($totalPages > $my_page) {
                echo '<a href="' . PricerrTheme_get_browse_pm_link2($end_me) . '">>></a>';
            }
            if ($page < $totalPages) {
                echo '<a href="' . PricerrTheme_get_browse_pm_link2($next_pg) . '">' . __('Next', 'PricerrTheme') . ' >></a>';
            }
            ?>
                     </div>
                    
                    <?php 
        } else {
            _e('No messages here.', 'PricerrTheme');
        }
        ?>
      
                </div>
                </div>
                </div>
            
            
		<!-- page content here -->	
			
        <?php 
    } elseif ($third_page == 'read-message') {
        $id = $_GET['id'];
        $s = "select * from " . $wpdb->prefix . "job_pm where id='{$id}' AND (user='******' OR initiator='{$myuid}')";
        $r = $wpdb->get_results($s);
        $row = $r[0];
        if ($myuid == $row->initiator) {
            $owner = true;
        } else {
            $owner = false;
        }
        if (!$owner) {
            $wpdb->query("update " . $wpdb->prefix . "job_pm set rd='1' where id='{$row->id}'");
        }
        ?>
        
        
		<!-- page content here -->	
			
            
            	<div class="my_box3">
            	<div class="padd10">
            
            	<div class="box_title"><?php 
        _e("Read Message: ", "PricerrTheme");
        echo " " . $row->subject;
        ?>
</div>
                <div class="box_content">  
                <?php 
        $mess = $row->content;
        $PricerrTheme_filter_urls_private_messages = get_option('PricerrTheme_filter_urls_private_messages');
        if ($PricerrTheme_filter_urls_private_messages == "yes") {
            $mess = PricerrTheme_url_cleaner($row->content);
        }
        //-----------------------
        $PricerrTheme_filter_emails_private_messages = get_option('PricerrTheme_filter_emails_private_messages');
        if ($PricerrTheme_filter_emails_private_messages == "yes") {
            $pattern = "/[^@\\s]*@[^@\\s]*\\.[^@\\s]*/";
            $replacement = "[****]";
            preg_replace($pattern, $replacement, $mess);
        }
        echo $mess;
        ?>
      <br/> <br/>
      
      <?php 
        if ($owner == false) {
            ?>
       <a href="<?php 
            echo $privurl_m;
            ?>
priv_act=send&<?php 
            echo 'pid=' . $row->pid . '&uid=' . $row->initiator;
            ?>
" class="nice_link"><?php 
            _e("Reply");
            ?>
</a> <?php 
        }
        ?>
                </div>
                </div>
                </div>
            
            
		<!-- page content here -->	
			
        <?php 
    } elseif ($third_page == 'delete-message') {
        $id = $_GET['id'];
        $s = "select * from " . $wpdb->prefix . "job_pm where id='{$id}' AND (user='******' OR initiator='{$myuid}')";
        $r = $wpdb->get_results($s);
        $row = $r[0];
        global $current_user;
        get_currentuserinfo();
        $myuid = $current_user->ID;
        if ($myuid == $row->initiator) {
            $owner = true;
        } else {
            $owner = false;
        }
        //if(!$owner)
        //$wpdb->query("update_i18n ".$wpdb->prefix."auction_pm set rd='1' where id='{$row->id}'");
        ?>
        
        
		<!-- page content here -->	
			
            
            	<div class="my_box3">
            	<div class="padd10">
            
            	<div class="box_title"><?php 
        _e("Delete Message: ", "PricerrTheme");
        echo " " . $row->subject;
        ?>
</div>
                <div class="box_content">  
                <?php 
        echo $row->content;
        ?>
      <br/> <br/>
      
      <?php 
        if (1) {
            //$owner == false):
            ?>
       <a href="<?php 
            echo $privurl_m;
            ?>
priv_act=delete-message&<?php 
            echo 'id=' . $row->id . '&return=' . $_GET['return'] . "&confirm_message_deletion=yes";
            ?>
" class="nice_link"><?php 
            _e("Confirm Deletion", 'PricerrTheme');
            ?>
</a> <?php 
        }
        ?>
                </div>
                </div>
                </div>
            
            
		<!-- page content here -->	
			
        <?php 
    } elseif ($third_page == 'send') {
        ?>
        <?php 
        $pid = $_GET['pid'];
        $uid = $_GET['uid'];
        $user = get_userdata($uid);
        if (!empty($pid)) {
            $post = get_post($pid);
            $subject = "RE: " . $post->post_title;
        }
        if (isset($_POST['send'])) {
            $subject = htmlspecialchars($_POST['subject']);
            $message = nl2br(htmlspecialchars($_POST['message']));
            $to = $_POST['to'];
            if (!empty($to)) {
                $uid = PricerrTheme_get_userid_from_username($to);
            }
            //--- parse emails out of the private messages -------
            $PricerrTheme_filter_emails_private_messages = get_option('PricerrTheme_filter_emails_private_messages');
            if ($PricerrTheme_filter_emails_private_messages == "yes") {
                $message = PricerrTheme_parseEmails($message);
            }
            //--- parse links out of the private messages  ---
            $PricerrTheme_filter_urls_private_messages = get_option('PricerrTheme_filter_urls_private_messages');
            if ($PricerrTheme_filter_urls_private_messages == "yes") {
                $message = PricerrTheme_parseHyperlinks($message);
            }
            //----------------------
            if ($uid != false) {
                global $current_user;
                get_currentuserinfo();
                $myuid = $current_user->ID;
                $tm_tm = $_POST['tm_tm'];
                global $wpdb;
                $s = "select * from " . $wpdb->prefix . "job_pm where initiator='{$myuid}' and datemade='{$tm_tm}'";
                $r = $wpdb->get_results($s);
                if (count($r) == 0) {
                    $s = "insert into " . $wpdb->prefix . "job_pm (subject, content, datemade, pid, initiator, user) values('{$subject}','{$message}','{$tm_tm}','{$pid}','{$myuid}','{$uid}')";
                    $wpdb->query($s);
                    //-----------------------
                    PricerrTheme_send_email_when_new_PM($myuid, $uid, $subject, $message);
                }
                //-----------------------
                ?>
					
					<div class="my_box3">
					<div class="padd10">
					 <?php 
                _e('Your message has been sent.', 'PricerrTheme');
                ?>
					</div>
					</div>
					
					<?php 
            } else {
                echo '<div class="error">' . __('Invalid username', 'PricerrTheme') . "</div>";
            }
        } else {
            ?>
   
             
        <div class="my_box3">
            	<div class="padd10">
            
            	<div class="box_title"><?php 
            _e("Send Private Message to: ", "PricerrTheme");
            ?>
 <?php 
            echo $user->user_login;
            ?>
</div>
                <div class="box_content">  
                <form method="post"> <input type="hidden" value="<?php 
            echo current_time('timestamp', 0);
            ?>
" name="tm_tm" />
                <table>
                <?php 
            if (empty($uid)) {
                ?>
                <tr>
                <td width="140"><?php 
                _e("Send To", "PricerrTheme");
                ?>
:</td>
                <td><input size="20" name="to" type="text" value="" /></td>
                </tr>
                <?php 
            }
            ?>
                
                <tr>
                <td width="140"><?php 
            _e("Subject", "PricerrTheme");
            ?>
:</td>
                <td><input size="50" name="subject" type="text" value="<?php 
            echo $subject;
            ?>
" /></td>
                </tr>
                
                <tr>
                <td valign="top"><?php 
            _e("Message", "PricerrTheme");
            ?>
:</td>
                <td><textarea name="message" rows="6" cols="50"></textarea></td>
                </tr>
                
                 <tr>
                <td width="140">&nbsp;</td>
                <td></td>
                </tr>
                
                 <tr>
                <td width="140">&nbsp;</td>
                <td><input name="send" type="submit" value="<?php 
            _e("Send Message", 'PricerrTheme');
            ?>
" /></td>
                </tr>
                
                </table>
      			</form>
                
                </div>
                </div>
                </div>
        
        
        <?php 
        }
    }
    ?>
        
        </div>
    
    
    
    <?php 
    PricerrTheme_get_users_links();
}
Esempio n. 3
0
 			

            <div class="ad_page_title_purchase">
            
            	
            
            
            	<div class="ad_page_title">
                <div class="image_and_user">
                <img width="25" height="25" border="0" src="<?php 
            echo pricerrTheme_get_avatar($post->post_author);
            $user = get_userdata($post->post_author);
            ?>
" /> 
				<a href="<?php 
            echo PricerrTheme_get_user_profile_link($user->user_login);
            ?>
"><?php 
            echo $user->user_login;
            ?>
</a>: </div>
				<h1><?php 
            the_title();
            ?>
</h1>
                
                
                </div>