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


PHP Core_cacheClear函数代码示例

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


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

示例1: Comments_adminDelete

function Comments_adminDelete()
{
    $id = (int) $_REQUEST['id'];
    dbQuery('delete from comments where id=' . $id);
    Core_cacheClear('comments');
    return array('status' => 1, 'id' => $id);
}
开发者ID:raylouis,项目名称:kvwebme,代码行数:7,代码来源:api-admin.php

示例2: Panels_adminSave

/**
 * save a panel
 *
 * @return null
 */
function Panels_adminSave()
{
    $id = (int) $_REQUEST['id'];
    $widgets = addslashes($_REQUEST['data']);
    dbQuery("update panels set body='{$widgets}' where id={$id}");
    Core_cacheClear('panels');
    Core_cacheClear('pages');
}
开发者ID:raylouis,项目名称:kvwebme,代码行数:13,代码来源:api-admin.php

示例3: Meetings_complete

/**
 * mark a meeting as complete
 *
 * @return null
 */
function Meetings_complete()
{
    if (!isset($_SESSION['userdata'])) {
        return;
    }
    $id = (int) $_REQUEST['id'];
    dbQuery('update meetings set is_complete=1 where id=' . $id);
    Core_cacheClear('meetings');
}
开发者ID:raylouis,项目名称:kvwebme,代码行数:14,代码来源:api.php

示例4: Search_getPage

/**
 * retrieve the search page, or create one if it doesn't exist
 *
 * @return object search page
 */
function Search_getPage()
{
    if (isset($_GET['s'])) {
        $_GET['search'] = $_GET['s'];
    }
    $p = Page::getInstanceByType(5);
    if (!$p || !isset($p->id)) {
        dbQuery('insert into pages set cdate=now(),edate=now(),name="__search",' . 'alias="__search",body="",type=5,special=2,ord=5000');
        Core_cacheClear('pages', 'page_by_type_5');
        $p = Page::getInstanceByType(5);
    }
    return $p->id;
}
开发者ID:raylouis,项目名称:kvwebme,代码行数:18,代码来源:search.php

示例5: deleteByAdminId

 static function deleteByAdminId($name, $id = false)
 {
     $adminId = '';
     if ($id !== false) {
         if ($id < 0) {
             $adminId = ' and admin_id>0';
         } else {
             $adminId = ' and admin_id=' . $id;
         }
     }
     dbQuery('delete from admin_vars where varname="' . addslashes($name) . '"' . $adminId);
     Core_cacheClear('admin_vars');
 }
开发者ID:raylouis,项目名称:kvwebme,代码行数:13,代码来源:AdminVars.php

示例6: Comments_update

/**
 * Update the comments table
 *
 * @return null
 */
function Comments_update()
{
    $id = $_REQUEST['id'];
    $comment = $_REQUEST['comment'];
    $allowed = in_array($id, $_SESSION['comment_ids']);
    if (!$allowed) {
        die('You do not have permission to do this');
    }
    if (!is_numeric($id)) {
        Core_quit('Invalid id');
    }
    dbQuery('update comments set comment = "' . addslashes($comment) . '" where id = ' . (int) $id);
    Core_cacheClear('comments');
    return array('status' => 1, 'id' => $id, 'comment' => $comment);
}
开发者ID:raylouis,项目名称:kvwebme,代码行数:20,代码来源:api.php

示例7: die

<?php

require $_SERVER['DOCUMENT_ROOT'] . '/ww.incs/basics.php';
if (!Core_isAdmin()) {
    die(__('access denied'));
}
if (isset($_REQUEST['id']) && isset($_REQUEST['vis']) && isset($_REQUEST['hid'])) {
    $id = (int) $_REQUEST['id'];
    $vis = '[' . addslashes($_REQUEST['vis']) . ']';
    $hid = '[' . addslashes($_REQUEST['hid']) . ']';
    dbQuery("update panels set visibility='{$vis}',hidden='{$hid}' where id={$id}");
    Core_cacheClear('panels');
}
开发者ID:raylouis,项目名称:kvwebme,代码行数:13,代码来源:save-visibility.php

示例8: OnlineStoreEbay_adminImportOrders

