Example #1
0
 public function action_contacts()
 {
     $this->title = "Контакты";
     $this->breadCrambsActive = $this->title;
     $user = $this->user;
     $this->messages = array();
     if ($this->isPost() && isset($_POST['sendEmail'])) {
         if (M_Helpers::sendEmail($_POST, $this->messages)) {
             $_SESSION['success_sent'] = true;
             $this->redirect(M_Link::ToPage('contacts'));
         }
         $this->fields = $_POST;
     } else {
         $this->fields['message'] = '';
         $this->fields['email'] = isset($user['login']) ? $user['login'] : '';
         $this->fields['name'] = isset($user['user_name']) ? $user['user_name'] : '';
         if (isset($_SESSION['success_sent'])) {
             $this->messages['success'] = 'Сообщение отправлено!';
             unset($_SESSION['success_sent']);
         }
     }
     // Получение пути к шаблону
     $templateName = $this->getTemplate('components/page/v_contacts.php');
     // Формирование контента страницы
     $this->blocks['_content_page'] = $this->Template($templateName, $this);
 }
Example #2
0
<article class="well blog-post">	
	<header>
		<h3 class="blog-post-title"><?php 
echo $object->page['post_title'];
?>
</h3>							
		<p class="post-info">
			Опубликовал <?php 
echo $object->page['user_name'];
?>
			<?php 
echo M_Helpers::strf_time('%d %B %Y, %a, %H:%M', strtotime($object->page['post_date_create']));
?>
		</p>
		<p>Просмотров: <?php 
echo $object->page['views'] + 1;
?>
</p>
	</header>
	<div>
		<?php 
echo $object->page['post_content'];
?>
	</div>
</article>


Example #3
0
					</div>
				</div>
			</fieldset>
		</form>
	</div>
	<?php 
        echo ob_get_clean();
    }
    ?>


	<?php 
    for ($i = 0, $c = count($comments); $i < $c; $i++) {
        ?>
	<?php 
        $date = M_Helpers::strf_time('%d-%m-%Y, %a, %H:%M:%S', strtotime($comments[$i]['dateCreate']));
        ?>
	
	<?php 
        if ($comments[$i]['level'] == 0) {
            ?>
	
		<div id="commentItem<?php 
            echo $comments[$i]['comment_id'];
            ?>
" class="comment">
			<div class="attribution">
				<p class="commenter-name"><?php 
            echo $comments[$i]['comment_author'];
            ?>
</p>
Example #4
0
 private function EnableParamsUrlCKEditor()
 {
     // путь к файлу инсталяции CKEditor
     $filename = substr(JS_DIR, iconv_strlen(BASE_URL)) . 'custom/init_posts_add_edit.js';
     $var_name = '_fileUploadUrl';
     // При добавление нового поста $post_id = 0
     if (isset($_GET['param'])) {
         $post_id = (int) $_GET['param'];
     } else {
         $post_id = 0;
     }
     $action_url = BASE_URL . 'index.php?c=ajax&action=ckupload&pid=post_' . $post_id;
     return M_Helpers::replace_var_js_file($var_name, $action_url, $filename);
 }
Example #5
0
</p>			
			<div class="progress">
				<div class="progress-bar" role="progressbar" aria-valuenow="<?php 
        echo $rating;
        ?>
" aria-valuemin="0" aria-valuemax="100" style="width: <?php 
        echo $rating;
        ?>
%;">
					(<?php 
        echo M_Helpers::get_correct_str($answer['res'], 'голос%s', '', 'а', 'ов');
        ?>
)
				</div>
			</div>		
		<?php 
    }
    ?>
		
		<p>Всего: <?php 
    echo M_Helpers::get_correct_str($object->show_result['value'], 'голос%s', '', 'а', 'ов');
    ?>
 </p>
	</div>
	<?php 
}
?>
</article>


Example #6
0
 public function action_upload()
 {
     $_SESSION['hash'] = M_Helpers::get_hash($_POST['name'] . time());
     $_SESSION['uploaddir'] = SITE_ROOT . '/' . VIDEO_DIR;
     $_SESSION['name'] = M_Helpers::unique_name($_SESSION['uploaddir'], $_POST['name'], true);
     die('1');
 }
Example #7
0
 public function action_get_cont_php_net()
 {
     if (M_Users::Instance()->Get() == null) {
         die;
     }
     $str = "";
     if (isset($_POST['url'])) {
         $str = M_Helpers::get_desc_func_from_php_net($_POST['url']);
     }
     echo $str;
 }
Example #8
0
 private function _setToken()
 {
     // путь к файлу инсталяции uploadify
     $filename = JS_DIR . 'custom/init_audio_add.js';
     $timestamp = time();
     $token = md5(HASH_KEY . $timestamp);
     $var_name[0] = '_timestampUploadFiles';
     $var_name[1] = '_tokenUploadFiles';
     $new_val[0] = $timestamp;
     $new_val[1] = $token;
     //var_dump($timestamp, $token, HASH_KEY);
     return M_Helpers::replace_var_js_file($var_name, $new_val, $filename);
 }