当前位置: 首页>>代码示例>>PHP>>正文


PHP PMF_Date::createIsoDate方法代码示例

本文整理汇总了PHP中PMF_Date::createIsoDate方法的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Date::createIsoDate方法的具体用法?PHP PMF_Date::createIsoDate怎么用?PHP PMF_Date::createIsoDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMF_Date的用法示例。


在下文中一共展示了PMF_Date::createIsoDate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildSitemapNode

function buildSitemapNode($location, $lastmod = null, $changeFreq = null, $priority = null)
{
    if (!isset($lastmod)) {
        $lastmod = PMF_Date::createIsoDate($_SERVER['REQUEST_TIME'], DATE_W3C, 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;
}
开发者ID:maggiofrancesco,项目名称:phpMyFAQ,代码行数:11,代码来源:sitemap.xml.php

示例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;
 }
开发者ID:maggiofrancesco,项目名称:phpMyFAQ,代码行数:20,代码来源:Report.php

示例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&amp;question=%d&amp;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;
 }
开发者ID:nosch,项目名称:phpMyFAQ,代码行数:25,代码来源:Layout.php

示例4: foreach

    $newsHeader = $news->getNewsHeader();
    foreach ($newsHeader as $key => $newsItem) {
        $newsHeader[$key]['date'] = $date->format($newsItem['date']);
    }
    $twig->loadTemplate('news/list.twig')->display(array('PMF_LANG' => $PMF_LANG, 'newsHeader' => $newsHeader));
    unset($date, $newsHeader, $key, $newsItem);
} elseif ('editnews' == $action && $user->perm->checkRight($user->getUserId(), 'editnews')) {
    $id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
    $newsData = $news->getNewsEntry($id, true);
    $dateStart = $newsData['dateStart'] != '00000000000000' ? PMF_Date::createIsoDate($newsData['dateStart'], 'Y-m-d') : '';
    $dateEnd = $newsData['dateEnd'] != '99991231235959' ? PMF_Date::createIsoDate($newsData['dateEnd'], 'Y-m-d') : '';
    $newsId = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
    $oComment = new PMF_Comment($faqConfig);
    $comments = $oComment->getCommentsData($newsId, PMF_Comment::COMMENT_TYPE_NEWS);
    foreach ($comments as $item) {
        $item['date'] = PMF_Date::createIsoDate($item['date'], 'Y-m-d H:i', false);
    }
    $twig->loadTemplate('news/edit.twig')->display(array('PMF_LANG' => $PMF_LANG, 'comments' => $comments, 'commentType' => PMF_Comment::COMMENT_TYPE_NEWS, 'dateEnd' => $dateEnd, 'dateStart' => $dateStart, 'languageSelector' => PMF_Language::selectLanguages($newsData['lang'], false, array(), 'langTo'), 'newsData' => $newsData));
} elseif ('savenews' == $action && $user->perm->checkRight($user->getUserId(), "addnews")) {
    $dateStart = PMF_Filter::filterInput(INPUT_POST, 'dateStart', FILTER_SANITIZE_STRING);
    $dateEnd = PMF_Filter::filterInput(INPUT_POST, 'dateEnd', FILTER_SANITIZE_STRING);
    $header = PMF_Filter::filterInput(INPUT_POST, 'newsheader', FILTER_SANITIZE_STRIPPED);
    $content = PMF_Filter::filterInput(INPUT_POST, 'news', FILTER_SANITIZE_SPECIAL_CHARS);
    $author = PMF_Filter::filterInput(INPUT_POST, 'authorName', FILTER_SANITIZE_STRIPPED);
    $email = PMF_Filter::filterInput(INPUT_POST, 'authorEmail', FILTER_VALIDATE_EMAIL);
    $active = PMF_Filter::filterInput(INPUT_POST, 'active', FILTER_SANITIZE_STRING);
    $comment = PMF_Filter::filterInput(INPUT_POST, 'comment', FILTER_SANITIZE_STRING);
    $link = PMF_Filter::filterInput(INPUT_POST, 'link', FILTER_VALIDATE_URL);
    $linktitle = PMF_Filter::filterInput(INPUT_POST, 'linkTitle', FILTER_SANITIZE_STRIPPED);
    $newslang = PMF_Filter::filterInput(INPUT_POST, 'langTo', FILTER_SANITIZE_STRING);
    $target = PMF_Filter::filterInput(INPUT_POST, 'target', FILTER_SANITIZE_STRIPPED);
开发者ID:ae120,项目名称:phpMyFAQ,代码行数:31,代码来源:news.php

示例5: foreach

    foreach ($comments as $item) {
        ?>
    <p><?php 
        print $PMF_LANG["ad_entry_commentby"];
        ?>
 <a href="mailto:<?php 
        print $item['email'];
        ?>
"><?php 
        print $item['user'];
        ?>
</a>:<br /><?php 
        print $item['content'];
        ?>
<br /><?php 
        print $PMF_LANG['newsCommentDate'] . PMF_Date::createIsoDate($item['date'], 'Y-m-d H:i', false);
        ?>
<a href="?action=delcomment&amp;artid=<?php 
        print $newsId;
        ?>
&amp;cmtid=<?php 
        print $item['id'];
        ?>
&amp;type=<?php 
        print PMF_Comment::COMMENT_TYPE_NEWS;
        ?>
"><img src="images/delete.gif" alt="<?php 
        print $PMF_LANG["ad_entry_delete"];
        ?>
" title="<?php 
        print $PMF_LANG["ad_entry_delete"];
开发者ID:nosch,项目名称:phpMyFAQ,代码行数:31,代码来源:news.php

示例6: foreach

                <tbody>
<?php 
        foreach ($openquestions as $question) {
            ?>
                    <tr>
                        <td>
                            <input id="questions[]"
                                   name="questions[]"
                                   value="<?php 
            echo $question['id'];
            ?>
" type="checkbox" />
                        </td>
                        <td>
                            <?php 
            echo $date->format(PMF_Date::createIsoDate($question['created']));
            ?>
                            <br>
                            <a href="mailto:<?php 
            echo $question['email'];
            ?>
">
                                <?php 
            echo $question['username'];
            ?>
                            </a>
                        </td>
                        <td>
                            <strong><?php 
            echo $category->categoryName[$question['category_id']]['name'];
            ?>
开发者ID:Ravikumarsreerama,项目名称:faq,代码行数:31,代码来源:record.questions.php

示例7: foreach

            print $PMF_LANG['ad_entry_visibility'];
            ?>
?</th>
            <th class="list"><?php 
            print $PMF_LANG['ad_gen_delete'];
            ?>
?</th>
        </tr>
    </thead>
    <tbody>
<?php 
            foreach ($openquestions as $question) {
                ?>
        <tr>
            <td class="list"><?php 
                print PMF_Date::createIsoDate($question['date']);
                ?>
<br /><a href="mailto:<?php 
                print $question['email'];
                ?>
"><?php 
                print $question['user'];
                ?>
</a></td>
            <td class="list"><?php 
                print $category->categoryName[$question['category']]['name'] . ":<br />" . $question['question'];
                ?>
</td>
            <td class="list"><a href="?action=question&amp;id=<?php 
                print $question['id'];
                ?>
开发者ID:noon,项目名称:phpMyFAQ,代码行数:31,代码来源:record.delquestion.php

示例8: getComments

 /**
  * Returns all user comments (HTML formatted) from a record by type
  *
  * @todo Move this code to a helper class
  *
  * @param integer $id   Comment ID
  * @param integer $type Comment type: {faq|news}
  *
  * @return string
  */
 public function getComments($id, $type)
 {
     $comments = $this->getCommentsData($id, $type);
     $output = '';
     foreach ($comments as $item) {
         $output .= '<p class="comment">';
         $output .= '<img src="images/bubbles.gif" />';
         $output .= sprintf('<strong>%s<a href="mailto:%s">%s</a>:</strong><br />%s<br />%s</p>', $this->pmf_lang['msgCommentBy'], PMF_Mail::safeEmail($item['email']), $item['user'], nl2br($item['content']), $this->pmf_lang['newsCommentDate'] . PMF_Date::format(PMF_Date::createIsoDate($item['date'], 'Y-m-d H:i', false)));
     }
     return $output;
 }
开发者ID:atlcurling,项目名称:tkt,代码行数:21,代码来源:Comment.php

示例9: getLatest

 /**
  * This function generates the list with the latest published records
  *
  * @return array
  */
 public function getLatest()
 {
     $result = $this->getLatestData(PMF_NUMBER_RECORDS_LATEST, $this->language);
     $output = array();
     if (count($result) > 0) {
         foreach ($result as $row) {
             $output['url'][] = $row['url'];
             $output['title'][] = PMF_Utils::makeShorterText($row['thema'], 8);
             $output['date'][] = PMF_Date::createIsoDate($row['datum']);
         }
     } else {
         $output['error'] = $this->pmf_lang["err_noArticles"];
     }
     return $output;
 }
开发者ID:nosch,项目名称:phpMyFAQ,代码行数:20,代码来源:Faq.php

示例10: 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;
        ?>
开发者ID:noon,项目名称:phpMyFAQ,代码行数:31,代码来源:record.save.php

示例11: 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);
 }
开发者ID:ae120,项目名称:phpMyFAQ,代码行数:62,代码来源:Pdf.php

示例12: foreach

            ?>
                            </option>
                            <?php 
            foreach ($revisions as $revisionId => $revisionData) {
                ?>
                                <option value="<?php 
                echo $revisionData['revision_id'];
                ?>
" <?php 
                if ($selectedRevisionId == $revisionData['revision_id']) {
                    echo 'selected="selected"';
                }
                ?>
 >
                                    <?php 
                printf('%s 1.%d: %s - %s', $PMF_LANG['ad_entry_revision'], $revisionData['revision_id'], PMF_Date::createIsoDate($revisionData['datum']), $revisionData['author']);
                ?>
                                </option>
                            <?php 
            }
            ?>
                        </select>
                    </form>
                </div>
        <?php 
        }
        if (isset($selectedRevisionId) && isset($faqData['revision_id']) && $selectedRevisionId != $faqData['revision_id']) {
            $faq->language = $faqData['lang'];
            $faq->getRecord($faqData['id'], $selectedRevisionId, true);
            $faqData = $faq->faqRecord;
            $faqData['tags'] = implode(',', $tagging->getAllTagsById($faqData['id']));
开发者ID:kapljr,项目名称:Jay-Kaplan-Farmingdale-BCS-Projects,代码行数:31,代码来源:record.edit.php

示例13: printOpenQuestions

 /**
  * Prints the open questions as a XHTML table
  *
  * @return  string
  * @access  public
  * @since   2002-09-17
  * @author  Thorsten Rinne <thorsten@phpmyfaq.de>
  */
 function printOpenQuestions()
 {
     global $sids, $category;
     $query = sprintf("\n            SELECT\n                COUNT(*) AS num\n            FROM\n                %sfaqquestions\n            WHERE\n                is_visible != 'Y'", SQLPREFIX);
     $result = $this->db->query($query);
     $row = $this->db->fetch_object($result);
     $numOfInvisibles = $row->num;
     if ($numOfInvisibles > 0) {
         $extraout = sprintf('<tr><td colspan="3"><hr />%s%s</td></tr>', $this->pmf_lang['msgQuestionsWaiting'], $numOfInvisibles);
     } else {
         $extraout = '';
     }
     $query = sprintf("\n            SELECT\n                id,\n                ask_username,\n                ask_usermail,\n                ask_rubrik,\n                ask_content,\n                ask_date\n            FROM\n                %sfaqquestions\n            WHERE\n                is_visible = 'Y'\n            ORDER BY\n                ask_date ASC", SQLPREFIX);
     $result = $this->db->query($query);
     $output = '';
     if ($this->db->num_rows($result) > 0) {
         while ($row = $this->db->fetch_object($result)) {
             $output .= '<tr class="openquestions">';
             $output .= sprintf('<td valign="top" nowrap="nowrap">%s<br /><a href="mailto:%s">%s</a></td>', PMF_Date::createIsoDate($row->ask_date), safeEmail($row->ask_usermail), $row->ask_username);
             $output .= sprintf('<td valign="top"><strong>%s:</strong><br />%s</td>', $category->categoryName[$row->ask_rubrik]['name'], strip_tags($row->ask_content));
             $output .= sprintf('<td valign="top"><a href="%s?%saction=add&amp;question=%d&amp;cat=%d">%s</a></td>', $_SERVER['PHP_SELF'], $sids, $row->id, $row->ask_rubrik, $this->pmf_lang['msg2answer']);
             $output .= '</tr>';
         }
     } else {
         $output = sprintf('<tr><td colspan="3">%s</td></tr>', $this->pmf_lang['msgNoQuestionsAvailable']);
     }
     return $output . $extraout;
 }
开发者ID:noon,项目名称:phpMyFAQ,代码行数:36,代码来源:Faq.php

示例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::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'];
            ?>
开发者ID:atlcurling,项目名称:tkt,代码行数:31,代码来源:record.delquestion.php

示例15: getComments

 /**
  * Returns all user comments (HTML formatted) from a record by type
  *
  * @todo Move this code to a helper class
  *
  * @param integer $id   Comment ID
  * @param integer $type Comment type: {faq|news}
  *
  * @return string
  */
 public function getComments($id, $type)
 {
     $comments = $this->getCommentsData($id, $type);
     $date = new PMF_Date($this->config);
     $mail = new PMF_Mail($this->config);
     $output = '';
     foreach ($comments as $item) {
         $output .= '<p class="comment">';
         $output .= '<img class="commment-bubbles" src="assets/img/bubbles.gif" />';
         $output .= sprintf('<strong>%s<a href="mailto:%s">%s</a>:</strong><br />%s<br /><small>%s</small></p>', $this->pmfStr['msgCommentBy'], $mail->safeEmail($item['email']), $item['user'], $this->showShortComment($id, $item['content']), $this->pmfStr['newsCommentDate'] . $date->format(PMF_Date::createIsoDate($item['date'], 'Y-m-d H:i', false)));
     }
     return $output;
 }
开发者ID:ae120,项目名称:phpMyFAQ,代码行数:23,代码来源:Comment.php


注:本文中的PMF_Date::createIsoDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。