updatetable('attachmenttypes', $setsqlarr, array('id' => $_POST['id']));
        showmessage('attachmenttype_update_success', $newurl);
    }
}
//GET METHOD
$addclass = $viewclass = '';
if (empty($_GET['op'])) {
    //LIST VIEW
    $wheresqlarr = array();
    $wheresqlstr = getwheresql($wheresqlarr);
    $query = $_SGLOBAL['db']->query('SELECT COUNT(*) FROM ' . tname('attachmenttypes') . ' WHERE ' . $wheresqlstr);
    $listcount = $_SGLOBAL['db']->result($query, 0);
    $multipage = '';
    if ($listcount) {
        $plussql = 'LIMIT ' . $start . ',' . $perpage;
        $listarr = selecttable('attachmenttypes', array(), $wheresqlarr, $plussql);
        $multipage = multi($listcount, $perpage, $page, $theurl);
    }
    $viewclass = ' class="active"';
} elseif ($_GET['op'] == 'edit') {
    //ONE VIEW FOR UPDATE
    $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('attachmenttypes') . ' WHERE id=\'' . $_GET['id'] . '\'');
    if ($thevalue = $_SGLOBAL['db']->fetch_array($query)) {
        $thevalue['maxsize'] = $thevalue['maxsize'] / 1024;
    }
} elseif ($_GET['op'] == 'add') {
    //ONE ADD
    $thevalue = array('id' => 0, 'fileext' => '', 'maxsize' => '512');
    $addclass = ' class="active"';
} elseif ($_GET['op'] == 'delete') {
    //ONE DELETE
Example #2
0
echo '
				</tr>
			</table>
		</td>
	</tr>
</table>
';
//GET METHOD
if (empty($_GET['op'])) {
    //op为空时,则表示采集器的列表操作
    $query = $_SGLOBAL['db']->query('SELECT COUNT(*) FROM ' . tname('robots'));
    $listcount = $_SGLOBAL['db']->result($query, 0);
    $multipage = '';
    if ($listcount) {
        $plussql = 'ORDER BY lasttime DESC LIMIT ' . $start . ',' . $perpage;
        $listarr = selecttable('robots', array(), array(), $plussql);
        //取出给定条件的采集器列表记录
        $multipage = multi($listcount, $perpage, $page, $theurl);
        //分页处理
    }
} elseif ($_GET['op'] == 'edit' || $_GET['op'] == 'copy') {
    //编辑采集器初始值
    $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('robots') . ' WHERE robotid=\'' . $_GET['robotid'] . '\'');
    if ($thevalue = $_SGLOBAL['db']->fetch_array($query)) {
        $thevalue['listurl_manual'] = $thevalue['listurl_auto'] = '';
        if ($thevalue['listurltype'] == 'auto') {
            $thevalue['listurl_auto'] = $thevalue['listurl'];
        } elseif ($thevalue['listurltype'] == 'manual') {
            $thevalue['listurl_manual'] = explode("\n", preg_replace("/\n+/", "\n", preg_replace("/(\r\n|\r|\n)/s", "\n", $thevalue['listurl'])));
        } elseif ($thevalue['listurltype'] == 'extraction') {
            $thevalue['listurl_manual'] = unserialize($thevalue['listurl']);
Example #3
0
                $wheresqlarr[] = 'tagname LIKE \'' . $searchkey . '\'';
                break;
        }
    }
    $wheresqlstr = implode(' OR ', $wheresqlarr);
    $query = $_SGLOBAL['db']->query('SELECT COUNT(*) FROM ' . tname('tags') . ' WHERE ' . $wheresqlstr);
    $listcount = $_SGLOBAL['db']->result($query, 0);
    $multipage = '';
    if ($listcount) {
        if (!empty($_SGET['order'])) {
            $order = $_SGET['order'] . ' ' . $_SGET['sc'];
        } else {
            $order = 'dateline DESC';
        }
        $plussql = 'ORDER BY ' . $order . ' LIMIT ' . $start . ',' . $perpage;
        $listarr = selecttable('tags', array(), $wheresqlstr, $plussql);
        $multipage = multi($listcount, $perpage, $page, $newurl);
    }
    $viewclass = ' class="active"';
} elseif ($_GET['op'] == 'edit') {
    //ONE VIEW FOR UPDATE
    $_GET['tagid'] = intval($_GET['tagid']);
    $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('tags') . ' WHERE tagid=\'' . $_GET['tagid'] . '\'');
    if ($thevalue = $_SGLOBAL['db']->fetch_array($query)) {
        $thevalue['relativetags'] = implode(',', explode("\t", $thevalue['relativetags']));
    } else {
        showmessage('tag_no_tagid');
    }
}
//MENU
echo '
Example #4
0
    $wheresqlarr = array();
    if (!empty($blockid)) {
        $wheresqlarr['blockid'] = $blockid;
    }
    if (!empty($blocktype)) {
        $wheresqlarr['blocktype'] = $blocktype;
    } elseif (!empty($_GET['viewblocktype'])) {
        $wheresqlarr['blocktype'] = $_GET['viewblocktype'];
    }
    $wheresqlstr = getwheresql($wheresqlarr);
    $query = $_SGLOBAL['db']->query('SELECT COUNT(*) FROM ' . tname('blocks') . ' WHERE ' . $wheresqlstr);
    $listcount = $_SGLOBAL['db']->result($query, 0);
    $multipage = '';
    if ($listcount) {
        $plussql = 'ORDER BY dateline DESC LIMIT ' . $start . ',' . $perpage;
        $listarr = selecttable('blocks', array(), $wheresqlarr, $plussql);
        $multipage = multi($listcount, $perpage, $page, $newurl);
    }
    $viewclass = ' class="active"';
} elseif ($_GET['op'] == 'edit') {
    //ONE VIEW FOR UPDATE
    $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('blocks') . ' WHERE blockid=\'' . $blockid . '\'');
    if ($thevalue = $_SGLOBAL['db']->fetch_array($query)) {
    }
    if ($_GET['blocktype'] == 'model') {
        $_GET['modelname'] = $thevalue['blockname'];
        $query = $_SGLOBAL['db']->query('SELECT modelname, modelalias FROM ' . tname('models'));
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            $modelarr[$value['modelname']] = $value['modelalias'];
        }
    }
