Exemplo n.º 1
0
function showlistrowphoto($value)
{
    global $_G, $BASESCRIPT;
    $mlist = '';
    $value['url'] = 'store.php?id=' . $value['shopid'] . '&action=album&xid=' . $value['albumid'] . '" target="_blank"';
    $imgurl = getattachurl($value['subjectimage'], 1);
    $value['subject'] = cutstr($value['subject'], 15);
    $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_photo_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_photo_subject('{$value['itemid']}');\" style=\"display:block; height:30px; line-height:30px; text-decoration:none;\" rel=\"internal\" title=\"{$value['subject']}\">{$value['subject']} &nbsp;<img src=\"static/image/ico_edit.png\" /></a>\n\t\t\t\t" . lang('photo_albumid') . ': ' . $value['title'] . "<br />\n\t\t\t\t" . "<div><a href=\"" . $BASESCRIPT . '?action=batchmod&operation=setalbumimg&albumid=' . $value['albumid'] . '&photoid=' . $value['itemid'] . "\">" . lang('setalbumimg') . "</a></div>" . "\n\t\t\t\t<input class=\"checkbox\" style=\"\" type=\"checkbox\" name=\"item[]\" value=\"" . $value['itemid'] . "\" checked />" . lang('select') . "\n\t\t\t\t<span></span>\n\t\t\t</div>\n\t\t</div>\n\t</li>\n\t";
    return $mlist;
}
Exemplo n.º 2
0
function block_sql($paramarr, $multicachekey = '', $returncount = 0)
{
    global $_G, $_SGLOBAL, $_GET, $_SERVER;
    if (!empty($paramarr['sql'])) {
        require_once B_ROOT . './source/function/block_sql.func.php';
        if ($returncount > 0) {
            return runsql($paramarr, '', 1);
        }
        list($sqlstring, $listcount) = runsql($paramarr, '', 0, $multicachekey);
        if (!empty($paramarr['perpage'])) {
            if ($listcount) {
                $urlarr = $_GET;
                foreach ($urlarr as $key => $value) {
                    if (empty($value)) {
                        unset($urlarr[$key]);
                    } else {
                        $urlarr[$key] = rawurlencode($urlarr[$key]);
                    }
                }
                unset($urlarr['page']);
                $phpurl = arraytostring($urlarr, '=', '&');
                $phpurl = $phpurl ? 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] . '?' . $phpurl : 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
                $theblockarr['multipage'] = multi($listcount, $paramarr['perpage'], $_GET['page'], rawurldecode($phpurl), 1);
                $theblockarr['listcount'] = $listcount;
            }
        }
    }
    //查詢數據
    if ($listcount) {
        //查詢
        $query = DB::query($sqlstring);
        while ($value = DB::fetch($query)) {
            if (isset($value['subjectimage'])) {
                $value['thumb'] = getattachurl($value['subjectimage'], 1);
                $value['subjectimage'] = getattachurl($value['subjectimage']);
            }
            $theblockarr[] = $value;
        }
    }
    return $theblockarr;
}
Exemplo n.º 3
0
         $update['validity_end'] = date("Y-m-d", $update['validity_end']);
     }
 } elseif ($mname == 'shop') {
     $editvalue['groupid'] = !empty($editvalue['groupid']) ? $_SGLOBAL['panelinfo']['group']['title'] : '';
     $categorylist = getmodelcategory('region');
     $editvalue['region'] = !empty($editvalue['region']) ? $categorylist[$editvalue['region']]['name'] : '';
     $categorylist = getmodelcategory($mname);
     $editvalue['catid'] = $categorylist[$editvalue['catid']]['name'];
     $editvalue['subjectimage'] = !empty($editvalue['subjectimage']) ? B_URL . '/' . getattachurl($editvalue['subjectimage']) : '';
     $editvalue['grade'] = lang('grade_' . $editvalue['grade']);
     $editvalue['validity_start'] = date("Y-m-d", !empty($_SGLOBAL['panelinfo']['validity_start']) ? $_SGLOBAL['panelinfo']['validity_start'] : time());
     $editvalue['validity_end'] = date("Y-m-d", $editvalue['validity_end']);
     $editvalue['isdiscount'] = $editvalue['isdiscount'] ? lang('yes') : lang('no');
 }
 if ($mname != 'shop') {
     $editvalue['subjectimage'] = !empty($editvalue['subjectimage']) ? B_URL . '/' . getattachurl($editvalue['subjectimage']) : '';
     if ($editvalue['grade'] == 0 || $editvalue['grade'] == 3) {
         $editvalue['grade'] = '顯示';
     } elseif ($editvalue['grade'] == '2') {
         $editvalue['grade'] = '關閉';
     }
     require_once B_ROOT . '/batch.attribute.php';
     $attributes = getattr($_GET['itemid'], $editvalue['catid']);
     $categorylist = getmodelcategory($mname);
     $editvalue['catid'] = $categorylist[$editvalue['catid']]['name'];
     $editvalue['validity_start'] = date("Y-m-d", $editvalue['validity_start']);
     $editvalue['validity_end'] = date("Y-m-d", $editvalue['validity_end']);
 }
 shownav('infomanage', $mname . '_adminview');
 showsubmenu($mname . '_adminview');
 showtips($mname . '_adminview_tips');
Exemplo n.º 4
0
function bbcode2html($str)
{
    preg_match_all("/\\[attach\\](\\d+)\\[\\/attach\\]/i", $str, $match);
    $query = DB::query("SELECT * FROM " . tname("photoitems") . " WHERE itemid IN ('" . implode("', '", $match[1]) . "')");
    while ($result = DB::fetch($query)) {
        $imagesrc[$result['itemid']] = getattachurl($result['subjectimage'], 1);
    }
    foreach ($match[0] as $key => $matchs) {
        $str = str_replace($matchs, "<img aid=\"" . $match[1][$key] . "\" src=\"" . $imagesrc[$match[1][$key]] . "\" />", $str);
    }
    return $str;
}
Exemplo n.º 5
0
                }
                if ($updatesql) {
                    DB::query('UPDATE ' . tname('albumitems') . ' SET ' . implode(', ', $updatesql) . " WHERE itemid='{$albumid}'");
                    if (!empty($albumid)) {
                        require_once B_ROOT . './api/bbs_syncpost.php';
                        syncalbum($albumid);
                    }
                }
            } else {
                $attach['name'] = 'UPLOAD Denied';
            }
        }
        if (!empty($photoid) && $photoid > 0) {
            $_BCACHE->deltype('storelist', 'photo', $shopid, $albumid);
            $xmlstatus = 'success';
            $fileurl = getattachurl($attach['attachment']);
        } else {
            $xmlstatus = 'failure';
        }
        //返回XML
        $returnxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t<uploadResponse>\n\t\t\t<message>" . ($xmlstatus == 'success' ? $slang['done'] : $attach) . "</message>\n\t\t\t<status>{$xmlstatus}</status>\n\t\t\t<albumid>{$albumid}</albumid>\n\t\t\t<picid>{$photoid}</picid>\n\t\t\t<proid></proid>\n\t\t\t<filepath>{$fileurl}</filepath>\n\t\t</uploadResponse>";
        echo $returnxml;
    }
}
function swfhash()
{
    global $_G, $_SGLOBAL;
    if (empty($_SGLOBAL['swfhash'])) {
        $hashadd = defined('IN_ADMIN') || defined('IN_STORE') ? 'Only For BRAND Admin OR Panel' : '';
        $_SGLOBAL['swfhash'] = substr(md5(substr($_G['timestamp'], 0, -7) . '|' . md5($_G['setting']['sitekey']) . '|' . $hashadd), 8, 8);
    }
Exemplo n.º 6
0
            if (!$relatedid && $itemid != $resultlist['itemid']) {
                $i++;
                echo "<option value=\"{$relatedtype}@{$resultlist['itemid']}\" " . ($i == 1 ? 'selected="selected"' : '') . ">{$resultlist['subject']}</option>\n";
            }
        } else {
            $i++;
            echo "<option value=\"{$relatedtype}@{$resultlist['itemid']}\" " . ($i == 1 ? 'selected="selected"' : '') . ">{$resultlist['subject']}</option>\n";
        }
    }
    if ($i == 0) {
        echo '<script type="text/javascript" charset="' . $_G['charset'] . '">alert(\'' . lang('noresult_content') . '\')</script>';
    }
} elseif ($_GET['opt'] == 'previewconsume') {
    $id = intval($_GET['id']);
    $shopid = intval($_GET['shopid']);
    $coupon_title = trim($_GET['coupon_title']);
    $brief = trim($_GET['brief']);
    $exception = trim($_GET['exception']);
    $shopinfo = DB::fetch(DB::query("SELECT subject, address, tel FROM " . tname('shopitems') . " WHERE itemid='{$shopid}'"));
    $coupon_title = biconv($coupon_title, 'UTF-8', $_G['charset']);
    $brief = biconv($brief, 'UTF-8', $_G['charset']);
    $exception = biconv($exception, 'UTF-8', $_G['charset']);
    $createimgarr = array('preview' => 1, 'id' => $id, 'coupon_title' => $coupon_title, 'dealer_name' => $shopinfo['subject'], 'begin_date' => $_GET['begin_date'], 'end_date' => $_GET['end_date'], 'brief' => $brief, 'exception' => $exception, 'address' => $shopinfo['address'], 'hotline' => $shopinfo['tel']);
    require_once B_ROOT . './source/adminfunc/tool.func.php';
    if ($consumeimgpath = image_text($createimgarr)) {
        echo '<img width="750px" height="466px" src="' . getattachurl($consumeimgpath) . '?time=' . $_G['timestamp'] . '">';
    }
} else {
    //其他情況
    echo "<option value=\"0\" selected=\"selected\">" . lang('please_select') . "</option>\n";
}
Exemplo n.º 7
0
function showattachrow($value)
{
    global $_G, $_SGLOBAL;
    $title = $value['subject'];
    $url = getattachurl($value['subjectimage'], 1);
    $thumb = getattachurl($value['subjectimage']);
    $mlist = '
		<div id="photodiv_' . $value['itemid'] . '" class="photo_div" style="height:100px;">
			<table style="clear:both;"><tr>
				<td style="border:none;">
					<div class="photoimg_desc">
						<a name="' . $value['itemid'] . '" href="' . $url . '" title="' . $title . '"><img id="photoimg_' . $value['itemid'] . '" class="photoimg" src="' . $thumb . '" alt="' . $title . '" /></a>
					</div>
				</td>
			</tr></table>
		</div>';
    return $mlist;
}
Exemplo n.º 8
0
function postformat($mname, $data)
{
    global $_G, $_SC, $_SGLOBAL;
    $data['shopurl'] = B_URL . "/store.php?id=" . $_SGLOBAL['panelinfo']['itemid'];
    $data['shopname'] = $_SGLOBAL['panelinfo']['subject'];
    $data['sourceurl'] = B_URL . "/store.php?id=" . $_SGLOBAL['panelinfo']['itemid'] . "&action=" . $mname . "&xid=" . $data['itemid'];
    $finalmsg = '';
    switch ($mname) {
        case 'good':
            $finalmsg .= "[b][size=3]" . b_lang("good_minprice") . "[/size]" . "[/b][size=3][color=Red]" . $data['minprice'] . b_lang('rmb_yuan') . "[/color][/size]        [size=3][b]" . b_lang('good_priceo') . "[/b]" . "" . $data['priceo'] . b_lang('rmb_yuan') . "[/size]\r\n\r\n";
            $finalmsg .= "[size=3][b]" . b_lang("good_subjectimage") . "[/b][/size]\r\n[img]" . getattachurl($data['subjectimage']) . "[/img]\r\n\r\n";
            $finalmsg .= "[size=3][b]" . b_lang('good_message') . "[/b][/size]\r\n[quote]" . bbs_bbcode(bbcode2html($data['message'])) . "[/quote]\r\n";
            if ($relatedmsg = bbs_getrelatedinfo($mname, $data['itemid'], $_SGLOBAL['panelinfo']['itemid'])) {
                $finalmsg .= "[align=left][size=3][b]" . b_lang('item_related') . "[/b][/size][/align]" . $relatedmsg . "\r\n";
            }
            $finalmsg .= "[align=left][size=3][b]" . b_lang('ownedshop') . "[/b][url=" . $data['shopurl'] . "]" . $data['shopname'] . "[/url][/size][/align]\r\n";
            $finalmsg .= "[align=left][size=3][b]" . b_lang("good_cats") . "[/b]" . bbs_getitemcatids($data['catid'], $mname) . "[/size][/align]\r\n";
            if ($attrmsg = bbs_getitemattr($data['catid'], $data['itemid'])) {
                $finalmsg .= "[align=left][size=3][b]" . b_lang("good_attributes") . "[/b]" . $attrmsg . "[/size][/align]\r\n";
            }
            $finalmsg .= "[align=left][size=3][b]" . b_lang("good_validity") . "[/b]" . date("Y-m-d", $data['validity_start']) . b_lang('validityto') . date("Y-m-d", $data['validity_end']) . "[/size][/align]\r\n";
            break;
        case 'notice':
            if (!empty($data['message']['jumpurl'])) {
                $finalmsg .= "[size=3][b]" . b_lang('notice_jumpurl') . "[/b][url=" . $data['jumpurl'] . "]" . $data['jumpurl'] . "[/url][/size]\r\n";
            } else {
                $finalmsg .= "[size=3][b]" . b_lang("notice_subjectimage") . "[/b][/size]\r\n[img]" . getattachurl($data['subjectimage']) . "[/img]\r\n\r\n";
                $finalmsg .= "[size=3][b]" . b_lang('notice_message') . "[/b][/size]\r\n[quote]" . bbs_bbcode(bbcode2html($data['message'])) . "[/quote]\r\n";
            }
            $finalmsg .= "[align=left][size=3][b]" . b_lang('ownedshop') . "[/b][url=" . $data['shopurl'] . "]" . $data['shopname'] . "[/url][/size][/align]\r\n";
            $finalmsg .= "[align=left][size=3][b]" . b_lang("notice_cats") . "[/b]" . bbs_getitemcatids($data['catid'], $mname) . "[/size][/align]\r\n";
            if ($attrmsg = bbs_getitemattr($data['catid'], $data['itemid'])) {
                $finalmsg .= "[align=left][size=3][b]" . b_lang("good_attributes") . "[/b]" . $attrmsg . "[/size][/align]\r\n";
            }
            $finalmsg .= "[align=left][size=3][b]" . b_lang("notice_validity") . "[/b]" . date("Y-m-d", $data['validity_start']) . b_lang('validityto') . date("Y-m-d", $data['validity_end']) . "[/size][/align]\r\n";
            break;
        case 'consume':
            $finalmsg .= "[size=3][b]" . b_lang("consume_nav") . "[/b][/size]\r\n[img]" . getattachurl($data['subjectimage']) . "[/img]\r\n\r\n";
            $finalmsg .= "[align=left][size=3][b]" . b_lang("consume_validity") . "[/b]" . date("Y-m-d", $data['validity_start']) . b_lang('validityto') . date("Y-m-d", $data['validity_end']) . "[/size][/align]\r\n";
            $finalmsg .= "[align=left][size=3][b]" . b_lang("consume_message") . "[/b]" . $data['message'] . "[/size][/align]\r\n";
            $finalmsg .= "[align=left][size=3][b]" . b_lang("consume_exception") . "[/b]" . $data['exception'] . "[/size][/align]\r\n";
            $finalmsg .= "[align=left][size=3][b]" . b_lang("consume_tel") . "[/b]" . $_SGLOBAL['panelinfo']['tel'] . "[/size][/align]\r\n";
            $finalmsg .= "[align=left][size=3][b]" . b_lang("consume_address") . "[/b]" . $_SGLOBAL['panelinfo']['address'] . "[/size][/align]\r\n";
            $finalmsg .= "[align=left][size=3][b]" . b_lang('ownedshop') . "[/b][url=" . $data['shopurl'] . "]" . $data['shopname'] . "[/url][/size][/align]\r\n";
            $finalmsg .= "[align=left][size=3][b]" . b_lang("consume_cats") . "[/b]" . bbs_getitemcatids($data['catid'], $mname) . "[/size][/align]\r\n";
            if ($attrmsg = bbs_getitemattr($data['catid'], $data['itemid'])) {
                $finalmsg .= "[align=left][size=3][b]" . b_lang("good_attributes") . "[/b]" . $attrmsg . "[/size][/align]\r\n";
            }
            break;
        case 'groupbuy':
            $finalmsg .= "[b][size=3]" . b_lang("groupbuy_priceo") . "[/size]" . "[/b][size=3][color=Red]" . $data['groupbuypriceo'] . b_lang('rmb_yuan') . "[/color][/size]    [size=3][b]" . b_lang('group_buyprice') . "[/b]" . "" . $data['groupbuyprice'] . b_lang('rmb_yuan') . "[/size]    ";
            $finalmsg .= "[size=3][b]" . b_lang("groupbuy_validity") . "[/b]" . date("Y-m-d", $data['validity_start']) . b_lang('validityto') . date("Y-m-d", $data['validity_end']) . "    [url=" . $data['sourceurl'] . "#groupbyjoin" . "][color=Red]" . b_lang('groupbyjoin') . "[/color][/url][/size]\r\n";
            $finalmsg .= "[size=3][b]" . b_lang("groupbuy_subjectimage") . "[/b][/size]\r\n[img]" . getattachurl($data['subjectimage']) . "[/img]\r\n\r\n";
            $finalmsg .= "[size=3][b]" . b_lang('groupbuy_message') . "[/b][/size]\r\n[quote]" . bbs_bbcode(bbcode2html($data['message'])) . "[/quote]\r\n";
            $finalmsg .= "[size=3][url=" . $data['sourceurl'] . "#groupbyjoin" . "][color=Red]" . b_lang('groupbyjoin') . "[/color][/url][/size]\r\n\r\n";
            if ($relatedmsg = bbs_getrelatedinfo($mname, $data['itemid'], $_SGLOBAL['panelinfo']['itemid'])) {
                $finalmsg .= "[align=left][size=3][b]" . b_lang('item_related') . "[/b][/size][/align]" . $relatedmsg . "\r\n";
            }
            $finalmsg .= "[align=left][size=3][b]" . b_lang('ownedshop') . "[/b][url=" . $data['shopurl'] . "]" . $data['shopname'] . "[/url][/size][/align]\r\n";
            $finalmsg .= "[align=left][size=3][b]" . b_lang("groupbuy_cats") . "[/b]" . bbs_getitemcatids($data['catid'], $mname) . "[/size][/align]\r\n";
            if ($attrmsg = bbs_getitemattr($data['catid'], $data['itemid'])) {
                $finalmsg .= "[align=left][size=3][b]" . b_lang("good_attributes") . "[/b]" . $attrmsg . "[/size][/align]\r\n";
            }
            break;
        case 'album':
            $finalmsg .= "[size=3][b]" . b_lang("album_message") . "[/b][/size]" . $data['item']['subject'] . "\r\n\r\n";
            $finalmsg .= "[size=3][b]" . b_lang("album_photolist") . "[/b][/size]\r\n\r\n";
            if (!empty($data['photolist'])) {
                foreach ($data['photolist'] as $photo) {
                    $finalmsg .= "[size=3]" . $photo['subject'] . "[/size]\r\n";
                    $finalmsg .= "[img]" . getattachurl($photo['subjectimage']) . "[/img]\r\n\r\n";
                }
            }
            $finalmsg .= "[align=left][size=3][b]" . b_lang('ownedshop') . "[/b][url=" . $data['shopurl'] . "]" . $data['shopname'] . "[/url][/size][/align]\r\n";
            $finalmsg .= "[align=left][size=3][b]" . b_lang("album_cats") . "[/b]" . bbs_getitemcatids($data['item']['catid'], $mname) . "[/size][/align]\r\n";
            if ($attrmsg = bbs_getitemattr($data['catid'], $data['itemid'])) {
                $finalmsg .= "[align=left][size=3][b]" . b_lang("good_attributes") . "[/b]" . $attrmsg . "[/size][/align]\r\n";
            }
            break;
        default:
            break;
    }
    $finalmsg .= "[size=3][b]" . b_lang('sourceurl') . "[/b][url=" . $data['sourceurl'] . "]" . $data['sourceurl'] . "[/url][/size]";
    return $finalmsg;
}