本文整理汇总了PHP中Story类的典型用法代码示例。如果您正苦于以下问题:PHP Story类的具体用法?PHP Story怎么用?PHP Story使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Story类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Renderize the view.
*
* @return null
*/
public function render(Story $story)
{
?>
<p>
<?php
echo REQUIRED_FIELDS_TEXT;
?>
</p>
<form action="<?php
echo $this->generateURL('story', 'edit', $story->getIdStory());
?>
" method="post">
<fieldset>
<div class="row">
<div class="col-md-6">
<div>
<label for="title">
Título <small>(*)</small>
</label>
<input name="title" type="text" required value="<?php
echo $story->getTitle();
?>
" />
</div>
</div>
<div class="col-md-6">
<div>
<label for="body">
Cuerpo <small>(*)</small>
</label>
<textarea name="body" required><?php
echo $story->getBody();
?>
</textarea>
</div>
<div>
<input type="submit" value="Modificar" />
</div>
</div>
</div>
</fieldset>
</form>
<?php
}
开发者ID:DRONESTUDIO,项目名称:fudit,代码行数:65,代码来源:EditView.php
示例2: story_plugin_action
function story_plugin_action()
{
global $_, $myUser;
switch ($_['action']) {
case 'DELETE_STORY':
$storyManager = new Story();
$causeManager = new Cause();
$effectManager = new Effect();
$storyManager->delete(array('id' => $_['id']));
$causeManager->delete(array('story' => $_['id']));
$effectManager->delete(array('story' => $_['id']));
break;
case 'plugin_story_check':
require_once 'Cause.class.php';
$vocal = new Cause();
$vocal = $vocal->getById($_['event']);
Story::check($vocal);
break;
case 'SAVE_STORY':
$causeManager = new Cause();
$effectManager = new Effect();
$story = new Story();
if (isset($_['story']['id']) && $_['story']['id'] != '0') {
$story = $story->getById($_['story']['id']);
$causeManager->delete(array('story' => $story->id));
$effectManager->delete(array('story' => $story->id));
}
$story->label = $_['story']['label'];
$story->date = time();
$story->state = 1;
$story->save();
$i = 0;
foreach ($_['story']['cause'] as $cause) {
$current = new Cause();
$current->type = $cause['type'];
$current->target = is_array(@$cause['target']) ? implode('|', @$cause['target']) : @$cause['target'];
$current->operator = @$cause['operator'];
$current->value = $cause['value'];
$current->sort = $i;
$current->union = $cause['union'];
$current->story = $story->id;
$current->save();
$i++;
}
$i = 0;
foreach ($_['story']['effect'] as $effect) {
$current = new Effect();
$current->type = $effect['type'];
$current->target = is_array(@$effect['target']) ? implode('|', @$effect['target']) : @$effect['target'];
$current->value = $effect['value'];
$current->sort = $i;
$current->union = $cause['union'];
$current->story = $story->id;
$current->save();
$i++;
}
break;
}
}
开发者ID:thib3113,项目名称:yana-server,代码行数:59,代码来源:story.plugin.disabled.php
示例3: __construct
public function __construct(Story $story)
{
// initialise our parent first
parent::__construct($story->getCategory() . ' > ' . $story->getGroupAsString() . ' > ' . $story->getName());
// remember the story we are reporting on
$this->story = $story;
// we want success to say 'PASS' rather than 'OKAY'
$this->resultStrings[self::OKAY] = 'PASS';
}
开发者ID:datasift,项目名称:storyplayer,代码行数:9,代码来源:Result.php
示例4: executeCreate
public function executeCreate(sfWebRequest $request)
{
$this->forward404Unless($request->isMethod('post'));
$iteration = Doctrine::getTable('Iteration')->find($request->getParameter('iteration_id'));
$story = new Story();
$story->setIteration($iteration);
$this->form = new StoryForm($story);
$this->processForm($request, $this->form);
$this->setTemplate('new');
}
开发者ID:nubee,项目名称:nubee,代码行数:10,代码来源:actions.class.php
示例5: dashboard
function dashboard()
{
$this->User->recursive = 0;
$this->set('users', $this->paginate());
$sprints = $this->Sprint->getCurrentSprint();
$this->set('sprints', $sprints);
$tasks = $this->Task->getUserTask($this->Auth->user('id'), false);
$this->set('tasks', $tasks);
$this->set('project', $this->Project->read(null, 1));
$this->set('information', $this->Information->getLatestInformation());
$this->set('show_link', true);
$all_sprints = $this->Sprint->getAllSprints();
$this->Sprint->makeSprintZero($all_sprints);
$stories = $this->Story->getActiveStory();
$all_sprints = $this->PmsCommon->getEachStoryPoints($all_sprints, $stories);
$this->set("all_sprints", $all_sprints);
}
开发者ID:vinicius-ianni,项目名称:PHPMyScrum,代码行数:17,代码来源:users_controller.php
示例6: action
function action()
{
$album = new Album();
$story = new Story();
$kdgs = new Kdgs();
$story_url = new StoryUrl();
$album_list = $album->get_list("id>0", 10);
foreach ($album_list as $k => $v) {
$story_list = $kdgs->get_album_story_list($v['link_url']);
foreach ($story_list as $k2 => $v2) {
$exists = $story->check_exists("`source_audio_url`='{$v2['source_audio_url']}'");
if ($exists) {
continue;
}
$story_id = $story->insert(array('album_id' => $v['id'], 'title' => $v2['title'], 'intro' => $v2['intro'], 's_cover' => $v2['cover'], 'source_audio_url' => $v2['source_audio_url'], 'add_time' => date('Y-m-d H:i:s')));
$story_url->insert(array('res_name' => 'story', 'res_id' => $story_id, 'field_name' => 'cover', 'source_url' => $v2['cover'], 'source_file_name' => ltrim(strrchr($v2['cover'], '/'), '/'), 'add_time' => date('Y-m-d H:i:s')));
echo $story_id;
echo "<br />";
exit;
}
}
}
开发者ID:huqq1987,项目名称:clone-lemon,代码行数:22,代码来源:kdgs_story.php
示例7: getBeastData
public function getBeastData($id)
{
$retArray = array();
if (Beast::where('TaxonID', '=', $id)->count() > 0) {
$beast = Beast::where('TaxonID', '=', $id)->first();
if (isset($beast->AcceptedCommonName)) {
$beastName = '%' . $beast->AcceptedCommonName . '%';
$stories = Story::where(function ($query) use($beastName) {
$query->where('Subjects', 'like', $beastName)->orWhere('Keywords', 'like', $beastName);
})->get();
$retArray['stories'] = $stories;
}
$sightings = Sighting::where('TaxonID', '=', $id)->orderBy('Date', 'DESC');
if ($sightings->count() > 0) {
$sighting = $sightings->first();
if (isset($beast->ScientificName)) {
$apiSighting = $this->getLatestAPISighting($beast->ScientificName);
if (count($apiSighting > 0) && $apiSighting[0] > $sighting->Date) {
$retArray['sighting'] = array('longitude' => $apiSighting[1][0], 'latitude' => $apiSighting[1][1], 'date' => $apiSighting[0], 'name' => $apiSighting[2]);
} else {
$retArray['sighting'] = array('longitude' => $sighting->Longitude, 'latitude' => $sighting->Latitude, 'date' => $sighting->Date, 'name' => $sighting->Username);
}
} else {
$retArray['sighting'] = array('longitude' => $sighting->Longitude, 'latitude' => $sighting->Latitude, 'date' => $sighting->Date, 'name' => $sighting->Username);
}
} else {
if (isset($beast->ScientificName)) {
$apiSighting = $this->getLatestAPISighting($beast->ScientificName);
if (count($apiSighting) > 0) {
$retArray['sighting'] = array('longitude' => $apiSighting[1][0], 'latitude' => $apiSighting[1][1], 'date' => $apiSighting[0], 'name' => $apiSighting[2]);
} else {
$retArray['sighting'] = array();
}
} else {
$retArray['sighting'] = array();
}
}
$retArray['info'] = $beast;
}
return $retArray;
}
开发者ID:johnnyluu,项目名称:anemu,代码行数:41,代码来源:AnimalController.php
示例8: array_keys
$t->is($post->getUniqueId(), $identifier);
// @Test: getFieldsArray() generates an array with all the required fields
$keys = array_keys($post->getFieldsArray());
$t->is_deeply($keys, array('sf_unique_id', 'sf_meta_class', 'sf_meta_id', 'title_t', 'body_t'));
// @Test: getFieldsArray() generates an array with correct values
$array = $post->getFieldsArray();
$t->is($array['sf_meta_class']['value'], 'Post');
$t->is($array['sf_meta_id']['value'], $post->getId());
$t->is($array['title_t']['value'], 'title');
$t->is($array['body_t']['value'], 'body');
// @Test: deleteIndex() calls the deleteAllFromClass handler function
$handler->deleteAllFromClass('Post')->once();
$handler->commit()->once();
$handler->replay();
Doctrine::getTable('Post')->deleteIndex();
$handler->verify();
// @Test: createSearchQuery returns a Doctrine_Query object
$results = array('response' => array('docs' => array(0 => array('sf_meta_id' => 1), 3 => array('sf_meta_id' => 2), 2 => array('sf_meta_id' => 3))));
$handler->any('search')->returns($results);
$handler->replay();
$q = Doctrine::getTable('Post')->createSearchQuery('azerty');
$t->ok($q instanceof Doctrine_Query);
// @Test: I18n integration
$story = new Story();
$story->slug = 'toto';
$story->Translation['fr']->body = 'Mon histoire';
$story->Translation['en']->body = 'My story';
$story->save();
$fields = $story->getFieldsArray();
$t->ok(array_key_exists('body_fr', $fields));
$t->ok(array_key_exists('body_en', $fields));
开发者ID:heristop,项目名称:tjSolrDoctrineBehaviorPlugin,代码行数:31,代码来源:Doctrine_Template_SolrTest.php
示例9: service_get_story
/**
* Get an existing story
*
* @param array args Contains all the data provided by the client
* @param string &output OUTPUT parameter containing the returned text
* @return int Response code as defined in lib-plugins.php
*/
function service_get_story($args, &$output, &$svc_msg)
{
global $_CONF, $_TABLES, $_USER;
$output = array();
$retval = '';
if (!isset($_CONF['atom_max_stories'])) {
$_CONF['atom_max_stories'] = 10;
// set a resonable default
}
$svc_msg['output_fields'] = array('draft_flag', 'hits', 'numemails', 'comments', 'trackbacks', 'featured', 'commentcode', 'statuscode', 'expire_date', 'postmode', 'advanced_editor_mode', 'frontpage', 'owner_id', 'group_id', 'perm_owner', 'perm_group', 'perm_members', 'perm_anon');
if (empty($args['sid']) && !empty($args['id'])) {
$args['sid'] = $args['id'];
}
if ($args['gl_svc']) {
if (isset($args['mode'])) {
$args['mode'] = COM_applyBasicFilter($args['mode']);
}
if (isset($args['sid'])) {
$args['sid'] = COM_applyBasicFilter($args['sid']);
}
if (empty($args['sid'])) {
$svc_msg['gl_feed'] = true;
} else {
$svc_msg['gl_feed'] = false;
}
} else {
$svc_msg['gl_feed'] = false;
}
if (empty($args['mode'])) {
$args['mode'] = 'view';
}
if (!$svc_msg['gl_feed']) {
$sid = $args['sid'];
$mode = $args['mode'];
$story = new Story();
$retval = $story->loadFromDatabase($sid, $mode);
if ($retval != STORY_LOADED_OK) {
$output = $retval;
return PLG_RET_ERROR;
}
reset($story->_dbFields);
while (list($fieldname, $save) = each($story->_dbFields)) {
$varname = '_' . $fieldname;
$output[$fieldname] = $story->{$varname};
}
$output['username'] = $story->_username;
$output['fullname'] = $story->_fullname;
if ($args['gl_svc']) {
if ($output['statuscode'] == STORY_ARCHIVE_ON_EXPIRE || $output['statuscode'] == STORY_DELETE_ON_EXPIRE) {
// This date format is PHP 5 only,
// but only the web-service uses the value
$output['expire_date'] = date('c', $output['expire']);
}
$output['id'] = $output['sid'];
$output['category'] = array($output['tid']);
$output['published'] = date('c', $output['date']);
$output['updated'] = date('c', $output['date']);
if (empty($output['bodytext'])) {
$output['content'] = $output['introtext'];
} else {
$output['content'] = $output['introtext'] . LB . '[page_break]' . LB . $output['bodytext'];
}
$output['content_type'] = $output['postmode'] == 'html' ? 'html' : 'text';
$owner_data = SESS_getUserDataFromId($output['owner_id']);
$output['author_name'] = $owner_data['username'];
$output['link_edit'] = $sid;
}
} else {
$output = array();
$mode = $args['mode'];
$sql = array();
if (isset($args['offset'])) {
$offset = COM_applyBasicFilter($args['offset'], true);
} else {
$offset = 0;
}
$max_items = $_CONF['atom_max_stories'] + 1;
$limit = " LIMIT {$offset}, {$max_items}";
$limit_pgsql = " LIMIT {$max_items} OFFSET {$offset}";
$order = " ORDER BY unixdate DESC";
$sql['mysql'] = "SELECT s.*, UNIX_TIMESTAMP(s.date) AS unixdate, UNIX_TIMESTAMP(s.expire) as expireunix, " . "u.username, u.fullname, u.photo, u.email, t.topic, t.imageurl " . "FROM {$_TABLES['stories']} AS s, {$_TABLES['users']} AS u, {$_TABLES['topics']} AS t " . "WHERE (s.uid = u.uid) AND (s.tid = t.tid)" . COM_getPermSQL('AND', $_USER['uid'], 2, 's') . $order . $limit;
$sql['pgsql'] = "SELECT s.*, UNIX_TIMESTAMP(s.date) AS unixdate, UNIX_TIMESTAMP(s.expire) as expireunix, u.username, u.fullname, u.photo, u.email, t.topic, t.imageurl FROM stories s, users u, topics t WHERE (s.uid = u.uid) AND (s.tid = t.tid) FROM {$_TABLES['stories']} AS s, {$_TABLES['users']} AS u, {$_TABLES['topics']} AS t WHERE (s.uid = u.uid) AND (s.tid = t.tid)" . COM_getPermSQL('AND', $_USER['uid'], 2, 's') . $order . $limit_pgsql;
$result = DB_query($sql);
$count = 0;
while (($story_array = DB_fetchArray($result, false)) !== false) {
$count += 1;
if ($count == $max_items) {
$svc_msg['offset'] = $offset + $_CONF['atom_max_stories'];
break;
}
$story = new Story();
$story->loadFromArray($story_array);
// This access check is not strictly necessary
//.........这里部分代码省略.........
开发者ID:mystralkk,项目名称:geeklog,代码行数:101,代码来源:lib-story.php
示例10: blockStory
public static function blockStory($type, $stories = [], $extra = NULL)
{
$blocks = ["recommended", "featured", "random", "new"];
if (in_array($type, $blocks)) {
while (list($key, ) = each($stories)) {
Story::dataProcess($stories[$key]);
}
\Base::instance()->set('renderData', $stories);
\Base::instance()->set('extra', $extra);
return parent::render("story/block.{$type}.html");
} else {
return NULL;
}
}
开发者ID:eFiction,项目名称:v5_1-vaporware,代码行数:14,代码来源:story.php
示例11: PLG_replaceTags
//.........这里部分代码省略.........
if (!empty($url)) {
$filelink = COM_createLink($linktext, $url);
$content = str_replace($autotag['tagstr'], $filelink, $content);
}
if ($autotag['tag'] == 'story_introtext') {
$url = '';
$linktext = '';
USES_lib_story();
if (isset($_USER['uid']) && $_USER['uid'] > 1) {
$result = DB_query("SELECT maxstories,tids,aids FROM {$_TABLES['userindex']} WHERE uid = {$_USER['uid']}");
$U = DB_fetchArray($result);
} else {
$U['maxstories'] = 0;
$U['aids'] = '';
$U['tids'] = '';
}
$sql = " (date <= NOW()) AND (draft_flag = 0)";
if (empty($topic)) {
$sql .= COM_getLangSQL('tid', 'AND', 's');
}
$sql .= COM_getPermSQL('AND', 0, 2, 's');
if (!empty($U['aids'])) {
$sql .= " AND s.uid NOT IN (" . str_replace(' ', ",", $U['aids']) . ") ";
}
if (!empty($U['tids'])) {
$sql .= " AND s.tid NOT IN ('" . str_replace(' ', "','", $U['tids']) . "') ";
}
$sql .= COM_getTopicSQL('AND', 0, 's') . ' ';
$userfields = 'u.uid, u.username, u.fullname';
$msql = "SELECT STRAIGHT_JOIN s.*, UNIX_TIMESTAMP(s.date) AS unixdate, " . 'UNIX_TIMESTAMP(s.expire) as expireunix, ' . $userfields . ", t.topic, t.imageurl " . "FROM {$_TABLES['stories']} AS s, {$_TABLES['users']} AS u, " . "{$_TABLES['topics']} AS t WHERE s.sid = '" . $autotag['parm1'] . "' AND (s.uid = u.uid) AND (s.tid = t.tid) AND" . $sql;
$result = DB_query($msql);
$nrows = DB_numRows($result);
if ($A = DB_fetchArray($result)) {
$story = new Story();
$story->loadFromArray($A);
$linktext = STORY_renderArticle($story, 'y');
}
$content = str_replace($autotag['tagstr'], $linktext, $content);
}
if ($autotag['tag'] == 'showblock') {
$blockName = COM_applyBasicFilter($autotag['parm1']);
$result = DB_query("SELECT * FROM {$_TABLES['blocks']} WHERE name = '" . DB_escapeString($blockName) . "'" . COM_getPermSQL('AND'));
if (DB_numRows($result) > 0) {
$skip = 0;
$B = DB_fetchArray($result);
$template = '';
$side = '';
$px = explode(' ', trim($autotag['parm2']));
if (is_array($px)) {
foreach ($px as $part) {
if (substr($part, 0, 9) == 'template:') {
$a = explode(':', $part);
$template = $a[1];
$skip++;
} elseif (substr($part, 0, 5) == 'side:') {
$a = explode(':', $part);
$side = $a[1];
$skip++;
break;
}
}
if ($skip != 0) {
if (count($px) > $skip) {
for ($i = 0; $i < $skip; $i++) {
array_shift($px);
}
开发者ID:spacequad,项目名称:glfusion,代码行数:67,代码来源:lib-plugins.php
示例12: Database
<?php
include 'includes/header.php';
// create DB object
$db = new Database();
$st = new Story();
$ca = new Category();
// check url for category
if (isset($_GET['category'])) {
$category = $_GET['category'];
$stories = $db->select($st->getStoryByCategory($category));
$cat = $db->select($ca->getCategoryById($category))->fetch_assoc();
} else {
$stories = $db->select($st->getAllStories());
}
$categories = $db->select($st->getStoryCategories());
?>
<div class="container">
<div class="header">
<h1 class="title">Stories</h1>
<?php
if (isset($category)) {
?>
<p class="lead description">Stories in the <?php
echo $cat['Name'];
?>
category</p>
<?php
} else {
?>
开发者ID:Owlnofeathers,项目名称:hansennorthforkranch.ajamesb.com,代码行数:31,代码来源:stories.php
示例13: mailstoryform
/**
* Display form to email a story to someone.
*
* @param string $sid ID of article to email
* @return string HTML for email story form
*
*/
function mailstoryform($sid, $to = '', $toemail = '', $from = '', $fromemail = '', $shortmsg = '', $msg = 0)
{
global $_CONF, $_TABLES, $_USER, $LANG08, $LANG_LOGIN;
require_once $_CONF['path_system'] . 'lib-story.php';
$retval = '';
if (COM_isAnonUser() && ($_CONF['loginrequired'] == 1 || $_CONF['emailstoryloginrequired'] == 1)) {
$retval = COM_startBlock($LANG_LOGIN[1], '', COM_getBlockTemplate('_msg_block', 'header'));
$login = new Template($_CONF['path_layout'] . 'submit');
$login->set_file(array('login' => 'submitloginrequired.thtml'));
$login->set_var('xhtml', XHTML);
$login->set_var('site_url', $_CONF['site_url']);
$login->set_var('site_admin_url', $_CONF['site_admin_url']);
$login->set_var('layout_url', $_CONF['layout_url']);
$login->set_var('login_message', $LANG_LOGIN[2]);
$login->set_var('lang_login', $LANG_LOGIN[3]);
$login->set_var('lang_newuser', $LANG_LOGIN[4]);
$login->parse('output', 'login');
$retval .= $login->finish($login->get_var('output'));
$retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
return $retval;
}
$story = new Story();
$result = $story->loadFromDatabase($sid, 'view');
if ($result != STORY_LOADED_OK) {
return COM_refresh($_CONF['site_url'] . '/index.php');
}
if ($msg > 0) {
$retval .= COM_showMessage($msg);
}
if (empty($from) && empty($fromemail)) {
if (!COM_isAnonUser()) {
$from = COM_getDisplayName($_USER['uid'], $_USER['username'], $_USER['fullname']);
$fromemail = DB_getItem($_TABLES['users'], 'email', "uid = {$_USER['uid']}");
}
}
$mail_template = new Template($_CONF['path_layout'] . 'profiles');
$mail_template->set_file('form', 'contactauthorform.thtml');
$mail_template->set_var('xhtml', XHTML);
$mail_template->set_var('site_url', $_CONF['site_url']);
$mail_template->set_var('site_admin_url', $_CONF['site_admin_url']);
$mail_template->set_var('layout_url', $_CONF['layout_url']);
$mail_template->set_var('start_block_mailstory2friend', COM_startBlock($LANG08[17]));
$mail_template->set_var('lang_title', $LANG08[31]);
$mail_template->set_var('story_title', $story->displayElements('title'));
$url = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $sid);
$mail_template->set_var('story_url', $url);
$link = COM_createLink($story->displayElements('title'), $url);
$mail_template->set_var('story_link', $link);
$mail_template->set_var('lang_fromname', $LANG08[20]);
$mail_template->set_var('name', $from);
$mail_template->set_var('lang_fromemailaddress', $LANG08[21]);
$mail_template->set_var('email', $fromemail);
$mail_template->set_var('lang_toname', $LANG08[18]);
$mail_template->set_var('toname', $to);
$mail_template->set_var('lang_toemailaddress', $LANG08[19]);
$mail_template->set_var('toemail', $toemail);
$mail_template->set_var('lang_cc', $LANG08[36]);
$mail_template->set_var('lang_cc_description', $LANG08[37]);
$mail_template->set_var('lang_shortmessage', $LANG08[27]);
$mail_template->set_var('shortmsg', htmlspecialchars($shortmsg));
$mail_template->set_var('lang_warning', $LANG08[22]);
$mail_template->set_var('lang_sendmessage', $LANG08[16]);
$mail_template->set_var('story_id', $sid);
$mail_template->set_var('end_block', COM_endBlock());
PLG_templateSetVars('emailstory', $mail_template);
$mail_template->parse('output', 'form');
$retval .= $mail_template->finish($mail_template->get_var('output'));
return $retval;
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:76,代码来源:profiles.php
示例14: STORY_renderArticle
if ($_CONF['showfirstasfeatured'] == 1) {
$story->_featured = 1;
}
// display first article
if ($story->DisplayElements('featured') == 1) {
$pageBody .= STORY_renderArticle($story, 'y');
$pageBody .= PLG_showCenterblock(CENTERBLOCK_AFTER_FEATURED, $page, $topic);
} else {
$pageBody .= PLG_showCenterblock(CENTERBLOCK_AFTER_FEATURED, $page, $topic);
$pageBody .= STORY_renderArticle($story, 'y');
}
$articleCounter++;
// get remaining stories
while ($A = DB_fetchArray($result)) {
$pageBody .= PLG_displayAdBlock('story', $articleCounter);
$story = new Story();
$story->loadFromArray($A);
$pageBody .= STORY_renderArticle($story, 'y');
$articleCounter++;
}
// get plugin center blocks that follow articles
$pageBody .= PLG_showCenterblock(CENTERBLOCK_BOTTOM, $page, $topic);
// bottom blocks
// Print Google-like paging navigation
if (!isset($_CONF['hide_main_page_navigation']) || $_CONF['hide_main_page_navigation'] == 0) {
if (empty($topic)) {
$base_url = $_CONF['site_url'] . '/index.php';
if ($newstories) {
$base_url .= '?display=new';
}
} else {
开发者ID:NewRoute,项目名称:glfusion,代码行数:31,代码来源:index.php
示例15: enqueue_issue_story_scripts
function enqueue_issue_story_scripts()
{
global $post;
if ($post->post_type == 'issue' && ($javascript_url = Issue::get_javascript_url($post)) !== False) {
Config::add_script($javascript_url);
} else {
if ($post->post_type == 'story' && ($javascript_url = Story::get_javascript_url($post)) !== False) {
if (($issue = get_story_issue($post)) !== False && ($issue_javascript_url = Issue::get_javascript_url($issue)) !== False) {
Config::add_script($issue_javascript_url);
}
Config::add_script($javascript_url);
}
}
}
开发者ID:rolandinsh,项目名称:Pegasus-Theme,代码行数:14,代码来源:functions.php
示例16: savestory
/**
* Saves a story submission
*
* @param array $A Data for that submission
* @return string HTML redirect
*
*/
function savestory($A)
{
global $_CONF, $_TABLES, $_USER;
$retval = '';
$story = new Story();
$story->loadSubmission();
// pseudo-formatted story text for the spam check
$result = PLG_checkforSpam($story->GetSpamCheckFormat(), $_CONF['spamx']);
if ($result > 0) {
COM_updateSpeedlimit('submit');
COM_displayMessageAndAbort($result, 'spamx', 403, 'Forbidden');
}
COM_updateSpeedlimit('submit');
$result = $story->saveSubmission();
if ($result == STORY_NO_ACCESS_TOPIC) {
// user doesn't have access to this topic - bail
$retval = COM_refresh($_CONF['site_url'] . '/index.php');
} elseif ($result == STORY_SAVED || $result == STORY_SAVED_SUBMISSION) {
if (isset($_CONF['notification']) && in_array('story', $_CONF['notification'])) {
sendNotification($_TABLES['storysubmission'], $story);
}
if ($result == STORY_SAVED) {
$retval = COM_refresh(COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $story->getSid()));
} else {
$retval = COM_refresh($_CONF['site_url'] . '/index.php?msg=2');
}
}
return $retval;
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:36,代码来源:submit.php
示例17: testGetAccessNotSet
public function testGetAccessNotSet()
{
$st = new Story();
$this->assertNull($st->getAccess());
}
开发者ID:mystralkk,项目名称:geeklog,代码行数:5,代码来源:storyClassTest.php
示例18: COM_applyFilter
}
if (isset($_GET['cpage'])) {
$page = COM_applyFilter($_GET['cpage'], true);
}
}
if (empty($sid)) {
echo COM_refresh($_CONF['site_url'] . '/index.php');
exit;
}
if (strcasecmp($order, 'ASC') != 0 && strcasecmp($order, 'DESC') != 0) {
$order = '';
}
$result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['stories']} WHERE sid = '{$sid}'" . COM_getPermSql('AND'));
$A = DB_fetchArray($result);
if ($A['count'] > 0) {
$story = new Story();
$args = array('sid' => $sid, 'mode' => 'view');
$output = STORY_LOADED_OK;
$result = PLG_invokeService('story', 'get', $args, $output, $svc_msg);
if ($result == PLG_RET_OK) {
/* loadFromArray cannot be used, since it overwrites the timestamp */
reset($story->_dbFields);
while (list($fieldname, $save) = each($story->_dbFields)) {
$varname = '_' . $fieldname;
if (array_key_exists($fieldname, $output)) {
$story->{$varname} = $output[$fieldname];
}
}
$story->_username = $output['username'];
$story->_fullname = $output['fullname'];
}
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:31,代码来源:article.php
示例19: _createMailStory
function _createMailStory($sid)
{
global $_CONF, $_TABLES, $LANG_DIRECTION, $LANG01, $LANG08;
USES_lib_story();
$story = new Story();
$args = array('sid' => $sid, 'mode' => 'view');
$output = STORY_LOADED_OK;
$result = PLG_invokeService('story', 'get', $args, $output, $svc_msg);
if ($result == PLG_RET_OK) {
/* loadFromArray cannot be used, since it overwrites the timestamp */
reset($story->_dbFields);
while (list($fieldname, $save) = each($story->_dbFields)) {
$varname = '_' . $fieldname;
if (array_key_exists($fieldname, $output)) {
$story->{$varname} = $output[$fieldname];
}
}
$story->_username = $output['username'];
$story->_fullname = $output['fullname'];
}
if ($output == STORY_PERMISSION_DENIED) {
$display = COM_siteHeader('menu', $LANG_ACCESS['accessdenied']) . COM_showMessageText($LANG_ACCESS['storydenialmsg'], $LANG_ACCESS['accessdenied'], true, 'error') . COM_siteFooter();
echo $display;
exit;
} elseif ($output == STORY_INVALID_SID) {
COM_404();
} else {
$T = new Template($_CONF['path_layout'] . 'article');
$T->set_file('article', 'mailable.thtml');
list($cacheFile, $style_cache_url) = COM_getStyleCacheLocation();
$T->set_var('direction', $LANG_DIRECTION);
$T->set_var('css_url', $style_cache_url);
$T->set_var('page_title', $_CONF['site_name'] . ': ' . $story->displayElements('title'));
$T->set_var('story_title', $story->DisplayElements('title'));
$T->set_var('story_subtitle', $story->DisplayElements('subtitle'));
$story_image = $story->DisplayElements('story_image');
if ($story_image != '') {
$T->set_var('story_image', $story_image);
} else {
$T->unset_var('story_image');
}
if ($_CONF['hidestorydate'] != 1) {
$T->set_var('story_date', $story->displayElements('date'));
}
if ($_CONF['contributedbyline'] == 1) {
$T->set_var('lang_contributedby', $LANG01[1]);
$authorname = COM_getDisplayName($story->displayElements('uid'));
$T->set_var('author', $authorname);
$T->set_var('story_author', $authorname);
$T->set_var('story_author_username', $story->DisplayElements('username'));
}
$T->set_var('story_introtext', $story->DisplayElements('introtext'));
$T->set_var('story_bodytext', $story->DisplayElements('bodytext'));
$T->set_var('site_name', $_CONF['site_name']);
$T->set_var('site_slogan', $_CONF['site_slogan']);
$T->set_var('story_id', $story->getSid());
$articleUrl = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $story->getSid());
if ($story->DisplayElements('commentcode') >= 0) {
$commentsUrl = $articleUrl . '#comments';
$comments = $story->DisplayElements('comments');
$numComments = COM_numberFormat($comments);
$T->set_var('story_comments', $numComments);
$T->set_var('comments_url', $commentsUrl);
$T->set_var('comments_text', $numComments . ' ' . $LANG01[3]);
$T->set_var('comments_count', $numComments);
$T->set_var('lang_comments', $LANG01[3]);
$comments_with_count = sprintf($LANG01[121], $numComments);
if ($comments > 0) {
$comments_with_count = COM_createLink($comments_with_count, $commentsUrl);
}
$T->set_var('comments_with_count', $comments_with_count);
}
$T->set_var('lang_full_article', $LANG08[33]);
$T->set_var('article_url', $articleUrl);
COM_setLangIdAndAttribute($T);
$T->parse('output', 'article');
$htmlMsg = $T->finish($T->get_var('output'));
return $htmlMsg;
}
}
开发者ID:spacequad,项目名称:glfusion,代码行数:80,代码来源:profiles.php
示例20: COM_404
}
}
if (empty($sid)) {
COM_404();
}
if (strcasecmp($order, 'ASC') != 0 && strcasecmp($order, 'DESC') != 0) {
$order = '';
}
$result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['stories']} WHERE sid = '" . DB_escapeString($sid) . "'" . COM_getPermSql('AND'));
$A = DB_fetchArray($result);
if ($A['count'] > 0) {
$ratedIds = array();
if ($_CONF['rating_enabled'] != 0) {
$ratedIds = RATING_getRatedIds('article');
}
$story = new Story();
$args = array('sid' => $sid, 'mode' => 'view');
$output = STORY_LOADED_OK;
$result = PLG_invokeService('story', 'get', $args, $output, $svc_msg);
if ($result == PLG_RET_OK) {
/* loadFromArray cannot be used, since it overwrites the timestamp */
reset($story->_dbFields);
while (list($fieldname, $save) = each($story->_dbFields)) {
$varname = '_' . $fieldname;
if (array_key_exists($fieldname, $output)) {
$story->{$varname} = $output[$fieldname];
}
}
$story->_username = $output['username'];
$story->_fullname = $output['fullname'];
}
开发者ID:NewRoute,项目名称:glfusion,代码行数:31,代码来源:article.php
注:本文中的Story类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论