Example #5
0
        //更新缓存
        updatecronscache();
        updatecroncache();
        showmessage('cron_update_success', $newurl);
    }
}
//GET METHOD
$addclass = $viewclass = '';
if (empty($_GET['op'])) {
    //LIST VIEW
    $query = $_SGLOBAL['db']->query('SELECT COUNT(*) FROM ' . tname('crons'));
    $listcount = $_SGLOBAL['db']->result($query, 0);
    $multipage = '';
    if ($listcount) {
        $plussql = 'LIMIT ' . $start . ',' . $perpage;
        $listarr = selecttable('crons', array(), array(), $plussql);
        $multipage = multi($listcount, $perpage, $page, $theurl);
    }
    $viewclass = ' class="active"';
} elseif ($_GET['op'] == 'edit') {
    //ONE VIEW FOR UPDATE
    $_GET['cronid'] = intval($_GET['cronid']);
    $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('crons') . ' WHERE cronid=\'' . $_GET['cronid'] . '\'');
    if ($thevalue = $_SGLOBAL['db']->fetch_array($query)) {
    }
} elseif ($_GET['op'] == 'add') {
    //ONE ADD
    $thevalue = array('cronid' => 0, 'name' => '', 'available' => 1, 'filename' => '', 'weekday' => '-1', 'day' => '-1', 'hour' => '-1', 'minute' => '');
    $addclass = ' class="active"';
} elseif ($_GET['op'] == 'delete') {
    //ONE DELETE
        $wheresqlarr['isimport'] = 1;
        $newurl .= '&isimport=1';
        $view1class = ' class="active"';
    } else {
        $wheresqlarr['isimport'] = 0;
        $newurl .= '&isimport=0';
        $view0class = ' class="active"';
    }
    $wheresqlstr = getwheresql($wheresqlarr);
    $query = $_SGLOBAL['db']->query('SELECT COUNT(*) FROM ' . tname('robotitems') . ' WHERE ' . $wheresqlstr);
    $listcount = $_SGLOBAL['db']->result($query, 0);
    $multipage = '';
    if ($listcount) {
        $uplistarr = getcategory();
        $plussql = 'ORDER BY robottime LIMIT ' . $start . ',' . $perpage;
        $listarr = selecttable('robotitems', array(), $wheresqlarr, $plussql);
        $multipage = multi($listcount, $perpage, $page, $newurl);
    }
} elseif ($_GET['op'] == 'edit') {
    //ONE VIEW FOR UPDATE
    $itemid = intval($_GET['itemid']);
    $query = $_SGLOBAL['db']->query('SELECT msg.*, item.* FROM ' . tname('robotitems') . ' item LEFT JOIN ' . tname('robotmessages') . ' msg ON item.itemid=msg.itemid WHERE item.itemid=\'' . $itemid . '\'');
    if ($thevalue = $_SGLOBAL['db']->fetch_array($query)) {
    }
} elseif ($_GET['op'] == 'add') {
    //ONE ADD
    $thevalue = array('itemid' => 0);
} elseif ($_GET['op'] == 'viewmessage') {
    //ONE DELETE
    $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('robotitems') . ' WHERE itemid=\'' . $_GET['itemid'] . '\'');
    if ($showvalue = $_SGLOBAL['db']->fetch_array($query)) {
Example #7
0
        updatetable('polls', $setsqlarr, array('pollid' => $pollid));
        showmessage('poll_update_success', $theurl);
    }
}
//GET METHOD
$addclass = $viewclass = '';
if (empty($_GET['op'])) {
    //LIST VIEW
    $wheresqlarr = array();
    $wheresqlstr = getwheresql($wheresqlarr);
    $query = $_SGLOBAL['db']->query('SELECT COUNT(*) FROM ' . tname('polls') . ' WHERE ' . $wheresqlstr);
    $listcount = $_SGLOBAL['db']->result($query, 0);
    $multipage = '';
    if ($listcount) {
        $plussql = 'ORDER BY dateline DESC LIMIT ' . $start . ',' . $perpage;
        $listarr = selecttable('polls', array(), $wheresqlarr, $plussql);
        $multipage = multi($listcount, $perpage, $page, $theurl);
    }
    $viewclass = ' class="active"';
} elseif ($_GET['op'] == 'edit') {
    //ONE VIEW FOR UPDATE
    $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('polls') . ' WHERE pollid=\'' . $pollid . '\'');
    if ($thevalue = $_SGLOBAL['db']->fetch_array($query)) {
    }
} elseif ($_GET['op'] == 'add') {
    //ONE ADD
    $thevalue = array('pollid' => 0, 'ismulti' => 0, 'max_select' => 0, 'ishide' => 0, 'isfinish' => 0, 'finish_hour' => 0, 'subject' => '', 'summary' => '', 'message' => '');
    $addclass = ' class="active"';
}
//MENU
echo '
Example #8
0
function showresult($message, $type = 'error')
{
    global $hash, $noinsert, $aid;
    $attacharr = empty($hash) ? array() : selecttable('attachments', array(), array('hash' => $hash), 'ORDER BY dateline');
    $listtext = getuploadinserthtml($attacharr, $noinsert, $aid);
    $listtext = addcslashes($listtext, '"');
    $message = addcslashes($message, '"');
    if (empty($message)) {
        $typestr = 'if(msg != null)msg.style.display = "none";
					if(msgok != null)msgok.style.display = "none";';
    } else {
        if ($type == 'ok') {
            $typestr = 'if(msg != null)msg.style.display = "none";
						if(msgok != null)msgok.style.display = "";
						if(msgok != null)msgok.innerHTML = "' . $message . '";
						if(subject0 != null)subject0.value = "";
						if(subject1 != null)subject1.value = "";
						if(localfile != null)localfile.outerHTML = localfile.outerHTML;
						if(remotefile != null)remotefile.value = "http://";
						';
        } else {
            $typestr = 'if(msg != null)msg.style.display = "";
						if(msgok != null)msgok.style.display = "none";
						if(msg != null)msg.innerHTML =  "' . $message . '";
						';
        }
    }
    $execjs = '';
    if (!$noinsert) {
        $execjs = 'parent.setdefaultpic()';
    }
    print <<<END
\t<script language="javascript">
\t<!--

\tvar list = parent.document.getElementById("divshowupload");
\tvar msg = parent.document.getElementById("divshowuploadmsg");
\tvar msgok = parent.document.getElementById("divshowuploadmsgok");
\tvar subject0 = parent.document.getElementById("uploadsubject0");
\tvar subject1 = parent.document.getElementById("uploadsubject1");
\tvar localfile = parent.document.getElementById("localfile");
\tvar remotefile = parent.document.getElementById("remotefile");
\tvar pf = parent.document.getElementById("phpframe");
\tlocalfile.value = "";
\tpf.src = "about:blank";
\tlist.innerHTML = "{$listtext}";
\t{$typestr}
\t{$execjs}
\t//-->
\t</script>
END;
    exit;
}
Example #9
0
    if ($residual) {
        jumpurl($newurl . '&op=deleteallwaste&all=' . $all . '&delnum=' . $delnum, 1000, 'meta');
    } else {
        jumpurl($newurl, 1000, 'meta');
    }
}
//THE VALUE SHOW
if ($thevalue) {
    //缩略图
    //CUSTOM FIELD
    if ($page == 1) {
        $cfhtmlselect = array('0' => $alang['space_customfield_none']);
        $wheresqlarr = array();
        $wheresqlarr['type'] = $type;
        $plussql = 'ORDER BY displayorder';
        $allcfarr = selecttable('customfields', array(), $wheresqlarr, $plussql);
        $cfhtml = '';
        $tbodynum = 0;
        foreach ($allcfarr as $cfkey => $cfvalue) {
            if (empty($thevalue['customfieldid'])) {
                if ($cfvalue['isdefault']) {
                    $thevalue['customfieldid'] = $cfvalue['customfieldid'];
                }
            }
            $cfhtmlselect[$cfvalue['customfieldid']] = $cfvalue['name'];
            $cfarr = unserialize($cfvalue['customfieldtext']);
            if (is_array($cfarr) && $cfarr) {
                if (!empty($thevalue['customfieldid']) && $thevalue['customfieldid'] == $cfvalue['customfieldid']) {
                    $tbodydisplay = '';
                    if (empty($thevalue['customfieldtext'])) {
                        $thecfarr = array();
Example #10
0
        showmessage('customfield_edit_success', $theurl);
    }
} else {
    //[GET]
    $viewclass = $addclass = '';
    //LIST VIEW
    if (empty($_GET['op'])) {
        //LIST VIEW
        $wheresqlarr = array();
        $plussql = 'ORDER BY displayorder';
        $listarr = selecttable('customfields', array(), $wheresqlarr, $plussql);
        $viewclass = ' class="active"';
    } elseif ($_GET['op'] == 'edit') {
        //EDIT VIEW
        $wheresqlarr = array('customfieldid' => $_GET['customfieldid']);
        $thevalues = selecttable('customfields', array(), $wheresqlarr);
        if (empty($thevalues[0])) {
            showmessage('customfield_customfieldid_no_exists');
        } else {
            $thevalue = $thevalues[0];
        }
    } elseif ($_GET['op'] == 'add') {
        //ADD VIEW
        $thevalue = array('customfieldid' => '0', 'type' => '', 'name' => '', 'displayorder' => '0', 'customfieldtext' => serialize(array(array('type' => 'input', 'name' => '', 'option' => ''))), 'isdefault' => 0);
        $addclass = ' class="active"';
    }
}
//display
echo '
<table summary="" id="pagehead" cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr>