📄 store_add.php
字号:
<?php
/*
+-------------------------------------------
|
| Technology of Wane netware
| ========================================
| Powered by wan-e.net inc
| (c) 2004 wane.net Power Services
| http://www.wan-e.net
| ========================================
| Web: http://www.wan-e.net
|
+-------------------------------------------
| Autohr : wsfuyibing
+-------------------------------------------
*/
if (!$RIGHT['STORE'])
{
$function->showmsg('javascript:history.go(-1)',$LANG_CP_INFO['ACCESS_DENIED'],'10');
}
elseif (!$RIGHT['ADDSP'])
{
$function->clickback($LANG_CP_SP['ACCESS_DENIED']);
}
else
{
$query_storecheck = $db->query("SELECT uid,username,infosign FROM {$tablepre}storeinfo WHERE uid='$wane_uid' limit 1");
$row_storecheck = $db->row($query_storecheck);
if (!$db->num($query_storecheck))
{
$function->clickback($LANG_CP_SP[ADDSP_DENIED]);
}
elseif (!$row_storecheck['infosign'] && $row_storecheck['infosign']!=$RIGHT['STORESIGN'])
{
$function->clickback($LANG_CP_SP[STORE_DENIED]);
}
elseif ($spsubmit && $type=='addstoresubmit' && $submit)
{
if (empty($spname)) {$function->clickback($LANG_CP_SP[CP_SP_INFO_NONAME]);}
elseif (empty($cid) || !is_numeric($cid) || $cid<1) {$function->clickback($LANG_CP_SP[CP_SP_INFO_NOCLASS]);}
elseif (empty($price_member) || empty($price_market) || empty($price_vip)) {$function->clickback($LANG_CP_SP[CP_SP_PRICE_M_V]);}
elseif (!is_numeric($price_member) || $price_member<0 || !is_numeric($price_market) || $price_market<0 || !is_numeric($price_vip) || $price_vip<0) {$function->clickback($LANG_CP_SP[CP_SP_PRICE_M_V]);}
elseif (empty($context)) {$function->clickback($LANG_CP_SP[CP_SP_INFO_NOCONTEXT]);}
else
{
if ($imgway && is_uploaded_file($userfile))
{
require $wane_root.'globals/class_upload.php';
$upload = new waneupload;
$spimg = $upload->upload_image($userfile_name,$userfile);
}
else
{
$spimg = "$spimg";
}
$htmlroot = $function->showtime($html_unit,time());
$addtime = time();
$losetime = $RIGHT[SPTIME]=='0' ? '0' : $addtime+$RIGHT[SPTIME]*86400;
$db->query("insert into {$tablepre}spinfo
(cid,mid,bid,uid,username,spname,keyword,spuser,spcount,spsize,price_market,price_member,price_vip,spcontext,spimg,sign,addtime,losetime,htmlroot,isdiscuss)
Values
('$cid','$mid','$bid','$wane_uid','$wane_user','$spname','$keyword','$spuser','$spcount','$spsize','$price_market','$price_member','$price_vip','$context','$spimg','$RIGHT[SPSIGN]','$addtime','$losetime','$htmlroot','$isdiscuss')");
$newspid = $db->query_id();
$db->query("UPDATE {$tablepre}storeinfo SET sps=sps+'1' WHERE uid='$wane_uid'");
require $wane_root.'globals/class_cache.php';
$cache = new wanecache;
$spcache = $bid=='1' ? 'spper' : 'spnew' ;
$cache -> update_cache($spcache);
if ($html_onoff && $html_spinfo)
{
echo "<script src='{$default_url}view.php?action=spinfo&info={$newspid}&newsubmit=1'></script>";
}
$function->showmsg($default_url.'index.php?action=memcp&type=managestore',$LANG_CP_SP[CP_SP_SUBMIT_ADD_SUCCESS]);
}
}
else
{
eval($function->load_cache(array('selectc','selectm')));
eval($tpl->set_var(array(
'CP_SP_SELECTC' => ($cid && is_numeric($cid) && $cid>0) ? str_replace("value='$cid'","value='$cid' selected",$cache_selectc) : $cache_selectc,
'CP_SP_SELECTM' => ($mid && is_numeric($mid) && $mid>0) ? str_replace("value='$mid'","value='$mid' selected",$cache_selectm) : $cache_selectm,
)));
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -