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


PHP SearchEngine::clearSearchCache方法代码示例

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


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

示例1: header

         }
     }
     header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin-edit.php?page=edit' . $qs_albumsuffix . $notify . $pg . $returntab);
     exitZP();
     break;
     /** DELETION ***************************************************************** */
     /*		 * ************************************************************************** */
 /** DELETION ***************************************************************** */
 /*		 * ************************************************************************** */
 case "deletealbum":
     XSRFdefender('delete');
     if ($folder) {
         $album = newAlbum($folder);
         if ($album->remove()) {
             $nd = 3;
             SearchEngine::clearSearchCache();
         } else {
             $nd = 4;
         }
         if (isset($_GET['return'])) {
             $albumdir = sanitize($_GET['return'], 3);
         } else {
             $albumdir = dirname($folder);
         }
         if ($albumdir != '/' && $albumdir != '.') {
             $albumdir = "&album=" . pathurlencode($albumdir);
         } else {
             $albumdir = '';
         }
     } else {
         $albumdir = '';
开发者ID:rb26,项目名称:zenphoto,代码行数:31,代码来源:admin-edit.php

示例2: processZenpageBulkActions

/**
 * Processes the check box bulk actions
 *
 */
function processZenpageBulkActions($type)
{
    global $_zp_zenpage;
    $action = false;
    if (isset($_POST['ids'])) {
        //echo "action for checked items:". $_POST['checkallaction'];
        $action = sanitize($_POST['checkallaction']);
        $links = sanitize($_POST['ids']);
        $total = count($links);
        $message = NULL;
        $sql = '';
        if ($action != 'noaction') {
            if ($total > 0) {
                if ($action == 'addtags' || $action == 'alltags') {
                    $tags = bulkTags();
                }
                if ($action == 'addcats') {
                    foreach ($_POST as $key => $value) {
                        $key = postIndexDecode($key);
                        if (substr($key, 0, 3) == 'cat') {
                            if ($value) {
                                $cats[] = substr($key, 3);
                            }
                        }
                    }
                    $cats = sanitize($cats, 3);
                }
                $n = 0;
                foreach ($links as $titlelink) {
                    $class = 'Zenpage' . $type;
                    $obj = new $class($titlelink);
                    switch ($action) {
                        case 'deleteall':
                            $obj->remove();
                            SearchEngine::clearSearchCache();
                            break;
                        case 'addtags':
                            $mytags = array_unique(array_merge($tags, $obj->getTags()));
                            $obj->setTags($mytags);
                            break;
                        case 'cleartags':
                            $obj->setTags(array());
                            break;
                        case 'alltags':
                            $allarticles = $obj->getArticles('', 'all', true);
                            foreach ($allarticles as $article) {
                                $newsobj = new ZenpageNews($article['titlelink']);
                                $mytags = array_unique(array_merge($tags, $newsobj->getTags()));
                                $newsobj->setTags($mytags);
                                $newsobj->save();
                            }
                            break;
                        case 'clearalltags':
                            $allarticles = $obj->getArticles('', 'all', true);
                            foreach ($allarticles as $article) {
                                $newsobj = new ZenpageNews($article['titlelink']);
                                $newsobj->setTags(array());
                                $newsobj->save();
                            }
                            break;
                        case 'addcats':
                            $catarray = array();
                            $allcats = $obj->getCategories();
                            foreach ($cats as $cat) {
                                $catitem = $_zp_zenpage->getCategory($cat);
                                $catarray[] = $catitem['titlelink'];
                                //to use the setCategories method we need an array with just the titlelinks!
                            }
                            $allcatsarray = array();
                            foreach ($allcats as $allcat) {
                                $allcatsarray[] = $allcat['titlelink'];
                                //same here!
                            }
                            $mycats = array_unique(array_merge($catarray, $allcatsarray));
                            $obj->setCategories($mycats);
                            break;
                        case 'clearcats':
                            $obj->setCategories(array());
                            break;
                        case 'showall':
                            $obj->set('show', 1);
                            break;
                        case 'hideall':
                            $obj->set('show', 0);
                            break;
                        case 'commentson':
                            $obj->set('commentson', 1);
                            break;
                        case 'commentsoff':
                            $obj->set('commentson', 0);
                            break;
                        case 'resethitcounter':
                            $obj->set('hitcounter', 0);
                            break;
                    }
                    $obj->save();
//.........这里部分代码省略.........
开发者ID:rauldobrota,项目名称:zenphoto,代码行数:101,代码来源:zenpage-admin-functions.php

示例3: XSRFdefender

     }
     break;
     /** clear the HTMLcache ****************************************************** */
 /** clear the HTMLcache ****************************************************** */
 case 'clear_html_cache':
     XSRFdefender('ClearHTMLCache');
     require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/static_html_cache.php';
     static_html_cache::clearHTMLCache();
     $class = 'messagebox';
     $msg = gettext('HTML cache cleared.');
     break;
     /** clear the search cache ****************************************************** */
 /** clear the search cache ****************************************************** */
 case 'clear_search_cache':
     XSRFdefender('ClearSearchCache');
     SearchEngine::clearSearchCache(NULL);
     $class = 'messagebox';
     $msg = gettext('Search cache cleared.');
     break;
     /** restore the setup files ************************************************** */
 /** restore the setup files ************************************************** */
 case 'restore_setup':
     XSRFdefender('restore_setup');
     list($diff, $needs) = checkSignature(2);
     if (empty($needs)) {
         $class = 'messagebox';
         $msg = gettext('Setup files restored.');
     } else {
         zp_apply_filter('log_setup', false, 'restore', implode(', ', $needs));
         $class = 'errorbox';
         $msg = gettext('Setup files restore failed.');
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:admin.php

示例4: processImageBulkActions

/**
 * Handles Image bulk actions
 * @param $album
 */
function processImageBulkActions($album)
{
    $action = sanitize($_POST['checkallaction']);
    $ids = sanitize($_POST['ids']);
    $total = count($ids);
    if ($action != 'noaction') {
        if ($total > 0) {
            if ($action == 'addtags') {
                $tags = bulkTags();
            }
            if ($action == 'moveimages' || $action == 'copyimages') {
                $dest = sanitize($_POST['massalbumselect']);
                $folder = sanitize($_POST['massfolder']);
                if (!$dest || $dest == $folder) {
                    return "&mcrerr=2";
                }
            }
            if ($action == 'changeowner') {
                $newowner = sanitize($_POST['massownerselect']);
            }
            $n = 0;
            foreach ($ids as $filename) {
                $n++;
                $imageobj = newImage($album, $filename);
                switch ($action) {
                    case 'deleteall':
                        $imageobj->remove();
                        SearchEngine::clearSearchCache();
                        break;
                    case 'showall':
                        $imageobj->set('show', 1);
                        break;
                    case 'hideall':
                        $imageobj->set('show', 0);
                        break;
                    case 'commentson':
                        $imageobj->set('commentson', 1);
                        break;
                    case 'commentsoff':
                        $imageobj->set('commentson', 0);
                        break;
                    case 'resethitcounter':
                        $imageobj->set('hitcounter', 0);
                        break;
                    case 'addtags':
                        $mytags = array_unique(array_merge($tags, $imageobj->getTags()));
                        $imageobj->setTags($mytags);
                        break;
                    case 'cleartags':
                        $imageobj->setTags(array());
                        break;
                    case 'copyimages':
                        if ($e = $imageobj->copy($dest)) {
                            return "&mcrerr=" . $e;
                        }
                        break;
                    case 'moveimages':
                        if ($e = $imageobj->move($dest)) {
                            SearchEngine::clearSearchCache();
                            return "&mcrerr=" . $e;
                        }
                        break;
                    case 'changeowner':
                        $imageobj->setOwner($newowner);
                        break;
                    default:
                        $action = call_user_func($action, $imageobj);
                        break;
                }
                $imageobj->save();
            }
        }
        return $action;
    }
}
开发者ID:elpadi,项目名称:dahlen-studio,代码行数:79,代码来源:admin-functions.php

示例5: move

 function move($new_unique_set)
 {
     if (class_exists('SearchEngine')) {
         SearchEngine::clearSearchCache($this);
     }
     return parent::move($new_unique_set);
 }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:7,代码来源:classes.php


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