Exemplo n.º 1
0
        showsubmenu($menustr);
        showtableheader('', 'nobottom');
        showtablerow('', array(), array('<ul class="tab1">' . '<li><a href="' . ADMINSCRIPT . '?action=plugins&operation=config&act=diyconfig&identifier=sanree_brand&pmod=admincp"><span>' . $langs['diyconfig'] . '</span></a></li>' . '<li><a href="' . ADMINSCRIPT . '?action=plugins&operation=config&act=diytemplate&identifier=sanree_brand&pmod=admincp"><span>' . $langs['diytemplate'] . '</span></a></li>' . '<li class="current"><a href="' . ADMINSCRIPT . '?action=plugins&operation=config&act=diystyle&identifier=sanree_brand&pmod=admincp"><span>' . $langs['diystyle'] . '</span></a></li>' . '<li style="float:right"><a href="http://dx.sanree.com/forum-82-1.html" target="_blank"><span style="color:#FF0000;text-decoration:underline;">' . $langs['sanreetemplate'] . '</span></a></li>' . '</ul>'));
        showtablefooter();
        if ($diystyleid > 0) {
            $menustr = $langs['editstyle'];
            $result = C::t('#sanree_brand#sanree_brand_diystyle')->get_by_diystyleid($diystyleid);
        } else {
            $menustr = $langs['addstyle'];
            $result['displayorder'] = 0;
            $result['status'] = 1;
        }
        showformheader($thisurl . "&do=" . $do . "&diystyleid=" . $diystyleid . "&page=" . $page, 'enctype');
        showtableheader($menustr, 'nobottom');
        showsetting($langs['stylename'], 'name', $result['name'], 'text', '', '', $langs['stylenametip']);
        $content = fixhtmlstr($result['content']);
        showsetting($langs['stylecontent'], 'content', $content, 'textarea', '', '', $langs['stylecontenttip']);
        showsetting($langs['showorder'], 'displayorder', $result['displayorder'], 'text');
        showsetting($langs['status'], 'status', $result['status'], 'radio');
        $result['dateline'] && showsetting($langs['dateline'], 'dateline', dgmdate($result[dateline]), 'text', '1');
        showsubmit('addsubmit');
        showtablefooter();
        showformfooter();
    }
} elseif ($do == 'copyrow') {
    $diystyleid = intval($_G['sr_diystyleid']);
    if ($diystyleid > 0) {
        $result = C::t('#sanree_brand#sanree_brand_diystyle')->get_by_diystyleid($diystyleid);
        if ($result) {
            $setarr = array();
            $setarr['name'] = $result['name'] . '_' . TIMESTAMP;
Exemplo n.º 2
0
function diytemplate($diytemplateid = 0)
{
    global $_G;
    $style = '';
    $condition = array();
    $condition[] = 'status=1';
    if ($diytemplateid > 0) {
        $condition[] = 'diytemplateid=' . $diytemplateid;
    }
    $orderby = 'displayorder, diytemplateid';
    $stamplist = C::t('#sanree_brand#sanree_brand_diytemplate')->fetch_all_by_search($condition, $orderby);
    foreach ($stamplist as $key => $val) {
        $val['name'] = $val['issys'] == 1 ? srlang('neizhi') . $val['name'] : $val['name'];
        $arr = array('name' => $val['name'], 'blockclass' => 'sanree_brand');
        $val['content'] = fixhtmlstr($val['content']);
        add_diy_template($val['content'], $arr);
    }
}