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


PHP cache::getLogsArray方法代码示例

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


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

示例1: array

// See how many logs are in the db for the cache if logprinting is selected
// If not or just five logs may printed, the system will set this fixed values for calling the DB.
$rscount = 99;
//Preset the value
$rsreturn = array(88);
//Preset the value
if (isset($_REQUEST['log']) && $_REQUEST['log'] == 'N') {
    $rscount = 0;
} elseif (isset($_REQUEST['log']) && $_REQUEST['log'] == 'A') {
    $rsreturn = cache::getLogsCount($cacheid);
    $rscount = current($rsreturn);
} else {
    $rscount = 5;
}
$tpl->assign('logcount', $rscount);
$logs = cache::getLogsArray($cacheid, 0, $rscount);
if (isset($logs[$rscount - 1])) {
    unset($logs[$rscount - 1]);
    $tpl->assign('showalllogs', true);
}
$loganz = sizeof($logs);
$tpl->assign('logs', $logs);
$tpl->assign('loganz', $loganz);
/*end insertion Uwe 20091215*/
/* nature protection areas
 */
$rs = sql("SELECT `npa_areas`.`id` AS `npaId`, `npa_areas`.`type_id` AS `npaType`, `npa_areas`.`name` AS `npaName`, `npa_types`.`name` AS `npaTypeName` \r\n\t             FROM `cache_npa_areas` \r\n\t       INNER JOIN `npa_areas` ON `cache_npa_areas`.`npa_id`=`npa_areas`.`id` \r\n\t       INNER JOIN `npa_types` ON `npa_areas`.`type_id`=`npa_types`.`id` \r\n\t            WHERE `cache_npa_areas`.`cache_id`='&1' AND `npa_types`.`no_warning`=0\r\n\t         GROUP BY `npa_areas`.`type_id`, `npa_areas`.`name`\r\n\t         ORDER BY `npa_types`.`ordinal` ASC", $cacheid);
$tpl->assign_rs('npaareasWarning', $rs);
sql_free_result($rs);
$rs = sql("SELECT `npa_areas`.`id` AS `npaId`, `npa_areas`.`type_id` AS `npaType`, `npa_areas`.`name` AS `npaName`, `npa_types`.`name` AS `npaTypeName` \r\n\t             FROM `cache_npa_areas` \r\n\t       INNER JOIN `npa_areas` ON `cache_npa_areas`.`npa_id`=`npa_areas`.`id` \r\n\t       INNER JOIN `npa_types` ON `npa_areas`.`type_id`=`npa_types`.`id` \r\n\t            WHERE `cache_npa_areas`.`cache_id`='&1' AND `npa_types`.`no_warning`=1\r\n\t         GROUP BY `npa_areas`.`type_id`, `npa_areas`.`name`\r\n\t         ORDER BY `npa_types`.`ordinal` ASC", $cacheid);
$tpl->assign_rs('npaareasNoWarning', $rs);
开发者ID:RH-Code,项目名称:opencaching,代码行数:31,代码来源:viewcache.php

示例2: sql

        $start = 0;
    }
}
$count = 5000;
if (isset($_REQUEST['count'])) {
    $count = $_REQUEST['count'];
    if (!is_numeric($count)) {
        $count = 5000;
    }
}
//$tpl->caching = true;
//$tpl->cache_lifetime = 31*24*60*60;
//$tpl->cache_id = $cache_id . '|' . $start . '|' . $count;
if ($cache_id != 0) {
    //get cache record
    $rs = sql("SELECT `caches`.`cache_id`, `caches`.`wp_oc` AS `wpoc`, `caches`.`user_id` AS `userid`, `caches`.`name`, IFNULL(`stat_caches`.`found`, 0) AS `found`, IFNULL(`stat_caches`.`notfound`, 0) AS `notfound`, IFNULL(`stat_caches`.`note`, 0) AS `note`, `cache_status`.`allow_user_view` FROM `caches` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` LEFT JOIN `stat_caches` ON `caches`.`cache_id`=`stat_caches`.`cache_id` WHERE `caches`.`cache_id`='&1'", $cache_id);
    $rCache = sql_fetch_array($rs);
    sql_free_result($rs);
    if ($rCache === false) {
        $tpl->error(ERROR_CACHE_NOT_EXISTS);
    } else {
        if ($rCache['allow_user_view'] != 1 && $rCache['userid'] != $login->userid) {
            $tpl->error(ERROR_NO_ACCESS);
        }
    }
} else {
    $tpl->error(ERROR_CACHE_NOT_EXISTS);
}
$tpl->assign('cache', $rCache);
$tpl->assign('logs', cache::getLogsArray($cache_id, $start, $count));
$tpl->display();
开发者ID:RH-Code,项目名称:opencaching,代码行数:31,代码来源:viewlogs.php

示例3: sql

