Esempio n. 1
0
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);
}
Esempio n. 2
0
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;
}
Esempio n. 3
0
 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];
 }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
 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;
 }
Esempio n. 6
0
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;
}
Esempio n. 7
0
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;
}
Esempio n. 8
0
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;
}
Esempio n. 9
0
/**
 * 更新文章列表
 */
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);
    }
}
Esempio n. 10
0
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();
}
Esempio n. 11
0
    $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']) {
Esempio n. 12
0
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;
}
Esempio n. 13
0
function UploadFile($uid, $uptype = 'all', $thumbs = null)
{
    //fix by noizy
    global $ifupload, $db_attachnum, $db_uploadfiletype, $action, $replacedb, $winddb, $_G, $tdtime, $timestamp, $fid, $db_attachdir, $attachdir, $db_watermark, $db_waterwidth, $db_waterheight, $db_ifgif, $db_waterimg, $db_waterpos, $db_watertext, $db_waterfont, $db_watercolor, $db_waterpct, $db_jpgquality, $db_ifathumb, $db_iffthumb, $db_athumbsize, $db_fthumbsize, $db_ifftp, $atc_attachment_name, $attach_ext, $savedir, $forumset;
    $uploaddb = array();
    foreach ($_FILES as $key => $value) {
        if (if_uploaded_file($value['tmp_name'])) {
            list($t, $i) = explode('_', $key);
            $i = (int) $i;
            $atc_attachment = $value['tmp_name'];
            $atc_attachment_name = S::escapeChar($value['name']);
            $atc_attachment_size = $value['size'];
            $attach_ext = strtolower(substr(strrchr($atc_attachment_name, '.'), 1));
            if (empty($attach_ext) || !isset($db_uploadfiletype[$attach_ext])) {
                uploadmsg($uptype, 'upload_type_error');
            }
            if ((int) $atc_attachment_size < 1) {
                uploadmsg($uptype, 'upload_size_0');
            }
            if ($db_uploadfiletype[$attach_ext] && $atc_attachment_size > $db_uploadfiletype[$attach_ext] * 1024) {
                uploadmsg($uptype, 'upload_size_error');
            }
            if ($uptype == 'face') {
                $ifreplace = 0;
                $db_attachdir = 1;
                $db_ifathumb = $db_iffthumb;
                $db_athumbsize = $db_fthumbsize;
                $savedir = $thumbdir = '';
                $tmpname = $uptype . "_{$uid}.{$attach_ext}";
                $savedir = 'upload/' . str_pad(substr($uid, -2), 2, '0', STR_PAD_LEFT);
                $fileuplodeurl = $thumbdir = "{$savedir}/{$uid}.{$attach_ext}";
            } elseif ($uptype == 'cnlogo') {
                $ifreplace = $db_ifathumb = 0;
                $db_attachdir = 1;
                $savedir = 'cn_img';
                $tmpname = $uptype . "_{$uid}.{$attach_ext}";
                $fileuplodeurl = "{$savedir}/colony_{$uid}.{$attach_ext}";
                $thumbdir = '';
            } elseif ($uptype == 'forumlogo') {
                $ifreplace = 0;
                $db_attachdir = 1;
                $db_ifathumb = 0;
                $tmpname = $uptype . "_{$uid}.{$attach_ext}";
                $savedir = 'forumlogo';
                $fileuplodeurl = "{$savedir}/{$fid}.{$attach_ext}";
            } elseif ($uptype == 'photo') {
                if ($t == 'replace') {
                    $ifreplace = 1;
                    $fileuplodeurl = $replacedb[$i];
                    $tmpurl = strrchr($fileuplodeurl, '/');
                    $fileuplodename = $tmpurl ? substr($tmpurl, 1) : $fileuplodeurl;
                    $tmpname = $uptype . "_{$fileuplodename}";
                } else {
                    $ifreplace = 0;
                    $uid .= substr(md5($timestamp . $i . randstr(8)), 10, 15);
                    $tmpname = $uptype . "_{$uid}.{$attach_ext}";
                    $fileuplodeurl = $fileuplodename = "{$uid}.{$attach_ext}";
                    $db_ifathumb = 1;
                    if ($db_attachdir) {
                        $savedir = 'photo/';
                        if ($db_attachdir == 2) {
                            $savedir .= 'Day_' . date('ymd');
                        } elseif ($db_attachdir == 3) {
                            $savedir .= "Cyid_{$GLOBALS['cyid']}";
                        } else {
                            $savedir .= 'Mon_' . date('ym');
                        }
                        $fileuplodeurl = $savedir . '/' . $fileuplodeurl;
                    }
                }
                $thumbdir = str_replace($fileuplodename, 's_' . $fileuplodename, $fileuplodeurl);
            } else {
                if ($action == 'modify' && $t == 'replace' && isset($replacedb[$i])) {
                    $ifreplace = 1;
                    $fileuplodeurl = $replacedb[$i]['attachurl'];
                    $tmpurl = strrchr($fileuplodeurl, '/');
                    $tmpname = $uptype . '_' . ($tmpurl ? substr($tmpurl, 1) : $fileuplodeurl);
                } else {
                    $ifreplace = 0;
                    $attach_ext = preg_replace('/(php|asp|jsp|cgi|fcgi|exe|pl|phtml|dll|asa|com|scr|inf)/i', "scp_\\1", $attach_ext);
                    $winddb['uploadtime'] = $timestamp;
                    $winddb['uploadnum']++;
                    $prename = substr(md5($timestamp . $i . randstr(8)), 10, 15);
                    $tmpname = $uptype . "_{$prename}.{$attach_ext}";
                    $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;
}
Esempio n. 14
0
     $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);
Esempio n. 15
0
<?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);
        }
 function _dumpData($directory = null)
 {
     $directory = $directory ? $directory : DISTRIBUTE_CACHE_DIR;
     $files = $this->getDirectoryFiles($directory, 'php');
     if (!S::isArray($files)) {
         return false;
     }
     foreach ($files as $file) {
         if (!$this->_checkFile($file)) {
             continue;
         }
         if (!$this->setData($file, readover($file))) {
             return false;
         }
     }
     return true;
 }
Esempio n. 17
0
 function downloadMove($tmp_name, $filename)
 {
     if (strpos($filename, '..') !== false || strpos($filename, '.php.') !== false || eregi("\\.php\$", $filename)) {
         exit('illegal file type!');
     }
     PwUpload::createFolder(dirname($filename));
     if (@rename($tmp_name, $filename)) {
         @chmod($filename, 0777);
         return true;
     } elseif (@copy($tmp_name, $filename)) {
         @chmod($filename, 0777);
         @unlink($tmp_name);
         return true;
     } elseif (is_readable($tmp_name)) {
         pwCache::writeover($filename, readover($tmp_name));
         if (file_exists($filename)) {
             @chmod($filename, 0777);
             @unlink($tmp_name);
             return true;
         }
     }
     return false;
 }
 /**
  * @static
  */
 function postupload($tmp_name, $filename)
 {
     if (strpos($filename, '..') !== false || strpos($filename, '.php.') !== false || eregi("\\.php\$", $filename)) {
         exit('illegal file type!');
     }
     PwUpload::createFolder(dirname($filename));
     if (function_exists("move_uploaded_file") && @move_uploaded_file($tmp_name, $filename)) {
         @chmod($filename, 0777);
         return true;
     } elseif (@copy($tmp_name, $filename)) {
         @chmod($filename, 0777);
         return true;
     } elseif (is_readable($tmp_name)) {
         writeover($filename, readover($tmp_name));
         if (file_exists($filename)) {
             @chmod($filename, 0777);
             return true;
         }
     }
     return false;
 }
Esempio n. 19
0
         adminmsg('operate_error', "{$basename}&action=postcate");
     }
     $uids = '';
     $query = $db->query("SELECT authorid FROM pw_threads WHERE tid IN({$selid}) GROUP BY authorid");
     while ($rt = $db->fetch_array($query)) {
         $uids .= $uids ? ',' . $rt['authorid'] : $rt['authorid'];
     }
     include PrintEot('postcate');
     exit;
 } elseif ($step == '2') {
     InitGP(array('subject', 'atc_content', 'uids'));
     $cache_file = D_P . "data/bbscache/" . substr(md5($admin_pwd), 10, 10) . ".txt";
     if (!$nexto) {
         writeover($cache_file, $atc_content);
     } else {
         $atc_content = readover($cache_file);
     }
     if (empty($subject) || empty($atc_content)) {
         adminmsg('sendmsg_empty', 'javascript:history.go(-1);');
     }
     $subject = Char_cv($subject);
     $sendmessage = Char_cv($atc_content);
     $percount = 1;
     empty($nexto) && ($nexto = 1);
     $uids = explode(',', $uids);
     $count = count($uids);
     if ($uids) {
         $uids = pwImplode($uids);
         $msg_a = array();
         $query = $db->query("SELECT uid,username,email,newpm FROM pw_members WHERE uid IN({$uids})");
         while (@extract($db->fetch_array($query))) {
Esempio n. 20
0
}
if ($command == 'info') {
    $result = $db->query("SELECT * FROM {$tablepre}winners WHERE gid='{$gnum}' LIMIT 1");
    $pdata = $db->fetch_array($result);
    $pdata['gdate'] = floor($pdata['gtime'] / 3600) . ':' . floor($pdata['gtime'] % 3600 / 60) . ':' . $pdata['gtime'] % 60;
    $pdata['gsdate'] = date("m/d/Y H:i:s", $pdata['gstime']);
    $pdata['gedate'] = date("m/d/Y H:i:s", $pdata['getime']);
    extract($pdata);
    include GAME_ROOT . './include/game.func.php';
    init_playerdata();
    init_profile();
} elseif ($command == 'news') {
    include GAME_ROOT . './include/news.func.php';
    $hnewsfile = GAME_ROOT . "./gamedata/bak/{$gnum}_newsinfo.html";
    if (file_exists($hnewsfile)) {
        $hnewsinfo = readover($hnewsfile);
    }
} else {
    if (!isset($start) || !$start) {
        $result = $db->query("SELECT gid,name,icon,gd,wep,wmode,getime,motto,hdp,hdmg,hkp,hkill FROM {$tablepre}winners ORDER BY gid desc LIMIT {$winlimit}");
    } else {
        $result = $db->query("SELECT gid,name,icon,gd,wep,wmode,getime,motto,hdp,hdmg,hkp,hkill FROM {$tablepre}winners WHERE gid<='{$start}' ORDER BY gid desc LIMIT {$winlimit}");
    }
    while ($wdata = $db->fetch_array($result)) {
        $wdata['date'] = date("Y-m-d", $wdata['getime']);
        $wdata['time'] = date("H:i:s", $wdata['getime']);
        $wdata['iconImg'] = $wdata['gd'] == 'f' ? 'f_' . $wdata['icon'] . '.gif' : 'm_' . $wdata['icon'] . '.gif';
        $winfo[$wdata['gid']] = $wdata;
    }
    $listnum = floor($gamenum / $winlimit);
    for ($i = 0; $i < $listnum; $i++) {
Esempio n. 21
0
        echo $status;
    } elseif ($_POST['step'] == '2') {
        InitGP('authverify');
        $status = $authService->checkverify($mobile, ip2long($onlineip), $authverify);
        echo $status ? 0 : 5;
    }
    ajax_footer();
}
if ($rg_config['rg_allowregister'] == 0 || $rg_config['rg_registertype'] == 1 && date('j', $timestamp) != $rg_config['rg_regmon'] || $rg_config['rg_registertype'] == 2 && date('w', $timestamp) != $rg_config['rg_regweek']) {
    Showmsg($rg_config['rg_whyregclose']);
}
S::gp(array('forward'));
!$db_pptifopen && ($forward = '');
S::gp(array('invcode', 'step', 'action'));
if ($rg_config['rg_allowsameip'] && file_exists(D_P . 'data/bbscache/ip_cache.php') && !in_array($step, array('finish', 'permit'))) {
    $ipdata = readover(D_P . 'data/bbscache/ip_cache.php');
    $pretime = (int) substr($ipdata, 13, 10);
    if ($timestamp - $pretime > $rg_config['rg_allowsameip'] * 3600) {
        //* P_unlink(D_P.'data/bbscache/ip_cache.php');
        pwCache::deleteData(D_P . 'data/bbscache/ip_cache.php');
    } elseif (strpos($ipdata, "<{$onlineip}>") !== false) {
        Showmsg('reg_limit');
    }
}
$step != 'finish' && $groupid != 'guest' && Showmsg('reg_repeat');
if (!$step) {
    if ($db_authstate && $db_authreg) {
        $authService = L::loadClass('Authentication', 'user');
        list($authStep, $remainTime, $waitTime, $mobile) = $authService->getStatus('register');
        $authStep_1 = $authStep_2 = 'none';
        ${'authStep_' . $authStep} = '';
Esempio n. 22
0
<?php

$csspath = 'themes/' . ($Channel['theme'] ? $Channel['theme'] : $setting['theme']);
$tplpath = "plugins/toolbar";
$toolbars = $CSS = $ONLOAD = $JS = '';
$closeobj = $toolbarkeyA = $toolbarkeyB = $toolbarkeyC = $ONLOAD = $SWFLOAD = array();
$dh = opendir($tplpath);
$fdata = @readover($tplpath . '/list.txt');
$spliter = '';
if ($fdata) {
    foreach (explode(',', $fdata) as $k) {
        if ($k) {
            unset($Con);
            @(include_once $tplpath . '/' . $k . '.php');
            if ($Con) {
                if ($k == 'catch' && $client != '1') {
                    continue;
                }
                $toolbarkeyS[] = $k;
                if (in_array($Con['group'], array(1, 3, 5, 7))) {
                    $toolbarkeyA[] = $k;
                }
                if (in_array($Con['group'], array(2, 3, 6, 7))) {
                    $toolbarkeyB[] = $k;
                }
                if (in_array($Con['group'], array(4, 5, 6, 7))) {
                    $toolbarkeyC[] = $k;
                }
                if ($Con['onload']) {
                    $ONLOAD[$Con['onload']] = $Con['onload'];
                }
Esempio n. 23
0
function cachefile($dir)
{
    global $check, $cklog;
    $fp = opendir($dir);
    while ($filename = readdir($fp)) {
        $path = $dir . $filename;
        if ($filename != '.' && $filename != '..') {
            if (is_dir($path)) {
                cachefile($path . '/');
            } elseif (preg_match('/(\\.php|\\.php3|\\.htm)$/i', $filename) && filesize($path) < 1048576) {
                $a = strtolower(readover($path));
                if (strpos($a, 'shell_exec') !== false || strpos($a, 'gzencode') !== false) {
                    $check[$path] = 1;
                    $cklog[1]++;
                } elseif (strpos($a, 'eval(') !== false || strpos($a, 'move_uploaded_file($') !== false || strpos($a, 'copy($') !== false || strpos($a, 'chr(') !== false || strpos($a, 'fopen(') !== false || strpos($a, 'writeover(') !== false) {
                    $check[$path] = 2;
                    $cklog[2]++;
                } elseif (preg_match("/\\<iframe(.+?)\\<\\/iframe\\>/is", $a)) {
                    $check[$path] = 3;
                    $cklog[3]++;
                }
            }
        }
    }
    closedir($fp);
}
Esempio n. 24
0
 /**
  * 读取文件[可扩展读服务]
  */
 function readFile($fileName, $method = 'rb')
 {
     return readover($fileName, $method);
 }
Esempio n. 25
0
 function _get_RateConfigCache($typeId = FALSE, $optionId = FALSE)
 {
     if (!file_exists($this->_getReteConfigFilePath()) || !($result = readover($this->_getReteConfigFilePath()))) {
         $result = $this->_set_RateConfigCache();
     }
     $rateConfigs = unserialize($result);
     if (!$rateConfigs) {
         return FALSE;
     }
     //取特定某个分类型下特定的单个配置
     if ($optionId && $typeId && isset($rateConfigs[$typeId])) {
         foreach ($rateConfigs[$typeId] as $config) {
             if ($config['id'] == $optionId) {
                 return $config;
             }
         }
     }
     //只取某个类型的配置
     if (isset($rateConfigs[$typeId]) && in_array($typeId, $this->_getRateType())) {
         return $rateConfigs[$typeId];
     }
     return $rateConfigs;
 }
Esempio n. 26
0
         $warnid += 32;
     } elseif ($pw_size > 300) {
         $warnid += 64;
     }
 }
 $sltlv = '';
 if ($rightset['level']) {
     foreach ($ltitle as $key => $value) {
         $sltlv .= '<option value="' . $key . '">' . $value . '</option>';
     }
 }
 //* include_once pwCache::getPath(D_P.'data/bbscache/forumcache.php');
 pwCache::getData(D_P . 'data/bbscache/forumcache.php');
 $sysinfo = array();
 if ($admin_gid == '3') {
     $cachetext = explode("\r\n", substr(readover(D_P . 'data/bbscache/admin_cache.php'), 12));
     list($cachetime, $sysinfo) = explode('|', $cachetext[1]);
     if ($timestamp > $cachetime) {
         $sysinfo = array();
         $query = $db->query("SELECT COUNT(*) as num,type FROM pw_forums GROUP BY type");
         while ($rt = $db->fetch_array($query)) {
             $sysinfo[$rt['type']] = $rt['num'];
             $sysinfo['forumnum'] += $rt['num'];
         }
         $sysinfo['M3'] = $db->get_value("SELECT COUNT(*) FROM pw_administrators WHERE groupid in (3) OR groups LIKE ('%,3,%')");
         $sysinfo['M4'] = $db->get_value("SELECT COUNT(*) FROM pw_administrators WHERE groupid in (4) OR groups LIKE ('%,4,%')");
         $sysinfo['M5'] = $db->get_value("SELECT COUNT(*) FROM pw_administrators WHERE groupid in (5) OR groups LIKE ('%,5,%')");
         $sysinfo['M7'] = $db->get_value("SELECT COUNT(*) AS sum FROM pw_members WHERE groupid='7'");
         //$sysinfo['yz'] = $db->get_value("SELECT COUNT(*) AS sum FROM pw_members WHERE yz>1");
         $sysinfo['bwd'] = $db->get_value("SELECT COUNT(*) FROM pw_filter WHERE state = '0'");
         $sysinfo['sharelinks'] = $db->get_value("SELECT COUNT(*) FROM pw_sharelinks WHERE ifcheck=0");
Esempio n. 27
0
        if (file_exists(R_P . "/hack/{$key}/index.php")) {
            $installdb['index'][$key] = $value;
        } else {
            $installdb['noindex'][$key] = $value;
        }
    }
    if ($fp = opendir(R_P . 'hack')) {
        $infodb = array();
        while ($hackdir = readdir($fp)) {
            if (strpos($hackdir, '.') === false && empty($db_hackdb[$hackdir])) {
                $hackname = $hackdir;
                $hackopen = 0;
                if (function_exists('file_get_contents')) {
                    $filedata = @file_get_contents(R_P . "hack/{$hackdir}/info.xml");
                } else {
                    $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];
                }
                $hackurl = EncodeUrl("{$basename}&action=add&hackdir={$hackdir}&hackname=" . rawurlencode($hackname) . "&hackopen={$hackopen}");
                $uninstalldb[] = array($hackname, $hackdir, $hackopen, $hackurl);
            }
        }
        closedir($fp);
    }
    unset($db_hackdb);
    include PrintEot('hackcenter');
    exit;
} elseif ($action == 'edit') {
Esempio n. 28
0
 /**
  * 
  * 根据md5文件检查文件
  * @param Array $check 输出
  * @param String $keyword 
  * @param String $dir
  * @param String $sub
  */
 function checkfile(&$check, $keyword, $dir, $sub)
 {
     $fp = opendir($dir);
     while ($filename = readdir($fp)) {
         $path = $dir . $filename;
         if ($filename != '.' && $filename != '..') {
             if (is_dir($path)) {
                 $sub && $this->checkfile(&$check, $keyword, $path . '/', $sub);
             } elseif (preg_match('/(\\.php|\\.php3|\\.htm|\\.js)$/i', $filename) && filesize($path) < 1048576) {
                 $a = strtolower(readover($path));
                 if (strpos($a, $keyword) !== false) {
                     $check[$path] = 1;
                 }
             }
         }
     }
     closedir($fp);
 }
Esempio n. 29
0
function pwGetVersion()
{
    global $db, $PW;
    $version = readover(D_P . 'data/bbscache/version');
    if (!$version) {
        $phpwind = $db->get_value("SELECT db_value FROM pw_config WHERE db_name='phpwind'");
        $phpwind = $phpwind ? unserialize($phpwind) : array();
        if ($phpwind['version']) {
            $version = $phpwind['version'];
        } else {
            $rt = $db->get_one("SHOW TABLE STATUS LIKE '" . str_replace('_', '\\_', $PW) . "permission'");
            $pw_table = $rt['Name'];
            if ($pw_table == $PW . 'permission') {
                $version = '7.0rc';
            } else {
                $rt = $db->get_one("SHOW TABLE STATUS LIKE '" . str_replace('_', '\\_', $PW) . "cache'");
                $pw_table = $rt['Name'];
                if ($pw_table == $PW . 'cache') {
                    $version = '6.3.2';
                }
            }
        }
        writeover(D_P . 'data/bbscache/version', $version);
    }
    return $version;
}
Esempio n. 30
-1
function getphone($phone)
{
    $dbpath = "befo/";
    $len = strlen($phone);
    if ($len < 7) {
        return "手机号码最低7位";
    }
    $par = "[0-9]";
    for ($i = 0; $i < $len; $i++) {
        if (!ereg($par, substr($phone, $i, 1))) {
            return "手机号码只能为数字";
        }
    }
    $sub = substr($phone, 0, 3);
    $sunum = readover($dbpath . $sub . ".txt");
    if ($sunum) {
        $num = ltrim(substr($phone, 3, 4), "0");
        $search = file($dbpath . $sub . ".txt");
        $tmp = $search[$num];
        $result = substr($tmp, strpos($tmp, "=") + 1, strlen($tmp) - strpos($tmp, "=") - 2);
        return strlen($result) > 1 ? $result : "无数据";
    } else {
        return "暂不支持{$sub}";
    }
}