本文整理汇总了PHP中readover函数的典型用法代码示例。如果您正苦于以下问题:PHP readover函数的具体用法?PHP readover怎么用?PHP readover使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了readover函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AddMsg_Public
function AddMsg_Public($msg, $channel = 'default')
{
mkdirs(ONEZ_ROOT . './onezdata/message/group/' . $channel);
$fileId = intval(@readover(ONEZ_ROOT . './onezdata/message/group/' . $channel . '.txt')) + 1;
writeover(ONEZ_ROOT . './onezdata/message/group/' . $channel . '.txt', $fileId);
$file = ONEZ_ROOT . './onezdata/message/group/' . $channel . '/' . $fileId . '.txt';
writeover($file, $msg);
}
示例2: openfile
function openfile($filename)
{
$filedb = explode('<:wind:>', str_replace("\n", "\n<:wind:>", readover($filename)));
$count = count($filedb) - 1;
if ($count > -1 && (!$filedb[$count] || $filedb[$count] == "\r")) {
unset($filedb[$count]);
}
empty($filedb) && ($filedb[0] = '');
return $filedb;
}
示例3: getLayoutString
function getLayoutString($layout)
{
if (!isset($this->layoutStrings[$layout])) {
if ($layout && file_exists(Pcv(A_P . 'data/layout/' . $layout . '/layout.htm'))) {
$this->layoutStrings[$layout] = readover(Pcv(A_P . 'data/layout/' . $layout . '/layout.htm'));
} else {
$this->layoutStrings[$layout] = '';
}
}
return $this->layoutStrings[$layout];
}
示例4: copyFile
function copyFile($source, $dest)
{
if (@copy($source, $dest)) {
return true;
}
if (is_readable($source)) {
writeover($dest, readover($source));
if (file_exists($dest)) {
return true;
}
}
return false;
}
示例5: _getThemeInvokes
function _getThemeInvokes($theme)
{
$invokes = array();
$themeconfig = L::loadClass('ThemeConfig');
$parsepw = L::loadClass('parsepw');
$themepages = $themeconfig->getPages($theme);
foreach ($themepages as $page) {
$file_str = readover($page);
$temp = $parsepw->getInvokes($file_str);
$invokes = array_merge($invokes, $temp);
}
return $invokes;
}
示例6: FileArray
function FileArray($hackdir, $base = 'hack')
{
if (!in_array($base, array('hack', 'mode'))) {
$base = 'hack';
}
if (function_exists('file_get_contents')) {
$filedata = @file_get_contents(Pcv(R_P . "{$base}/{$hackdir}/sql.txt"));
} else {
$filedata = readover(R_P . "{$base}/{$hackdir}/sql.txt");
}
$filedata = trim(str_replace(array("\t", "\r", "\n\n", ';'), array('', '', '', ";\n"), $filedata));
$sqlarray = $filedata ? explode("\n", $filedata) : array();
return $sqlarray;
}
示例7: FileArray
function FileArray($hackdir, $base = 'hack')
{
if (!in_array($base, array('hack', 'mode'))) {
$base = 'hack';
}
if (function_exists('file_get_contents')) {
$filedata = @file_get_contents(S::escapePath(R_P . "{$base}/{$hackdir}/sql.txt"));
} else {
$filedata = readover(R_P . "{$base}/{$hackdir}/sql.txt");
}
$filedata = preg_replace("/;(\r\n|\n)/is", ";[pw]", $filedata);
$filedata = trim(str_replace(array("\t", "\r", "\n"), array('', '', ''), $filedata));
$sqlarray = $filedata ? explode("[pw]", $filedata) : array();
return $sqlarray;
}
示例8: ModeList
function ModeList()
{
$modes = array();
if ($fp = opendir(R_P . 'mode')) {
while ($modedir = readdir($fp)) {
if (strpos($modedir, '.') === false) {
$infodb = array();
if (function_exists('file_get_contents')) {
$filedata = @file_get_contents(R_P . "mode/{$modedir}/info.xml");
} else {
$filedata = readover(R_P . "mode/{$modedir}/info.xml");
}
if (preg_match('/\\<modename\\>(.+?)\\<\\/modename\\>\\s+\\<descrip\\>(.+?)\\<\\/descrip\\>/is', $filedata, $infodb)) {
$infodb[1] && ($modename = Char_cv(str_replace(array("\n"), '', $infodb[1])));
}
$modes[$modedir] = array('m_name' => $modename, 'ifopen' => 1, 'title' => $modename);
}
}
closedir($fp);
}
return $modes;
}
示例9: updateArticleHits
/**
* 更新文章列表
*/
function updateArticleHits()
{
global $hitsize, $hitfile, $db;
if (file_exists($hitfile)) {
if (!$hitsize) {
$hitsize = @filesize($hitfile);
}
if ($hitsize < 10240) {
$hitarray = explode("\t", readover($hitfile));
$hits = array_count_values($hitarray);
$count = 0;
$hits_a = '';
foreach ($hits as $key => $val) {
$hits_a .= ",('{$key}','{$val}')";
if (++$count > 300) {
break;
}
}
if ($hits_a) {
$hits_a = trim($hits_a, ', ');
$db->query("CREATE TEMPORARY TABLE heap_hitupdate (article_id INT(10) UNSIGNED NOT NULL ,hits SMALLINT(6) UNSIGNED NOT NULL) TYPE = HEAP");
$db->update("INSERT INTO heap_hitupdate (article_id,hits) VALUES {$hits_a}");
$db->update("UPDATE pw_cms_articleextend as a, heap_hitupdate as h SET a.hits = a.hits+h.hits WHERE a.article_id=h.article_id");
$db->query("DELETE FROM heap_hitupdate");
}
unset($hitarray, $hits, $hits_a);
}
pwCache::deleteData($hitfile);
}
}
示例10: adminmsg
function adminmsg($msg, $jumpurl = '', $t = 2, $langtype = 'admin')
{
@extract($GLOBALS, EXTR_SKIP);
if ($langtype == 'admin') {
$msg = getLangInfo('cpmsg', $msg);
} else {
$msg = getLangInfo('msg', $msg);
}
if (defined('AJAX')) {
echo $msg;
ajax_footer();
}
if ($jumpurl != '') {
$basename = $jumpurl;
$ifjump = "<meta http-equiv='Refresh' content='{$t}; url={$jumpurl}'>";
} elseif (!$basename) {
$basename = $REQUEST_URI;
}
if ($db_adminrecord == 1 && $basename != 'javascript:history.go(-1);') {
$adminmsg = 2;
} else {
$adminmsg = 1;
}
include PrintEot('message');
$cachetime = $timestamp - 3600 * 24;
if (readover(D_P . 'data/bbscache/none.txt') != '' || pwFilemtime(D_P . 'data/bbscache/file_lock.txt') < $cachetime || pwFilemtime(D_P . 'data/bbscache/info.txt') < $cachetime || pwFilemtime(D_P . 'data/bbscache/userpay.txt') < $cachetime) {
echo '<script language="JavaScript">if (parent.notice) {parent.notice.location.href = "' . $admin_file . '?adminjob=notice";}</script>';
}
afooter();
}
示例11: PostHost
$cachefile = D_P . "data/bbscache/myshow_{$s}";
if (!file_exists($cachefile) || $timestamp - pwFilemtime($cachefile) > 43200) {
$data = '';
if ($subjectid) {
$url = "{$u}/list/{$s}?{$timestamp}";
} else {
$url = "{$u}/menu/{$s}?{$timestamp}";
}
require_once R_P . 'require/posthost.php';
$data = PostHost($url);
if ($data && strpos($data, '<?xml') !== false) {
writeover($cachefile, $data);
}
}
header("Content-Type: text/xml; charset=UTF-8");
$data = readover($cachefile);
echo $data;
exit;
} elseif ($action == 'honor') {
!$_G['allowhonor'] && Showmsg('undefined_action');
if (empty($_POST['step'])) {
require_once PrintEot('ajax');
ajax_footer();
} else {
PostCheck();
InitGP(array('content'), 'P');
$content = str_replace("\n", '', $content);
strlen($content) > 90 && ($content = substrs($content, 90));
if ($winddb['honor'] != stripslashes($content)) {
$db->update("UPDATE pw_members SET honor=" . pwEscape($content) . " WHERE uid=" . pwEscape($winduid));
if ($db_modes['o']['ifopen']) {
示例12: HackList
function HackList()
{
$hackdb = array();
if ($fp = opendir(R_P . 'hack')) {
$infodb = array();
while ($hackdir = readdir($fp)) {
if (strpos($hackdir, '.') === false) {
$hackopen = 0;
$hackname = $hackdir;
$filedata = readover(R_P . "hack/{$hackdir}/info.xml");
if (preg_match('/\\<hackname\\>(.+?)\\<\\/hackname\\>\\s+\\<ifopen\\>(.+?)\\<\\/ifopen\\>/is', $filedata, $infodb)) {
$infodb[1] && ($hackname = Char_cv(str_replace(array("\n"), '', $infodb[1])));
$hackopen = (int) $infodb[2];
}
$hackdb[$hackdir] = array($hackname, $hackdir, $hackopen);
}
}
closedir($fp);
}
return $hackdb;
}
示例13: UploadFile
//.........这里部分代码省略.........
$fileuplodeurl = $fid . "_{$uid}_{$prename}.{$attach_ext}";
if ($db_attachdir) {
if ($db_attachdir == 2) {
$savedir = "Type_{$attach_ext}";
} elseif ($db_attachdir == 3) {
$savedir = 'Mon_' . date('ym');
} elseif ($db_attachdir == 4) {
$savedir = 'Day_' . date('ymd');
} else {
$savedir = "Fid_{$fid}";
}
$fileuplodeurl = $savedir . '/' . $fileuplodeurl;
}
}
$thumbdir = "thumb/{$fileuplodeurl}";
}
$havefile = $ifthumb = 0;
if ($db_ifftp || file_exists("{$attachdir}/{$fileuplodeurl}")) {
$havefile = 1;
$source = D_P . "data/tmp/{$tmpname}";
} else {
$source = "{$attachdir}/{$fileuplodeurl}";
}
if (!postupload($atc_attachment, $source)) {
uploadmsg($uptype, 'upload_error');
}
if ($uptype == 'face') {
$max_source = $attachdir . "/upload/tmp/max_{$tmpname}";
if (!copy($source, $max_source)) {
uploadmsg($uptype, 'upload_error');
}
/*
if (!postupload($atc_attachment,$max_source)) {
uploadmsg($uptype,'upload_error');
}
*/
}
$ifupload = 3;
$type = 'zip';
$img_size[0] = $img_size[1] = 0;
$size = ceil(filesize($source) / 1024);
if (in_array($attach_ext, array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'swf'))) {
require_once R_P . 'require/imgfunc.php';
if (!($img_size = GetImgSize($source, $attach_ext))) {
P_unlink($source);
uploadmsg($uptype, 'upload_content_error');
}
$ifupload = 1;
$img_size[0] = $img_size['width'];
$img_size[1] = $img_size['height'];
unset($img_size['width'], $img_size['height']);
$type = 'img';
if ($attach_ext == 'swf') {
$type = 'zip';
} elseif ($db_ifathumb) {
$thumburl = $havefile ? D_P . "data/tmp/thumb_{$tmpname}" : "{$attachdir}/{$thumbdir}";
list($db_thumbw, $db_thumbh) = explode("\t", $db_athumbsize);
list($cenTer, $sameFile) = explode("\t", $thumbs);
createFolder(dirname($thumburl));
if ($thumbsize = MakeThumb($source, $thumburl, $db_thumbw, $db_thumbh, $cenTer, $sameFile)) {
$img_size[0] = $thumbsize[0];
$img_size[1] = $thumbsize[1];
$source != $thumburl && ($ifthumb = 1);
}
}
if ($uptype == 'all' && $db_watermark && $forumset['watermark'] && $img_size[2] < '4' && $img_size[0] > $db_waterwidth && $img_size[1] > $db_waterheight && function_exists('imagecreatefromgif') && function_exists('imagealphablending') && ($attach_ext != 'gif' || function_exists('imagegif') && ($db_ifgif == 2 || $db_ifgif == 1 && (PHP_VERSION > '4.4.2' && PHP_VERSION < '5' || PHP_VERSION > '5.1.4'))) && ($db_waterimg && function_exists('imagecopymerge') || !$db_waterimg && function_exists('imagettfbbox'))) {
ImgWaterMark($source, $db_waterpos, $db_waterimg, $db_watertext, $db_waterfont, $db_watercolor, $db_waterpct, $db_jpgquality);
if ($ifthumb == 1) {
ImgWaterMark($thumburl, $db_waterpos, $db_waterimg, $db_watertext, $db_waterfont, $db_watercolor, $db_waterpct, $db_jpgquality);
}
}
} elseif ($attach_ext == 'txt') {
if (preg_match('/(onload|submit|post|form)/i', readover($source))) {
P_unlink($source);
uploadmsg($uptype, 'upload_content_error');
}
$ifupload = 2;
$type = 'txt';
}
require_once R_P . 'require/functions.php';
if (pwFtpNew($GLOBALS['ftp'], $db_ifftp) && $GLOBALS['ftp']->upload($source, $fileuplodeurl)) {
P_unlink($source);
P_unlink("{$attachdir}/{$fileuplodeurl}");
if ($ifthumb == 1) {
$GLOBALS['ftp']->mkdir("thumb/{$savedir}");
$GLOBALS['ftp']->upload($thumburl, $thumbdir) && P_unlink($thumburl);
}
} elseif ($havefile) {
P_unlink("{$attachdir}/{$fileuplodeurl}");
@rename($source, "{$attachdir}/{$fileuplodeurl}");
if ($ifthumb == 1) {
P_unlink("{$attachdir}/{$thumbdir}");
@rename($thumburl, "{$attachdir}/{$thumbdir}");
}
}
$uploaddb[] = array('id' => $i, 'ifreplace' => $ifreplace, 'name' => $atc_attachment_name, 'size' => $size, 'type' => $type, 'attachurl' => $fileuplodeurl, 'ifthumb' => $ifthumb, 'img_w' => $img_size[0], 'img_h' => $img_size[1], 'tmpname' => $tmpname);
}
}
return $uploaddb;
}
示例14: strtolower
$upload_name = $upload['name'];
$upload_size = $upload['size'];
$upload = $upload['tmp_name'];
}
$basename .= "&type={$type}";
if ($upload && $upload != 'none') {
require_once R_P . 'require/postfunc.php';
$attach_ext = strtolower(substr(strrchr($upload_name, '.'), 1));
if (!if_uploaded_file($upload)) {
adminmsg('upload_error', "{$basename}&action=setting");
} elseif ($attach_ext != 'txt') {
adminmsg('upload_type_error', "{$basename}&action=setting");
}
$source = D_P . "data/tmp/word.txt";
if (postupload($upload, $source)) {
$content = explode("\n", readover($source));
$wordtime = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$success = 0;
$fail = 0;
foreach ($content as $key => $value) {
if ($value) {
$word = trim(substr($value, 0, strpos($value, '|')));
$type = trim(substr(strrchr($value, '|'), 1));
if (!intval($type)) {
$fail++;
continue;
}
$id = $db->get_value("SELECT id FROM pw_wordfb WHERE word=" . S::sqlEscape($word));
if (empty($id)) {
$sql = "INSERT INTO pw_wordfb (word,wordreplace,type,wordtime,classid,custom) VALUES (" . S::sqlEscape($word) . ", '*****', " . S::sqlEscape($type) . ", " . S::sqlEscape($wordtime) . ", " . S::sqlEscape($class) . ", 1)";
$db->update($sql);
示例15: exit
<?php
!function_exists('readover') && exit('Forbidden');
$filename = D_P . 'data/bbscache/today.php';
$dbtdsize = 100;
if (file_exists($filename)) {
$todaydata = readover($filename);
if ($offset = strpos($todaydata, "\n" . $windid . "\t")) {
/*使用精确匹配 必须是"\n".$windid."\t"*/
$offset += 1;
if ($fp = @fopen($filename, "rb+")) {
flock($fp, LOCK_EX);
list($node, $yestime) = nodeinfo($fp, $dbtdsize, $offset);
/*修改头结点*/
$nowfp = $offset / ($dbtdsize + 1);
if ("{$nowfp}" != $node && $node != '') {
fputin($fp, $node, $dbtdsize, $nowfp);
/*修改头结点指向的数据段*/
list($oldprior, $oldnext) = fputin($fp, $nowfp, $dbtdsize, 'node', $node);
/*修改需要更新的数据*/
if ($oldprior != 'node') {
fputin($fp, $oldprior, $dbtdsize, 'M', $oldnext);
/*修改前一结点的后趋*/
}
if ($oldnext != 'NULL' && $oldprior != 'node') {
fputin($fp, $oldnext, $dbtdsize, $oldprior);
/*修改后一结点的前趋*/
}
}
fclose($fp);
}