if (isset($_REQUEST['count'])) {
    $count = $_REQUEST['count'];
    if (!is_numeric($count)) {
        $count = 5000;
    }
}
$admin_access = ($login->admin && ADMIN_USER) > 0;
$deleted = @$_REQUEST['deleted'] > 0 && $admin_access;
//$tpl->caching = true;
//$tpl->cache_lifetime = 31*24*60*60;
//$tpl->cache_id = $cache_id . '|' . $start . '|' . $count;
if ($cache_id != 0) {
    //get cache record
    $rs = sql("\n\t\t\tSELECT\n\t\t\t\t`caches`.`cache_id`, `caches`.`wp_oc` AS `wpoc`, `caches`.`cache_id` AS `cacheid`,\n\t\t\t\t`caches`.`user_id` AS `userid`, `caches`.`name`,\n\t\t\t\t`caches`.`status` AS `status`,\n\t\t\t\t`caches`.`type` AS `type`,\n\t\t\t\t`caches`.`protect_old_coords` OR `user`.`is_active_flag`=0 AS `protect_old_coords`,\n\t\t\t\tIFNULL(`stat_caches`.`found`, 0) AS `found`,\n\t\t\t\tIFNULL(`stat_caches`.`notfound`, 0) AS `notfound`,\n\t\t\t\tIFNULL(`stat_caches`.`will_attend`, 0) AS `willattend`,\n\t\t\t\tIFNULL(`stat_caches`.`note`, 0) AS `note`,\n\t\t\t\t`cache_status`.`allow_user_view`\n\t\t\tFROM `caches`\n\t\t\tINNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`\n\t\t\tLEFT JOIN `stat_caches` ON `caches`.`cache_id`=`stat_caches`.`cache_id`\n\t\t\tINNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`\n\t\t\tWHERE `caches`.`cache_id`='&1'", $cache_id);
    $rCache = sql_fetch_array($rs);
    sql_free_result($rs);
    if ($rCache === false) {
        $tpl->error(ERROR_CACHE_NOT_EXISTS);
    } else {
        if ($rCache['allow_user_view'] != 1 && $rCache['userid'] != $login->userid && !$admin_access) {
            $tpl->error(ERROR_NO_ACCESS);
        }
    }
} else {
    $tpl->error(ERROR_CACHE_NOT_EXISTS);
}
$rCache['adminlog'] = $login->admin & ADMIN_USER;
$tpl->assign('cache', $rCache);
$tpl->assign('logs', cache::getLogsArray($cache_id, $start, $count, $deleted, $rCache['protect_old_coords']));
$tpl->assign('tagloadlogs', $tagloadlogs);
$tpl->display();
开发者ID:kirstenko,项目名称:oc-server3,代码行数:31,代码来源:viewlogs.php

示例4: current

            $rscount = 0;
            break;
        case 'A':
            $rscount = current(cache::getLogsCount($cacheid));
            // This option is also used when referencing logs, e.g. from log lists
            // and picture galleries.
            break;
        default:
            // This is currently used only for the print view function
            // with parameters 5 or 10.
            if ($_REQUEST['log'] >= 0 && $_REQUEST['log'] <= 100) {
                $rscount = $_REQUEST['log'] + 0;
            }
    }
}
$logs = cache::getLogsArray($cacheid, 0, $rscount + 1, false, $rCache['protect_old_coords']);
if (isset($logs[$rscount])) {
    unset($logs[$rscount]);
    $tpl->assign('morelogs', true);
}
$loganz = sizeof($logs);
$tpl->assign('logs', $logs);
$tpl->assign('loganz', $loganz);
/*end insertion Uwe 20091215*/
/* nature protection areas
 */
$rs = sql("SELECT `npa_areas`.`id` AS `npaId`, `npa_areas`.`type_id` AS `npaType`, `npa_areas`.`name` AS `npaName`, `npa_types`.`name` AS `npaTypeName`\n\t             FROM `cache_npa_areas`\n\t       INNER JOIN `npa_areas` ON `cache_npa_areas`.`npa_id`=`npa_areas`.`id`\n\t       INNER JOIN `npa_types` ON `npa_areas`.`type_id`=`npa_types`.`id`\n\t            WHERE `cache_npa_areas`.`cache_id`='&1' AND `npa_types`.`no_warning`=0\n\t         GROUP BY `npa_areas`.`type_id`, `npa_areas`.`name`\n\t         ORDER BY `npa_types`.`ordinal` ASC", $cacheid);
$tpl->assign_rs('npaareasWarning', $rs);
sql_free_result($rs);
$rs = sql("SELECT `npa_areas`.`id` AS `npaId`, `npa_areas`.`type_id` AS `npaType`, `npa_areas`.`name` AS `npaName`, `npa_types`.`name` AS `npaTypeName`\n\t             FROM `cache_npa_areas`\n\t       INNER JOIN `npa_areas` ON `cache_npa_areas`.`npa_id`=`npa_areas`.`id`\n\t       INNER JOIN `npa_types` ON `npa_areas`.`type_id`=`npa_types`.`id`\n\t            WHERE `cache_npa_areas`.`cache_id`='&1' AND `npa_types`.`no_warning`=1\n\t         GROUP BY `npa_areas`.`type_id`, `npa_areas`.`name`\n\t         ORDER BY `npa_types`.`ordinal` ASC", $cacheid);
$tpl->assign_rs('npaareasNoWarning', $rs);
开发者ID:kirstenko,项目名称:oc-server3,代码行数:31,代码来源:viewcache.php


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