function OnlineStoreEbay_adminImportOrders()
{
    require_once 'eBaySession.php';
    error_reporting(E_ALL);
    $rs = dbAll('select * from online_store_vars where name like "ebay%"');
    $vs = array();
    foreach ($rs as $r) {
        $vs[$r['name']] = $r['val'];
    }
    $production = (int) $vs['ebay_status'];
    if ($production) {
        $devID = $vs['ebay_devid'];
        $appID = $vs['ebay_appid'];
        $certID = $vs['ebay_certid'];
        $serverUrl = 'https://api.ebay.com/ws/api.dll';
        // server URL different for prod and sandbox
        $userToken = $vs['ebay_usertoken'];
    } else {
        $devID = $vs['ebay_sandbox_devid'];
        $appID = $vs['ebay_sandbox_appid'];
        $certID = $vs['ebay_sandbox_certid'];
        $serverUrl = 'https://api.sandbox.ebay.com/ws/api.dll';
        $userToken = $vs['ebay_sandbox_usertoken'];
    }
    $compatabilityLevel = 827;
    // eBay API version
    $siteToUseID = 205;
    $sess = new eBaySession($userToken, $devID, $appID, $certID, $serverUrl, $compatabilityLevel, $siteToUseID, 'GetOrders');
    $xml = '<?xml version="1.0" encoding="utf-8"?>' . '<GetOrdersRequest xmlns="urn:ebay:apis:eBLBaseComponents">' . '	<RequesterCredentials>' . '		<eBayAuthToken>' . $userToken . '</eBayAuthToken>' . '	</RequesterCredentials>' . '	<NumberOfDays>10</NumberOfDays>' . '	<OrderRole>Seller</OrderRole>' . '	<OrderStatus>Completed</OrderStatus>' . '	<DetailLevel>ReturnAll</DetailLevel>' . '	<SortingOrder>Descending</SortingOrder>' . '	<WarningLevel>High</WarningLevel>' . '</GetOrdersRequest>';
    $xmlstr = $sess->sendHttpRequest($xml);
    $reply = new SimpleXMLElement($xmlstr);
    if (isset($reply->Errors)) {
        return array('sent' => $xml, 'reply' => new SimpleXMLElement($xmlstr), 'errors' => $reply->Errors);
    }
    $imported = 0;
    foreach ($reply->OrderArray->Order as $order) {
        $order = json_decode(json_encode($order));
        $ebayOrderId = $order->OrderID;
        $r = dbOne('select id from online_store_orders where ebayOrderId="' . $ebayOrderId . '"' . ' limit 1', 'id');
        if ($r) {
            continue;
        }
        $address = $order->ShippingAddress;
        if ($address->PostalCode == '') {
            $address->PostalCode = 'na';
        }
        $form_vals = array('FirstName' => preg_replace('/ .*/', '', $address->Name), 'Surname' => preg_replace('/.*? /', '', $address->Name), 'Phone' => $address->Phone, 'Email' => 'ebay@kaebots.com', 'Street' => $address->Street1, 'Street2' => $address->Street2, 'Town' => $address->CityName, 'County' => $address->StateOrProvince, 'PostCode' => $address->PostalCode, 'Country' => $address->CountryName, 'CountryCode' => $address->Country);
        $form_vals = json_encode($form_vals);
        $total = (double) $order->Total;
        $date_created = date('Y-m-d h:i:s', strtotime($order->CreatedTime));
        $transactions = array();
        $tArr = $order->TransactionArray->Transaction;
        if (!is_array($tArr)) {
            $transactions = array($tArr);
        } else {
            $transactions = $tArr;
        }
        $items = array();
        foreach ($transactions as $transaction) {
            $item = $transaction->Item;
            if (isset($item->ApplicationData)) {
                $appData = json_decode(htmlspecialchars_decode($item->ApplicationData));
                $itemId = $appData->productId;
            } else {
                $itemId = dbOne('select id from products where link="' . addslashes($item->Title) . '"', 'id');
            }
            $key = 'products_' . $itemId;
            if (!isset($items[$key])) {
                $items[$key] = array();
                $r = dbRow('select * from products where id=' . $itemId . ' limit 1');
                $items[$key] = array('short_desc' => $r['name'], 'id' => $itemId, 'amt' => 0);
            }
            $items[$key]['amt'] += $transaction->QuantityPurchased;
        }
        $jitems = json_encode($items);
        // { create the order entry
        dbQuery('insert into online_store_orders set total="' . $total . '"' . ', items="' . addslashes($jitems) . '"' . ', ebayOrderId="' . $ebayOrderId . '"' . ', form_vals="' . addslashes($form_vals) . '"' . ', date_created="' . addslashes($date_created) . '"' . ', status=1');
        $id = dbLastInsertId();
        // }
        dbQuery('update online_store_orders set invoice_num=id where id=' . $id);
        Core_cacheClear('online_store_orders');
        OnlineStore_updateProductSales($id, $items, $date_created);
        $imported++;
    }
    return array('imported' => $imported, 'reply' => new SimpleXMLElement($xmlstr));
}
开发者ID:raylouis,项目名称:kvwebme,代码行数:86,代码来源:api-admin.php

