本文整理汇总了PHP中discuz_upload::make_dir方法的典型用法代码示例。如果您正苦于以下问题:PHP discuz_upload::make_dir方法的具体用法?PHP discuz_upload::make_dir怎么用?PHP discuz_upload::make_dir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类discuz_upload
的用法示例。
在下文中一共展示了discuz_upload::make_dir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_dir_exists
function check_dir_exists($type = '', $sub1 = '', $sub2 = '')
{
$type = discuz_upload::check_dir_type($type);
$basedir = !getglobal('setting/attachdir') ? DISCUZ_ROOT . './data/attachment' : getglobal('setting/attachdir');
$typedir = $type ? $basedir . '/' . $type : '';
$subdir1 = $type && $sub1 !== '' ? $typedir . '/' . $sub1 : '';
$subdir2 = $sub1 && $sub2 !== '' ? $subdir1 . '/' . $sub2 : '';
$res = $subdir2 ? is_dir($subdir2) : ($subdir1 ? is_dir($subdir1) : is_dir($typedir));
if (!$res) {
$res = $typedir && discuz_upload::make_dir($typedir);
$res && $subdir1 && ($res = discuz_upload::make_dir($subdir1));
$res && $subdir1 && $subdir2 && ($res = discuz_upload::make_dir($subdir2));
}
return $res;
}
示例2: setattachment
function setattachment($bid, $caid, $tid, $pid)
{
global $_G;
$attachment = C::t('#sanree_brand#sanree_brand_attachment')->fetch_firstbyaid($caid);
if ($attachment) {
$aid = getattachnewaid($attachment['uid']);
$insert = array('aid' => $aid, 'tid' => $tid, 'pid' => $pid, 'dateline' => $attachment['dateline'], 'filename' => $attachment['filename'], 'filesize' => $attachment['filesize'], 'attachment' => $attachment['attachment'], 'isimage' => $attachment['isimage'], 'uid' => $attachment['uid'], 'thumb' => $attachment['thumb'], 'remote' => $attachment['remote'], 'width' => $attachment['width']);
$target = getglobal('setting/attachdir') . './forum/' . $attachment['attachment'];
list($one, $tow) = explode("/", $attachment['attachment']);
$appVer = $_G['setting']['version'];
if ($appVer == 'X2') {
require_once libfile('class/upload');
}
discuz_upload::make_dir(getglobal('setting/attachdir') . './forum/' . $one);
discuz_upload::make_dir(getglobal('setting/attachdir') . './forum/' . $one . '/' . $tow);
$source = getglobal('setting/attachdir') . './category/' . $attachment['attachment'];
!file_exists($target) && @copy($source, $target);
$tableid = getattachtableid($tid);
DB::update('forum_attachment_' . $tableid, array('tid' => 0, 'pid' => 0), "tid=" . $tid);
DB::update('forum_attachment', array('tid' => 0, 'pid' => 0), "tid=" . $tid);
C::t('#sanree_brand#forum_attachment_n')->insert($tableid, $insert);
DB::update('forum_attachment', array('tid' => $tid, 'pid' => $pid, 'uid' => $attachment['uid'], 'tableid' => $tableid), "aid=" . $aid);
C::t('#sanree_brand#sanree_brand_businesses')->update($bid, array('aid' => $aid));
$tidata = C::t('#sanree_brand#forum_post')->fetch_threadpost_by_tid_invisible($tid);
$message = $tidata['message'];
$message = preg_replace('/\\[poster\\]/is', '[attach]' . $aid . '[/attach]', $message);
C::t('#sanree_brand#forum_post')->update(0, $pid, array('message' => $message, 'attachment' => 1), TRUE);
$data = array('tid' => $tid, 'attachment' => $attachment['attachment'], 'remote' => 0);
C::t('#sanree_brand#forum_threadimage')->delete($tid);
C::t('#sanree_brand#forum_threadimage')->insert($data);
}
}