当前位置: 首页>>代码示例>>PHP>>正文


PHP comments函数代码示例

本文整理汇总了PHP中comments函数的典型用法代码示例。如果您正苦于以下问题:PHP comments函数的具体用法?PHP comments怎么用?PHP comments使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了comments函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: smarty_function_comments

function smarty_function_comments($params, &$smarty) {
    if (!$params['target']) { return false; }
    if (!$params['target_id']) { return false; }
    
    cmsCore::includeComments();
    
    comments($params['target'], $params['target_id'], (is_array($params['labels']) ? $params['labels'] : array()), (isset($params['can_delete']) ? $params['can_delete'] : false));
    
    return;
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:10,代码来源:function.comments.php

示例2: cmsSmartyComments

/**
 * Вспомогательные функции
 */
function cmsSmartyComments($params)
{
    if (!$params['target']) {
        return false;
    }
    if (!$params['target_id']) {
        return false;
    }
    cmsCore::includeComments();
    comments($params['target'], $params['target_id'], is_array($params['labels']) ? $params['labels'] : array());
    return;
}
开发者ID:vicktorwork,项目名称:cms1,代码行数:15,代码来源:smartyTpl.php

示例3: fenom_function_comments

function fenom_function_comments($params)
{
    if (!$params['target']) {
        return false;
    }
    if (!$params['target_id']) {
        return false;
    }
    cmsCore::includeComments();
    comments($params['target'], $params['target_id'], is_array($params['labels']) ? $params['labels'] : array(), isset($params['can_delete']) ? $params['can_delete'] : false);
    return true;
}
开发者ID:myinstantcms,项目名称:dev-component,代码行数:12,代码来源:function.comments.php

示例4: comments

/**
 * Выводит дерево комментариев. Используется здесь и в xajax/contest.server.php
 * @param  integer   $pid            id проекта
 * @param  string    $name           название проекта
 * @param  array     $comments       массив с деревом комментариев (подробнее в classes/contest.php)
 * @param  boolean   $comm_blocked   автор отключил возможность оставлять комментарии?
 * @param  boolean   $project_end    проект закрыт?
 * @param  integer   $s_level        уровень вложенности комментария
 * @return string                    HTML с кнопками управления
 */
function comments($pid, $name, &$comments, $comm_blocked, $project_end, $s_level = 0)
{
    global $stop_words, $contest, $project, $session;
    static $level = 0;
    $level = ($s_level ? $s_level : $level) + 1;
    $html = '';
    $set_branch_as_read = false;
    for ($i = 0, $c = count($comments); $i < $c; $i++) {
        if (($comments[$i]['is_banned'] || $comments[$i]['usr_banned'] || $comments[$i]['user_blocked'] === 't') && !hasPermissions('projects') && !$contest->is_owner) {
            $msg = $msg2 = 'Ответ от заблокированного пользователя';
        } else {
            if (!trim($comments[$i]['deleted'])) {
                $sMsg = $comments[$i]['moderator_status'] === '0' ? $stop_words->replace($comments[$i]['msg']) : $comments[$i]['msg'];
                $msg = reformat($sMsg, 30, 0, 0, 1);
                $msg2 = reformat($comments[$i]['msg'], 30, 0, 0, 1);
            } else {
                $msg2 = $msg = "Комментарий удален модератором";
                if (hasPermissions("comments")) {
                    $moderator = '';
                    $moderatorData = new users();
                    $moderatorData->GetUserByUID($comments[$i]['deluser_id']);
                    if ($moderatorData->login) {
                        $moderator = ' ' . $moderatorData->login . ' (' . $moderatorData->uname . ' ' . $moderatorData->usurname . ') ';
                    }
                    $msg2 = $msg = $msg . " {$moderator}";
                }
                if ($comments[$i]['deluser_id'] == $comments[$i]['user_id']) {
                    $msg2 = $msg = "Комментарий удален автором";
                } else {
                    if (trim($comments[$i]['deleted_reason']) && (hasPermissions("comments") || $comments[$i]['user_id'] == get_uid(false))) {
                        $msg2 = $msg = $msg . "<div style='color:#ff0000'>Причина: " . $comments[$i]['deleted_reason'] . "</div>";
                    }
                }
            }
        }
        $a_is_banned = ($comments[$i]['is_banned'] || $comments[$i]['usr_banned']) && hasPermissions('projects');
        $html .= "\n\t\t\t<li class='thread' id='thread-{$comments[$i]['id']}'" . ($level >= 9 ? " style='margin-left: 0'" : "") . ">\n\t\t\t\t<a name='c-comment-{$comments[$i]['id']}'></a>\n\t\t\t\t<div class='comment-one" . ($comments[$i]['deleted'] || $comments[$i]['hidden'] ? " comment-deleted" : "") . "' id='comment-{$comments[$i]['id']}'>\n\t\t\t\t\t<div class='contest-ea'>" . view_avatar($comments[$i]['login'], $comments[$i]['photo'], 1) . "</div>\n\t\t\t\t\t<div class='comment-body'>\n\t\t\t\t\t\t<h3 class='username'>" . $session->view_online_status($comments[$i]['login']) . "\n\t\t\t\t\t\t\t<a href='/users/{$comments[$i]['login']}' class='" . (is_emp($comments[$i]['role']) ? 'employer-name' : 'freelancer-name') . "'>{$comments[$i]['uname']} {$comments[$i]['usurname']} [{$comments[$i]['login']}]</a>&nbsp;" . view_mark_user($comments[$i]) . "&nbsp;" . ($comments[$i]['completed_cnt'] > 0 ? '<a href="/promo/bezopasnaya-sdelka/" title="Пользователь работал через Безопасную Сделку" target="_blank"><span class="b-icon b-icon__shield b-icon_top_1"></span></a>' : '') . "\n\t\t\t\t\t\t\t<span>[" . dateFormat('d.m.Y | H:i', $comments[$i]['post_date']) . "]</span>\n\t\t\t\t\t\t\t<span id='comment-modified-{$comments[$i]['id']}'>" . ($comments[$i]['modified'] ? "[изменен " . dateFormat('d.m.Y | H:i', $comments[$i]['modified']) . "]" : '&nbsp;') . "</span>\n\t\t\t\t\t\t\t" . ($a_is_banned ? "<b style=\"color:#ff0000\">Пользователь забанен</b>" : "") . "\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t" . ($_SESSION['uid'] && $comments[$i]['is_new'] ? "<p><img src='/images/mark-new.png' width='53' height='12' alt='новое' class='mark-new' /></p>" : "") . "\n\t\t\t\t\t\t<div id='comment-change-{$comments[$i]['id']}'>\n\t\t\t\t\t\t<p id='comment-msg-{$comments[$i]['id']}' " . ($a_is_banned ? "style='color:silver'" : "") . ".>" . $msg . "</p>\n\t\t\t\t\t\t<div id='comment-msg-original-{$comments[$i]['id']}' style='display:none'>" . $msg2 . "</div>\n\t\t\t\t\t\t<script type=\"text/javascript\">\n                        banned.addContext( 'p{$pid}c{$comments[$i]['id']}', 3, '" . HTTP_PREFIX . "{$_SERVER['HTTP_HOST']}" . getFriendlyURL("project", $pid) . "?comm={$comments[$i]['id']}#comment-{$comments[$i]['id']}', \"" . htmlspecialchars($name) . "\" );\n                        </script>\n\t\t\t\t\t\t<ul class='thread-options' id='comment-options-{$comments[$i]['id']}'>\n\t\t\t\t\t\t\t" . comment_options($pid, $comments[$i], $comm_blocked, $project_end, $level, $name) . "\n\t\t\t\t\t\t</ul>\n                        <div id='warnreason-" . $comments[$i]['id'] . "-" . $comments[$i]['user_id'] . "' style='display:none; padding: 0 0 5px 0px;'>&nbsp;</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t" . (empty($comments[$i]['comments']) ? '' : '<ul>' . comments($pid, $name, $comments[$i]['comments'], $comm_blocked, $project_end) . '</ul>') . "\n\t\t\t</li>\n\t\t";
        if ($comments[$i]['is_new']) {
            $set_branch_as_read = true;
        }
    }
    if ($set_branch_as_read) {
        $p = new projects();
        $data = array("id" => $pid, "kind" => 7, "user_id" => $project["user_id"]);
        $p->SetRead($data, get_uid(false), true);
    }
    --$level;
    return $html;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:59,代码来源:contest.php

示例5: while




		<!-- Comments are closed but keeping code just in case -->
		<!--
		<?php 
if (comments_open()) {
    ?>
		<section class="comments">
			<?php 
    if (has_comments()) {
        ?>
			<ul class="commentlist">
				<?php 
        $i = 0;
        while (comments()) {
            $i++;
            ?>
				<li class="comment" id="comment-<?php 
            echo comment_id();
            ?>
">
					<div class="wrap">
						<h2><?php 
            echo comment_name();
            ?>
</h2>
						<time><?php 
            echo relative_time(comment_time());
            ?>
</time>
开发者ID:josephshambrook,项目名称:josephshambrook-anchor,代码行数:28,代码来源:article.php

示例6: calendar


//.........这里部分代码省略.........
            $inPage->setTitle('Просмотр события "' . $event['title'] . '"');
            $smarty = $inCore->initSmarty('components', 'com_calendar_event_view.tpl');
            $smarty->assign('event', $event);
            $smarty->assign('content', $msg);
            $smarty->assign('parent', $event['parent']);
            $smarty->assign('calendar_view', $calendar_view);
            $smarty->assign('events_string', $events_string);
            $smarty->assign('year', $year);
            $smarty->assign('month', $month);
            $smarty->assign('day', $day);
            $smarty->assign('start_time', date("d.m.Y H:i", $event['start_time']));
            $smarty->assign('end_time', date("d.m.Y H:i", $event['end_time']));
            $smarty->assign('issngnup', $issignup);
            $smarty->assign('singups_user', $singups_user);
            $smarty->assign('images', $images);
            //fotolib
            $smarty->assign('allow_add_foto', $allow_add_foto);
            //fotolib
            if ($event['start_time'] - time() < 0) {
                $status = "Прошедшее событие";
            } else {
                if ($event['start_time'] - time() > 86400) {
                    $status = 'Осталось ' . declension(round(($event['start_time'] - time()) / 86400), array("день", "дня", "дней"));
                } else {
                    $status = 'Осталось ' . declension(round(($event['start_time'] - time()) / 3600), array("час", "часа", "часов"));
                }
            }
            $smarty->assign('status', $status);
            if ($inUser->id == $event['author_id'] or $inUser->is_admin) {
                $smarty->assign('admin', TRUE);
            }
            $smarty->display('com_calendar_event_view.tpl');
            $inCore->includeComments();
            comments('calendar', $event_id);
            return;
        }
    }
    if ($do == "delete_event") {
        if ($inUser->id == 0) {
            $inCore->redirect('/');
            exit;
        }
        $event_id = $inCore->request('event_id', 'int', 0);
        $deleted = $model->deleteEvent($event_id);
        if ($deleted) {
            cmsCore::addSessionMessage('Ваше мероприятие удалено!', 'success');
            $inCore->redirect('/calendar');
            exit;
        } else {
            cmsCore::addSessionMessage('Ошибка', 'error');
            $inCore->redirect('/calendar');
            exit;
        }
    }
    if ($do == "edit_event") {
        if ($inUser->id == 0) {
            $inCore->redirect('/');
            exit;
        }
        $event_id = $inCore->request('event_id', 'int', 0);
        $event = $model->getEvent($event_id);
        if ($event["author_id"] != $inUser->id and !$inUser->is_admin) {
            cmsCore::addSessionMessage('Ошибка доступа', 'error');
            $inCore->redirectBack();
            exit;
        }
开发者ID:ratmir-by,项目名称:icms-calendar,代码行数:67,代码来源:frontend.php

示例7: clubs


//.........这里部分代码省略.........
    if (!$photo['meta_desc']) {
        if ($photo['description']) {
            $inPage->setDescription(crop($photo['description']));
        } else {
            $inPage->setDescription($photo['title']);
        }
    } else {
        $inPage->setDescription($photo['meta_desc']);
    } 

	// ссылки вперед назад
	$photo['nextid'] = $inDB->get_fields('cms_photo_files', 'id<'.$photo['id'].' AND album_id = '.$photo['album_id'], 'id, file, title', 'id DESC');
	$photo['previd'] = $inDB->get_fields('cms_photo_files', 'id>'.$photo['id'].' AND album_id = '.$photo['album_id'], 'id, file, title', 'id ASC');

	// кнопки голосования
	$photo['karma_buttons'] = cmsKarmaButtons('club_photo', $photo['id'], $photo['rating'], $is_author);

	// Обновляем кол-во просмотров
	if(!$is_author){
		$inDB->setFlag('cms_photo_files', $photo['id'], 'hits', $photo['hits']+1);
	}

	// выводим в шаблон
    cmsPage::initTemplate('components', 'com_clubs_view_photo')->
            assign('club', $club)->
            assign('photo', $photo)->
            assign('is_admin', $is_admin)->
            assign('is_moder', $is_moder)->
            assign('is_exists_original', (file_exists(PATH.'/images/photos/'. $photo['file'])))->
            assign('is_author', $is_author)->
            display();

	//если есть, выводим комментарии
	if ($photo['comments'] && $inCore->isComponentEnable('comments')) {
            cmsCore::includeComments();
            comments('club_photo', $photo['id'], array(), $is_author);
	}

}
////////////////////////////// УДАЛИТЬ ФОТО ////////////////////////////////////
if ($do=='delete_photo'){

    if(!$inUser->id) { return false; }

    if(!cmsCore::isAjax()) { return false; }

	if(!cmsUser::checkCsrfToken()) { return false; }

	$photo = $inPhoto->getPhoto(cmsCore::request('photo_id', 'int', 0));
	if (!$photo) { cmsCore::halt(); }

	// получаем клуб
	$club = $model->getClub($photo['auser_id']);
	if(!$club) { cmsCore::halt(); }

	// Инициализируем участников клуба
	$model->initClubMembers($club['id']);
	// права доступа
    $is_admin = $inUser->is_admin || ($inUser->id == $club['admin_id']);
    $is_moder = $model->checkUserRightsInClub('moderator');

	// удалять могут только модераторы и администраторы
	if(!$is_admin && !$is_moder) { cmsCore::halt(); }

	$inPhoto->deletePhoto($photo, $model->initUploadClass());
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:66,代码来源:frontend.php

示例8: content


//.........这里部分代码省略.........
                $inPage->addPathway($pcat['title'], $model->getCategoryURL(null, $pcat['seolink']));
            }
        }
        $inPage->addPathway($article['title']);
        // Мета теги KEYWORDS и DESCRIPTION
        if ($article['meta_keys']) {
            $inPage->setKeywords($article['meta_keys']);
        } else {
            if (mb_strlen($article['content']) > 30) {
                $inPage->setKeywords(cmsCore::getKeywords(cmsCore::strClear($article['content'])));
            }
        }
        if (mb_strlen($article['meta_desc'])) {
            $inPage->setDescription($article['meta_desc']);
        }
        // Выполняем фильтры
        $article['content'] = cmsCore::processFilters($article['content']);
        // Разбивка статей на страницы
        $pt_pages = array();
        if (!empty($GLOBALS['pt'])) {
            foreach ($GLOBALS['pt'] as $num => $page_title) {
                $pt_pages[$num]['title'] = $page_title;
                $pt_pages[$num]['url'] = $model->getArticleURL(null, $article['seolink'], $num + 1);
            }
        }
        // Рейтинг статьи
        if ($model->config['rating'] && $article['canrate']) {
            $karma = cmsKarma('content', $article['id']);
            $karma_points = cmsKarmaFormatSmall($karma['points']);
            $btns = cmsKarmaButtonsText('content', $article['id'], $karma['points'], $is_author);
        }
        cmsPage::initTemplate('components', $article['tpl'])->assign('article', $article)->assign('cfg', $model->config)->assign('page', $page)->assign('is_pages', !empty($GLOBALS['pt']))->assign('pt_pages', $pt_pages)->assign('is_admin', $is_admin)->assign('is_editor', $is_editor)->assign('is_author', $is_author)->assign('is_author_del', $is_author_del)->assign('tagbar', cmsTagBar('content', $article['id']))->assign('karma_points', @$karma_points)->assign('karma_votes', @$karma['votes'])->assign('karma_buttons', @$btns)->display($article['tpl']);
        // Комментарии статьи
        if ($article['published'] && $article['comments'] && $inCore->isComponentInstalled('comments')) {
            cmsCore::includeComments();
            comments('article', $article['id'], array(), $is_author);
        }
    }
    ///////////////////////////////////// ADD ARTICLE //////////////////////////////////////////////////////////////////////////////////
    if ($do == 'addarticle' || $do == 'editarticle') {
        $is_add = cmsUser::isUserCan('content/add');
        // может добавлять статьи
        $is_auto_add = cmsUser::isUserCan('content/autoadd');
        // добавлять статьи без модерации
        if (!$is_add && !$is_auto_add) {
            cmsCore::error404();
        }
        // Для редактирования получаем статью и проверяем доступ
        if ($do == 'editarticle') {
            // Получаем статью
            $item = $model->getArticle($id);
            if (!$item) {
                cmsCore::error404();
            }
            $pubcats = array();
            // доступ к редактированию админам, авторам и редакторам
            if (!$inUser->is_admin && $item['user_id'] != $inUser->id && !($item['modgrp_id'] == $inUser->group_id && cmsUser::isUserCan('content/autoadd'))) {
                cmsCore::error404();
            }
        }
        // Для добавления проверяем не вводили ли мы данные ранее
        if ($do == 'addarticle') {
            $item = cmsUser::sessionGet('article');
            if ($item) {
                cmsUser::sessionDel('article');
            }
开发者ID:deltas1,项目名称:icms1,代码行数:67,代码来源:frontend.php

示例9: contents


//.........这里部分代码省略.........
            $articles->limit($offset_string . s('limit'));
        } else {
            $articles->limit(0);
        }
    }
    /* query result */
    $result = $articles->findArray();
    $num_rows_active = count($result);
    /* handle error */
    if (CATEGORY && $num_rows == '') {
        $error = l('article_no');
    } else {
        if ($result == '' || $num_rows_active == '' || CONTENT_ERROR) {
            $error = l('content_not_found');
        } else {
            if ($result) {
                $accessValidator = new Redaxscript\Validator\Access();
                foreach ($result as $r) {
                    $access = $r['access'];
                    /* access granted */
                    if ($accessValidator->validate($access, MY_GROUPS) === Redaxscript\Validator\ValidatorInterface::PASSED) {
                        if ($r) {
                            foreach ($r as $key => $value) {
                                ${$key} = stripslashes($value);
                            }
                        }
                        if (LAST_TABLE == 'categories' || FULL_ROUTE == '' || $aliasValidator->validate(FIRST_PARAMETER, Redaxscript\Validator\Alias::MODE_DEFAULT) == Redaxscript\Validator\ValidatorInterface::PASSED) {
                            $route = build_route('articles', $id);
                        }
                        /* parser object */
                        $parser = new Redaxscript\Parser(Redaxscript\Registry::getInstance(), Redaxscript\Language::getInstance());
                        $parser->init($text, array('className' => array('readmore' => 'link_read_more', 'codequote' => 'js_code_quote box_code'), 'route' => $route));
                        /* collect headline output */
                        $output .= Redaxscript\Hook::trigger('article_start', $r);
                        if ($headline == 1) {
                            $output .= '<h2 class="title_content" id="article-' . $alias . '">';
                            if (LAST_TABLE == 'categories' || FULL_ROUTE == '' || $aliasValidator->validate(FIRST_PARAMETER, Redaxscript\Validator\Alias::MODE_DEFAULT) == Redaxscript\Validator\ValidatorInterface::PASSED) {
                                $output .= anchor_element('internal', '', '', $title, $route);
                            } else {
                                $output .= $title;
                            }
                            $output .= '</h2>';
                        }
                        /* collect box output */
                        $output .= '<div class="box_content">' . $parser->getOutput();
                        $output .= '</div>' . Redaxscript\Hook::trigger('article_end', $r);
                        /* prepend admin dock */
                        if (LOGGED_IN == TOKEN && FIRST_PARAMETER != 'logout') {
                            $output .= admin_dock('articles', $id);
                        }
                        /* infoline */
                        if ($infoline == 1) {
                            $output .= infoline('articles', $id, $author, $date);
                        }
                    } else {
                        $counter++;
                    }
                }
                /* handle access */
                if (LAST_TABLE == 'categories') {
                    if ($num_rows_active == $counter) {
                        $error = l('access_no');
                    }
                } else {
                    if (LAST_TABLE == 'articles' && $counter == 1) {
                        $error = l('access_no');
                    }
                }
            }
        }
    }
    /* handle error */
    if ($error) {
        notification(l('something_wrong'), $error);
    } else {
        $output .= Redaxscript\Hook::trigger(__FUNCTION__ . '_end');
        echo $output;
        /* call comments as needed */
        if (ARTICLE) {
            /* comments replace */
            if ($comments == 1 && (COMMENTS_REPLACE == 1 || Redaxscript\Registry::get('commentsReplace'))) {
                Redaxscript\Hook::trigger('comments_replace');
            } else {
                if ($comments > 0) {
                    $route = build_route('articles', ARTICLE);
                    comments(ARTICLE, $route);
                    /* comment form */
                    if ($comments == 1 || COMMENTS_NEW == 1 && $comments == 3) {
                        comment_form(ARTICLE, $language);
                    }
                }
            }
        }
    }
    /* call pagination as needed */
    if ($sub_maximum > 1 && s('pagination') == 1) {
        $route = build_route('categories', CATEGORY);
        pagination($sub_active, $sub_maximum, $route);
    }
}
开发者ID:amanpreetsinghmalhotra,项目名称:redaxscript,代码行数:101,代码来源:contents.php

