本文整理汇总了PHP中pwDelatt函数的典型用法代码示例。如果您正苦于以下问题:PHP pwDelatt函数的具体用法?PHP pwDelatt怎么用?PHP pwDelatt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pwDelatt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: transfer
function transfer()
{
if (empty($this->flashatt)) {
return false;
}
global $db_enhideset, $db_sellset, $db_ifpwcache, $timestamp;
require_once R_P . 'require/functions.php';
$pw_attachs = L::loadDB('attachs', 'forum');
$saveAttach = $this->getSaveAttach($this->uid);
$deltmp = array();
$attach = $pw_attachs->gets(array('tid' => 0, 'pid' => 0, 'uid' => $this->uid, 'did' => 0, 'mid' => 0));
foreach ($attach as $rt) {
if (!isset($this->flashatt[$rt['aid']])) {
pwDelatt($rt['attachurl'], $this->ifftp);
$deltmp[] = $rt['aid'];
continue;
}
$saveAttach && $saveAttach->add($rt);
$value = $this->flashatt[$rt['aid']];
$rt['descrip'] = $value['desc'];
$pw_attachs->updateById($rt['aid'], array('mid' => '1', 'descrip' => $rt['descrip']));
$this->attachs[$rt['aid']] = array('aid' => $rt['aid'], 'name' => $rt['name'], 'type' => $rt['type'], 'attachurl' => $rt['attachurl'], 'size' => $rt['size'], 'hits' => $rt['hits'], 'desc' => str_replace('\\', '', $rt['descrip']), 'ifthumb' => $rt['ifthumb']);
$this->fieldDatas[] = array('uid' => $this->uid, 'aid' => $rt['aid'], 'mid' => $this->mid, 'rid' => $this->rid, 'status' => 1);
}
$saveAttach && $saveAttach->execute();
$deltmp && $pw_attachs->delete($deltmp);
return true;
}
示例2: transfer
function transfer()
{
if (empty($this->flashatt)) {
return false;
}
global $timestamp, $winddb;
require_once R_P . 'require/functions.php';
$saveAttach = $this->getSaveAttach($this->uid);
$deltmp = array();
$attach = $this->pw_attachs->gets(array('tid' => 0, 'pid' => 0, 'uid' => $this->uid, 'did' => 0, 'mid' => 0));
foreach ($attach as $rt) {
if (!isset($this->flashatt[$rt['aid']])) {
pwDelatt($rt['attachurl'], $this->ifftp);
$deltmp[] = $rt['aid'];
continue;
}
$saveAttach && $saveAttach->add($rt);
$value = $this->flashatt[$rt['aid']];
$rt['descrip'] = $value['desc'];
$this->attachs[$rt['aid']] = array('aid' => $rt['aid'], 'name' => $rt['name'], 'type' => $rt['type'], 'attachurl' => $rt['attachurl'], 'needrvrc' => 0, 'special' => 0, 'ctype' => '', 'size' => $rt['size'], 'hits' => $rt['hits'], 'desc' => str_replace('\\', '', $rt['descrip']), 'ifthumb' => $rt['ifthumb']);
if ($rt['descrip']) {
$this->pw_attachs->updateById($rt['aid'], array('descrip' => $rt['descrip']));
}
$winddb['uploadnum']++;
$winddb['uploadtime'] = $timestamp;
$this->ifupload = $rt['type'] == 'img' ? 1 : ($rt['type'] == 'txt' ? 2 : 3);
}
$saveAttach && $saveAttach->execute();
$deltmp && $this->pw_attachs->delete($deltmp);
return true;
}
示例3: transfer
function transfer()
{
if (empty($this->flashatt)) {
return false;
}
global $timestamp, $winddb;
require_once R_P . 'require/functions.php';
$pw_attachs = L::loadDB('attachs', 'forum');
$saveAttach = $this->getSaveAttach($this->uid);
$deltmp = array();
$attach = $pw_attachs->gets(array('tid' => 0, 'pid' => 0, 'uid' => $this->uid, 'did' => 0, 'mid' => 0));
foreach ($attach as $rt) {
$deltmp[] = $rt['aid'];
if (!isset($this->flashatt[$rt['aid']])) {
pwDelatt($rt['attachurl'], $this->ifftp);
continue;
}
$saveAttach && $saveAttach->add($rt);
$value = $this->flashatt[$rt['aid']];
$rt['descrip'] = $value['desc'];
$this->attachs[] = array('id' => $rt['aid'], 'attname' => 'attachment', 'name' => $rt['name'], 'type' => $rt['type'], 'fileuploadurl' => $rt['attachurl'], 'size' => $rt['size'], 'descrip' => str_replace('\\', '', $rt['descrip']), 'ifthumb' => $rt['ifthumb']);
$winddb['uploadnum']++;
$winddb['uploadtime'] = $timestamp;
}
$saveAttach && $saveAttach->execute();
$deltmp && $pw_attachs->delete($deltmp);
return true;
}
示例4: transfer
function transfer()
{
if (empty($this->flashatt)) {
return false;
}
require_once R_P . 'require/functions.php';
$saveAttach = $this->getSaveAttach($this->uid);
$deltmp = array();
$query = $this->db->query("SELECT * FROM pw_actattachs WHERE actid=0 AND uid=" . S::sqlEscape($this->uid));
while ($rt = $this->db->fetch_array($query)) {
if (!isset($this->flashatt[$rt['aid']])) {
pwDelatt($rt['attachurl'], $this->ifftp);
$deltmp[] = $rt['aid'];
continue;
}
$saveAttach && $saveAttach->add($rt);
$value = $this->flashatt[$rt['aid']];
$rt['descrip'] = $value['desc'];
if ($rt['descrip']) {
$this->db->update("UPDATE pw_actattachs SET " . S::sqlSingle(array('descrip' => $rt['descrip'])) . ' WHERE aid=' . S::sqlEscape($rt['aid']));
}
$this->attachs[$rt['aid']] = array('aid' => $rt['aid'], 'name' => $rt['name'], 'type' => $rt['type'], 'attachurl' => $rt['attachurl'], 'size' => $rt['size'], 'hits' => $rt['hits'], 'desc' => str_replace('\\', '', $rt['descrip']), 'ifthumb' => $rt['ifthumb']);
}
$saveAttach && $saveAttach->execute();
if ($deltmp) {
$this->db->update("DELETE FROM pw_actattachs WHERE aid IN(" . S::sqlImplode($deltmp) . ')');
}
return true;
}
示例5: transfer
function transfer()
{
if (empty($this->flashatt)) {
return false;
}
global $db_enhideset, $db_sellset, $db_ifpwcache, $timestamp;
require_once R_P . 'require/functions.php';
$saveAttach = $this->getSaveAttach($this->post->uid);
$deltmp = array();
$attach = $this->pw_attachs->gets(array('tid' => 0, 'pid' => 0, 'uid' => $this->post->uid, 'did' => 0, 'mid' => 0));
foreach ($attach as $rt) {
if (!isset($this->flashatt[$rt['aid']])) {
pwDelatt($rt['attachurl'], $this->ifftp);
$deltmp[] = $rt['aid'];
continue;
}
$saveAttach && $saveAttach->add($rt);
$value = $this->flashatt[$rt['aid']];
$rt['descrip'] = $value['desc'];
$rt['special'] = intval($value['special']);
$rt['needrvrc'] = intval($value['needrvrc']);
$rt['ctype'] = $value['ctype'];
$this->attachs[$rt['aid']] = array('aid' => $rt['aid'], 'name' => $rt['name'], 'type' => $rt['type'], 'attachurl' => $rt['attachurl'], 'needrvrc' => 0, 'special' => 0, 'ctype' => '', 'size' => $rt['size'], 'hits' => $rt['hits'], 'desc' => str_replace('\\', '', $rt['descrip']), 'ifthumb' => $rt['ifthumb']);
$pwSQL = array('fid' => $this->forum->fid, 'descrip' => $rt['descrip']);
if ($rt['needrvrc'] > 0 && ($rt['special'] == 1 && $this->post->allowencode && in_array($rt['ctype'], $db_enhideset['type']) || $rt['special'] == 2 && $this->post->allowsell && in_array($rt['ctype'], $db_sellset['type']))) {
$this->attachs[$rt['aid']]['needrvrc'] = $pwSQL['needrvrc'] = $rt['needrvrc'];
$this->attachs[$rt['aid']]['special'] = $pwSQL['special'] = $rt['special'];
$this->attachs[$rt['aid']]['ctype'] = $pwSQL['ctype'] = $rt['ctype'];
}
if ($rt['type'] == 'img') {
$this->uploadImgNum++;
}
$this->post->user['uploadnum']++;
$this->post->user['uploadtime'] = $timestamp;
$this->pw_attachs->updateById($rt['aid'], $pwSQL);
$this->ifupload = $rt['type'] == 'img' ? 1 : ($rt['type'] == 'txt' ? 2 : 3);
if ($db_ifpwcache & 512 && !$rt['needrvrc'] && $rt['type'] == 'img' && !$this->elementpic) {
$this->elementpic = array('aid' => $rt['aid'], 'attachurl' => $rt['attachurl'], 'ifthumb' => $rt['ifthumb']);
}
}
$saveAttach && $saveAttach->execute();
$deltmp && $this->pw_attachs->delete($deltmp);
return true;
}
示例6: delByUids
function delByUids($uids)
{
global $db_ifftp;
if (!$uids || !is_array($uids)) {
return false;
}
$diaryDb = $this->_getDiaryDB();
$diaryDb->delDiaryByUids($uids);
$diaryDb->delDiaryTypeByUids($uids);
$attachsService = L::loadClass('attachs', 'forum');
/* @var $attachsService PW_attachs */
$attachs = array();
$attachs = $attachsService->getByUids($uids);
foreach ($attachs as $attach) {
pwDelatt("diary/" . $attach['attachurl'], $db_ifftp);
$attachsService->delByids(array($attach['aid']));
}
return true;
}
示例7: exit
<?php
!defined('P_W') && exit('Forbidden');
require_once R_P . 'u/lib/space.class.php';
$newSpace = new PwSpace($winduid);
$space = $newSpace->getInfo();
pwDelatt($space['banner'], $db_ifftp);
$newSpace->updateInfo(array('banner' => ''));
echo 'ok';
ajax_footer();
示例8: exit
<?php
!defined('P_W') && exit('Forbidden');
$aids = array();
$query = $db->query("SELECT aid,attachurl,ifthumb FROM pw_attachs WHERE tid='0' AND pid='0' AND uid=" . S::sqlEscape($winduid));
while ($rt = $db->fetch_array($query)) {
$rt['attachurl'] = substr($rt['attachurl'], 11);
pwDelatt('mutiupload/' . $rt['attachurl'], $db_ifftp);
$rt['ifthumb'] & 1 && pwDelatt('mutiupload/s1_' . $rt['attachurl'], $db_ifftp);
$rt['ifthumb'] & 2 && pwDelatt('mutiupload/s2_' . $rt['attachurl'], $db_ifftp);
$aids[] = $rt['aid'];
}
S::isArray($aids) && $db->update("DELETE FROM pw_attachs WHERE aid IN (" . S::sqlImplode($aids) . ')');
echo 'ok';
ajax_footer();
示例9: Showmsg
!$attach && Showmsg('job_attach_error');
if (empty($attach['attachurl']) || strpos($attach['attachurl'], '..') !== false) {
Showmsg('job_attach_error');
}
$aid = $attach['aid'];
//获取管理权限
$isGM = S::inArray($windid, $manager);
!$isGM && ($groupid = 3 && ($isGM = 1));
if ($isGM) {
$admincheck = 1;
} else {
$admincheck = 0;
}
$attach['attachurl'] = "diary/" . $attach['attachurl'];
if ($admincheck || $attach['uid'] == $winduid) {
pwDelatt($attach['attachurl'], $db_ifftp);
pwFtpClose($ftp);
$diaryService = L::loadClass('Diary', 'diary');
/* @var $diaryService PW_Diary */
$diary = array();
$diary = $diaryService->get($did);
$attachs = unserialize($diary['aid']);
if (is_array($attachs)) {
unset($attachs[$aid]);
$attachs = $attachs ? serialize($attachs) : '';
//$db->update("UPDATE pw_diary SET aid=".S::sqlEscape($attachs)."WHERE did=" . S::sqlEscape($did));
pwQuery::update('pw_diary', 'did =:did', array($did), array('aid' => $attachs));
}
$db->update("DELETE FROM pw_attachs WHERE aid=" . S::sqlEscape($aid));
echo 'success';
ajax_footer();
示例10: Delcnimg
function Delcnimg($filename)
{
return pwDelatt("cn_img/{$filename}", $GLOBALS['db_ifftp']);
}
示例11: delete_att
function delete_att($attachdb, $ifdel = true)
{
require_once R_P . 'require/functions.php';
$delaids = array();
foreach ($attachdb as $key => $value) {
is_numeric($key) && ($delaids[] = $key);
if ($ifdel) {
pwDelatt($value['attachurl'], $GLOBALS['db_ifftp']);
$value['ifthumb'] && pwDelatt("thumb/{$value['attachurl']}", $GLOBALS['db_ifftp']);
}
}
if ($delaids) {
$pw_attachs = L::loadDB('attachs', 'forum');
if ($ifdel) {
$pw_attachs->delete($delaids);
} else {
$pw_attachs->updateById($delaids, array('fid' => 0));
}
}
return $delaids;
}
示例12: DelIcon
function DelIcon($filename)
{
if (strpos($filename, '..') !== false) {
return false;
}
require_once R_P . 'require/functions.php';
pwDelatt("upload/{$filename}", $GLOBALS['db_ifftp']);
pwDelatt("upload/middle/{$filename}", $GLOBALS['db_ifftp']);
pwDelatt("upload/small/{$filename}", $GLOBALS['db_ifftp']);
return true;
}
示例13: DelIcon
function DelIcon($filename)
{
if (strpos($filename, '..') !== false) {
return false;
}
pwDelatt("upload/{$filename}", $GLOBALS['db_ifftp']);
pwDelatt("upload/middle/{$filename}", $GLOBALS['db_ifftp']);
pwDelatt("upload/small/{$filename}", $GLOBALS['db_ifftp']);
return true;
}
示例14: pwDelThreadAtt
function pwDelThreadAtt($path, $ifftp, $ifthumb = 3)
{
pwDelatt($path, $ifftp);
$ifthumb & 1 && pwDelatt('thumb/' . $path, $ifftp);
$ifthumb & 2 && pwDelatt('thumb/mini/' . $path, $ifftp);
}
示例15: recycle
function recycle($ids)
{
global $db, $fid;
$delids = array();
foreach ($ids as $key => $value) {
if (is_numeric($value)) {
$delids[] = $value;
}
}
if ($delids) {
$delids = pwImplode($delids);
} else {
Showmsg('forumcp_recycle_nodata');
}
$query = $db->query("SELECT r.*,t.special,t.ifshield,t.ifupload,t.ptable,t.replies,t.fid AS ckfid FROM pw_recycle r LEFT JOIN pw_threads t ON r.tid=t.tid WHERE r.tid IN ({$delids}) AND r.pid='0' AND r.fid=" . pwEscape($fid));
$taid_a = $ttable_a = $ptable_a = array();
$delids = $pollids = $actids = $delaids = $rewids = $ids = array();
while (@extract($db->fetch_array($query))) {
$ids[] = $tid;
($ifshield != '2' || $replies == '0' || $ckfid == '0') && ($delids[] = $tid);
$special == 1 && ($pollids[] = $tid);
$special == 2 && ($actids[] = $tid);
$special == 3 && ($rewids[] = $tid);
if ($ifshield != '2' || $replies == '0' || $ckfid == '0') {
$ptable_a[$ptable] = 1;
$ttable_a[GetTtable($tid)][] = $tid;
}
if ($ifupload) {
$taid_a[GetTtable($tid)][] = $tid;
if ($ifshield != '2' || $replies == '0' || $ckfid == '0') {
$pw_posts = GetPtable($ptable);
$query2 = $db->query("SELECT aid FROM {$pw_posts} WHERE tid=" . pwEscape($tid) . " AND aid!=''");
while (@extract($db->fetch_array($query2))) {
if (!$aid) {
continue;
}
$attachs = unserialize(stripslashes($aid));
foreach ($attachs as $key => $value) {
is_numeric($key) && ($delaids[] = $key);
pwDelatt($value['attachurl'], $GLOBALS['db_ifftp']);
$value['ifthumb'] && pwDelatt("thumb/{$value['attachurl']}", $GLOBALS['db_ifftp']);
}
}
}
}
}
foreach ($taid_a as $pw_tmsgs => $value) {
$value = pwImplode($value);
$query = $db->query("SELECT aid FROM {$pw_tmsgs} WHERE tid IN({$value}) AND aid!=''");
while (@extract($db->fetch_array($query))) {
if (!$aid) {
continue;
}
$attachs = unserialize(stripslashes($aid));
foreach ($attachs as $key => $value) {
is_numeric($key) && ($delaids[] = $key);
pwDelatt($value['attachurl'], $GLOBALS['db_ifftp']);
$value['ifthumb'] && pwDelatt("thumb/{$value['attachurl']}", $GLOBALS['db_ifftp']);
}
}
}
if ($pollids) {
$pollids = pwImplode($pollids);
$db->update("DELETE FROM pw_polls WHERE tid IN({$pollids})");
}
if ($actids) {
$actids = pwImplode($actids);
$db->update("DELETE FROM pw_activity WHERE tid IN({$actids})");
$db->update("DELETE FROM pw_actmember WHERE actid IN({$actids})");
}
if ($rewids) {
$rewids = pwImplode($rewids);
$db->update("DELETE FROM pw_reward WHERE tid IN({$rewids})");
}
if ($delaids) {
$pw_attachs = L::loadDB('attachs');
$pw_attachs->delete($delaids);
}
$delids = pwImplode($delids);
if ($delids) {
# $db->update("DELETE FROM pw_threads WHERE tid IN($delids)");
# ThreadManager
$threadManager = L::loadClass("threadmanager");
$threadManager->deleteByThreadIds($fid, $delids);
}
foreach ($ttable_a as $pw_tmsgs => $val) {
$val = pwImplode($val);
$db->update("DELETE FROM {$pw_tmsgs} WHERE tid IN({$val})");
}
foreach ($ptable_a as $key => $val) {
$pw_posts = GetPtable($key);
$db->update("DELETE FROM {$pw_posts} WHERE tid IN({$delids})");
}
delete_tag($delids);
if ($ids) {
$ids = pwImplode($ids);
$db->update("DELETE FROM pw_recycle WHERE tid IN ({$ids})");
}
pwFtpClose($GLOBALS['ftp']);
}