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


PHP P_unlink函数代码示例

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


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

示例1: fhtml

function fhtml($txt, $html, $dir = "", $mu = "", $cahehtm)
{
    //$txt = file_get_contents($file);
    if ($dir != '') {
        $newdir = explode("/", $dir);
        $listdir = "";
        foreach ($newdir as $value) {
            $listdir .= "/{$value}";
            if (!is_dir(R_P . "html{$listdir}")) {
                mkdir(R_P . "html{$listdir}", 0777);
            }
        }
    }
    if ($mu != '') {
        $patterns = array("/(=)('|\"{0,1})(lang|image|attach|\\.)(\\/)(\\W?)(.*?)(\\W?)( |'|\"|>{1,2})/is");
        $replace = array("\\1\\2{$mu}\\3\\4\\5\\6\\7\\8");
        $txt = preg_replace($patterns, $replace, $txt);
    }
    if ($cahehtm) {
        P_unlink(R_P . $html);
    }
    $fp = fopen(R_P . $html, "w");
    flock($fp, LOCK_EX);
    fwrite($fp, $txt);
    fclose($fp);
    //关闭指针
    if (is_dir($mu) !== TRUE) {
        mkdir($mu, 0777);
    }
    chmod(R_P . $html, 0777);
}
开发者ID:holin,项目名称:sstour,代码行数:31,代码来源:html_fun.php