示例10: emots

#Page title
$view->title = $news['name'];
#Emoticons
if ($news['opt'] & 2) {
    $news['txt'] = emots($news['txt']);
    if ($full) {
        $full = emots($full);
    }
}
#Line breaks
if ($news['opt'] & 1) {
    $news['txt'] = nl2br($news['txt']);
    if ($full) {
        $full = nl2br($full);
    }
}
#Date, author
$news['date'] = genDate($news['date'], true);
$news['wrote'] = autor($news['author']);
#Assign to template
$view->add('news', array('news' => &$news, 'full' => &$full, 'path' => catPath($news['cat']), 'edit' => admit($news['cat'], 'CAT') ? url('edit/5/' . $id, 'ref') : false, 'root' => isset($cfg['allCat']) ? $lang['cats'] : $lang['news'], 'cats' => url(isset($cfg['allCat']) ? 'cats' : 'cats/news')));
#Tags
if (isset($cfg['tags'])) {
    include './lib/tags.php';
    tags($id, 5);
}
#Comments
if (isset($cfg['ncomm']) && $news['catOpt'] & 2) {
    require './lib/comm.php';
    comments($id, 5);
}
开发者ID:BGCX067,项目名称:f3site-svn-to-git,代码行数:31,代码来源:news.php

示例11: ShowrvwLoop

	function ShowrvwLoop($atts) {
	extract(shortcode_atts(array(
		"categories" => null,
		"class" => "loop",
		"width" => null,
		"rows" => null,
		"columns" => 1,
		"num_posts" => get_option('posts_per_page'),
		"pagination" => "yes",
		"offset" => 0,
		"content_excerpt" => "excerpt",
		"num_words" => null
	), $atts));

	if ((!$width) && ($columns)) {
		$width = (100/$columns) . "%";
		} else {
		$width = "100%";
		$columns = 1;
	}

	if ((!$pagination == "yes") && ($rows)) {
		$num_posts = $rows * $columns;
	}

	if (!$rows) {
		$rows = 9999;
	}

	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
	$query_args = array (
		'posts_per_page' => $num_posts,
		'cat' => $categories,
		'offset' => $offset,
		'paged' => $paged
	);

	global $wp_query;
	$temp = $wp_query;
	$wp_query= null;
	$wp_query = new WP_Query();

	$wp_query->query($query_args);

	$rt = 0;

	$return = '<div class="rvw_loop ' . $class . '">'. PHP_EOL;

	if ($wp_query->have_posts()) : while ($wp_query->have_posts())  : $wp_query->the_post();

		global $post;

		if ($ct && $ct%$columns==0) {
			$return .= '<div class="clearcol"></div>'. PHP_EOL;
			$rt++;
		}

		if ($rt >= $rows) { break; }

		if ($ct >= $num_posts) { break; }

		$return .= '<div class="col" style="width: ' . $width . ';">'. PHP_EOL;

		if ( has_post_thumbnail() ) {
			$return .= '    <a href="' . get_permalink() . '" rel="bookmark">' . get_the_post_thumbnail($post->ID, $class) . '</a>' . PHP_EOL;
		}
		$return .= '    <div class="title"><h2><a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a></h2></div>' . PHP_EOL;
		$return .= '    <div class="date"><span class="label">Date: </span>' . get_the_time(get_option('date_format' )) . '</div>' . PHP_EOL;
		$return .= '    <div class="author"><span class="label">By: </span>' . get_the_author_link() . '</div>' . PHP_EOL;
		$return .= '    <div class="comments"><span class="label">Comments: </span>' . comments() . '</div>' . PHP_EOL;

		if ($content_excerpt == "content") {
			$return .= '    <div class="content">' . content($num_words) . '</div>'. PHP_EOL;
		} else {
			$return .= '    <div class="content">' . excerpt($num_words) . '</div>'. PHP_EOL;
		}
		$return .= '    <div class="categories"><span class="label">Categories: </span>' . get_the_term_list( $post->ID, 'category', '', ', ', '&nbsp;' ) . '</div>' . PHP_EOL;
		$return .= '    <div class="tags"><span class="label">Tags: </span>' . get_the_term_list( $post->ID, 'post_tag', '', ', ', '&nbsp;' ) . '</div>' . PHP_EOL;

		$return .= '</div>  <!-- end class col -->'. PHP_EOL;

		$ct++;

	endwhile;

	if ($pagination == "yes") :
		$return .= '<!-- Previous/Next page navigation -->'. PHP_EOL;
		$return .= '<div class="paging" style="width: ' . $width . ';">'. PHP_EOL;
		$return .= '<div class="alignleft">' . get_previous_posts_link('&laquo; Previous Page') . '</div>'. PHP_EOL;
		$return .= '<div class="alignright">' . get_next_posts_link('Next Page &raquo;') . '</div>'. PHP_EOL;
		$return .= '</div>'. PHP_EOL;
	endif;

	$wp_query = null; $wp_query = $temp;
	
	else : // do not delete

	$return .= '<div class="post">'. PHP_EOL;
	$return .= '    no items found'. PHP_EOL;
	$return .= '</div>'. PHP_EOL;
//.........这里部分代码省略.........
开发者ID:rvanweerd,项目名称:rvwloop,代码行数:101,代码来源:rvwloop.php

示例12: strpos

    $view->info(sprintf($lang['NVAL'], $img['name']), null, 'warning');
}
#Dimensions
$size = strpos($img['size'], '|') ? explode('|', $img['size']) : null;
#Data, autor
$img['date'] = genDate($img['date'], true);
$img['author'] = autor($img['author']);
#Ocena
if (isset($cfg['irate']) and $img['opt'] & 4) {
    $view->css(SKIN_DIR . 'rate.css');
    $rates = 'vote.php?type=3&amp;id=' . $id;
} else {
    $rates = 0;
}
#Tag title and meta description - clean temporary
$view->title = $img['name'];
$view->desc = $img['dsc'] ? clean(substr($img['dsc'], 0, 150)) : $cfg['metaDesc'];
#Description
$img['dsc'] = nl2br($img['dsc']);
#Template
$view->add('img', array('img' => &$img, 'size' => &$size, 'rates' => $rates, 'image' => $img['type'] === '1' ? true : false, 'flash' => $img['type'] === '2' ? true : false, 'audio' => $img['type'] === '3' ? true : false, 'video' => $img['type'] === '4' ? true : false, 'path' => catPath($img['cat']), 'edit' => admit($img['cat'], 'CAT') ? url('edit/3/' . $id, 'ref') : false, 'root' => isset($cfg['allCat']) ? $lang['cats'] : $lang['imgs'], 'cats' => url(isset($cfg['allCat']) ? 'cats' : 'cats/images'), 'lightbox' => isset($cfg['lightbox'])));
#Tags
if (isset($cfg['tags'])) {
    include './lib/tags.php';
    tags($id, 3);
}
#Comments
if (isset($cfg['icomm']) && $img['opt'] & 2) {
    require 'lib/comm.php';
    comments($id, 3);
}
开发者ID:BGCX067,项目名称:f3site-svn-to-git,代码行数:31,代码来源:img.php