示例9: Core_adminUserEditVal

/**
 * edit a single value of a user
 *
 * @return array status
 */
function Core_adminUserEditVal()
{
    $id = (int) $_REQUEST['id'];
    $name = $_REQUEST['name'];
    $value = $_REQUEST['val'];
    $contact_fields = array('contact_name', 'business_phone', 'business_email', 'phone', 'website', 'mobile', 'skype', 'facebook', 'twitter', 'linkedin', 'blog');
    if (in_array($name, array('name', 'email'))) {
        dbQuery('update user_accounts set ' . $name . '="' . addslashes($value) . '" where id=' . $id);
    } elseif (in_array($name, $contact_fields)) {
        $c = json_decode(dbOne('select contact from user_accounts where id=' . $id, 'contact'), true);
        $c[$name] = $value;
        dbQuery('update user_accounts set contact="' . addslashes(json_encode($c)) . '"' . ' where id=' . $id);
    }
    Core_cacheClear();
    return array('ok' => 1);
}
开发者ID:raylouis,项目名称:kvwebme,代码行数:21,代码来源:api-admin.php

示例10: Mailinglists_adminListSave

/**
 * save a mailing list
 *
 * @return status
 */
function Mailinglists_adminListSave()
{
    $id = (int) $_REQUEST['vals']['id'];
    $sql = 'mailinglists_lists set ' . 'name="' . addslashes($_REQUEST['vals']['name']) . '",' . 'meta="' . addslashes(json_encode($_REQUEST['meta'])) . '"';
    if ($id) {
        dbQuery('update ' . $sql . ' where id=' . $id);
    } else {
        dbQuery('insert into ' . $sql);
    }
    Core_cacheClear('mailinglists');
    return array('ok' => 1);
}
开发者ID:raylouis,项目名称:kvwebme,代码行数:17,代码来源:api-admin.php

示例11: Core_isAdmin

<?php

/**
 * Deletes a comment
 *
 * PHP Version 5.3
 *
 * @category   CommentsPlugin
 * @package    WebworksWebme
 * @subpackage CommentsPlugin
 * @author     Belinda Hamilton <bhamilton@webworks.ie>
 * @license    GPL Version 2
 * @link       www.kvweb.me
 **/
require_once $_SERVER['DOCUMENT_ROOT'] . '/ww.incs/basics.php';
$id = $_REQUEST['id'];
$allowed = Core_isAdmin() || in_array($id, $_SESSION['comment_ids']);
if (!$allowed) {
    die('You do not have permission to delete this comment');
}
if (!is_numeric($id)) {
    Core_quit('Invalid id');
}
dbQuery('delete from comments where id = ' . $id);
Core_cacheClear('comments');
if (dbOne('select id from comments where id  = ' . $id, 'id')) {
    echo '{"status":0}';
} else {
    echo '{"status":1, "id":' . $id . '}';
}
开发者ID:raylouis,项目名称:kvwebme,代码行数:30,代码来源:delete.php

示例12: products_adminFixOrphanedCategories

function products_adminFixOrphanedCategories()
{
    $rs = dbAll('select id,name,parent_id from products_categories');
    foreach ($rs as $r) {
        if ($r['parent_id'] == '0') {
            continue;
        }
        $pid = dbOne('select id from products_categories where id=' . $r['parent_id'], 'id');
        if (!$pid) {
            $sql = 'update products_categories set parent_id=0 where id=' . $r['id'];
            dbQuery($sql);
            echo $sql . "<br/>";
        } else {
            echo 'product_category ' . $r['name'] . ' is okay.<br/>';
        }
    }
    Core_cacheClear('products_categories');
    exit;
}
开发者ID:raylouis,项目名称:kvwebme,代码行数:19,代码来源:api-admin.php

