本文整理汇总了PHP中PMF_Date类的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Date类的具体用法?PHP PMF_Date怎么用?PHP PMF_Date使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PMF_Date类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildSitemapNode
function buildSitemapNode($location, $lastmod = null, $changeFreq = null, $priority = null)
{
if (!isset($lastmod)) {
$lastmod = PMF_Date::createISO8601Date($_SERVER['REQUEST_TIME'], false);
}
if (!isset($changeFreq)) {
$changeFreq = PMF_SITEMAP_GOOGLE_CHANGEFREQ_DAILY;
}
$node = '<url>' . '<loc>' . PMF_String::htmlspecialchars($location) . '</loc>' . '<lastmod>' . $lastmod . '</lastmod>' . '<changefreq>' . $changeFreq . '</changefreq>' . (isset($priority) ? '<priority>' . $priority . '</priority>' : '') . '</url>';
return $node;
}
示例2: getReportingData
/**
* Generates a huge array for the report
* @return array
*/
public function getReportingData()
{
$report = [];
$query = sprintf("\n SELECT\n fd.id AS id,\n fd.lang AS lang,\n fcr.category_id AS category_id,\n c.name as category_name,\n c.parent_id as parent_id,\n fd.sticky AS sticky,\n fd.thema AS question,\n fd.author AS original_author,\n fd.datum AS creation_date,\n fv.visits AS visits,\n u.display_name AS last_author\n FROM\n %sfaqdata fd\n LEFT JOIN\n %sfaqcategoryrelations fcr\n ON\n (fd.id = fcr.record_id AND fd.lang = fcr.record_lang)\n LEFT JOIN\n %sfaqvisits fv\n ON\n (fd.id = fv.id AND fd.lang = fv.lang)\n LEFT JOIN\n %sfaqchanges as fc\n ON\n (fd.id = fc.id AND fd.lang = fc.lang)\n LEFT JOIN\n %sfaquserdata as u\n ON\n (u.user_id = fc.usr)\n LEFT JOIN\n %sfaqcategories as c\n ON\n (c.id = fcr.category_id AND c.lang = fcr.record_lang)\n ORDER BY\n fd.id\n ASC", PMF_Db::getTablePrefix(), PMF_Db::getTablePrefix(), PMF_Db::getTablePrefix(), PMF_Db::getTablePrefix(), PMF_Db::getTablePrefix(), PMF_Db::getTablePrefix());
$result = $this->_config->getDb()->query($query);
$lastId = 0;
while ($row = $this->_config->getDb()->fetchObject($result)) {
if ($row->id == $lastId) {
$report[$row->id]['faq_translations'] += 1;
} else {
$report[$row->id] = array('faq_id' => $row->id, 'faq_language' => $row->lang, 'category_id' => $row->category_id, 'category_parent' => $row->parent_id, 'category_name' => $row->category_name, 'faq_translations' => 0, 'faq_sticky' => $row->sticky, 'faq_question' => $row->question, 'faq_org_author' => $row->original_author, 'faq_creation' => PMF_Date::createIsoDate($row->creation_date), 'faq_visits' => $row->visits, 'faq_last_author' => $row->last_author);
}
$lastId = $row->id;
}
return $report;
}
示例3: renderOpenQuestions
/**
* Renders the open questions table
*
* @param array $questions Array of open questions
*/
public function renderOpenQuestions(array $questions)
{
global $PMF_LANG, $sids;
$html = '';
if (count($questions)) {
foreach ($questions as $question) {
if ($question->is_visible == 'N') {
continue;
}
$html .= '<tr class="openquestions">';
$html .= sprintf('<td valign="top" nowrap="nowrap">%s<br /><a href="mailto:%s">%s</a></td>', PMF_Date::createIsoDate($question->date), PMF_Mail::safeEmail($question->email), $question->username);
$html .= sprintf('<td valign="top"><strong>%s:</strong><br />%s</td>', $this->categoryLayout->renderBreadcrumb(array($question->category_id)), strip_tags($question->question));
$html .= sprintf('<td valign="top"><a href="?%saction=add&question=%d&cat=%d">%s</a></td>', $sids, $question->id, $question->category_id, $PMF_LANG['msg2answer']);
$html .= '</tr>';
}
} else {
$output = sprintf('<tr><td colspan="3">%s</td></tr>', $PMF_LANG['msgNoQuestionsAvailable']);
}
return $html;
}
示例4: foreach
</p>
<p>
<label><?php
print $PMF_LANG["ad_stat_browse"];
?>
:</label>
<select name="day" size="1">
<?php
foreach ($trackingDates as $trackingDate) {
printf('<option value="%d"', $trackingDate);
if (date("Y-m-d", $trackingDate) == strftime('%Y-%m-%d', $_SERVER['REQUEST_TIME'])) {
print ' selected="selected"';
}
print '>';
print PMF_Date::format(date('Y-m-d H:i', $trackingDate));
print "</option>\n";
}
?>
</select>
</p>
<p>
<input class="submit" type="submit" name="statbrowse" value="<?php
print $PMF_LANG["ad_stat_ok"];
?>
" />
</p>
</fieldset>
</form>
示例5: PMF_Category
<h2 class="page-header">
<i class="fa fa-pencil"></i> <?php
echo $PMF_LANG['msgOpenQuestions'];
?>
</h2>
</div>
</header>
<div class="row">
<div class="col-lg-12">
<?php
if ($user->perm->checkRight($user->getUserId(), 'delquestion')) {
$category = new PMF_Category($faqConfig, [], false);
$category->setUser($currentAdminUser);
$category->setGroups($currentAdminGroups);
$date = new PMF_Date($faqConfig);
$questionId = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$toggle = PMF_Filter::filterInput(INPUT_GET, 'is_visible', FILTER_SANITIZE_STRING);
if ($toggle == 'toggle') {
$is_visible = $faq->getVisibilityOfQuestion($questionId);
if (!is_null($is_visible)) {
$faq->setVisibilityOfQuestion($questionId, $is_visible == 'N' ? 'Y' : 'N');
}
}
echo '<div id="returnMessage"></div>';
$openquestions = $faq->getAllOpenQuestions();
if (count($openquestions) > 0) {
?>
<form id="questionSelection" name="questionSelection" method="post" accept-charset="utf-8">
<table class="table table-striped">
<thead>
示例6: html_entity_decode
?>
</h2>
<h3><strong><em><?php
print $categorylist;
?>
</em>
<?php
print $question;
?>
</strong></h3>
<?php
print html_entity_decode($content);
?>
<p class="little"><?php
print $PMF_LANG["msgLastUpdateArticle"] . PMF_Date::createIsoDate(date("YmdHis"));
?>
<br />
<?php
print $PMF_LANG["msgAuthor"] . ' ' . $author;
?>
</p>
<form action="?action=editpreview" method="post">
<input type="hidden" name="id" value="<?php
print $record_id;
?>
" />
<input type="hidden" name="thema" value="<?php
print $question;
?>
示例7: foreach
?>
?</th>
<th><?php
print $PMF_LANG['ad_gen_delete'];
?>
?</th>
</tr>
</thead>
<tbody>
<?php
foreach ($openquestions as $question) {
?>
<tr>
<td>
<?php
print PMF_Date::format(PMF_Date::createIsoDate($question['created']));
?>
<br />
<a href="mailto:<?php
print $question['email'];
?>
">
<?php
print $question['username'];
?>
</a>
</td>
<td>
<?php
print $category->categoryName[$question['category_id']]['name'];
?>
示例8: getNewsEntry
/**
* Fetches a news entry identified by its ID
*
* @param integer $id ID of news
* @param boolean $admin Is admin
*
* @return array
*/
function getNewsEntry($id, $admin = false)
{
$news = array();
$query = sprintf("SELECT\n *\n FROM\n %sfaqnews\n WHERE\n id = %d\n AND\n lang = '%s'", SQLPREFIX, $id, $this->language);
$result = $this->db->query($query);
if ($this->db->numRows($result) > 0) {
if ($row = $this->db->fetchObject($result)) {
$content = $row->artikel;
$active = 'y' == $row->active;
$allowComments = 'y' == $row->comment;
$expired = date('YmdHis') > $row->date_end;
if (!$admin) {
if (!$active) {
$content = $this->pmf_lang['err_inactiveNews'];
}
if ($expired) {
$content = $this->pmf_lang['err_expiredNews'];
}
}
$news = array('id' => $row->id, 'lang' => $row->lang, 'date' => PMF_Date::createIsoDate($row->datum), 'header' => $row->header, 'content' => $content, 'authorName' => $row->author_name, 'authorEmail' => $row->author_email, 'dateStart' => $row->date_start, 'dateEnd' => $row->date_end, 'active' => $active, 'allowComments' => $allowComments, 'link' => $row->link, 'linkTitle' => $row->linktitel, 'target' => $row->target);
}
}
return $news;
}
示例9: generate
/**
* Generates the export
*
* @param integer $categoryId Category Id
* @param boolean $downwards If true, downwards, otherwise upward ordering
* @param string $language Language
*
* @return string
*/
public function generate($categoryId = 0, $downwards = true, $language = '')
{
global $PMF_LANG;
// Set PDF options
$this->pdf->enableBookmarks = true;
$this->pdf->isFullExport = true;
$filename = 'FAQs.pdf';
// Initialize categories
$this->category->transform($categoryId);
$this->pdf->setCategory($categoryId);
$this->pdf->setCategories($this->category->categoryName);
$this->pdf->SetCreator($this->_config->get('main.titleFAQ') . ' - powered by phpMyFAQ ' . $this->_config->get('main.currentVersion'));
$faqdata = $this->faq->get(FAQ_QUERY_TYPE_EXPORT_XML, $categoryId, $downwards, $language);
$categories = $this->category->catTree;
$categoryGroup = 0;
$this->pdf->AddPage();
foreach ($categories as $category) {
if ($category['id'] !== $categoryGroup) {
$this->pdf->Bookmark(html_entity_decode($this->category->categoryName[$category['id']]['name'], ENT_QUOTES, 'utf-8'), $category['level'], 0);
$categoryGroup = $category['id'];
}
foreach ($faqdata as $faq) {
if ($faq['category_id'] === $category['id']) {
$this->pdf->AddPage();
$this->pdf->setCategory($category['id']);
$this->pdf->Bookmark(html_entity_decode($faq['topic'], ENT_QUOTES, 'utf-8'), $category['level'] + 1, 0);
if ($this->tags instanceof PMF_Tags) {
$tags = $this->tags->getAllTagsById($faq['id']);
}
$this->pdf->WriteHTML('<h2 align="center">' . $faq['topic'] . '</h2>', true);
$this->pdf->Ln(10);
$this->pdf->SetFont($this->pdf->getCurrentFont(), '', 12);
$this->pdf->WriteHTML(trim($faq['content']));
$this->pdf->Ln(10);
if (!empty($faq['keywords'])) {
$this->pdf->Ln();
$this->pdf->Write(5, $PMF_LANG['msgNewContentKeywords'] . ' ' . $faq['keywords']);
}
if (isset($tags) && 0 !== count($tags)) {
$this->pdf->Ln();
$this->pdf->Write(5, $PMF_LANG['ad_entry_tags'] . ': ' . implode(', ', $tags));
}
$this->pdf->Ln();
$this->pdf->Ln();
$this->pdf->Write(5, $PMF_LANG['msgLastUpdateArticle'] . PMF_Date::createIsoDate($faq['lastmodified']));
}
}
}
// remove default header/footer
$this->pdf->setPrintHeader(false);
$this->pdf->addFaqToc();
return $this->pdf->Output($filename);
}
示例10: foreach
<?php
print $PMF_LANG['ad_entry_changelog_history'];
?>
</a>
</legend>
<div id="editChangelogHistory" style="display: none;">
<?php
$changeEntries = $faq->getChangeEntries($faqData['id']);
foreach ($changeEntries as $entry) {
$user->getUserById($entry['user']);
?>
<p style="font-size: 10px;">
<label>
<?php
printf('%s 1.%d<br/>%s<br/>%s: %s', $PMF_LANG['ad_entry_revision'], $entry['revision_id'], PMF_Date::format(date('Y-m-d H:i', $entry['date'])), $PMF_LANG['ad_entry_author'], $user->getUserData('display_name'));
?>
</label>
<?php
print $entry['changelog'];
?>
</p>
<?php
}
?>
</div>
</fieldset>
</form>
<script type="text/javascript">
示例11: html_entity_decode
$rss->writeElement('description', html_entity_decode($faqConfig->get('main.metaDescription')));
$rss->writeElement('link', $faqConfig->get('main.referenceURL'));
$rss->startElementNS('atom', 'link', 'http://www.w3.org/2005/Atom');
$rss->writeAttribute('rel', 'self');
$rss->writeAttribute('type', 'application/rss+xml');
$rss->writeAttribute('href', $faqConfig->get('main.referenceURL') . 'feed/openquestions/rss.php');
$rss->endElement();
if ($num > 0) {
$counter = 0;
foreach ($rssData as $item) {
if ($counter < PMF_RSS_OPENQUESTIONS_MAX) {
$counter++;
$rss->startElement('item');
$rss->writeElement('title', PMF_Utils::makeShorterText(html_entity_decode($item['question'], ENT_COMPAT, 'UTF-8'), 8) . " (" . $item['username'] . ")");
$rss->startElement('description');
$rss->writeCdata($item['question']);
$rss->endElement();
$rss->writeElement('link', (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/openquestions/rss.php", "index.php", $_SERVER['SCRIPT_NAME']) . "?action=open#openq_" . $item['id']);
$rss->writeElement('guid', (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/openquestions/rss.php", "index.php", $_SERVER['SCRIPT_NAME']) . "?action=open#openq_" . $item['id']);
$rss->writeElement('pubDate', PMF_Date::createRFC822Date($item['created'], true));
$rss->endElement();
}
}
}
$rss->endElement();
$rss->endElement();
$rssData = $rss->outputMemory();
$headers = array('Content-Type: application/rss+xml', 'Content-Length: ' . strlen($rssData));
$http = new PMF_Helper_Http();
$http->sendWithHeaders($rssData, $headers);
$faqConfig->getDb()->close();
示例12: str_replace
print str_replace("\"", "´", $record['title']);
?>
'">
<?php
print $record['title'];
?>
</a>
<?php
if (isset($numCommentsByFaq[$record['id']])) {
printf('<br/>(<a href="?action=comments#record_id_%d">%d %s</a>)', $record['id'], $numCommentsByFaq[$record['id']], $PMF_LANG['ad_start_comments']);
}
?>
</td>
<td style="width: 48px;">
<?php
print PMF_Date::format($record['date']);
?>
</td>
<td style="width: 96px;">
<?php
print $linkverifier->getEntryStateHTML($record['id'], $record['lang']);
?>
</td>
<td style="width: 16px;">
<a href="javascript:void(0);"
onclick="javascript:deleteRecord(<?php
print $record['id'];
?>
, '<?php
print $record['lang'];
?>
示例13: html_entity_decode
$rss->setIndent(true);
$rss->startDocument('1.0', 'utf-8');
$rss->startElement('rss');
$rss->writeAttribute('version', '2.0');
$rss->startElement('channel');
$rss->writeElement('title', $faqconfig->get('main.titleFAQ') . ' - ' . $PMF_LANG['msgOpenQuestions']);
$rss->writeElement('description', html_entity_decode($faqconfig->get('main.metaDescription')));
$rss->writeElement('link', PMF_Link::getSystemUri('/feed/openquestions/rss.php'));
if ($num > 0) {
$counter = 0;
foreach ($rssData as $item) {
if ($counter < PMF_RSS_OPENQUESTIONS_MAX) {
$counter++;
$rss->startElement('item');
$rss->writeElement('title', PMF_Utils::makeShorterText(html_entity_decode($item->question), 8) . " (" . $item->username . ")");
$rss->startElement('description');
$rss->writeCdata($item->question);
$rss->endElement();
$rss->writeElement('link', (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/openquestions/rss.php", "index.php", $_SERVER["PHP_SELF"]) . "?action=open#openq_" . $item->id);
$rss->writeElement('pubDate', PMF_Date::createRFC822Date($item->date, true));
$rss->endElement();
}
}
}
$rss->endElement();
$rss->endElement();
$rssData = $rss->outputMemory();
header('Content-Type: application/rss+xml');
header('Content-Length: ' . strlen($rssData));
print $rssData;
$db->dbclose();
示例14: foreach
?>
?</th>
<th><?php
print $PMF_LANG['ad_gen_delete'];
?>
?</th>
</tr>
</thead>
<tbody>
<?php
foreach ($openQuestions as $question) {
?>
<tr>
<td>
<?php
print PMF_Date::createIsoDate($question->date);
?>
<br />
<a href="mailto:<?php
print $question->email;
?>
"><?php
print $question->username;
?>
</a>
</td>
<td>
<?php
print $categoryLayout->renderBreadcrumb($categoryData->getPath($question->category_id));
?>
:<br />
示例15: while
while (list($dummy, $dummy, $dummy, $dummy, $dummy, $dummy, $dummy, $tstamp) = fgetcsv($fp, 1024, ";")) {
$stamp = $tstamp;
}
fclose($fp);
if (empty($stamp)) {
$stamp = $_SERVER['REQUEST_TIME'];
}
print date("d.m.Y H:i:s", $stamp) . '<br />';
} else {
print $PMF_LANG["ad_sess_noentry"] . '<br />';
}
$dir = opendir(PMF_ROOT_DIR . "/data");
$trackingDates = array();
while (false !== ($dat = readdir($dir))) {
if ($dat != "." && $dat != ".." && strlen($dat) == 16 && !is_dir($dat)) {
$trackingDates[] = PMF_Date::getTrackingFileDate($dat);
}
}
closedir($dir);
sort($trackingDates);
?>
<label class="left"><?php
print $PMF_LANG["ad_stat_browse"];
?>
:</label>
<select name="day" size="1">
<?php
foreach ($trackingDates as $trackingDate) {
printf('<option value="%d"', $trackingDate);
if (date("Y-m-d", $trackingDate) == strftime('%Y-%m-%d', $_SERVER['REQUEST_TIME'])) {
print ' selected="selected"';