示例13: comments

    ?>
    		<hr>
			<div class="row">
				<div class="large-12 columns">
					<h4 class="color_green">
						<?php 
    echo $language->line('general_blog_leave_replay');
    ?>
					</h4>
				</div>
			</div>
		
			<div class="row">
				<div class="large-12 columns">
					<div class="large-12 columns"><?php 
    echo comments($config['disqus_id']);
    ?>
</div>
				</div>
			</div>
		<?php 
}
?>

	</article>
</div>


<!-- News -->

<div class="row">
开发者ID:gocanto,项目名称:gocanto-cms,代码行数:31,代码来源:content.php

示例14: comments_update

function comments_update()
{
    extract($_REQUEST);
    if (!empty($n_comment)) {
        $sql = "\n\t\tINSERT INTO cubit.recon_comments_ct (comment, supid)\n\t\tVALUES ('" . base64_encode($n_comment) . "', '{$supid}')";
        db_exec($sql) or errDie("Unable to update comments.");
    }
    if (isset($remove)) {
        foreach ($remove as $id => $value) {
            $sql = "DELETE FROM cubit.recon_comments_ct WHERE id='{$id}'";
            db_exec($sql) or errDie("Unable to remove comments.");
        }
    }
    return comments();
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:15,代码来源:recon_balance_ct.php

示例15: challangeImage

    challangeImage($dbh, $array);
}
if ($type == 'challangeCom') {
    challangeCom($dbh, $array);
}
if ($type == 'myChall') {
    challangeSearch($dbh, $array);
}
if ($type == 'popChall') {
    popularChallangeSearch($dbh, $array);
}
if ($type == 'logSearch') {
    logSearch($dbh, $array);
}
if ($type == 'comments') {
    comments($dbh, $array);
}
if ($type == 'locationSearch') {
    location($dbh, $array, "", $data);
}
if ($type == 'topLocation') {
    location($dbh, $array, "order by likes desc limit 20", $data);
}
if ($type == 'recentAddLocation') {
    location($dbh, $array, "order by id desc limit 20", $data);
}
if ($type == 'allLocation') {
    location($dbh, $array, "", "");
}
if ($type == 'login') {
    login($dbh, $array);
开发者ID:up730418,项目名称:WebScript,代码行数:31,代码来源:dbSearch.php


注:本文中的comments函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。