本文整理匯總了PHP中News::getDate方法的典型用法代碼示例。如果您正苦於以下問題:PHP News::getDate方法的具體用法?PHP News::getDate怎麽用?PHP News::getDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類News
的用法示例。
在下文中一共展示了News::getDate方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getOne
public function getOne($id)
{
$sql = '
SELECT {{tree}}.*, {{sort}}.countComments, {{sort}}.popularity FROM {{tree}}
LEFT JOIN {{sort}} ON {{tree}}.id={{sort}}.tree
WHERE {{tree}}.id=' . $id . '
';
$data = DB::getRow($sql);
$fields = Fields::getFieldsByTree($id, 'wide');
$data['preview'] = $fields['preview'];
$data['pic'] = $fields['files_gal']['image'][0]['path'];
$data['source'] = $fields['source'];
$data['link'] = $fields['link'];
$data['tags'] = News::getTags($id, $data['parent']);
$data['path'] = Tree::getPathToTree($id);
$data['date'] = News::getDate($data['udate']);
$data['type'] = 'news';
if ($data['countComments'] == '') {
$data['countComments'] = 0;
$sql = 'INSERT INTO {{sort}} SET tree=' . $id;
DB::exec($sql);
}
$sql = '
SELECT {{tree}}.* FROM {{data}}
INNER JOIN {{tree}} ON {{tree}}.id={{data}}.value_text
WHERE {{data}}.tree=' . $id . ' AND {{data}}.path=\'author\'
';
$author = DB::getRow($sql);
$author['path'] = '/persons/' . $author['path'] . '/';
$data['author'] = $author;
return $data;
}
示例2: testCreateNews
public function testCreateNews()
{
// Arrange
$a = new News('a', 'b', 123, 'http://abc.com', '2011-09-23T13:24:09.000Z');
// Assert
$this->assertEquals('a', $a->getTitle());
$this->assertEquals('b', $a->getAuthor());
$this->assertEquals(123, $a->getPoints());
$this->assertEquals('http://abc.com', $a->getLink());
$this->assertEquals('2011-09-23T13:24:09.000Z', $a->getDate());
}
示例3: getAssociation
private function getAssociation(P2000 $p2000, News $news)
{
$p2000id = $p2000->getId();
$newsid = $news->getId();
$leftLabels = array();
$rightLabels = array();
if (strtolower($p2000->getLocation()) !== strtolower($news->getLocation())) {
return false;
}
foreach ($p2000->getLabels() as $pLabel) {
$date = null;
$match = false;
foreach ($news->getLabels() as $nLabel) {
if (strtolower($nLabel) === "overig") {
continue;
}
if (Util::labelsMatch($pLabel, $nLabel)) {
if (!$match) {
$match = true;
}
if (!in_array($pLabel, $leftLabels, true)) {
array_push($leftLabels, $pLabel);
}
if (!in_array($nLabel, $rightLabels, true)) {
array_push($rightLabels, $nLabel);
}
}
}
if ($match) {
$p2000date = $p2000->getDate()->format('d-m-Y');
$newsDate = $news->getDate()->format('d-m-Y');
if ($p2000date === $newsDate && !in_array($p2000date, $leftLabels, true)) {
array_push($leftLabels, $p2000->getDate()->format('d-m-Y'));
$date = $p2000->getDate();
}
}
}
if (count($leftLabels) < 1) {
return false;
}
return new AssocRule($p2000id, $newsid, $leftLabels, $rightLabels, $date);
}
示例4:
<a title="<?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'View the latest post');
?>
" href="<?php
echo IPB::getLink($topic->tid, $topic->title);
?>
" target="_blank">
<?php
echo $topic->title;
?>
</a>
</div>
<div class="date">
<?php
echo News::getDate(date('d M Y -.H:i', $topic->last_post));
?>
</div>
<div class="last-poster">
<span class="author">
<?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Author');
?>
:
</span>
<span class="r-author">
<?php
echo $topic->last_poster_name;
?>
示例5: time
</td>
<td align="center"><?php
echo $charEntity->{$gReset};
?>
</td>
<td align="center"><?php
echo $model->getCGuild($item->mainChar->GameIDC);
?>
</td>
<td align="center"><?php
echo $model->getGLogo($model->getCGuild($item->mainChar->GameIDC), 16);
?>
</td>
<td align="center"><?php
echo $this->getMap($charEntity->MapNumber);
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<div class="upd-time">
<?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Last updated') . ': ' . News::getDate(date("d M Y -.H:i", time()));
?>
</div>
示例6: array
echo $this->createUrl('cp/article', array('id' => $data->id));
?>
">
<?php
echo $data->title;
?>
</a>
</h3>
<div class="by-line">
<span class="news-author"><?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Author') . ': ' . $data->author;
?>
</span>
<span class="spacer"></span>
<?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Date') . ': ' . News::getDate(date('d M Y -.H:i', $data->date));
?>
</div>
<?php
if ($data->img != '') {
?>
<div class="article-left" style="background-image: url(<?php
echo $data->img;
?>
);">
<span class="thumb-frame"></span>
</div>
<?php
}
?>
示例7:
images/stock_person.png" alt="user"/></a>
<div class="messageArea">
<span class="aro"></span>
<div class="infoRow">
<span class="name"><strong><?php
echo $model->memb___id;
?>
</strong> (<?php
echo $model->character;
?>
) <?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'says');
?>
:</span>
<span class="time"><?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Sent') . ': ' . News::getDate(date("d M Y -.H:i:s", $model->date));
?>
</span>
<div class="clear"></div>
</div>
<?php
echo $model->description;
?>
</div>
<div class="clear"></div>
</li>
示例8:
</li>
<li>
<div class="enty">
<?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Status');
?>
:
</div>
<div class="val">
<?php
echo FAI_TICKETS::getPriority($model->priority, 'word');
?>
</div>
</li>
<li>
<div class="enty">
<?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Date');
?>
:
</div>
<div class="val">
<?php
echo News::getDate(date("d M Y -.H:i:s", $model->date));
?>
</div>
</li>
</ul>
</div>
示例9:
<div class="news">
<div class="news-head">
<div class="news_icon"></div>
<div class="newstitle">
<h3><?php
echo $data->title;
?>
</h3>
<div class="newstime">
<?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Wrote') . ': ' . $data->author . ' / ' . News::getDate(date('d.m.Y', $data->date));
?>
</div>
</div>
<div class="clear"></div>
</div>
<div class="n-content">
<?php
if ($data->img != '') {
?>
<img class="n-image" width="152" height="152" src="<?php
echo $data->img;
?>
" alt="<?php
echo $data->title;
?>
"/>
<?php
}
?>
示例10: news_text
/**
* generate textual representation for a news
*
* @param News $news
* @param String $generator_model
* @param Array $pks
* @param BaseObject $generator
* @param Array $options
* context - 0: box, 1: news per politico, 2:pagina di un atto, 3: argomento
* in_mail - if the news lives in a mail or not
* @return string (html)
* @author Guglielmo Celata
*/
function news_text(News $news, $generator_model, $pks, $generator, $options = array())
{
sfLoader::loadHelpers('Asset');
// default value for context
if (!array_key_exists('context', $options)) {
$context = CONTEXT_LIST;
} else {
$context = $options['context'];
}
// default value for in_mail
if (!array_key_exists('in_mail', $options)) {
$in_mail = false;
} else {
$in_mail = $options['in_mail'];
}
$news_string = "";
// notizie di gruppo (votazioni, interventi o emendamenti)
if (count($pks) == 0) {
if ($generator_model == 'OppVotazioneHasAtto') {
if ($news->getPriority() == 1) {
$news_string .= content_tag('p', $news->getRamoVotazione() == 'C' ? 'Camera - ' : 'Senato - ');
$news_string .= content_tag('p', 'si è svolta almeno una VOTAZIONE');
} else {
$news_string .= "<p>";
$news_string .= $news->getRamoVotazione() == 'C' ? 'Camera - ' : 'Senato - ';
$news_string .= 'si è svolta una VOTAZIONE</p>';
if ($context == CONTEXT_LIST) {
$atto = call_user_func_array(array($news->getRelatedMonitorableModel() . 'Peer', 'retrieveByPK'), $news->getRelatedMonitorableId());
$atto_link = link_to_in_mail($atto->getRamo() . '.' . $atto->getNumfase() . ' ' . $atto->getTitolo(true), 'atto/index?id=' . $atto->getId(), array('title' => $atto->getTitolo(true)));
$news_string .= 'per ' . OppTipoAttoPeer::retrieveByPK($news->getTipoAttoId())->getDenominazione() . ' ';
$news_string .= '<p>' . $atto_link . '</p>';
}
}
}
if ($generator_model == 'OppIntervento') {
$news_string .= "<p>";
$news_string .= OppSedePeer::retrieveByPK($news->getSedeInterventoId())->getRamo() == 'C' ? 'Camera - ' : 'Senato - ';
$news_string .= 'C\'è stato <strong>almeno un intervento</strong> in ';
if (OppSedePeer::retrieveByPK($news->getSedeInterventoId())->getTipologia() != 'Assemblea') {
$news_string .= OppSedePeer::retrieveByPK($news->getSedeInterventoId())->getTipologia();
}
$news_string .= ' ' . OppSedePeer::retrieveByPK($news->getSedeInterventoId())->getDenominazione();
if ($context = CONTEXT_LIST) {
$news_string .= ' per ' . OppTipoAttoPeer::retrieveByPK($news->getTipoAttoId())->getDescrizione() . '</p> ';
// link all'atto
$atto = call_user_func_array(array($news->getRelatedMonitorableModel() . 'Peer', 'retrieveByPK'), array($news->getRelatedMonitorableId()));
$atto_link = link_to_in_mail($atto->getRamo() . '.' . $atto->getNumfase() . ' ' . $atto->getTitolo(true), 'atto/index?id=' . $atto->getId(), array('title' => $atto->getTitolo(true)));
$news_string .= '<p>' . $atto_link . '</p>';
} else {
$news_string .= '</p>';
}
}
if ($generator_model == 'OppEmendamento') {
$related_monitorable_model = $news->getRelatedMonitorableModel();
if ($related_monitorable_model == 'OppAtto') {
$atto = OppAttoPeer::retrieveByPK($news->getRelatedMonitorableId());
$n_pres = $atto->countPresentedEmendamentiAtDate($news->getDate());
if ($n_pres > 1) {
$news_string .= content_tag('p', sprintf("Sono stati presentati %s", link_to($n_pres . " emendamenti", '/emendamenti_atto/' . $atto->getId())));
} else {
$news_string .= content_tag('p', sprintf("È stato presentato %s", link_to("un emendamento", '/emendamenti_atto/' . $atto->getId())));
}
} else {
if ($related_monitorable_model == 'OppPolitico') {
// fetch del politico
$politico = OppPoliticoPeer::retrieveByPK($news->getRelatedMonitorableId());
$n_signs = $politico->countSignedEmendamentiAtDate($news->getDate());
if ($n_signs > 1) {
$news_string .= content_tag('p', "Ha firmato <b>{$n_signs}</b> emendamenti");
} else {
$news_string .= content_tag('p', "Ha firmato un emendamento");
}
}
}
}
return $news_string;
}
// eccezione per firma, quando in pagina argomenti
// corregge bug #307
if ($context == CONTEXT_TAG && $generator_model == 'OppCaricaHasAtto') {
$atto = $generator->getOppAtto();
$carica = $generator->getOppCarica();
$tipo = $atto->getOppTipoAtto();
$tipo_firma = $generator->getTipo();
switch ($tipo_firma) {
case "P":
$tipo_firma = 'presenta';
//.........這裏部分代碼省略.........
示例11: array
<tr>
<td align="center">
<?php
echo $data->id;
?>
</td>
<td>
<?php
echo $data->title;
?>
</td>
<td>
<?php
echo News::getDate(date('d M Y -.H:s:i', $data->date));
?>
</td>
<td align="center">
<?php
if ($data->onmpage == 1) {
?>
<?php
$form = $this->beginWidget('CActiveForm', array('id' => 'category-form', 'action' => '' . Yii::app()->controller->id . '/mpage/' . $data->id . '', 'enableAjaxValidation' => false));
?>
<button class="status-btn" type="submit"><img src="<?php
echo $this->getTemplate('backend');
?>
images/accept.png" alt="<?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Active');