示例13: addslashes

            }
        }
    }
    $data = addslashes(json_encode($data));
    $sql = "messaging_notifier set data='{$data}'";
    if ($id) {
        $sql = "update {$sql} where id={$id}";
        dbQuery($sql);
    } else {
        $sql = "insert into {$sql}";
        dbQuery($sql);
        $id = dbOne('select last_insert_id() as id', 'id');
    }
    $ret = array('id' => $id, 'id_was' => $id_was, 'datastr' => $_REQUEST['data'], 'dataobj' => $data);
    echo json_encode($ret);
    Core_cacheClear('messaging_notifier');
    Core_quit();
}
if (isset($_REQUEST['id'])) {
    $id = (int) $_REQUEST['id'];
} else {
    $id = 0;
}
echo '<a href="javascript:;" id="messaging_notifier_editlink_' . $id . '" class="button messaging_notifier_editlink">view or edit feeds</a><br />';
// { show story title
echo '<strong>hide story title</strong><br />' . '<select name="hide_story_title"><option value="0">No</option>' . '<option value="1"';
if (@$_REQUEST['hide_story_title'] == 1) {
    echo ' selected="selected"';
}
echo '>Yes</option></select><br />';
// }
开发者ID:raylouis,项目名称:kvwebme,代码行数:31,代码来源:widget-form.php

示例14: Theme_findErrors

// { if theme fails check, remove temp dir and throw error
$msg = '';
if (!$failure_message) {
    $msg = Theme_findErrors($theme_folder);
}
if ($msg || $failure_message) {
    shell_exec('rm -rf ' . $temp_dir);
    echo '<script>parent.themes_dialog("<em>installation failed: ' . $failure_message . $msg . '</em>");</script>';
    Core_quit();
}
// }
// { get variant
if (is_dir($theme_folder . '/cs')) {
    $variant = Theme_getFirstVariant($theme_folder . '/cs/');
}
// }
// { remove temp dir and extract to themes-personal
shell_exec('rm -rf ' . $themes_personal . '/' . $name);
rename($temp_dir . '/' . $name, $themes_personal . '/' . $name);
shell_exec('rm -rf ' . $temp_dir);
if (isset($_POST['install-theme'])) {
    $DBVARS['theme'] = $name;
    if (isset($variant)) {
        $DBVARS['theme_variant'] = $variant;
    }
    Core_configRewrite();
    Core_cacheClear('pages');
    $_SESSION['theme_selected'] = 1;
}
// }
echo '<script>parent.document.location="step7.php";</script>';
开发者ID:raylouis,项目名称:kvwebme,代码行数:31,代码来源:theme-upload.php

示例15: ClassifiedAds_adminCategoryUploadImage

/**
 * upload a new category image
 *
 * @return null
 */
function ClassifiedAds_adminCategoryUploadImage()
{
    $id = (int) $_REQUEST['id'];
    if (!file_exists(USERBASE . '/f/classified-ads/categories/' . $id)) {
        mkdir(USERBASE . '/f/classified-ads/categories/' . $id, 0777, true);
    }
    $imgs = new DirectoryIterator(USERBASE . '/f/classified-ads/categories/' . $id);
    foreach ($imgs as $img) {
        if ($img->isDot()) {
            continue;
        }
        unlink($img->getPathname());
    }
    $from = $_FILES['Filedata']['tmp_name'];
    $ext = preg_replace('/.*\\./', '', $_FILES['Filedata']['name']);
    $url = '/classified-ads/categories/' . $id . '/icon.' . $ext;
    $to = USERBASE . '/f' . $url;
    move_uploaded_file($from, $to);
    dbQuery('update classifiedads_categories set' . ' icon="' . $url . '" where id=' . $id);
    Core_cacheClear();
    echo $url;
    Core_quit();
}
开发者ID:raylouis,项目名称:kvwebme,代码行数:28,代码来源:api-admin.php


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