function showlistrowalbum($value) { global $_G, $BASESCRIPT; $mlist = ''; $value['url'] = $_GET['optpass'] == 1 || $_GET['updatepass'] == 1 ? $BASESCRIPT . '?action=edit&m=album&itemid=' . $value['itemid'] . '&op=adminview&' . ($_GET['updatepass'] == 1 ? 'updatepass' : 'optpass') . '=1' : $BASESCRIPT . '?action=list&m=photo&shopid=' . $value['shopid'] . '&albumid=' . $value['itemid'] . '&filtersubmit=GO'; $albumcats = getmodelcategory('album'); $imgurl = getattachurl($value['subjectimage'], 1); $value['subject'] = cutstr($value['subject'], 15); // 上傳的鏈接 if ($value['itemid'] > 0) { if ($value['frombbs']) { if (pkperm('isadmin')) { $addlink = '<a style="color:#900;" href="admin.php?action=import&fromalbum=1&albumid=' . $value['itemid'] . '">' . lang('import_albumchoose') . '</a>'; } } else { $addlink = '<a style="color:#900;" href="' . $BASESCRIPT . '?action=add&m=photo&albumid=' . $value['itemid'] . '">' . lang('album_addphoto') . '</a>'; } } else { $addlink = ''; } $mlist = "\n\t<li>\t\t \n\t\t<div class=\"b\">\n\t\t\t\t\t<p><a href=\"{$value['url']}\" rel=\"internal\" title=\"{$value['subject']}\">\n\t\t\t<img class=\"fit129\" src=\"{$imgurl}\" rel=\"\" height=\"128\" width=\"128\" /></a>\n\t\t\t</p>\n\t\t</div>\n\t\n\t\t<div class=\"w\" style=\"margin-top:5px; \">\n\t\t\t<div id=\"flExpand\" style=\"height:75; line-height:20px;\">\n\t\t\t\t<div id=\"div_subject_{$value['itemid']}\" style=\"position:absolute; display:none;\">\n\t\t\t\t\t<input id=\"input_subject_{$value['itemid']}\" style=\"height:20px; border:#ccc 1px solid; padding:1px;\" name=\"subject['{$value['itemid']}']\" onblur=\"edit_album_subject({$value['itemid']}, this.value);\" value=\"{$value['subject']}\" />\n\t\t\t\t</div>\n\t\t\t\t<a id=\"label_subject_{$value['itemid']}\" href=\"javascript:;\" onclick=\"start_edit_album_subject('{$value['itemid']}');\" style=\"display:block; height:30px; line-height:30px; text-decoration:none;\" rel=\"internal\" title=\"{$value['subject']}\">{$value['subject']} <img src=\"static/image/ico_edit.png\" /></a>\n\t\t\t\t" . $addlink . "<br />\n\t\t\t\t" . (IN_ADMIN === true ? ($value['title'] === NULL ? lang('album_default') : $value['title']) . "<br/>" : "") . "\n\t\t\t\t" . lang('album_catid') . ': ' . $albumcats[$value['catid']]['name'] . "<br />\n\t\t\t\t" . lang('display_order') . ": <input class=\"txt\" style=\"heigth:30px; width:30px; border:#ccc 1px solid; font-size:9px;\" type=\"text\" name=\"display[{$value['itemid']}]\" value=\"" . (IN_ADMIN === true ? $value['displayorder'] : $value['displayorder_s']) . "\" checked />\n\t\t\t\t<input class=\"checkbox\" style=\"\" type=\"checkbox\" name=\"item[]\" value=\"" . $value['itemid'] . "\" checked />\n\t\t\t\t<span></span>\n\t\t\t</div>\n\t\t</div>\n\t</li>\n\n\t"; return $mlist; }
/** * 創建相冊 * @param * @return 相冊id */ function createalbum($shopid = 0, $catid = 0, $uid = 0, $username = '', $subject = '', $description = '') { global $_G, $_SGLOBAL; $arr_data = array(); //id foreach (array('shopid', 'catid', 'uid') as $value) { ${$value} = intval(${$value}); } //字符串 foreach (array('subject', 'description') as $value) { ${$value} = trim(strip_tags(${$value})); } //判斷必填,設置插入數據庫的數據 foreach (array('shopid', 'catid', 'uid', 'username', 'subject') as $value) { if (empty(${$value})) { cpmsg($value . '_not_selected', '', '', '', true, true); } $arr_data[$value] = ${$value}; } $arr_data['description'] = $description; if ($_SGLOBAL['panelinfo']['group']['verifyalbum'] && !pkperm('isadmin')) { $arr_data['grade'] = 0; } else { $arr_data['grade'] = 3; } $arr_data['dateline'] = $_G['timestamp']; $albumid = inserttable('albumitems', $arr_data, 1); if (!$albumid) { cpmsg('album_creat_error', '', '', '', true, true); } //相冊屬性 if (!empty($_POST['attr_ids'])) { require_once B_ROOT . "./batch.attribute.php"; setattributesettings($catid, $albumid, $_POST['attr_ids']); } return $albumid; }
$themeid = intval(substr($_GET['theme'], 1)); $query = DB::query("UPDATE " . tname("shopitems") . " SET themeid = '{$themeid}' WHERE {$wheresql} LIMIT 1"); if (DB::affected_rows($query)) { cpmsg('update_success', $BASESCRIPT . '?action=theme&m=shop&itemid=' . $_GET['itemid']); } } else { //取得信息 $query = DB::query('SELECT itemid, subject, themeid FROM ' . tname('shopitems') . ' WHERE ' . $wheresql . ' ORDER BY itemid DESC LIMIT 1'); $editvalue = DB::fetch($query); if (empty($editvalue)) { cpmsg('no_item', $BASESCRIPT . '?action=list&m=' . $mname); } //顯示導航以及表頭 $subjectnav = $BASESCRIPT == 'admin.php' ? $editvalue['subject'] : ''; shownav($mname, $mname . '_' . $_GET['action'], $subjectnav); if (pkperm('isadmin')) { $shopmenu = array(array('shop_edit', 'edit&m=shop&itemid=' . $_GET['itemid']), array('menu_shop_theme', 'theme&m=shop&itemid=' . $_GET['itemid'], 1), array('menu_modifypasswd', 'modifypasswd&m=shop&itemid=' . $_GET['itemid'], 0)); if ($_G['setting']['enablemap'] == 1) { array_push($shopmenu, array('menu_shop_map', 'map&m=shop&itemid=' . $_GET['itemid'])); } showsubmenu('menu_shop_theme', $shopmenu); } else { showsubmenu($mname . '_' . $_GET['action']); } showtips('theme_tips'); showformheader('theme'); echo '<div id="theme_list">'; showthistheme('default'); $tpl = dir(B_ROOT . './templates/store/'); $tpl->handle; while ($entry = $tpl->read()) {
function pklabel($showarr, $isall = 1) { global $_G, $_SGLOBAL, $alang, $lang, $mname; $thetext = $htmltext = $thelang = ''; if (!empty($showarr['alang'])) { if (isset($alang[$showarr['alang']])) { $thelang = $alang[$showarr['alang']]; } else { $thelang = $showarr['alang']; } } elseif (!empty($showarr['lang'])) { if (isset($lang[$showarr['lang']])) { $thelang = $lang[$showarr['lang']]; } else { $thelang = $showarr['lang']; } } if (!isset($showarr['name'])) { $showarr['name'] = ''; } if (!isset($showarr['size'])) { $showarr['size'] = 30; } if (!isset($showarr['maxlength'])) { $showarr['maxlength'] = ''; } if (!isset($showarr['value'])) { $showarr['value'] = ''; } if (!isset($showarr['values'])) { $showarr['values'] = array(); } if (!isset($showarr['options'])) { $showarr['options'] = array(); } if (!isset($showarr['other'])) { $showarr['other'] = ''; } if (!isset($showarr['display'])) { $showarr['display'] = ''; } if (!isset($showarr['hots'])) { $showarr['hots'] = array(); } if (!isset($showarr['lasts'])) { $showarr['lasts'] = array(); } if (!isset($showarr['btnname'])) { $showarr['btnname'] = ''; } if (!isset($showarr['title'])) { $showarr['title'] = ''; } if (!isset($showarr['mode'])) { $showarr['mode'] = '0'; } if (!isset($showarr['cols'])) { $showarr['cols'] = ''; } if (!isset($showarr['fileurl'])) { $showarr['fileurl'] = ''; } switch ($showarr['type']) { case 'input': showsetting($showarr['alang'], $showarr['name'], $showarr['value'], 'text', '', '', '', $showarr['other'], $showarr['required']); break; case 'file': showsetting($showarr['alang'], $showarr['name'], $showarr['value'], 'file', '', '', '', $showarr['other'], $showarr['required']); if (!empty($showarr['value'])) { echo "\n" . '<tr class="noborder"><td class="vtop rowform"> <a href="' . $showarr['fileurl'] . '" target="_blank">' . $showarr['value'] . '</a></td><td class="vtop tips2"><a href="javascript:;" title="Delete" onclick="document.getElementById(\'' . $showarr['name'] . '_value\').value=\'\'; this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);">' . lang('delete') . '</a></td></tr>'; } break; case 'edit': if (pkperm('isadmin')) { $enablealbum = 1; } else { if ($_SGLOBAL['panelinfo']['enablealbum']) { $enablealbum = 1; } else { $enablealbum = 0; } } echo "<script type=\"text/javascript\">var enablealbum={$enablealbum};</script>"; echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"static/js/editor/xheditor-zh-cn.js\"></script>\n\t\t\t\t<tr><td class=\"td27\" colspan=\"2\">" . lang($showarr['alang']) . "{$showarr[required]}</td></tr>\n\t\t\t\t<tr class=\"noborder\"><td class=\"vtop rowform\" colspan=\"2\">\n\t\t\t\t<textarea cols=\"100\" id=\"{$showarr[name]}\" name=\"{$showarr[name]}\" rows=\"20\" style=\"width:600px;\" class=\"xheditor {tools:'Bold,Italic,Underline,Strikethrough,FontSize,FontColor,BackColor,Separator,Align,List,Separator,Link,Img,About',skin:'default'}\">{$showarr[value]}</textarea>\n\t\t\t\t</td></tr>"; break; case 'textarea': showsetting($showarr['alang'], $showarr['name'], $showarr['value'], 'textarea', '', '', '', $showarr['other'], $showarr['required']); break; case 'select': $optionarr = array(); foreach ($showarr['options'] as $key => $value) { $optionarr[$key][0] = $key; $optionarr[$key][1] = $value['pre'] . $value['name']; } showsetting($showarr['alang'], array($showarr['name'], $optionarr), $showarr['value'], 'select', '', '', '', $showarr['other'], $showarr['required']); break; case 'radio': showsetting($showarr['alang'], $showarr['name'], $showarr['value'], 'radio', '', '', '', $showarr['other'], $showarr['required']); break; case 'radio_a': showsetting($showarr['alang'], $showarr['name'], $showarr['value'], 'radio_a', '', '', '', $showarr['other'], $showarr['required']); break; case 'checkbox': $thetext = ''; $i = 0; $thetext = '<table class="freetable"><tr>'; foreach ($showarr['options'] as $tmpkey => $tmpvalue) { $thetext .= '<td><input name="' . $showarr['name'] . '[]" type="checkbox" value="' . $tmpkey . '"' . $showarr['other'] . ' />' . $tmpvalue . '</td>'; if ($i % 5 == 4) { $thetext .= '</tr><tr>'; } $i++; } $thetext .= '</tr></table>'; if (!empty($showarr['value'])) { if (is_array($showarr['value'])) { $showvaluearr = $showarr['value']; } else { $showvaluearr = explode(',', $showarr['value']); } foreach ($showvaluearr as $showvalue) { $showvalue = trim($showvalue); $thetext = str_replace('value="' . $showvalue . '"', 'value="' . $showvalue . '" checked', $thetext); } } break; case 'date': $datearr = array('0' => $alang['space_date_null'], '86400' => $alang['space_date_day_1'], '172800' => $alang['space_date_day_2'], '604800' => $alang['space_date_week_1'], '1209600' => $alang['space_date_week_2'], '2592000' => $alang['space_date_month_1'], '7948800' => $alang['space_date_month_3'], '15897600' => $alang['space_date_month_6'], '31536000' => $alang['space_date_year_1']); $thetext = getselectstr($showarr['name'], $datearr, $showarr['value']); break; case 'time': $thetext = '<input name="' . $showarr['name'] . '" readonly type="text" id="' . $showarr['name'] . '" value="' . $showarr['value'] . '"/><img src="static/image/admin/time.gif" onClick="getDatePicker(\'' . $showarr['name'] . '\',event,21)"/>'; break; case 'hidden': $htmltext = '<tr><td colspan="2" style="display:none"><input name="' . $showarr['name'] . '" type="hidden" value="' . $showarr['value'] . '"' . $showarr['other'] . ' /></td></tr>'; break; default: $thetext = ''; break; } if (!$isall) { return $thetext; } return $htmltext . "\n"; }
$value['formtype'] = $value['formtype'] == 'linkage' ? 'select' : $value['formtype']; if ($value['formtype'] == 'checkbox') { $editvalue[$value['fieldname']] = explode("\n", $editvalue[$value['fieldname']]); } $fileurl = A_URL . '/' . $editvalue[$value['fieldname']]; if (preg_match("/^(img|flash|file)\$/i", $value['formtype'])) { $value['formtype'] = 'file'; } if ($value['fieldname'] == 's_enablealbum' || $value['fieldname'] == 'intro' || $value['fieldname'] == 's_enableconsume' || $value['fieldname'] == 's_enablenotice' || $value['fieldname'] == 's_enablegood' || $value['fieldname'] == 'isdiscount' || $value['fieldname'] == 'mapapimark' || (!$_G['setting']['enablecard'] || !$editvalue['isdiscount']) && $value['fieldname'] == 'discount') { unset($value); } if ($value['fieldname'] == "styletitle" || $value['fieldname'] == "groupid" || $value['fieldname'] == "region") { unset($value); } if ($value['fieldname'] == "forum") { if (!pkperm('isadmin')) { unset($value); } } if (empty($value)) { continue; } if ($value['formtype'] != 'timestamp') { // 如果是自定字 if (strpos($value['fieldname'], 'ext_') === 0) { $title = $value['fieldtitle']; } else { $title = $mname . '_' . $value['fieldname']; } pklabel(array('type' => $value['formtype'], 'alang' => $title, 'name' => $value['fieldname'], 'options' => $temparr2, 'rows' => 10, 'width' => '30%', 'size' => '60', 'value' => $editvalue[$value['fieldname']], 'other' => $other, 'fileurl' => $fileurl, 'required' => $value['required'])); }
echo <<<EOT \t\t\t\t\t</div> \t\t\t\t\t<div class="navbd"></div> \t\t\t\t\t<div class="sitemapbtn"></div> \t\t\t\t</div> \t\t\t</div> \t\t</td> \t</tr> \t<tr> \t\t<td valign="top" width="160" class="menutd"> \t\t\t<div id="leftmenu" class="menu"> EOT; require_once B_ROOT . './source/admininc/menu.inc.php'; $uc_api_url = UC_API; $ucadd = pkperm('isadmin') ? ", 'uc'" : ''; $release = B_RELEASE; $bver = B_VER; echo <<<EOT \t\t\t</div> \t\t</td> \t\t<td valign="top" width="100%" class="mask" id="mainframes"> EOT; if (IN_STORE === true) { echo "<div style=\"border-bottom:1px solid #B5CFD9; padding:0 0 5px 10px;\"><p id=\"admincpnav\"></p></div>"; } echo <<<EOT \t\t\t<iframe src="{$BASESCRIPT}?{$extra}" id="main" name="main" onload="mainFrame(0)" width="100%" height="100%" frameborder="0" scrolling="yes" style="overflow: visible;display:"></iframe> \t\t</td> \t</tr>
function showlistmod($mname) { global $_G, $catstr, $opcheckstr, $gradestr, $_SGLOBAL, $_SC; //下拉框拼湊 $opcheckstr = ""; foreach ($_SGLOBAL['shopgrade'] as $key => $value) { if ($_G['myshopstatus'] == 'verified' && ($key == 0 || $key == 5 || !pkperm('isadmin') && $key == 1)) { } else { $opcheckstr .= ' <input class="radio" type="radio" name="opcheck" value="' . $key . '"' . (pkperm('isadmin') ? ' onClick="showchecktxt(' . $key . ');"' : '') . '> ' . $value . ' '; $gradestr .= '<option value="' . $key . '" ' . ($_GET['grade'] == $key ? 'selected="selected"' : '') . '>' . $value . '</option>'; } } //批量操作方法 $opt_master_pass = $_GET['optpass'] == 1 ? true : false; //快速操作,管理員點擊待審核列表時,只出現更改審核狀態的設置 $update_master_pass = $_GET['updatepass'] == 1 ? true : false; //審核通過店舖,修改信息後站長審核頁面。 showtableheader(lang('operation_form'), 'nobottom'); if (!$opt_master_pass && !$update_master_pass) { showsubtitle(array('', 'operation', 'option')); } $checktextjavascript = ' <script type="text/javascript" charset="' . $_G['charset'] . '"> function showchecktxt(cktxtid) { if($("#newgroupid").length>0) { $("#newgroupfield").css("display","none"); } if(cktxtid==1) { $("#check_trid").css("display",""); $("#check_txtid").text("' . lang('mod_checktxt_fail') . '"); } else if(cktxtid==2) { $("#check_trid").css("display",""); $("#check_txtid").text("' . lang('mod_checktxt_close') . '"); } else if(cktxtid==3) { if($("#newgroupid").length>0) { $("#newgroupfield").css("display",""); } else { var newgroupid = $("#groupid").clone(); newgroupid[0].id= "newgroupid"; newgroupid[0].name= "newgroupid"; $("#newgroupselect").before(newgroupid); $("#newgroupfield").css("display",""); } $("#check_trid").css("display",""); $("#check_txtid").text("' . lang('mod_checktxt_pass') . '"); } else if(cktxtid==4) { $("#check_trid").css("display",""); $("#check_txtid").text("' . lang('mod_checktxt_recommend') . '"); } else { $("#check_trid").css("display","none"); $("#check_txtid").text(""); } } $(function() { $("#submit_listsubmit").click(function() { var operations = $(":radio[name=\'operation\']"); if(operations.length>0) { for(var i = 0; i < operations.length; i++) { if(operations[i].checked) { return true; } } } alert("' . lang("operation_mustselected") . '"); return false; }); }); </script>'; // 如果進入的是待審核快速操作選項 if ($opt_master_pass) { if ($mname == 'shop') { showtablerow('', array('style="display:none;"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" checked name="operation" value="check">', ' <input type="radio" onclick="showchecktxt(3);" value="3" name="opcheck" class="radio">' . lang('pass_update') . ' <input type="radio" onclick="showchecktxt(1);" value="1" name="opcheck" class="radio">' . lang('del_update'))); showtablerow('id="check_trid" style="display:none;"', array('class="rowform" style="width:auto;"'), array(' <textarea rows="6" name="check_txt" id="check_txtid" cols="50" class="tarea"></textarea> <span class="vtop tips2">' . lang('mod_check_textarea_comment') . '</span>')); $catstr = '<select name="newgroupid" id="newgroupid">'; $query = DB::query("SELECT * FROM " . tname("shopgroup") . " ORDER BY id ASC;"); while ($result = DB::fetch($query)) { $catstr .= '<option value="' . $result['id'] . '">' . $result['title'] . '</option>'; } showtablerow('id="newgroupfield" style="display:none;"', array('class="rowform" style="width:auto;"'), array($catstr . '</select> <span id="newgroupselect" class="vtop tips2">' . lang('mod_check_newgroupid_comment') . '</span>')); echo $checktextjavascript; } else { showtablerow('', array('style="display:none;"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" checked="checked" name="operation" value="passcheck">', ' <input type="radio" onclick="showchecktxt(3);" checked="checked" value="3" name="opcheck" class="radio">' . lang('pass_update') . ' <input type="radio" onclick="showchecktxt(1);" value="1" name="opcheck" class="radio">' . lang('del_update'))); showtablerow('id="check_trid" style="display:;"', array('class="rowform" style="width:auto;"'), array(' <textarea rows="6" name="check_txt" id="check_txtid" cols="50" class="tarea">' . lang('mod_update_pass_' . $mname) . '</textarea> <span class="vtop tips2">' . lang('mod_check_textarea_comment_' . $mname) . '</span>')); echo $checktextjavascript_ = '<script type="text/javascript" charset="' . $_G['charset'] . '">function showchecktxt(cktxtid) { if(cktxtid==1) { $("#check_trid").css("display",""); $("#check_txtid").text("' . lang('mod_checktxt_refuse_' . $mname) . '"); } else if(cktxtid==3) { $("#check_trid").css("display",""); $("#check_txtid").text("' . lang('mod_checktxt_pass_' . $mname) . '"); } } </script> '; } } elseif ($update_master_pass) { if ($mname == 'shop') { showtablerow('', array('style="display:none;"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" checked name="operation" value="passupdate">', ' <input class="radio" type="radio" checked="checked" name="update" value="1" />' . lang('pass_update') . ' <input class="radio" type="radio" name="update" value="0" />' . lang('del_update'))); showtablerow('id="check_trid" style="display:;"', array('class="rowform" style="width:auto;"'), array(' <textarea rows="6" name="check_txt" id="check_txtid" cols="50" class="tarea">' . lang('mod_update_pass_' . $mname) . '</textarea> <span class="vtop tips2">' . lang('mod_check_textarea_comment') . '</span>')); } else { showtablerow('', array('style="display:none;"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" checked name="operation" value="passupdate">', ' <input class="radio" type="radio" checked="checked" name="update" value="1" />' . lang('pass_update') . ' <input class="radio" type="radio" name="update" value="0" />' . lang('del_update'))); showtablerow('id="check_trid" style="display:;"', array('class="rowform" style="width:auto;"'), array(' <textarea rows="6" name="check_txt" id="check_txtid" cols="50" class="tarea">' . lang('mod_update_pass_' . $mname) . '</textarea> <span class="vtop tips2">' . lang('mod_check_textarea_comment_' . $mname) . '</span>')); } echo '<script type="text/javascript" charset="' . $_G['charset'] . '"> $(function(e){ $(":radio[name=\'update\']").click(function(e){ var update = e.target.value; if(update == 0) { $("#check_txtid").text("' . lang('mod_update_refuse_' . $mname) . '"); } else { $("#check_txtid").text("' . lang('mod_update_pass_' . $mname) . '"); } }); }); </script>'; } else { // 調整顯示順序,除了圖片外都有顯示順序 if ($mname != 'photo') { showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="display">', lang('mod_displayorder'), '')); } //一般情況的批量操作選項 if ($mname == 'album') { $mycats = array(); if (pkperm('isadmin')) { $mycats = getmodelcategory('album'); } else { $mycats = mymodelcategory('album'); } $please_select = '<select name="catid" id="album_catid" style="width:140px;"><option value="0" selected="selected">' . lang('please_select') . '</option>'; foreach ($mycats as $value) { $please_select .= '<option value="' . $value['catid'] . '" >' . $value['name'] . '</option>'; } $please_select .= '</select>'; showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="album_movecat" >', lang('mod_album_movecat'), InteractionCategoryMenu(getmodelcategory('album'), 'catid', null, 1))); } //站長修改店舖組和分類 if (pkperm('isadmin') && $mname == 'shop') { echo '<tr class="hover"> <td class="td25"><input type="radio" value="changecat" name="operation" class="radio"></td> <td class="td24">' . lang("modallshopcat") . '</td> <td style="width: auto;" class="rowform"> <div id="catdiv" style="width: 700px;"> '; $catelist = getmodelcategory('shop'); echo '<div id="' . shopcat . 'div" colspan="2">'; echo InteractionCategoryMenu(getmodelcategory('shop'), 'shopcat', null, null); echo '</div></div></td></tr>'; $catstr = '<select name="groupid" id="groupid">'; $query = DB::query("SELECT * FROM " . tname("shopgroup") . " ORDER BY id ASC;"); while ($result = DB::fetch($query)) { $catstr .= '<option value="' . $result['id'] . '">' . $result['title'] . '</option>'; } showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="movecat">', lang('mod_shop_changegroup'), $catstr . '</select>')); } //站長修改信息所屬店舖 if (pkperm('isadmin') && $mname != 'shop' && $mname != 'photo') { showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="moveshop">', lang('mod_' . $mname . '_moveshop'), '<input class="number" type="number" name="opshopid">' . lang('mod_moveshop_id'))); } //更改店舖狀態 showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="check">', lang('mod_check'), $opcheckstr)); if ($mname == 'shop') { //店舖狀態短信通知 showtablerow('id="check_trid" style="display:none;"', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('', lang('mod_check_textarea'), ' <textarea rows="6" name="check_txt" id="check_txtid" cols="50" class="tarea"></textarea> <span class="vtop tips2">' . lang('mod_check_textarea_comment') . '</span>')); showtablerow('id="newgroupfield" style="display:none;"', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('', '<font color="red">' . lang('shop_newgroupid') . '</font>', ' <span id="newgroupselect" class="vtop tips2">' . lang('mod_check_newgroupid_comment') . '</span>')); //店舖狀態短信通知js echo $checktextjavascript; //是否首頁推薦 showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="recommend">', lang('mod_recommend'), ' <input class="radio" type="radio" name="opallowreply" value="1"> ' . lang('yes') . ' <input class="radio" type="radio" name="opallowreply" value="0"> ' . lang('no'))); //會員卡 showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="discount">', lang('mod_discount'), ' <input class="radio" type="radio" name="opdiscount" value="1"> ' . lang('mod_discount_yes') . ' <input class="radio" type="radio" name="opdiscount" value="0"> ' . lang('mod_discount_no'))); //店舖所有者 showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="owner">', lang('mod_owner'), '<input class="number" type="number" name="opowner" value="" /> <span style="color:#999;"> ' . lang('mod_owner_inputuid') . '</span>')); } //是否允許評論 if ($mname != 'photo' && $mname != 'album') { showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="allowreply">', lang('mod_allowreply'), ' <input class="radio" type="radio" name="opallowreply" value="1"> ' . lang('mod_allowreply_yes') . ' <input class="radio" type="radio" name="opallowreply" value="0"> ' . lang('mod_allowreply_no'))); } //刪除信息 showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="delete">', lang('mod_delete'), $mname == 'shop' ? '<input class="checkbox" type="checkbox" name="opdelete" id="opdelete" value="1" checked="checked" /><label for="opdelete"> ' . lang('mod_delete_all') . '</label>' : '')); } showsubmit('listsubmit', 'submit', ''); showtablefooter(); showformfooter(); }
function auth() { global $_G; $cookie = $_G['cookie']['auth']; if ($cookie) { @(list($password, $uid) = explode("\t", authcode($cookie, 'DECODE'))); $uid = intval($uid); $password = addslashes($password); $member = DB::fetch_first('SELECT * FROM ' . tname('members') . ' WHERE uid=\'' . $uid . '\' AND password=\'' . $password . '\''); if ($member) { $_G['uid'] = $uid; $_G['username'] = addslashes($member['username']); $_G['email'] = addslashes($member['email']); $_G['myshopid'] = intval($member['myshopid']); $_G['member']['shopcount'] = 0; $_G['member'] = $member; if ($_G['myshopid'] > 0) { require_once B_ROOT . "./source/class/shop.class.php"; $_G['myshopsarr'] = shop::ls_myshops(); $_G['member']['shopcount'] = count($_G['myshops']); } } } //if(!$_G['uid']) { sclearcookie(); return ;} if (IN_STORE === true) { if (pkperm('isadmin')) { showmessage('admin_no_perm_to_panel', 'index.php'); } elseif ($_G['myshopid'] < 0) { showmessage('no_perm', 'index.php'); } else { $shop_grade = $_G['myshopsarr'][$_G['myshopid']]['grade']; if ($shop_grade <= 1) { $_G['myshopstatus'] = 'unverified'; } elseif ($shop_grade > 1) { $_G['myshopstatus'] = 'verified'; } } } }
$query = DB::query('SELECT * FROM ' . tname('albumitems') . " WHERE itemid='{$albumid}' LIMIT 1"); $update = DB::fetch($query); $update = serialize($update); DB::query("REPLACE INTO " . tname("itemupdates") . " (`itemid`, `type`, `updatestatus`, `update`) VALUES ('{$albumid}', 'album', '1', '{$update}');"); DB::query("UPDATE " . tname("albumitems") . " SET updateverify = 1 WHERE itemid = '{$albumid}' ;"); } elseif ($albumgrade == 1) { DB::query("UPDATE " . tname("albumitems") . " SET grade = 0 WHERE itemid = '{$albumid}' ;"); } } } } } $attach = loadClass('attach')->attach_upload('Filedata'); if (is_array($attach) && $shopid) { $attach['name'] = substr($attach['name'], 0, -4); if ($_SGLOBAL['panelinfo']['group']['verifyalbum'] && !pkperm('isadmin')) { $grade = 0; } else { $grade = 3; } $photoid = DB::insert('photoitems', array('shopid' => $shopid, 'albumid' => $albumid, 'uid' => $_G['uid'], 'username' => $_G['username'], 'subject' => $attach['title'], 'subjectimage' => $attach['attachment'], 'dateline' => $_G['timestamp'], 'lastpost' => $_G['timestamp'], 'allowreply' => '1', 'grade' => $grade), 1); } if (empty($photoid) || $photoid < 0) { //插入數據庫失敗則刪除文件 @unlink(A_DIR . '/' . $attach['attachment']); } $updatesql = array(); if ($photoid) { $updatesql[] = " `picnum`=`picnum`+1 "; } if (empty($albumimg) && $photoid) {
function geteditcont($cont = 'www', $string = 0) { global $_G, $_SGLOBAL, $wheresql, $lang, $_SC; if (pkperm('isadmin')) { $shopid = intval($_G['cookie']['shopid']); if ($shopid < 1) { exit('<div>cookie error</div>'); } $wheresql = " WHERE shopid='{$shopid}'"; } elseif ($_G['myshopstatus'] == 'verified') { $wheresql = " WHERE shopid='{$_G['myshopid']}'"; } switch ($cont) { case 'www': $str = <<<EOF \t\t\t<div id="e_www" unselectable="on" class="p_opt popupfix" style=""> \t\t\t\t<table width="100%" cellspacing="0" cellpadding="0"> \t\t\t\t\t<tbody> \t\t\t\t\t\t<tr> \t\t\t\t\t\t\t<th width="74%">{$lang['editor_imgsrc']}<span class="xi1" id="e_image_status"></span></th> \t\t\t\t\t\t\t<th width="13%">{$lang['editor_imgwidth']}</th> \t\t\t\t\t\t\t<th width="13%">{$lang['editor_imgheight']}</th> \t\t\t\t\t\t</tr> \t\t\t\t\t\t<tr> \t\t\t\t\t\t\t<td><input type="text" autocomplete="off" class="px" value="" style="width: 95%;" id="e_image_param_1"></td> \t\t\t\t\t\t\t<td><input autocomplete="off" class="px p_fre" value="" size="1" id="e_image_param_2"></td> \t\t\t\t\t\t\t<td><input autocomplete="off" class="px p_fre" value="" size="1" id="e_image_param_3"></td> \t\t\t\t\t\t</tr> \t\t\t\t\t\t<tr> \t\t\t\t\t\t\t<td align="center" class="pns" colspan="3"> \t\t\t\t\t\t\t\t<button id="e_image_submit" class="pn pnc" type="button"><span>{$lang['settingsubmit']}</span></button> \t\t\t\t\t\t\t</td> \t\t\t\t\t\t</tr> \t\t\t\t\t</tbody> \t\t\t\t</table> \t\t\t</div> \t\t\t<script type="text/javascript"> \t\t\t\$("#e_image_submit").click( \t\t\t\tfunction() { \t\t\t\t\tvar msgeditor; \t\t\t\t\tmsgeditor=\$("#message")[0].editor; \t\t\t\t\tvar edtimgextra = ''; \t\t\t\t\tif(\$("#e_image_param_2").val()>0) { \t\t\t\t\t\tedtimgextra += ' width="'+\$("#e_image_param_2").val()+'"'; \t\t\t\t\t} \t\t\t\t\tif(\$("#e_image_param_3").val()>0) { \t\t\t\t\t\tedtimgextra += ' height="'+\$("#e_image_param_3").val()+'"'; \t\t\t\t\t} \t\t\t\t\tmsgeditor.pasteHTML('<img src="'+\$("#e_image_param_1").val()+'" '+edtimgextra+' />'); \t\t\t\t\tmsgeditor.hidePanel(); \t\t\t\t\treturn false; \t\t\t\t} \t\t\t); \t\t\t</script> EOF; break; case 'albumlist': $str = ' <div style="" id="e_albumlist" unselectable="on" class="p_opt"> <div class="upfilelist"> ' . lang('editor_albumchoose') . ' <select id="choosealbum"> <option value="0">' . lang('all') . '</option> <option value="-1">' . lang('album_default') . '</option>'; $query = DB::query('SELECT itemid, subject FROM ' . tname('albumitems') . $wheresql . ' ORDER BY itemid DESC'); while ($albumarr = DB::fetch($query)) { $str .= "<option value=\"{$albumarr['itemid']}\">{$albumarr['subject']}</option>"; } $str .= ' </select> <p id="albumphoto"></p> </div> </div> <script type="text/javascript"> $("#choosealbum").change(function() { $("#albumphoto").load(\'' . $BASESCRIPT . '?action=ajax_editor&cont=imgattachlist&albumid=\'+$("#choosealbum").val());}); </script> '; break; case 'imgattachlist': $str = ' <div id="e_imgattachlist" unselectable="on" class="p_opt"> <div class="upfilelist"> <div id="imgattachlist" style=""> ' . showattachshtml() . ' </div> <div id="unusedimgattachlist"></div> </div> <p style="" id="imgattach_notice" class="notice">' . lang('editor_clickphoto') . '</p> </div>'; break; case 'multi': $configxml = rawurlencode('misc.php?ac=swfupload&op=config&ineditor=1'); $str = <<<EOF \t\t\t<div id="e_multi" class="swfup" style="float:left;"> \t\t\t\t\t\t<div id="swfup"> \t\t\t\t\t\t\t<h1>Alternative content</h1> \t\t\t\t\t\t\t<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p> \t\t\t\t\t\t</div> \t\t\t</div> \t\t\t<script charset="utf-8" type="text/javascript" src="static/image/admin/swfobject.js"></script> \t\t\t<script type="text/javascript"> \t\t\t\tswfobject.embedSWF("static/image/admin/upload.swf?config={$configxml}", "swfup", "100%", "400", "9.0.0", "static/image/admin/expressInstall.swf"); \t\t\t\tfunction swfHandler(albumid, albumurl) { \t\t\t\t\t\$("#e_image_ctrl a").removeClass('current'); \t\t\t\t\t\$("#e_btn_imgattachlist").addClass('current'); \t\t\t\t\t\$("#e_cont").load(albumurl + albumid); \t\t\t\t} \t\t\t</script> EOF; break; } if ($string) { return $str; } else { echo $str; } }
function setalbumimg() { global $_G, $_SGLOBAL; $albumid = intval($_REQUEST['albumid']); $photoid = intval($_REQUEST['photoid']); if (pkperm('isadmin')) { $pwheresql = " itemid='{$photoid}'"; $awheresql = " itemid='{$albumid}'"; } else { $pwheresql = " itemid='{$photoid}' AND shopid='{$_G['myshopid']}'"; $awheresql = " itemid='{$albumid}' AND shopid='{$_G['myshopid']}'"; } $imgurl = DB::result_first('SELECT subjectimage FROM ' . tname('photoitems') . ' WHERE ' . $pwheresql); if ($imgurl) { if (strpos($imgurl, 'http://') === 0) { //遠程圖片的相冊保存到本地做個縮略圖 $oldalbumimg = DB::result_first('SELECT subjectimage FROM ' . tname('albumitems') . " WHERE {$awheresql} AND frombbs='1'"); if (!empty($oldalbumimg)) { @unlink(A_DIR . '/' . $oldalbumimg); @unlink(A_DIR . '/' . substr($oldalbumimg, 0, -4) . '.thumb.jpg'); } $remoteattach = loadClass('attach')->saveremotefile($imgurl, array(320, 240)); $imgurl = $remoteattach['file']; } $query = DB::query('UPDATE ' . tname('albumitems') . " SET subjectimage='{$imgurl}' WHERE {$awheresql}"); $num = DB::affected_rows($query); } if ($num > 0) { cpmsg('message_success', '', 'success', '', true, true); } else { cpmsg('message_fail', '', 'error', '', true, true); } }
<?php /** * [品牌空間] (C)2001-2010 Comsenz Inc. * This is NOT a freeware, use is subject to license terms * * $Id: batch.attribute.php 4413 2010-09-13 09:10:48Z xuhui $ */ if (!empty($_REQUEST['ajax'])) { require_once './common.php'; $_POST['valueid'] = intval($_POST['valueid']); $_GET['typeid'] = intval($_GET['typeid']); $_GET['itemid'] = intval($_GET['itemid']); if ($_POST['op'] == 'delete' && pkperm('isadmin')) { DB::query("DELETE FROM " . tname('attrvalue') . " WHERE `attr_valueid` = '{$_POST['valueid']}'"); echo $_POST['valueid']; } $categorylist = getmodelcategory('good'); empty($_GET['typeid']) ? exit('') : ''; $_GET['itemid'] = !empty($_GET['itemid']) ? $_GET['itemid'] : 0; echo $attrsettings = getattributesettings($_GET['typeid'], $_GET['itemid']); } /** * 讀取篩選器 * @param $var - 變量名 (最好標注下類型) * @param $type_id - 商品分類id * @param $life - 生命期 * @param $prefix - 前綴 * @return */ function getattribute($type_id)