本文整理汇总了PHP中NewsStory::uid方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsStory::uid方法的具体用法?PHP NewsStory::uid怎么用?PHP NewsStory::uid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewsStory
的用法示例。
在下文中一共展示了NewsStory::uid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: XoopsXmlRpcFault
function &getPost($respond = true)
{
if (!$this->_checkUser($this->params[1], $this->params[2])) {
$this->response->add(new XoopsXmlRpcFault(104));
} else {
// will be removed... don't worry if this looks bad
include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
$story = new NewsStory($this->params[0]);
$ret = array('uid' => $story->uid(), 'published' => $story->published(), 'storyid' => $story->storyId(), 'title' => $story->title('Edit'), 'hometext' => $story->hometext('Edit'), 'moretext' => $story->bodytext('Edit'));
if (!$respond) {
return $ret;
} else {
if (!$ret) {
$this->response->add(new XoopsXmlRpcFault(106));
} else {
$struct = new XoopsXmlRpcStruct();
$content = '';
foreach ($ret as $key => $value) {
switch ($key) {
case 'uid':
$struct->add('userid', new XoopsXmlRpcString($value));
break;
case 'published':
$struct->add('dateCreated', new XoopsXmlRpcDatetime($value));
break;
case 'storyid':
$struct->add('postid', new XoopsXmlRpcString($value));
$struct->add('link', new XoopsXmlRpcString(XOOPS_URL . '/modules/news/article.php?item_id=' . $value));
$struct->add('permaLink', new XoopsXmlRpcString(XOOPS_URL . '/modules/news/article.php?item_id=' . $value));
break;
case 'title':
$struct->add('title', new XoopsXmlRpcString($value));
break;
default:
$content .= '<' . $key . '>' . trim($value) . '</' . $key . '>';
break;
}
}
$struct->add('description', new XoopsXmlRpcString($content));
$this->response->add($struct);
}
}
}
}
示例2: b_news_top_show
//.........这里部分代码省略.........
if ($currenttab == 0 && $usespotlight) {
// Spotlight or not ?
$block['current_is_spotlight'] = true;
if ($options[5] == 0 && $options[6] == 0) {
// If the story to use was no selected then we switch to the "recent news" mode.
$options[5] = 1;
}
if ($options[5] == 0) {
// Use a specific news
if (!isset($permstory)) {
$tmpstory->NewsStory($options[6]);
} else {
$tmpstory = $permstory;
}
} else {
// Use the most recent news
$stories = array();
$stories = $tmpstory->getAllPublished(1, 0, $restricted, 0, 1, true, $options[0]);
if (count($stories) > 0) {
$firststory = $stories[0];
$tmpstory->NewsStory($firststory->storyid());
} else {
$block['use_spotlight'] = false;
}
}
$spotlight = array();
$spotlight['title'] = $tmpstory->title();
if ($options[7] != '') {
$spotlight['image'] = sprintf("<a href='%s'>%s</a>", XOOPS_URL . '/modules/news/article.php?storyid=' . $tmpstory->storyid(), $myts->displayTarea($options[7], $tmpstory->nohtml));
}
$spotlight['text'] = $tmpstory->hometext();
// Added 16 february 2007 *****************************************
$story_user = null;
$story_user = new XoopsUser($tmpstory->uid());
if (is_object($story_user)) {
$spotlight['avatar'] = XOOPS_UPLOAD_URL . '/' . $story_user->getVar('user_avatar');
}
// ****************************************************************
$spotlight['id'] = $tmpstory->storyid();
$spotlight['date'] = formatTimestamp($tmpstory->published(), $dateformat);
$spotlight['hits'] = $tmpstory->counter();
$spotlight['rating'] = number_format($tmpstory->rating(), 2);
$spotlight['votes'] = $tmpstory->votes();
if (strlen(xoops_trim($tmpstory->bodytext())) > 0) {
$spotlight['read_more'] = true;
} else {
$spotlight['read_more'] = false;
}
$spotlight['readmore'] = sprintf("<a href='%s'>%s</a>", XOOPS_URL . '/modules/news/article.php?storyid=' . $tmpstory->storyid(), _MB_READMORE);
$spotlight['title_with_link'] = sprintf("<a href='%s'>%s</a>", XOOPS_URL . '/modules/news/article.php?storyid=' . $tmpstory->storyid(), $tmpstory->title());
if ($tmpstory->votes() == 1) {
$spotlight['number_votes'] = _NW_ONEVOTE;
} else {
$spotlight['number_votes'] = sprintf(_NW_NUMVOTES, $tmpstory->votes());
}
$spotlight['votes_with_text'] = sprintf(_NW_NUMVOTES, $tmpstory->votes());
$spotlight['topicid'] = $tmpstory->topicid();
$spotlight['topic_title'] = $tmpstory->topic_title();
// Added, topic's image and description
$spotlight['topic_image'] = XOOPS_URL . '/modules/news/images/topics/' . $tmpstory->topic_imgurl();
$spotlight['topic_description'] = $myts->displayTarea($tmpstory->topic_description, 1);
if ($displayname != 3) {
$spotlight['author'] = sprintf("%s %s", _POSTEDBY, $tmpstory->uname());
$spotlight['author_with_link'] = sprintf("%s <a href='%s'>%s</a>", _POSTEDBY, XOOPS_URL . '/userinfo.php?uid=' . $tmpstory->uid(), $tmpstory->uname());
} else {
$spotlight['author'] = '';
示例3: isset
} else {
$groups = XOOPS_GROUP_ANONYMOUS;
}
if (!$gperm_handler->checkRight('news_view', $article->topicid(), $groups, $xoopsModule->getVar('mid'))) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 3, _NOPERM);
exit;
}
$storypage = isset($_GET['page']) ? intval($_GET['page']) : 0;
$dateformat = news_getmoduleoption('dateformat');
$hcontent = '';
/**
* update counter only when viewing top page and when you are not the author or an admin
*/
if (empty($_GET['com_id']) && $storypage == 0) {
if (is_object($xoopsUser)) {
if ($xoopsUser->getVar('uid') == $article->uid() || news_is_admin_group()) {
// nothing ! ;-)
} else {
$article->updateCounter();
}
} else {
$article->updateCounter();
}
}
$xoopsOption['template_main'] = 'news_article.html';
include_once XOOPS_ROOT_PATH . '/header.php';
$story['id'] = $storyid;
$story['posttime'] = formatTimestamp($article->published(), $dateformat);
$story['news_title'] = $article->title();
$story['title'] = $article->textlink() . ' : ' . $article->title();
$story['topic_title'] = $article->textlink();
示例4: array
if ($result) {
if ($approveprivilege && news_getmoduleoption('tags')) {
$tag_handler = xoops_getmodulehandler('tag', 'tag');
$tag_handler->updateByItem($_POST['item_tag'], $story->storyid(), $xoopsModule->getVar('dirname'), 0);
}
if (!$editmode) {
// Notification
// TODO: modifier afin qu'en cas de prépublication, la notification ne se fasse pas
$notification_handler =& xoops_gethandler('notification');
$tags = array();
$tags['STORY_NAME'] = $story->title();
$tags['STORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?storyid=' . $story->storyid();
// If notify checkbox is set, add subscription for approve
if ($notifypub && $approve) {
include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
$notification_handler->subscribe('story', $story->storyid(), 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE, $xoopsModule->getVar('mid'), $story->uid());
}
if ($approve == 1) {
$notification_handler->triggerEvent('global', 0, 'new_story', $tags);
$notification_handler->triggerEvent('story', $story->storyid(), 'approve', $tags);
// Added by Lankford on 2007/3/23
$notification_handler->triggerEvent('category', $story->topicid(), 'new_story', $tags);
} else {
$tags['WAITINGSTORIES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=newarticle';
$notification_handler->triggerEvent('global', 0, 'story_submit', $tags);
}
}
if ($allowupload) {
// Manage upload(s)
if (isset($_POST['delupload']) && count($_POST['delupload']) > 0) {
foreach ($_POST['delupload'] as $onefile) {
示例5: XoopsPageNav
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$pagenav = new XoopsPageNav($story_pages, 1, $storypage, 'page', 'storyid=' . $storyid);
$xoopsTpl->assign('pagenav', $pagenav->renderNav());
//$xoopsTpl->assign('pagenav', $pagenav->renderImageNav());
if ($storypage == 0) {
$story['text'] = $story['text'] . '<br /><br />' . $articletext[$storypage];
} else {
$story['text'] = $articletext[$storypage];
}
} else {
$story['text'] = $story['text'] . '<br /><br />' . $bodytext;
}
}
$story['poster'] = $article->uname();
if ($story['poster']) {
$story['posterid'] = $article->uid();
$story['poster'] = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $story['posterid'] . '">' . $story['poster'] . '</a>';
} else {
$story['poster'] = '';
$story['posterid'] = 0;
$story['poster'] = $xoopsConfig['anonymous'];
}
$story['morelink'] = '';
$story['adminlink'] = '';
unset($isadmin);
if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
$isadmin = true;
$story['adminlink'] = $article->adminlink();
}
$story['topicid'] = $article->topicid();
$story['imglink'] = '';