• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getRecents函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getRecents函数的典型用法代码示例。如果您正苦于以下问题:PHP getRecents函数的具体用法?PHP getRecents怎么用?PHP getRecents使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: rssRecentChanges

/**
 * Add recent changed pages to the feed object
 *
 * @author Andreas Gohr <[email protected]>
 */
function rssRecentChanges($opt)
{
    global $conf;
    global $auth;
    $flags = RECENTS_SKIP_DELETED;
    if (!$opt['show_minor']) {
        $flags += RECENTS_SKIP_MINORS;
    }
    $recents = getRecents(0, $opt['items'], $opt['namespace'], $flags);
    return $recents;
}
开发者ID:Harvie,项目名称:dokuwiki,代码行数:16,代码来源:feed.php


示例2: html_recent

/**
 * display recent changes
 *
 * @author Andreas Gohr <[email protected]>
 * @author Matthias Grimm <[email protected]>
 * @author Ben Coburn <[email protected]>
 * @author Kate Arzamastseva <[email protected]>
 */
function html_recent($first = 0, $show_changes = 'both')
{
    global $conf;
    global $lang;
    global $ID;
    /* we need to get one additionally log entry to be able to
     * decide if this is the last page or is there another one.
     * This is the cheapest solution to get this information.
     */
    $flags = 0;
    if ($show_changes == 'mediafiles' && $conf['mediarevisions']) {
        $flags = RECENTS_MEDIA_CHANGES;
    } elseif ($show_changes == 'pages') {
        $flags = 0;
    } elseif ($conf['mediarevisions']) {
        $show_changes = 'both';
        $flags = RECENTS_MEDIA_PAGES_MIXED;
    }
    $recents = getRecents($first, $conf['recent'] + 1, getNS($ID), $flags);
    if (count($recents) == 0 && $first != 0) {
        $first = 0;
        $recents = getRecents($first, $conf['recent'] + 1, getNS($ID), $flags);
    }
    $hasNext = false;
    if (count($recents) > $conf['recent']) {
        $hasNext = true;
        array_pop($recents);
        // remove extra log entry
    }
    print p_locale_xhtml('recent');
    if (getNS($ID) != '') {
        print '<div class="level1"><p>' . sprintf($lang['recent_global'], getNS($ID), wl('', 'do=recent')) . '</p></div>';
    }
    $form = new Doku_Form(array('id' => 'dw__recent', 'method' => 'GET'));
    $form->addHidden('sectok', null);
    $form->addHidden('do', 'recent');
    $form->addHidden('id', $ID);
    if ($conf['mediarevisions']) {
        $form->addElement(form_makeListboxField('show_changes', array('pages' => $lang['pages_changes'], 'mediafiles' => $lang['media_changes'], 'both' => $lang['both_changes']), $show_changes, $lang['changes_type'], '', '', array('class' => 'quickselect')));
        $form->addElement(form_makeButton('submit', 'recent', $lang['btn_apply']));
    }
    $form->addElement(form_makeOpenTag('ul'));
    foreach ($recents as $recent) {
        $date = dformat($recent['date']);
        if ($recent['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
            $form->addElement(form_makeOpenTag('li', array('class' => 'minor')));
        } else {
            $form->addElement(form_makeOpenTag('li'));
        }
        $form->addElement(form_makeOpenTag('div', array('class' => 'li')));
        if ($recent['media']) {
            $form->addElement(media_printicon($recent['id']));
        } else {
            $icon = DOKU_BASE . 'lib/images/fileicons/file.png';
            $form->addElement('<img src="' . $icon . '" alt="' . $filename . '" class="icon" />');
        }
        $form->addElement(form_makeOpenTag('span', array('class' => 'date')));
        $form->addElement($date);
        $form->addElement(form_makeCloseTag('span'));
        if ($recent['media']) {
            $diff = count(getRevisions($recent['id'], 0, 1, 8192, true)) && @file_exists(mediaFN($recent['id']));
            if ($diff) {
                $href = media_managerURL(array('tab_details' => 'history', 'mediado' => 'diff', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
            }
        } else {
            $href = wl($recent['id'], "do=diff", false, '&');
        }
        if ($recent['media'] && !$diff) {
            $form->addElement('<img src="' . DOKU_BASE . 'lib/images/blank.gif" width="15" height="11" alt="" />');
        } else {
            $form->addElement(form_makeOpenTag('a', array('class' => 'diff_link', 'href' => $href)));
            $form->addElement(form_makeTag('img', array('src' => DOKU_BASE . 'lib/images/diff.png', 'width' => 15, 'height' => 11, 'title' => $lang['diff'], 'alt' => $lang['diff'])));
            $form->addElement(form_makeCloseTag('a'));
        }
        if ($recent['media']) {
            $href = media_managerURL(array('tab_details' => 'history', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
        } else {
            $href = wl($recent['id'], "do=revisions", false, '&');
        }
        $form->addElement(form_makeOpenTag('a', array('class' => 'revisions_link', 'href' => $href)));
        $form->addElement(form_makeTag('img', array('src' => DOKU_BASE . 'lib/images/history.png', 'width' => 12, 'height' => 14, 'title' => $lang['btn_revs'], 'alt' => $lang['btn_revs'])));
        $form->addElement(form_makeCloseTag('a'));
        if ($recent['media']) {
            $href = media_managerURL(array('tab_details' => 'view', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
            $class = file_exists(mediaFN($recent['id'])) ? 'wikilink1' : ($class = 'wikilink2');
            $form->addElement(form_makeOpenTag('a', array('class' => $class, 'href' => $href)));
            $form->addElement($recent['id']);
            $form->addElement(form_makeCloseTag('a'));
        } else {
            $form->addElement(html_wikilink(':' . $recent['id'], useHeading('navigation') ? null : $recent['id']));
        }
        $form->addElement(form_makeOpenTag('span', array('class' => 'sum')));
//.........这里部分代码省略.........
开发者ID:nefercheprure,项目名称:dokuwiki,代码行数:101,代码来源:html.php


示例3: _list

 /**
  * List recent edits matching the given filter
  */
 function _list($filter)
 {
     global $conf;
     global $lang;
     echo '<hr /><br />';
     echo '<form action="" method="post"><div class="no">';
     echo '<input type="hidden" name="filter" value="' . hsc($filter) . '" />';
     formSecurityToken();
     $recents = getRecents(0, $this->max_lines);
     echo '<ul>';
     $cnt = 0;
     foreach ($recents as $recent) {
         if ($filter) {
             if (strpos(rawWiki($recent['id']), $filter) === false) {
                 continue;
             }
         }
         $cnt++;
         $date = strftime($conf['dformat'], $recent['date']);
         echo $recent['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT ? '<li class="minor">' : '<li>';
         echo '<div class="li">';
         echo '<input type="checkbox" name="revert[]" value="' . hsc($recent['id']) . '" checked="checked" id="revert__' . $cnt . '" />';
         echo '<label for="revert__' . $cnt . '">' . $date . '</label> ';
         echo '<a href="' . wl($recent['id'], "do=diff") . '">';
         $p = array();
         $p['src'] = DOKU_BASE . 'lib/images/diff.png';
         $p['width'] = 15;
         $p['height'] = 11;
         $p['title'] = $lang['diff'];
         $p['alt'] = $lang['diff'];
         $att = buildAttributes($p);
         echo "<img {$att} />";
         echo '</a> ';
         echo '<a href="' . wl($recent['id'], "do=revisions") . '">';
         $p = array();
         $p['src'] = DOKU_BASE . 'lib/images/history.png';
         $p['width'] = 12;
         $p['height'] = 14;
         $p['title'] = $lang['btn_revs'];
         $p['alt'] = $lang['btn_revs'];
         $att = buildAttributes($p);
         echo "<img {$att} />";
         echo '</a> ';
         echo html_wikilink(':' . $recent['id'], useHeading('navigation') ? NULL : $recent['id']);
         echo ' – ' . htmlspecialchars($recent['sum']);
         echo ' <span class="user">';
         echo $recent['user'] . ' ' . $recent['ip'];
         echo '</span>';
         echo '</div>';
         echo '</li>';
         @set_time_limit(10);
         flush();
     }
     echo '</ul>';
     echo '<p>';
     echo '<input type="submit" class="button" value="' . $this->getLang('revert') . '" /> ';
     printf($this->getLang('note2'), hsc($filter));
     echo '</p>';
     echo '</div></form>';
 }
开发者ID:nextghost,项目名称:dokuwiki,代码行数:63,代码来源:admin.php


示例4: html_recent

/**
 * display recent changes
 *
 * @author Andreas Gohr <[email protected]>
 * @author Matthias Grimm <[email protected]>
 * @author Ben Coburn <[email protected]>
 */
function html_recent($first = 0)
{
    global $conf;
    global $lang;
    global $ID;
    /* we need to get one additionally log entry to be able to
     * decide if this is the last page or is there another one.
     * This is the cheapest solution to get this information.
     */
    $recents = getRecents($first, $conf['recent'] + 1, getNS($ID));
    if (count($recents) == 0 && $first != 0) {
        $first = 0;
        $recents = getRecents($first, $conf['recent'] + 1, getNS($ID));
    }
    $hasNext = false;
    if (count($recents) > $conf['recent']) {
        $hasNext = true;
        array_pop($recents);
        // remove extra log entry
    }
    print p_locale_xhtml('recent');
    if (getNS($ID) != '') {
        print '<div class="level1"><p>' . sprintf($lang['recent_global'], getNS($ID), wl('', 'do=recent')) . '</p></div>';
    }
    $form = new Doku_Form('dw__recent', script(), 'get');
    $form->addHidden('sectok', null);
    $form->addHidden('do', 'recent');
    $form->addHidden('id', $ID);
    $form->addElement(form_makeOpenTag('ul'));
    foreach ($recents as $recent) {
        $date = strftime($conf['dformat'], $recent['date']);
        if ($recent['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
            $form->addElement(form_makeOpenTag('li', array('class' => 'minor')));
        } else {
            $form->addElement(form_makeOpenTag('li'));
        }
        $form->addElement(form_makeOpenTag('div', array('class' => 'li')));
        $form->addElement(form_makeOpenTag('span', array('class' => 'date')));
        $form->addElement($date);
        $form->addElement(form_makeCloseTag('span'));
        $form->addElement(form_makeOpenTag('a', array('class' => 'diff_link', 'href' => wl($recent['id'], "do=diff", false, '&'))));
        $form->addElement(form_makeTag('img', array('src' => DOKU_BASE . 'lib/images/diff.png', 'width' => 15, 'height' => 11, 'title' => $lang['diff'], 'alt' => $lang['diff'])));
        $form->addElement(form_makeCloseTag('a'));
        $form->addElement(form_makeOpenTag('a', array('class' => 'revisions_link', 'href' => wl($recent['id'], "do=revisions", false, '&'))));
        $form->addElement(form_makeTag('img', array('src' => DOKU_BASE . 'lib/images/history.png', 'width' => 12, 'height' => 14, 'title' => $lang['btn_revs'], 'alt' => $lang['btn_revs'])));
        $form->addElement(form_makeCloseTag('a'));
        $form->addElement(html_wikilink(':' . $recent['id'], useHeading('navigation') ? NULL : $recent['id']));
        $form->addElement(form_makeOpenTag('span', array('class' => 'sum')));
        $form->addElement(' &ndash; ' . htmlspecialchars($recent['sum']));
        $form->addElement(form_makeCloseTag('span'));
        $form->addElement(form_makeOpenTag('span', array('class' => 'user')));
        if ($recent['user']) {
            $form->addElement(editorinfo($recent['user']));
            if (auth_ismanager()) {
                $form->addElement(' (' . $recent['ip'] . ')');
            }
        } else {
            $form->addElement($recent['ip']);
        }
        $form->addElement(form_makeCloseTag('span'));
        $form->addElement(form_makeCloseTag('div'));
        $form->addElement(form_makeCloseTag('li'));
    }
    $form->addElement(form_makeCloseTag('ul'));
    $form->addElement(form_makeOpenTag('div', array('class' => 'pagenav')));
    $last = $first + $conf['recent'];
    if ($first > 0) {
        $first -= $conf['recent'];
        if ($first < 0) {
            $first = 0;
        }
        $form->addElement(form_makeOpenTag('div', array('class' => 'pagenav-prev')));
        $form->addElement(form_makeTag('input', array('type' => 'submit', 'name' => 'first[' . $first . ']', 'value' => $lang['btn_newer'], 'accesskey' => 'n', 'title' => $lang['btn_newer'] . ' [N]', 'class' => 'button')));
        $form->addElement(form_makeCloseTag('div'));
    }
    if ($hasNext) {
        $form->addElement(form_makeOpenTag('div', array('class' => 'pagenav-next')));
        $form->addElement(form_makeTag('input', array('type' => 'submit', 'name' => 'first[' . $last . ']', 'value' => $lang['btn_older'], 'accesskey' => 'p', 'title' => $lang['btn_older'] . ' [P]', 'class' => 'button')));
        $form->addElement(form_makeCloseTag('div'));
    }
    $form->addElement(form_makeCloseTag('div'));
    html_form('recent', $form);
}
开发者ID:jalemanyf,项目名称:wsnlocalizationscala,代码行数:90,代码来源:html.php


示例5: _mixture_last_changes

/**
 * PRINT LAST CHANGES LIST
 * 
 * Print an <ul> loaded with @param last changes.
 *
 * @param integer   $n number of last changes to show in the list
 */
function _mixture_last_changes($n, $context = null)
{
    global $conf, $lang;
    $flags = '';
    if (strpos(tpl_getConf('lastchanges'), 'skip_deleted') !== false) {
        $flags = RECENTS_SKIP_DELETED;
    }
    if (strpos(tpl_getConf('lastchanges'), 'skip_minors') !== false) {
        $flags += RECENTS_SKIP_MINORS;
    }
    $recents = getRecents(0, $n, getNS($ID), $flags);
    $i = 0;
    foreach ($recents as $key => $value) {
        $details = null;
        if ($value['sum'] != null) {
            $details = ucfirst(trim($value['sum'], "."));
        } else {
            $details = ucfirst(trim(str_replace(":", "", $lang['mail_changed']), chr(0xc2) . chr(0xa0)));
        }
        if ($value['user'] != null and $context == "landing") {
            $details .= $lang['by'] . ucwords($value['user']);
        }
        if ($context == "landing") {
            $details .= ".";
        }
        print '<li';
        if ($context == "landing") {
            print ' data-infos="' . $details . '"';
            $logo = _mixture_namespacedFile('logo', 'inherit', 1, null, $value['id']);
            if ($logo != null) {
                print ' data-logo="' . $logo['fileID'] . '"';
            }
        }
        print '>';
        if ($context == "landing") {
            //print '<i class="fa fa-fw fa-play state"></i>';
            print '<span class="timestamp display-none">' . _mixture_date("long", $value['date'], true) . '</span>';
        }
        if (page_exists($value['id'])) {
            $exist = "wikilink1";
        } else {
            $exist = "wikilink2";
        }
        if ($context == null or $conf['useheading'] == 0 or p_get_first_heading($value['id']) == null) {
            $pageName = $value['id'];
        } else {
            $pageName = p_get_first_heading($value['id']);
        }
        if ($context == "landing") {
            tpl_link(wl($value['id']), $pageName, 'class="' . $exist . '"');
        } else {
            tpl_link(wl($value['id']), $pageName, 'title="' . $details . ' (' . _mixture_date("long", $value['date']) . ')" class="' . $exist . '"');
        }
        $by = null;
        if ($value['user'] != null) {
            $by = " " . $lang['by'] . " ";
        }
        if ($context == null) {
            print '<span class="display-none wd-display-initial">' . $by . '<span class="text-capitalize"><bdi>' . $value['user'] . '</bdi></span></span>';
        }
        $i++;
        print '</li>';
    }
}
开发者ID:geekitude,项目名称:dokuwiki-template-mixture,代码行数:71,代码来源:tpl_functions.php


示例6: rssRecentChanges

/**
 * Add recent changed pages to the feed object
 *
 * @author Andreas Gohr <[email protected]>
 */
function rssRecentChanges($opt)
{
    global $conf;
    $flags = RECENTS_SKIP_DELETED;
    if (!$opt['show_minor']) {
        $flags += RECENTS_SKIP_MINORS;
    }
    if ($opt['content_type'] == 'media' && $conf['mediarevisions']) {
        $flags += RECENTS_MEDIA_CHANGES;
    }
    if ($opt['content_type'] == 'both' && $conf['mediarevisions']) {
        $flags += RECENTS_MEDIA_PAGES_MIXED;
    }
    $recents = getRecents(0, $opt['items'], $opt['namespace'], $flags);
    return $recents;
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:21,代码来源:feed.php


示例7: html_recent

/**
 * display recent changes
 *
 * @author Andreas Gohr <[email protected]>
 * @author Matthias Grimm <[email protected]>
 * @author Ben Coburn <[email protected]>
 */
function html_recent($first = 0)
{
    global $conf;
    global $lang;
    global $ID;
    /* we need to get one additionally log entry to be able to
     * decide if this is the last page or is there another one.
     * This is the cheapest solution to get this information.
     */
    $recents = getRecents($first, $conf['recent'] + 1, getNS($ID));
    if (count($recents) == 0 && $first != 0) {
        $first = 0;
        $recents = getRecents($first, $conf['recent'] + 1, getNS($ID));
    }
    $hasNext = false;
    if (count($recents) > $conf['recent']) {
        $hasNext = true;
        array_pop($recents);
        // remove extra log entry
    }
    print p_locale_xhtml('recent');
    print '<ul>';
    foreach ($recents as $recent) {
        $date = date($conf['dformat'], $recent['date']);
        print $recent['type'] === 'e' ? '<li class="minor">' : '<li>';
        print '<div class="li">';
        print $date . ' ';
        print '<a href="' . wl($recent['id'], "do=diff") . '">';
        $p = array();
        $p['src'] = DOKU_BASE . 'lib/images/diff.png';
        $p['width'] = 15;
        $p['height'] = 11;
        $p['title'] = $lang['diff'];
        $p['alt'] = $lang['diff'];
        $att = buildAttributes($p);
        print "<img {$att} />";
        print '</a> ';
        print '<a href="' . wl($recent['id'], "do=revisions") . '">';
        $p = array();
        $p['src'] = DOKU_BASE . 'lib/images/history.png';
        $p['width'] = 12;
        $p['height'] = 14;
        $p['title'] = $lang['btn_revs'];
        $p['alt'] = $lang['btn_revs'];
        $att = buildAttributes($p);
        print "<img {$att} />";
        print '</a> ';
        print html_wikilink(':' . $recent['id'], $conf['useheading'] ? NULL : $recent['id']);
        print ' &ndash; ' . htmlspecialchars($recent['sum']);
        print ' <span class="user">';
        if ($recent['user']) {
            print $recent['user'];
        } else {
            print $recent['ip'];
        }
        print '</span>';
        print '</div>';
        print '</li>';
    }
    print '</ul>';
    print '<div class="pagenav">';
    $last = $first + $conf['recent'];
    if ($first > 0) {
        $first -= $conf['recent'];
        if ($first < 0) {
            $first = 0;
        }
        print '<div class="pagenav-prev">';
        print html_btn('newer', '', "p", array('do' => 'recent', 'first' => $first));
        print '</div>';
    }
    if ($hasNext) {
        print '<div class="pagenav-next">';
        print html_btn('older', '', "n", array('do' => 'recent', 'first' => $last));
        print '</div>';
    }
    print '</div>';
}
开发者ID:canneverbe,项目名称:flyspray,代码行数:85,代码来源:html.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getRecord函数代码示例发布时间:2022-05-15
下一篇:
PHP getRecInsuranceData函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap