本文整理匯總了PHP中MemberUploads函數的典型用法代碼示例。如果您正苦於以下問題:PHP MemberUploads函數的具體用法?PHP MemberUploads怎麽用?PHP MemberUploads使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MemberUploads函數的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ShowMsg
}
if ($arow['mid'] != $cfg_ml->M_ID) {
ShowMsg("你沒有修改這個附件的權限!", "-1");
exit;
}
include DEDEMEMBER . "/templets/uploads_edit.htm";
exit;
} else {
if ($dopost == 'save') {
$title = HtmlReplace($title, 2);
if ($mediatype == 1) {
$utype = 'image';
} else {
if ($mediatype == 2) {
$utype = 'flash';
} else {
if ($mediatype == 3) {
$utype = 'media';
} else {
$utype = 'addon';
}
}
}
$title = HtmlReplace($title, 2);
$exname = preg_replace("#(.*)/#", "", $oldurl);
$exname = preg_replace("#\\.(.*)\$#", "", $exname);
$filename = MemberUploads('addonfile', $oldurl, $cfg_ml->M_ID, $utype, $exname, -1, -1, TRUE);
SaveUploadInfo($title, $filename, $mediatype);
ShowMsg("成功修改文件!", "uploads_edit.php?aid={$aid}");
}
}
示例2: cn_substrR
}
//文檔的默認狀態
if ($cInfos['arcsta'] == 0) {
$ismake = 0;
$arcrank = 0;
} else {
if ($cInfos['arcsta'] == 1) {
$ismake = -1;
$arcrank = 0;
} else {
$ismake = 0;
$arcrank = -1;
}
}
//對保存的內容進行處理
$title = cn_substrR(HtmlReplace($title, 1), $cfg_title_maxlen);
$writer = cn_substrR(HtmlReplace($writer, 1), 20);
if (empty($description)) {
$description = '';
}
$description = cn_substrR(HtmlReplace($description, 1), 250);
$keywords = cn_substrR(HtmlReplace($tags, 1), 30);
$mid = $cfg_ml->M_ID;
$isadmin = $cfg_ml->fields['matt'] == 10 ? true : false;
//處理上傳的縮略圖
$litpic = MemberUploads('litpic', $oldlitpic, $mid, 'image', '', $cfg_ddimg_width, $cfg_ddimg_height, false, $isadmin);
if ($litpic != '') {
SaveUploadInfo($title, $litpic, 1);
} else {
$litpic = $oldlitpic;
}
示例3: ShowMsg
$maxlength = $cfg_max_face * 1024;
$userdir = $cfg_user_dir . '/' . $cfg_ml->M_ID;
if (!ereg('^' . $userdir, $oldspacelogo)) {
$oldspacelogo = '';
}
if (is_uploaded_file($spacelogo)) {
if (@filesize($_FILES['spacelogo']['tmp_name']) > $maxlength) {
ShowMsg("你上傳的Logo文件超過了係統限製大小:{$cfg_max_face} K!", '-1');
exit;
}
//刪除舊圖片(防止文件擴展名不同,如:原來的是gif,後來的是jpg)
if (eregi("\\.(jpg|gif|png)\$", $oldspacelogo) && file_exists($cfg_basedir . $oldspacelogo)) {
@unlink($cfg_basedir . $oldspacelogo);
}
//上傳新工圖片
$spacelogo = MemberUploads('spacelogo', '', $cfg_ml->M_ID, 'image', 'mylogo', 200, 50);
} else {
$spacelogo = $oldspacelogo;
}
$pagesize = intval($pagesize);
$spacename = cn_substrR(HtmlReplace($spacename, 2), 50);
$sign = cn_substrR(HtmlReplace($sign), 100);
$spacenews = HtmlReplace($spacenews, -1);
$query = "update `#@__member_space` set `pagesize` = '{$pagesize}',`spacename`='{$spacename}' , spacelogo='{$spacelogo}', `sign` = '{$sign}' ,`spacenews`='{$spacenews}' where mid='{$cfg_ml->M_ID}' ";
$dsql->ExecuteNoneQuery($query);
if ($cfg_ml->M_Spacesta >= 0) {
$dsql->ExecuteNoneQuery("update `#@__member` set spacesta=1 where mid='{$cfg_ml->M_ID}' And spacesta < 1 ");
}
ShowMsg('成功更新空間信息!', 'edit_space_info.php');
exit;
} else {
示例4: ShowMsg
if ($catid == 0) {
ShowMsg("請指定圖書所屬欄目!", "-1");
exit;
}
//獲得父欄目
$nrow = $dsql->GetOne("Select * From #@__story_catalog where id='{$catid}' ");
$bcatid = $nrow['pid'];
$booktype = $nrow['booktype'];
$pubdate = GetMkTime($pubdate);
$bookname = addslashes(cn_substr(stripslashes($bookname), 50));
if ($keywords != "") {
$keywords = trim(addslashes(cn_substr(stripslashes($keywords), 60)));
}
//處理上傳的縮略圖
if (!empty($litpic)) {
$litpic = MemberUploads('litpic', $litpic, $cfg_ml->M_ID, 'image', '', $cfg_ddimg_width, $cfg_ddimg_height, false);
$litpic = " litpic='{$litpic}', ";
} else {
$litpic = "";
}
$userip = getip();
//自動摘要
if ($description == "" && $cfg_auot_description > 0) {
$description = stripslashes(cn_substr(html2text($body), $cfg_auot_description));
$description = addslashes($description);
}
$status = $status == 1 ? 1 : 0;
$upQuery = "\r\nUpdate `#@__story_books`\r\nset catid='{$catid}',\r\nbcatid='{$bcatid}',\r\nbookname='{$bookname}',\r\nauthor='{$author}',\r\n{$litpic}\r\npubdate='{$pubdate}',\r\ndescription='{$description}',\r\nstatus = '{$status}',\r\nbody='{$body}',\r\nkeywords='{$keywords}'\r\nwhere id='{$bookid}' and mid='{$cfg_ml->M_ID}'\r\n";
if (!$dsql->ExecuteNoneQuery($upQuery)) {
ShowMsg("更新數據庫時出錯,請檢查!" . $dsql->GetError(), "-1");
exit;
示例5: HtmlReplace
}
$menutype = 'content';
if ($dopost == '') {
include DEDEMEMBER . "/templets/uploads_add.htm";
} else {
if ($dopost == 'save') {
$cfg_ml->CheckUserSpace();
if ($mediatype == 1) {
$utype = 'image';
} else {
if ($mediatype == 2) {
$utype = 'flash';
} else {
if ($mediatype == 3) {
$utype = 'media';
} else {
$utype = 'addon';
}
}
}
$title = HtmlReplace($title, 2);
$filename = MemberUploads('addonfile', '', $cfg_ml->M_ID, $utype, '', -1, -1, true);
SaveUploadInfo($title, $filename, $mediatype);
$bkurl = "uploads_select.php?f=" . $f . "&mediatype=" . $mediatype . "&keyword=" . urlencode($keyword) . "&filename=" . $filename;
if ($filename == '') {
ShowMsg("上傳文件失敗!", "-1");
} else {
ShowMsg("成功上傳一個文件!", $bkurl);
}
}
}
示例6: ShowMsg
$maxlength = $cfg_max_face * 1024;
$userdir = $cfg_user_dir . '/' . $cfg_ml->M_ID;
if (!preg_match("#^" . $userdir . "#", $oldface)) {
$oldface = '';
}
if (is_uploaded_file($face)) {
if (@filesize($_FILES['face']['tmp_name']) > $maxlength) {
ShowMsg("你上傳的頭像文件超過了係統限製大小:{$cfg_max_face} K!", '-1');
exit;
}
//刪除舊圖片(防止文件擴展名不同,如:原來的是gif,後來的是jpg)
if (preg_match("#\\.(jpg|gif|png)\$#i", $oldface) && file_exists($cfg_basedir . $oldface)) {
@unlink($cfg_basedir . $oldface);
}
//上傳新工圖片
$face = MemberUploads('face', $oldface, $cfg_ml->M_ID, 'image', 'myface', 180, 180);
} else {
$face = $oldface;
}
$query = "UPDATE `#@__member` SET `face` = '{$face}' WHERE mid='{$cfg_ml->M_ID}' ";
$dsql->ExecuteNoneQuery($query);
// 清除緩存
$cfg_ml->DelCache($cfg_ml->M_ID);
ShowMsg('成功更新頭像信息!', $backurl);
exit;
} else {
if ($dopost == 'delold') {
if (empty($oldface)) {
ShowMsg("沒有可刪除的頭像!", "-1");
exit;
}
示例7: time
if (empty($urlValue)) {
$urlValue = '';
}
if (empty($imgsrcValue)) {
$imgsrcValue = '';
}
if (empty($imgurl)) {
$imgurl = '';
}
if (empty($dd)) {
$dd = '';
}
if ($dopost == 'upload') {
$ntime = time();
$cfg_ml->CheckUserSpace();
$filename = MemberUploads('imgfile', '', $cfg_ml->M_ID, 'image', '', -1, -1, true);
$dfilename = ereg_replace("(.*)/", "", $filename);
SaveUploadInfo("對話框上傳 {$dfilename} ", $filename, 1);
if ($dd == "yes") {
$litfilename = str_replace(".", "-lit.", $filename);
copy($cfg_basedir . '/' . $filename, $cfg_basedir . '/' . $litfilename);
SaveUploadInfo("對話框上傳 {$dfilename} 的小圖", $litfilename, 1);
ImageResize($cfg_basedir . '/' . $litfilename, $w, $h);
$urlValue = $filename;
$imgsrcValue = $litfilename;
$info = '';
$sizes = getimagesize($cfg_basedir . '/' . $litfilename, $info);
$imgwidthValue = $sizes[0];
$imgheightValue = $sizes[1];
$imgsize = filesize($cfg_basedir . '/' . $litfilename);
} else {
示例8: str_replace
}
}
$info = '';
//正常上傳
for ($i = 1; $i <= 120; $i++) {
//含有圖片的條件
if (isset($_FILES['imgfile' . $i]['tmp_name']) && is_uploaded_file($_FILES['imgfile' . $i]['tmp_name'])) {
$iinfo = str_replace("'", "`", stripslashes(${'imgmsg' . $i}));
if (!is_uploaded_file($_FILES['imgfile' . $i]['tmp_name'])) {
continue;
} else {
$sparr = array("image/pjpeg", "image/jpeg", "image/gif", "image/png", "image/xpng", "image/wbmp");
if (!in_array($_FILES['imgfile' . $i]['type'], $sparr)) {
continue;
}
$filename = MemberUploads('imgfile' . $i, '', $cfg_ml->M_ID, 'image', '', 0, 0, false);
if ($filename != '') {
SaveUploadInfo($title, $filename, 1);
}
//縮圖
if ($pagestyle > 2) {
$litpicname = GetImageMapDD($filename, $ddmaxwidth);
if ($litpicname != '') {
SaveUploadInfo($title . ' 小圖', $litpicname, 1);
}
} else {
$litpicname = $filename;
}
$imgfile = $cfg_basedir . $filename;
if (is_file($imgfile)) {
$iurl = $filename;
示例9: GetFieldValue
/**
* 處理不同類型的數據
*
* @access public
* @param string $dvalue 默認值
* @param string $dtype 默認類型
* @param int $aid 文檔ID
* @param string $job 操作類型
* @param string $addvar 值
* @param string $admintype 管理類型
* @param string $fieldname 變量類型
* @return string
*/
function GetFieldValue($dvalue, $dtype, $aid = 0, $job = 'add', $addvar = '', $admintype = 'admin', $fieldname = '')
{
global $cfg_basedir, $cfg_cmspath, $adminid, $cfg_ml, $cfg_cookie_encode;
if (!empty($adminid)) {
$adminid = $adminid;
} else {
$adminid = isset($cfg_ml) ? $cfg_ml->M_ID : 1;
}
if ($dtype == 'int') {
if ($dvalue == '') {
return 0;
}
return GetAlabNum($dvalue);
} else {
if ($dtype == 'stepselect') {
$dvalue = trim(preg_replace("#[^0-9\\.]#", "", $dvalue));
return $dvalue;
} else {
if ($dtype == 'float') {
if ($dvalue == '') {
return 0;
}
return GetAlabNum($dvalue);
} else {
if ($dtype == 'datetime') {
if ($dvalue == '') {
return 0;
}
return GetMkTime($dvalue);
} else {
if ($dtype == 'checkbox') {
$okvalue = '';
if (is_array($dvalue)) {
$okvalue = join(',', $dvalue);
}
return $okvalue;
} else {
if ($dtype == "htmltext") {
if ($admintype == 'member' || $admintype == 'diy') {
$dvalue = HtmlReplace($dvalue, -1);
}
return $dvalue;
} else {
if ($dtype == "multitext") {
if ($admintype == 'member' || $admintype == 'diy') {
$dvalue = HtmlReplace($dvalue, 0);
}
return $dvalue;
} else {
if ($dtype == "textdata") {
$ipath = $cfg_cmspath . "/data/textdata";
$tpath = ceil($aid / 5000);
if (!is_dir($cfg_basedir . $ipath)) {
MkdirAll($cfg_basedir . $ipath, $GLOBALS['cfg_dir_purview']);
}
if (!is_dir($cfg_basedir . $ipath . '/' . $tpath)) {
MkdirAll($cfg_basedir . $ipath . '/' . $tpath, $GLOBALS['cfg_dir_purview']);
}
$ipath = $ipath . '/' . $tpath;
$filename = "{$ipath}/{$aid}-" . cn_substr(md5($cfg_cookie_encode), 0, 16) . ".txt";
//會員投稿內容安全處理
if ($admintype == 'member' || $admintype == 'diy') {
$dvalue = HtmlReplace($dvalue, -1);
}
$fp = fopen($cfg_basedir . $filename, "w");
fwrite($fp, stripslashes($dvalue));
fclose($fp);
CloseFtp();
return $filename;
} else {
if ($dtype == 'img' || $dtype == 'imgfile') {
if (preg_match("#[\\|/]uploads[\\|/]userup#", $dvalue)) {
return $dvalue;
}
if ($admintype == 'diy') {
$iurl = MemberUploads($fieldname, '', 0, 'image', '', -1, -1, false);
return $iurl;
}
$iurl = stripslashes($dvalue);
if (trim($iurl) == '') {
return '';
}
$iurl = trim(str_replace($GLOBALS['cfg_basehost'], "", $iurl));
$imgurl = "{dede:img text='' width='' height=''} " . $iurl . " {/dede:img}";
if (preg_match("/^http:\\/\\//i", $iurl) && $GLOBALS['cfg_isUrlOpen']) {
//遠程圖片
$reimgs = '';
//.........這裏部分代碼省略.........
示例10: cn_substrR
}
//文檔的默認狀態
if ($cInfos['arcsta'] == 0) {
$arcrank = 0;
} else {
if ($cInfos['arcsta'] == 1) {
$arcrank = 0;
} else {
$arcrank = -1;
}
}
//對保存的內容進行處理
$title = cn_substrR(HtmlReplace($title, 1), $cfg_title_maxlen);
$mid = $cfg_ml->M_ID;
//處理上傳的縮略圖
$litpic = MemberUploads('litpic', $oldlitpic, $mid, 'image', '', $cfg_ddimg_width, $cfg_ddimg_height, FALSE);
if ($litpic != '') {
SaveUploadInfo($title, $litpic, 1);
} else {
$litpic = $oldlitpic;
}
//分析處理附加表數據
$inadd_f = $inadd_m = '';
if (!empty($dede_addonfields)) {
$addonfields = explode(';', $dede_addonfields);
if (is_array($addonfields)) {
foreach ($addonfields as $v) {
if ($v == '') {
continue;
}
$vs = explode(',', $v);
示例11: cn_substrR
$smalltypes = @explode(",", $row['smalltype']);
if (!isset($action)) {
$action = '';
}
if ($action == "save") {
$groupname = cn_substrR($groupname, 75);
$storeid = ereg_replace("[^0-9]", "", $store);
$description = cn_substrR($des, 100);
$row = $db->GetOne("SELECT tops FROM #@__store_groups WHERE storeid='{$storeid}'");
if ($row['tops'] > 0) {
$rootstoreid = $row['tops'];
} else {
$rootstoreid = $storeid;
}
//處理上傳的縮略圖
$litpic = MemberUploads('litpic', '', $cfg_ml->M_ID, 'image', '', 100, 70, false);
if ($litpic != '') {
SaveUploadInfo($groupname, $litpic, 1);
}
$inQuery = "UPDATE #@__groups SET groupname='" . $groupname . "',des='" . $description . "',groupimg='" . $litpic . "',rootstoreid='{$rootstoreid}',storeid='{$storeid}' WHERE groupid='{$id}' AND uid='" . $cfg_ml->M_ID . "';";
$db->SetQuery($inQuery);
if (!$db->ExecuteNoneQuery()) {
echo $db->GetError();
ShowMsg("把數據更新到數據庫groups表時出錯,請檢查!", "-1");
exit;
} else {
ShowMsg("成功更改圈子設置!", "-1");
exit;
}
}
//類目遞歸
示例12: ShowMsg
}
ShowMsg("成功修改你的資料!", 'edit_fullinfo.php');
exit;
} else {
if ($cfg_ml->M_MbType == '企業') {
$userdir = $cfg_user_dir . '/' . $cfg_ml->M_ID;
if (!ereg('^' . $userdir, $oldcomface)) {
$oldcomface = '';
}
if (is_uploaded_file($comface)) {
//刪除舊圖片(防止文件擴展名不同,如:原來的是gif,後來的是jpg)
if ($oldcomface != '' && file_exists($cfg_basedir . $oldcomface)) {
@unlink($cfg_basedir . $oldcomface);
}
//上傳新工圖片
$comface = MemberUploads('comface', '', $cfg_ml->M_ID, 'image', 'comface', 600, 450);
} else {
$comface = $oldcomface;
}
if (empty($city)) {
$place = $province;
} else {
$place = $city;
}
$tel = GetAlabNum($tel);
$fax = GetAlabNum($fax);
$mobile = GetAlabNum($mobile);
$email = cn_substrR(eregi_replace("[^0-9a-z\\.@-]", '', $email), 50);
$url = cn_substrR(eregi_replace("[^0-9a-z\\.:/-]", '', $url), 50);
$product = cn_substrR(HtmlReplace($product, 1), 20);
$linkman = cn_substrR(HtmlReplace($linkman, 1), 20);