示例2: resetCloudWind

 function resetCloudWind()
 {
     $GLOBALS['db']->query("DELETE FROM `pw_config` WHERE db_name = 'db_yunsearch_search'");
     $GLOBALS['db']->query("DELETE FROM `pw_config` WHERE db_name = 'db_yunsearch_hook'");
     $GLOBALS['db']->query("DELETE FROM `pw_config` WHERE db_name = 'db_yunsearch_search'");
     $GLOBALS['db']->query("DELETE FROM `pw_config` WHERE db_name = 'db_yunsearch_domain'");
     $GLOBALS['db']->query("DELETE FROM `pw_config` WHERE db_name = 'db_yunsearch_isopen'");
     $GLOBALS['db']->query("DELETE FROM `pw_config` WHERE db_name = 'db_yunsearch_unique'");
     $GLOBALS['db']->query("DELETE FROM `pw_config` WHERE db_name = 'db_yundefend_shield'");
     $GLOBALS['db']->query("DELETE FROM `pw_config` WHERE db_name = 'db_yundefend_shielduser'");
     $GLOBALS['db']->query("DELETE FROM `pw_config` WHERE db_name = 'db_yundefend_shieldpost'");
     $GLOBALS['db']->query("DELETE FROM `pw_config` WHERE db_name = 'db_yun_model'");
     $GLOBALS['db']->query("DELETE FROM `pw_config` WHERE db_name = 'db_yun_expand'");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_aggregate`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_attachs`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_colonys`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_diary`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_forums`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_members`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_postdefend`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_posts`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_postverify`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_setting`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_threads`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_userdefend`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_log_weibos`");
     $GLOBALS['db']->query("TRUNCATE TABLE `pw_yun_setting`");
     P_unlink(D_P . 'data/bbscache/cloudwind_logsettings.php');
     P_unlink(D_P . 'data/bbscache/cloudwind_settings.php');
     P_unlink(D_P . 'data/bbscache/cloudwind_postinfo.php');
     require_once R_P . 'admin/cache.php';
     updatecache_c();
     return true;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:34,代码来源:platform.reset.class.php

示例3: update

 function update()
 {
     if ($this->_fileSize && ($this->_fileSize > $this->_maxFileSizeLimit || $this->_timestamp - $this->_lastUpdateTime > $this->_statisticTimeNode)) {
         $this->_updateDb();
         P_unlink($this->_filePath);
     }
     return true;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:8,代码来源:keywordstatistic.class.php

示例4: clearguestcache

function clearguestcache($tid, $replies)
{
    global $db_readperpage, $db_guestdir;
    $pages = ceil(($replies + 1) / $db_readperpage);
    $tmp = 'R_' . intval($tid / 500);
    for ($i = 1; $i <= $pages; $i++) {
        if (file_exists(D_P . "{$db_guestdir}/{$tmp}/{$tid}_{$i}.html")) {
            P_unlink(D_P . "{$db_guestdir}/{$tmp}/{$tid}_{$i}.html");
        }
    }
}
开发者ID:adi00,项目名称:wumaproject,代码行数:11,代码来源:guestfunc.php

示例5: delete

 function delete($fileName)
 {
     $filepath = $this->directory . $fileName;
     $thumbPath = $this->directory . $this->thumbPrefix . $fileName;
     if (file_exists($filepath)) {
         @P_unlink($filepath);
     }
     if (file_exists($thumbPath)) {
         @P_unlink($thumbPath);
     }
     return true;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:12,代码来源:updatepicture.class.php

示例6: updateInvokeTagCode

 function updateInvokeTagCode($name, $tagCode)
 {
     $temp = $this->getInvokeByName($name);
     $parseTagCode = L::loadClass('ParseTagCode', 'area');
     $parseTagCode->init($name, $tagCode);
     $parsecode = $parseTagCode->getParseCode();
     $newInvokePieces = $parseTagCode->getConditoin();
     $this->_updateInvokePieceTagCode($name, $newInvokePieces);
     $data = array('tagcode' => $tagCode, 'parsecode' => $parsecode);
     $data['pieces'] = $this->getInvokePieces($name);
     $this->updateInvokeByName($name, $data);
     P_unlink($this->getInvokeApiFile($temp['id']));
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:13,代码来源:invokeservice.class.php

示例7: _checkWaitSegment

 /**
  * 检查用户搜索间隔时间
  * @return unknown_type
  */
 function _checkWaitSegment()
 {
     if (!$this->_waitSegment) {
         return true;
     }
     if (file_exists(D_P . 'data/bbscache/schwait_cache.php')) {
         if ($this->_timestamp - pwFilemtime(D_P . 'data/bbscache/schwait_cache.php') > $this->_waitSegment) {
             P_unlink(D_P . 'data/bbscache/schwait_cache.php');
         } else {
             return false;
         }
     }
     return true;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:18,代码来源:base.search.php

示例8: fdelfiletmp

function fdelfiletmp($base_dir)
{
    $dir = opendir($base_dir);
    while ($flist = readdir($dir)) {
        if ($flist != "." && $flist != "..") {
            if (filesize($base_dir . "/" . $flist) == 0) {
                P_unlink($base_dir . "/" . $flist);
            }
            if (eregi("(_g.js)\$", $flist)) {
                P_unlink($base_dir . "/" . $flist);
            }
            if (filemtime($base_dir . "/" . $flist) > $mtime[1] + 1000) {
                P_unlink($base_dir . "/" . $flist);
            }
        }
    }
}
开发者ID:holin,项目名称:sstour,代码行数:17,代码来源:hack.php

示例9: resetWind

 function resetWind()
 {
     $fields = array('db_yunsearch_search', 'db_yunsearch_hook', 'db_yun_hash', 'db_yunsearch_domain', 'db_yunsearch_isopen', 'db_yunsearch_unique', 'db_yundefend_shield', 'db_yundefend_shielduser', 'db_yundefend_shieldpost', 'db_yun_model', 'db_yun_expand');
     foreach ($fields as $field) {
         $GLOBALS['db']->query("DELETE FROM `pw_config` WHERE db_name = '{$field}'");
     }
     $tables = array('pw_log_aggregate', 'pw_log_attachs', 'pw_log_colonys', 'pw_log_diary', 'pw_log_forums', 'pw_log_members', 'pw_log_postdefend', 'pw_log_posts', 'pw_log_postverify', 'pw_log_setting', 'pw_log_threads', 'pw_log_userdefend', 'pw_log_weibos', 'pw_yun_setting');
     foreach ($tables as $table) {
         $result = $GLOBALS['db']->get_one("SHOW TABLES LIKE '{$table}'");
         if ($result) {
             $GLOBALS['db']->query("TRUNCATE TABLE `{$table}`");
         }
     }
     P_unlink(D_P . 'data/bbscache/cloudwind_logsettings.php');
     P_unlink(D_P . 'data/bbscache/cloudwind_settings.php');
     P_unlink(D_P . 'data/bbscache/cloudwind_postinfo.php');
     require_once R_P . 'admin/cache.php';
     updatecache_c();
     return true;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:20,代码来源:ver.core.reset.php

示例10: removeAttach

 function removeAttach($userId, $id)
 {
     $userId = intval($userId);
     $id = intval($id);
     if (1 > $userId || 1 > $id) {
         return false;
     }
     $msAttachsDao = $this->getMsAttachsDao();
     if (!($msAttach = $msAttachsDao->get($id))) {
         return false;
     }
     $attachsDao = $this->getAttachsDao();
     $attach = $attachsDao->get($msAttach['aid']);
     $file = $this->_attachmentPath . '/' . $attach['attachurl'];
     if (is_file($file)) {
         P_unlink($file);
     }
     $attachsDao->delete(array($attach['aid']));
     $msAttachsDao->delete($id);
     return true;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:21,代码来源:attach.ms.php

示例11: deleteDir

 function deleteDir($dir)
 {
     $dir = S::escapePath($dir);
     while (!rmdir($dir)) {
         if (is_dir($dir)) {
             if ($dp = opendir($dir)) {
                 while (($file = readdir($dp)) != false) {
                     if (is_dir($dir . '/' . $file) && $file != '.' && $file != '..') {
                         PW_FileOperate::deleteDir($dir . '/' . $file);
                     } else {
                         if ($file != '.' && $file != '..') {
                             P_unlink($dir . '/' . $file);
                         }
                     }
                 }
                 closedir($dp);
             } else {
                 return false;
             }
         }
     }
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:22,代码来源:fileoperate.class.php

示例12: GetPtable

                $pw_posts = GetPtable($threaddb['ptable']);
                $pids = S::sqlImplode($pids);
                $query = $db->query("SELECT pid,fid,tid,aid,author,authorid,postdate,subject,content,anonymous,ifcheck FROM {$pw_posts} WHERE tid='{$dtid}' AND fid='{$dfid}' AND pid IN({$pids})");
                $replydb = array();
                while ($result = $db->fetch_array($query)) {
                    !$result['subject'] && ($result['subject'] = substrs($rt['content'], 35));
                    $result['postdate'] = get_date($result['postdate']);
                    $result['ptable'] = $threaddb['ptable'];
                    $replydb[] = $result;
                }
                /*删除回复*/
                $delarticle->delReply($replydb, false);
                /*删除静态*/
                $htmurl = $db_htmdir . '/' . $dfid . '/' . get_date('ym', $threaddb['postdate']) . '/' . $dtid . '.html';
                if (file_exists(R_P . $htmurl)) {
                    P_unlink(R_P . $htmurl);
                }
            }
            //* P_unlink(D_P.'data/bbscache/c_cache.php');
            pwCache::deleteData(D_P . 'data/bbscache/c_cache.php');
            adminmsg('operate_success', "{$admin_file}?adminjob=superdel&admintype=article&action={$action}&fid={$_POST['fid']}&tid={$_POST['tid']}&pstart={$pstart}&pend={$pend}&author=" . rawurlencode($author) . "&keyword=" . rawurlencode($keyword) . "&userip={$userip}&tcounts={$tcounts}&counts={$counts}&nums={$nums}&ptable={$ptable}&page={$page}");
        }
    } elseif ($action == 'view') {
        S::gp(array('tid', 'pid'));
        $pw_posts = GetPtable('N', $tid);
        $rt = $db->get_one("SELECT COUNT(*) AS sum FROM {$pw_posts} WHERE tid=" . S::sqlEscape($tid) . 'AND pid<' . S::sqlEscape($pid));
        $page = ceil(($rt['sum'] + 1.5) / $db_readperpage);
        ObHeader("read.php?tid={$tid}&page={$page}#{$pid}");
    }
} elseif ($admintype == 'message') {
    $basename = "{$admin_file}?adminjob=superdel&admintype=message";
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:superdel.php

示例13: getReadContent

 function getReadContent()
 {
     $readdb = array();
     $pw_tmsgs = GetTtable($this->tid);
     $read = $this->db->get_one("SELECT t.*,tm.*,m.uid,m.username,m.oicq,m.groupid,m.memberid,m.icon AS micon ,m.hack,m.honor,m.signature,m.regdate,m.medals,m.userstatus,md.onlinetime,md.postnum,md.digests,md.rvrc,md.money,md.credit,md.currency,md.starttime,md.thisvisit,md.lastvisit,mb.* FROM pw_threads t LEFT JOIN {$pw_tmsgs} tm ON t.tid=tm.tid LEFT JOIN pw_members m ON m.uid=t.authorid LEFT JOIN pw_memberdata md ON md.uid=t.authorid {$this->tablaadd} WHERE t.tid=" . S::sqlEscape($this->tid));
     if (!$read || $read['special'] || !$read['ifcheck']) {
         return false;
     }
     $this->fid = $read['fid'];
     $this->datedir = date('ym', $read['postdate']);
     if (file_exists(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/{$this->tid}.html")) {
         P_unlink(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/{$this->tid}.html");
     }
     if (!$this->initForum($this->fid)) {
         return false;
     }
     if ($this->isHideContent($read['content'])) {
         return false;
     }
     $this->setSeosetting(&$read);
     $this->vars['forumtitle'] = $this->forumtitle;
     $this->vars['msg_guide'] = $this->guidename . "<em>&gt;</em><a href=\"read.php?tid={$this->tid}\">{$read['subject']}</a>";
     $this->vars['db_metakeyword'] = $read['subject'] . str_replace(array('|', ' - '), ',', $this->forumtitle) . 'phpwind';
     $this->vars['subject'] = $read['subject'];
     $this->vars['titletop1'] = substrs('Re:' . str_replace('&nbsp;', ' ', $read['subject']), L::config('db_titlemax') - 2);
     $this->vars['hits'] = $read['hits'];
     $this->vars['replies'] = $read['replies'];
     $this->vars['tid'] = $this->tid;
     $this->vars['fid'] = $this->fid;
     $this->vars['pwforum'] = $this->forum;
     $this->vars['postUrl'] = 'post.php?fid=' . $this->fid;
     $_pids = array();
     $read['aid'] && ($_pids[] = 0);
     $count = $read['replies'] + 1;
     $this->vars['pages'] = numofpage($count, 1, ceil($count / $this->perpage), "{$GLOBALS['db_bbsurl']}/read.php?tid={$this->tid}&");
     $read['pid'] = 'tpc';
     $readdb[] = $read;
     if ($read['replies'] > 0) {
         $readnum = $this->perpage - 1;
         $pw_posts = GetPtable($read['ptable']);
         $query = $this->db->query("SELECT t.*,m.uid,m.username,m.oicq,m.groupid,m.memberid,m.icon AS micon,m.hack,m.honor,m.signature,m.regdate,m.medals,m.userstatus,md.onlinetime,md.postnum,md.digests,md.rvrc,md.money,md.credit,md.currency,md.starttime,md.thisvisit,md.lastvisit, mb.* FROM {$pw_posts} t LEFT JOIN pw_members m ON m.uid=t.authorid LEFT JOIN pw_memberdata md ON md.uid=t.authorid {$this->tablaadd} WHERE t.tid=" . S::sqlEscape($this->tid) . " AND ifcheck='1' ORDER BY postdate LIMIT 0,{$readnum}");
         while ($read = $this->db->fetch_array($query)) {
             if ($this->isHideContent($read['content'])) {
                 return false;
             }
             $read['aid'] && ($_pids[] = $read['pid']);
             $readdb[] = $read;
         }
         $this->db->free_result($query);
     }
     if ($_pids) {
         $this->attachShow = new attachShow(false);
         $this->attachShow->init($this->tid, $_pids);
     }
     $this->vars['db_menuinit'] = "'td_post' : 'menu_post','td_post1' : 'menu_post','td_hack' : 'menu_hack'";
     $bandb = $this->forum->forumBan($readdb);
     $authorids = array($read['authorid']);
     $start_limit = 0;
     foreach ($readdb as $key => $read) {
         isset($bandb[$read['authorid']]) && ($read['groupid'] = 6);
         $authorids[] = $read['authorid'];
         $readdb[$key] = $this->htmread($read, $start_limit++);
         $this->vars['db_menuinit'] .= ",'td_read_" . $read['pid'] . "':'menu_read_" . $read['pid'] . "'";
     }
     if (L::config('db_showcustom')) {
         $this->vars['customdb'] = $this->getCustomdb($authorids);
     }
     return $readdb;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:69,代码来源:staticpage.class.php

示例14: postDelete

 function postDelete($tids, $uid)
 {
     global $db_recycle, $db_ifpwcache;
     $tiddb = explode(',', $tids);
     $delids = array();
     foreach ($tiddb as $key => $value) {
         if (is_numeric($value)) {
             $delids[] = $value;
         }
     }
     if (!$delids) {
         return new ApiResponse(false);
     }
     foreach ($readdb as $key => $read) {
         if ($read['authorid'] != $uid) {
             return new ErrorMsg(API_THREAD_AUTHOR_ERROR, 'The author is not right');
         }
     }
     $delarticle = L::loadClass('DelArticle');
     $readdb = $delarticle->getTopicDb('tid ' . $delarticle->sqlFormatByIds($delids));
     $delarticle->delTopic($readdb, 0);
     if ($db_ifpwcache ^ 1) {
         $this->db->update("DELETE FROM pw_elements WHERE type !='usersort' AND id IN(" . pwImplode($delids) . ')');
     }
     P_unlink(D_P . 'data/bbscache/c_cache.php');
     return new ApiResponse(true);
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:27,代码来源:class_Thread.php

示例15: delforum

function delforum($fid)
{
    global $db, $db_guestdir, $db_guestthread, $db_guestread;
    $foruminfo = $db->get_one("SELECT fid,fup,forumadmin FROM pw_forums WHERE fid=" . pwEscape($fid));
    $db->update("DELETE FROM pw_forums WHERE fid=" . pwEscape($fid));
    $db->update("DELETE FROM pw_forumdata WHERE fid=" . pwEscape($fid));
    $db->update("DELETE FROM pw_forumsextra WHERE fid=" . pwEscape($fid));
    $db->update("DELETE FROM pw_permission WHERE fid>'0' AND fid=" . pwEscape($fid));
    if ($foruminfo['forumadmin']) {
        $forumadmin = explode(",", $foruminfo['forumadmin']);
        foreach ($forumadmin as $key => $value) {
            if ($value) {
                $gid = $db->get_one("SELECT uid,groupid FROM pw_members WHERE username=" . pwEscape($value, false));
                if ($gid['groupid'] == 5 && !ifadmin($value)) {
                    $db->update("UPDATE pw_members SET groupid='-1' WHERE username=" . pwEscape($value, false));
                    admincheck($gid['uid'], $value, $gid['groupid'], '', 'delete');
                }
            }
        }
    }
    if ($db_guestthread || $db_guestread) {
        require_once R_P . 'require/guestfunc.php';
        $db_guestthread && deldir(D_P . "{$db_guestdir}/T_{$fid}");
    }
    P_unlink(D_P . "data/forums/fid_{$fid}.php");
    $ttable_a = $ptable_a = array();
    $query = $db->query("SELECT tid,replies,ptable FROM pw_threads WHERE fid=" . pwEscape($fid));
    while ($tpc = $db->fetch_array($query)) {
        $tid = $tpc['tid'];
        $ttable_a[GetTtable($tid)][] = $tid;
        $ptable_a[$tpc['ptable']] = 1;
        $db_guestread && clearguestcache($tid, $tpc['replies']);
    }
    foreach ($ttable_a as $pw_tmsgs => $val) {
        $val = pwImplode($val, false);
        $db->update("DELETE FROM {$pw_tmsgs} WHERE tid IN({$val})");
    }
    # $db->update("DELETE FROM pw_threads WHERE fid=".pwEscape($fid));
    # ThreadManager
    $threadManager = L::loadClass("threadmanager");
    $threadManager->deleteByForumId($fid);
    foreach ($ptable_a as $key => $val) {
        $pw_posts = GetPtable($key);
        $db->update("DELETE FROM {$pw_posts} WHERE fid=" . pwEscape($fid));
    }
    updateforum($foruminfo['fup']);
}
开发者ID:adi00,项目名称:wumaproject,代码行数:47,代码来源:setforum.php


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