本文整理汇总了PHP中countPosts函数的典型用法代码示例。如果您正苦于以下问题:PHP countPosts函数的具体用法?PHP countPosts怎么用?PHP countPosts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了countPosts函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayTopics
function displayTopics()
{
$db = Database::obtain();
$sql = 'SELECT * FROM forum_topics ORDER BY lastpost DESC';
$topics = $db->fetch_array($sql);
$return = '';
foreach ($topics as $topic) {
$return .= '<tr><td><img src="theme/images/bullet_green.png" /></td><td><a href="admin.php?page=forum&topic=' . $topic['id'] . '">' . $topic['name'] . '</a></td><td>' . countPosts($topic['id']) . '</td><td>' . ago(strtotime($topic['lastpost'])) . '</td></tr>';
}
return $return;
}
示例2: ajax_footer
ajax_footer();
} else {
$query = $db->query("SELECT pid,path,ifthumb FROM pw_cnphoto WHERE aid=" . pwEscape($aid));
if (($num = $db->num_rows($query)) > 0) {
$affected_rows = 0;
while ($rt = $db->fetch_array($query)) {
pwDelatt($rt['path'], $db_ifftp);
if ($rt['ifthumb']) {
$lastpos = strrpos($rt['path'], '/') + 1;
pwDelatt(substr($rt['path'], 0, $lastpos) . 's_' . substr($rt['path'], $lastpos), $db_ifftp);
}
$affected_rows += delAppAction('photo', $rt['pid']) + 1;
//TODO 效率?
}
pwFtpClose($ftp);
countPosts("-{$affected_rows}");
}
$db->update("DELETE FROM pw_cnphoto WHERE aid=" . pwEscape($aid));
$db->update("DELETE FROM pw_cnalbum WHERE aid=" . pwEscape($aid));
updateUserAppNum($album['ownerid'], 'photo', 'minus', $album['photonum']);
if ($album['ownerid'] != $winduid) {
echo getLangInfo('msg', 'operate_success') . "\tjump\t{$basename}a=friend";
} else {
echo getLangInfo('msg', 'operate_success') . "\tjump\t{$basename}a=own";
}
ajax_footer();
}
} elseif ($a == 'editalbum') {
define('AJAX', 1);
define('F_M', true);
banUser();
示例3: foreach
require_once R_P . 'require/bbscode.php';
$wordsfb = L::loadClass('FilterUtil', 'filter');
foreach ($pintro as $k => $v) {
if (strlen($v) > 255) {
Showmsg('photo_pintro_toolong');
}
if (($banword = $wordsfb->comprise($v)) !== false) {
Showmsg('content_wordsfb');
}
}
$result = $photoService->uploadPhoto($aid);
if (!is_array($result)) {
Showmsg($result);
}
list($albumInfo, $pid, $photoNum, $photos) = $result;
countPosts("+{$photoNum}");
$weiboService = L::loadClass('weibo', 'sns');
/* @var $weiboService PW_Weibo */
$weiboPrivacy = $weiboService->checkUserSpacePrivacy($winduid);
if (!$albumInfo['private']) {
if (!$weiboPrivacy['index'] && !$weiboPrivacy['photos']) {
$weiboPhotos = array();
$tmpid = $pid;
foreach ($photos as $value) {
$value['pid'] = $tmpid;
$tmpid++;
$weiboPhotos[] = $value;
}
$objId = count($photos) > 1 ? 0 : $pid;
$weiboExtra = array('aid' => $aid, 'aname' => $albumInfo['aname'], 'photos' => $weiboPhotos);
$weiboService->send($winduid, '分享照片', 'photos', $objId, $weiboExtra);
示例4: isset
isset($msg_delmoney) && ($tmp_msg_delmoney = $msg_delmoney != 0 ? "-{$msg_delmoney}" : 0);
$msgdb[] = array('toUser' => $read['author'], 'title' => getLangInfo('writemsg', 'del_title'), 'content' => getLangInfo('writemsg', 'del_content', array('manager' => $windid, 'fid' => $read['fid'], 'tid' => $read['tid'], 'subject' => $read['subject'], 'postdate' => get_date($read['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'affect' => "{$db_rvrcname}:{$tmp_msg_delrvrc},{$db_moneyname}:{$tmp_msg_delmoney}", 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content))));
}
}
$delarticle->delTopic($readdb, $db_recycle, $ifdel, array('reason' => $atc_content));
$weiboService = L::loadClass('weibo', 'sns');
/* @var $weiboService PW_Weibo */
$weibos = $weiboService->getWeibosByObjectIdsAndType($selids, 'group_article');
if ($weibos) {
$mids = array();
foreach ($weibos as $key => $weibo) {
$mids[] = $weibo['mid'];
}
$weiboService->deleteWeibos($mids);
}
countPosts('-1');
$credit->runsql();
sendMawholeMessages($msgdb);
if ($db_ifpwcache ^ 1) {
$db->update("DELETE FROM pw_elements WHERE type !='usersort' AND id IN(" . S::sqlImplode($selids) . ')');
}
//* P_unlink(D_P.'data/bbscache/c_cache.php');
pwCache::deleteData(D_P . 'data/bbscache/c_cache.php');
if (!defined('AJAX')) {
refreshto("apps.php?q=group&a=thread&cyid={$cyid}", 'deltopic_success');
} else {
Showmsg('deltopic_success_ajax');
}
}
}
function checkForHeadTopic($toptype, $fid, $selForums)
示例5: foreach
$imgs = '';
foreach ($attimages as $k => $v) {
$imgs .= "[img]" . $v . "[/img]";
}
$share_code = '';
} else {
$share_code = '';
}
$type_name = getLangInfo('app', $type);
!$title && ($title = substrs($share['link'], 40));
pwAddFeed($winduid, 'share', $f_id, array('lang' => 'share_view', 'link' => $share['link'], 'title' => $title, 'descrip' => $descrip, 'abstract' => $abstract, 'imgs' => $imgs, 'share_code' => $share_code, 'uid' => $winduid, 'username' => $windid, 'type_name' => $type_name));
$a = 'self';
} else {
$a = 'my';
}
countPosts('+1');
//积分变动
require_once R_P . 'require/credit.php';
$o_share_creditset = unserialize($o_share_creditset);
$creditset = getCreditset($o_share_creditset['Post']);
$creditset = array_diff($creditset, array(0));
if (!empty($creditset)) {
$credit->sets($winduid, $creditset, true);
updateMemberid($winduid);
}
if ($creditlog = unserialize($o_share_creditlog)) {
addLog($creditlog['Post'], $windid, $winduid, 'share_Post');
}
updateUserAppNum($winduid, 'share');
$memberShare = array('reply' => "memberShareThread", 'topic' => "memberShareThread", 'diary' => "memberShareDiary", 'album' => "memberShareAlbum", 'user' => "memberShareUser", 'group' => "memberShareGroup", 'photo' => "memberSharePic", 'web' => "memberShareLink", 'video' => "memberShareVideo", 'music' => "memberShareMusic");
$threadShare = array('topic' => "threadShare", 'diary' => "diaryShare", 'photo' => "picShare");
示例6: delAlbum
/**
*删除相册
*@param $aid int 相册ID
*/
function delAlbum($aid)
{
if (!$this->isDelRight() && !$this->isSelf() || intval($aid) <= 0) {
return array();
}
$photoDao = $this->_getDaoFactory('CnPhoto');
$albumDao = $this->_getDaoFactory('CnAlbum');
$photoList = $photoDao->getPhotosInfoByAid($aid);
if (!empty($photoList)) {
$affected_rows = 0;
foreach ($photoList as $key => $value) {
pwDelatt($value['path'], $this->_dbifftp);
if ($value['ifthumb']) {
$lastpos = strrpos($value['path'], '/') + 1;
pwDelatt(substr($value['path'], 0, $lastpos) . 's_' . substr($value['path'], $lastpos), $this->_dbifftp);
}
$affected_rows += delAppAction('photo', $value['pid']) + 1;
//TODO 效率?
}
pwFtpClose($ftp);
countPosts("-{$affected_rows}");
}
$photoDao->delPhotosByAid($aid);
$albumDao->delete($aid);
}
示例7: getPage
function getPage($nPage)
{
$nPages = ceil(countPosts() / 10);
$posts = get_paging_posts(10, ($nPage - 1) * 10);
require APPLICATION_PATH . '/views/list.html.php';
}
示例8: getLatestNews
</div></div>
</div>
<div class="col-md-9">
<div class="row">
<div class="col-md-12"><?php
getLatestNews($limit, $offset);
?>
</div>
</div>
<div class="row">
<div class="col-md-12">
<?php
getPrevBtn($limit, $offset);
?>
<?php
getNextBtn($limit, $offset);
?>
</div>
</div>
<div class="col-md-12 text-center"><p class="meta"><?php
countPosts($limit, $offset);
?>
</p></div>
</div>
</div>
<hr>
</div>
<!-- /CONTENT ============-->
<?php
echo $footer;
示例9: empty
empty($selid) && adminmsg("no_album_selid");
if (!function_exists('countPosts')) {
require_once R_P . 'u/require/core.php';
}
foreach ($selid as $key => $id) {
$thiscomm = $db->get_one("SELECT uid,type,typeid FROM pw_comment WHERE id=" . S::sqlEscape($id));
$updatenum = 0;
$db->update("DELETE FROM pw_comment WHERE id=" . S::sqlEscape($id));
$updatenum += $db->affected_rows();
$db->update("DELETE FROM pw_comment WHERE upid=" . S::sqlEscape($id));
$updatenum += $db->affected_rows();
list($app_table, $app_filed) = getCommTypeTable($thiscomm['type']);
if ($updatenum && $app_table && $thiscomm['typeid']) {
$db->update("UPDATE {$app_table} SET c_num=c_num-" . S::sqlEscape($updatenum) . " WHERE {$app_filed}=" . S::sqlEscape($thiscomm['typeid']));
}
countPosts("-{$updatenum}");
}
adminmsg('operate_success', "{$basename}&job=list&title=" . rawurlencode($title) . "&username=" . rawurlencode($username) . "&type={$type}&typeid={$typeid}&postdate_s={$postdate_s}&postdate_e={$postdate_e}&ordertype={$ordertype}&lines={$lines}&page={$page}&");
} else {
S::gp(array('type', 'typeid', 'title', 'username', 'postdate_s', 'postdate_e', 'ordertype', 'page', 'lines'));
$lines = $lines ? $lines : $db_perpage;
$ascChecked = $ordertype == 'asc' ? 'checked' : '';
$descChecked = !$ascChecked ? 'checked' : '';
$postdateStartString = $postdate_s && is_numeric($postdate_s) ? get_date($postdate_s, 'Y-m-d') : $postdate_s;
$postdateEndString = $postdate_e && is_numeric($postdate_e) ? get_date($postdate_e, 'Y-m-d') : $postdate_e;
$commentTypeSelections = formSelect('type', $type, array('diary' => 'ÈÕÖ¾', 'photo' => 'ÕÕƬ', 'board' => 'ÁôÑÔ'), 'class="select_wa"', '--ÇëÑ¡Ôñ--');
if (empty($type) && empty($title) && empty($username) && empty($postdate_s) && empty($postdate_e)) {
$noticeMessage = getLangInfo('cpmsg', 'noenough_condition');
} else {
$postdate_s && !is_numeric($postdate_s) && ($postdate_s = PwStrtoTime($postdate_s));
$postdate_e && !is_numeric($postdate_e) && ($postdate_e = PwStrtoTime($postdate_e));