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;
    }
}
Example #2
0
    //查詢一次獲得總數
    setimportcookie();
    ssetcookie('i_count', $count, 900);
    ssetcookie('i_maxpage', ceil($count / $perpage), 900);
    ssetcookie('i_norepeat', '1', 900);
    header('Location:admin.php?action=import&m=album&step=3');
} elseif ($step == 3) {
    //圖片列表顯示頁面
    require_once B_ROOT . './api/bbs_pic.php';
    $list_pic = list_thread_pic($tid, $firstonly, $page - 1, $perpage, $minsize);
    showformheader('import');
    showtableheader('import_listresult', 'notop');
    showtablefooter();
    showhiddenfields(array('step' => '4'));
    showhiddenfields(array('page' => $page));
    showattachshtml();
    //圖片列表
    showalbummod();
    showformfooter();
    //批量操作的form結束
} elseif ($step == 4) {
    //數據提交處理頁面
    $attachs = getpostattach();
    $updatesql = array();
    if ($_POST['albumop'] == 'new') {
        require_once B_ROOT . './source/adminfunc/album.func.php';
        $albumid = createalbum($shopid, $_POST['catid'], $authorid, $author, $_POST['albumname'], $_POST['albumdesc']);
        //更新相冊記錄為從論壇導入的相冊
        $imgurl = $attachs[0]['url'];
        if (strpos($imgurl, 'http://') === 0) {
            $remoteattach = loadClass('attach')->saveremotefile($imgurl, array(320, 240));