本文整理汇总了PHP中A::MAINFRAME方法的典型用法代码示例。如果您正苦于以下问题:PHP A::MAINFRAME方法的具体用法?PHP A::MAINFRAME怎么用?PHP A::MAINFRAME使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类A
的用法示例。
在下文中一共展示了A::MAINFRAME方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: round
$section = $row['section'];
$row['section'] = $srows[$section];
$row['section_name'] = $srows[$section]['caption'];
$row['section_link'] = $srows[$section]['link'];
$row['link'] = catalog_createItemLink($row['id'], $section);
$row['vote'] = round($row['vote'], 2);
$row['category'] = getTreePath("{$section}_categories", $row['idcat']);
$row['images'] = A::$DB->getAll("SELECT * FROM " . DOMAIN . "_images WHERE idsec=? AND iditem=? ORDER BY sort", array($srows[$section]['id'], $row['id']));
$row['idimg'] = isset($row['images'][0]['id']) ? $row['images'][0]['id'] : 0;
$row['files'] = A::$DB->getAll("SELECT * FROM " . DOMAIN . "_files WHERE idsec=? AND iditem=? ORDER BY sort", array($srows[$section]['id'], $row['id']));
foreach ($row['files'] as $i => $data) {
$row['files'][$i]['link'] = (LANG == DEFAULTLANG ? "" : "/" . LANG) . "/getfile/" . $data['id'] . "/" . $data['name'];
$row['files'][$i]['size'] = sizestring($data['size']);
}
$row['idfile'] = isset($row['files'][0]['id']) ? $row['files'][0]['id'] : 0;
if (!empty($row['tags'])) {
$row['tags'] = A_SearchEngine::getInstance()->convertTags($row['tags']);
}
prepareValues($section, $row);
$items[$i] = $row;
}
$this->Assign("items", $items);
$this->Assign("items_pager", $pager);
$this->AddNavigation(SECTION_NAME);
}
}
if (A::$CACHE->page) {
A::$CACHE->page->restore();
}
A::$MAINFRAME = new ArchiveModule();
示例2: array
$comments[] = $row;
}
A::$DB->free();
$this->Assign("comments", $comments);
$form = array();
$form['name'] = !empty($_REQUEST['name']) ? $_REQUEST['name'] : (A::$AUTH->isLogin() ? A::$AUTH->data['name'] : "");
$form['message'] = !empty($_REQUEST['message']) ? $_REQUEST['message'] : "";
$this->Assign("form", $form);
$this->Assign("captcha", $captcha = substr(time(), rand(0, 6), 4));
A_Session::set("captcha", md5($captcha));
}
if (A::$OPTIONS['usevote']) {
$this->Assign("isvote", A_Session::get(SECTION . "_vote_" . $this->iditem, false));
$this->addCacheParam_Session(SECTION . "_vote_" . $this->iditem);
}
$this->AddNavigation(SECTION_NAME, getSectionLink(SECTION));
if (isset($this->category)) {
$this->AddNavCategories($this->category['id']);
}
$this->title = $this->itemdata['name'] . (!empty($this->title) ? " - " . $this->title : "");
if (!empty($this->itemdata['keywords'])) {
$this->keywords = $this->itemdata['keywords'];
}
$this->description = $this->itemdata['description'];
}
}
if (A::$CACHE->page) {
A::$CACHE->page->restore();
}
A::$MAINFRAME = new CatalogModule();
示例3: createData
}
/**
* Формирование данных доступных в шаблоне.
*/
function createData()
{
$this->Assign("maincontent", getTextOption(SECTION, 'content'));
$types = array('string' => 'Строка', 'int' => 'Целое число', 'float' => 'Дробное число', 'bool' => 'Логический (Да/Нет)', 'date' => 'Дата', 'text' => 'Текст', 'format' => 'Форматированный текст', 'select' => 'Значение из списка', 'mselect' => 'Множество значений из списка', 'image' => 'Изображение', 'file' => 'Файл');
$fields = array();
A::$DB->query("SELECT * FROM " . DOMAIN . "_fields WHERE item='" . SECTION . "' ORDER BY sort");
while ($row = A::$DB->fetchRow()) {
$row['name'] = $row['name_' . DEFAULTLANG];
$row['type'] = isset($types[$row['type']]) ? $types[$row['type']] : "";
$fields[] = $row;
}
A::$DB->free();
$this->Assign("fields", $fields);
$arch = array();
$pager = new A_Pager(20);
$pager->tab = "arch";
$pager->query("SELECT * FROM " . SECTION . "_arch ORDER BY date DESC");
while ($row = $pager->fetchRow()) {
$arch[] = $row;
}
$this->Assign("arch", $arch);
$this->Assign("arch_pager", $pager);
$this->Assign("optbox", new A_OptionsBox("", array("idgroup" => 1)));
}
}
A::$MAINFRAME = new FeedbackModule_Admin();
示例4: MyOrdersPage
* Формирование данных доступных в шаблоне страницы "мои заказы".
*/
function MyOrdersPage()
{
if (!A::$AUTH->isLogin()) {
A::goUrl(getSectionLink(SECTION));
}
$orders = array();
$pager = new A_Pager(20);
$pager->tab = "orders";
$pager->query("SELECT * FROM " . SECTION . "_orders WHERE iduser=? ORDER BY date DESC", A::$AUTH->id);
while ($row = $pager->fetchRow()) {
if ($section = getSectionByModule('robopay')) {
$row['paylink'] = getSectionLink($section) . "?action=pay&code=" . md5($section . $row['date']);
}
$row['pay'] = function_exists('pay_getname') ? pay_getname($row['pay']) : "Наличные";
$row['basket'] = !empty($row['basket']) ? unserialize($row['basket']) : array();
$row['sum'] = round($row['sum'], 2);
$orders[] = $row;
}
$pager->free();
$this->Assign("orders", $orders);
$this->Assign("orders_pager", $pager);
$this->AddNavigation(SECTION_NAME, getSectionLink(SECTION));
}
}
if (A::$CACHE->page) {
A::$CACHE->page->restore();
}
A::$MAINFRAME = new ShopLiteModule();
示例5: createData
A::NotFound();
}
}
/**
* Формирование данных доступных в шаблоне.
*/
function createData()
{
$this->supportCached();
$checkeds = getTextOption(SECTION, 'sections');
$checkeds = !empty($checkeds) ? unserialize($checkeds) : array();
A::$DB->query("SELECT * FROM " . DOMAIN . "_sections WHERE lang='" . LANG . "' OR lang='all' ORDER BY sort");
while ($row = A::$DB->fetchRow()) {
if (in_array($row['id'], $checkeds)) {
if (function_exists($row['module'] . '_createMap')) {
$section = DOMAIN . "_" . $row['lang'] . "_" . $row['name'];
$caption = !empty($row['caption_' . LANG]) ? $row['caption_' . LANG] : $row['caption'];
call_user_func($row['module'] . "_createMap", $this->treemap, $section, $caption);
}
}
}
A::$DB->free();
$this->Assign_by_ref("treemap", $this->treemap);
$this->AddNavigation(SECTION_NAME);
}
}
if (A::$CACHE->page) {
A::$CACHE->page->restore();
}
A::$MAINFRAME = new SiteMapModule();
示例6: MainPage
}
}
/**
* Формирование данных доступных в шаблоне главной страницы раздела.
*/
function MainPage()
{
$this->Assign("form", $_REQUEST);
$this->prepareAddForm();
$this->Assign("content", getTextOption(SECTION, 'content'));
$this->Assign("captcha", $captcha = substr(time(), rand(0, 6), 4));
A_Session::set("captcha", md5($captcha));
$this->AddNavigation(SECTION_NAME);
}
/**
* Формирование данных доступных в шаблоне страницы сообщения.
*/
function MessagePage()
{
$fields = array();
if ($id = A_Session::get(SECTION . "_id", 0)) {
if ($arch = A::$DB->getRowById($id, SECTION . "_arch")) {
$fields = !empty($arch['data']) ? unserialize($arch['data']) : array();
}
}
$this->Assign("fields", $fields);
$this->AddNavigation(SECTION_NAME, getSectionLink(SECTION));
}
}
A::$MAINFRAME = new FeedbackModule();
示例7: prepareValues
prepareValues(A::$AUTH->section, $row['user']);
}
}
$comments[] = $row;
}
A::$DB->free();
$this->Assign("comments", $comments);
$form = array();
$form['name'] = !empty($_REQUEST['name']) ? $_REQUEST['name'] : (A::$AUTH->isLogin() ? A::$AUTH->data['name'] : "");
$form['message'] = !empty($_REQUEST['message']) ? $_REQUEST['message'] : "";
$this->Assign("form", $form);
$this->Assign("captcha", $captcha = substr(time(), rand(0, 6), 4));
A_Session::set("captcha", md5($captcha));
}
if (A::$OPTIONS['usevote']) {
$this->Assign("isvote", A_Session::get(SECTION . "_vote_" . $this->idalb, false));
$this->addCacheParam_Session(SECTION . "_vote_" . $this->idalb);
}
$this->AddNavigation(SECTION_NAME, getSectionLink(SECTION));
if (isset($this->category)) {
$this->AddNavCategories($this->category['id']);
}
$this->title = $this->album['name'] . (!empty($this->title) ? " - " . $this->title : "");
$this->description = $this->album['description'];
}
}
if (A::$CACHE->page) {
A::$CACHE->page->restore();
}
A::$MAINFRAME = new GalleryModule();
示例8: setcookie
$this->Assign("sections", $sections);
if (!empty($_GET['idsec'])) {
$idsec = (int) $_GET['idsec'];
if (isset($sections[$idsec])) {
setcookie(STRUCTURE, $idsec, time() + 31104000);
}
}
if (empty($idsec)) {
$idsec = A_Session::get(STRUCTURE, isset($_COOKIE[STRUCTURE]) ? $_COOKIE[STRUCTURE] : key($sections));
}
if (isset($sections[$idsec])) {
A_Session::set(STRUCTURE, $idsec);
$this->Assign("idsec", $idsec);
} elseif ($sections) {
A_Session::set(STRUCTURE, $idsec = key($sections));
$this->Assign("idsec", $idsec);
} else {
return;
}
$types = array('string' => 'Строка', 'int' => 'Целое число', 'float' => 'Дробное число', 'bool' => 'Логический (Да/Нет)', 'date' => 'Дата', 'text' => 'Текст', 'format' => 'Форматированный текст', 'select' => 'Значение из списка', 'mselect' => 'Множество значений из списка', 'image' => 'Изображение', 'file' => 'Файл');
$fields = array();
A::$DB->query("SELECT * FROM " . STRUCTURE . " WHERE idsec={$idsec} ORDER BY sort");
while ($row = A::$DB->fetchRow()) {
$row['type'] = isset($types[$row['type']]) ? $types[$row['type']] : "";
$fields[] = $row;
}
$this->Assign("fields", $fields);
}
}
A::$MAINFRAME = new FCategory_Admin();
示例9: array
if (!empty($_REQUEST["price{$i}"]) || !empty($_REQUEST["per{$i}"])) {
$data[] = array('from' => !empty($_REQUEST["from{$i}"]) ? (int) $_REQUEST["from{$i}"] : "", 'to' => !empty($_REQUEST["to{$i}"]) ? (int) $_REQUEST["to{$i}"] : "", 'price' => !empty($_REQUEST["price{$i}"]) ? (int) $_REQUEST["price{$i}"] : 0, 'per' => !empty($_REQUEST["per{$i}"]) ? (int) $_REQUEST["per{$i}"] : 0);
}
}
$_REQUEST['name'] = trim($_REQUEST['name']);
$_REQUEST['data'] = serialize($data);
$dataset = new A_DataSet(STRUCTURE);
$dataset->fields = array("name", "data");
return $dataset->Update();
}
function Del()
{
$dataset = new A_DataSet(STRUCTURE);
return $dataset->Delete();
}
function createData()
{
if ($section = getSectionByModule('shoplite')) {
$this->Assign("valute", getOption($section, 'valute'));
}
$this->Assign('shopassoc', !empty($section));
$items = array();
A::$DB->query("SELECT * FROM " . STRUCTURE . " ORDER BY sort");
while ($row = A::$DB->fetchRow()) {
$items[] = $row;
}
$this->Assign("items", $items);
}
}
A::$MAINFRAME = new Courier_Admin();
示例10: getTreePath
$row['catpath'] = getTreePath(SECTION . "_categories", $row['idcat']);
}
$items[] = $row;
}
$pager->free();
$this->Assign("items", $items);
$this->Assign("items_pager", $pager);
if (!empty($_GET['idalb'])) {
$_GET['idalb'] = (int) $_GET['idalb'];
$this->Assign("album", A::$DB->getRowById($_GET['idalb'], SECTION . "_albums"));
$images = A::$DB->getAll("\r\r\n\t SELECT * FROM " . DOMAIN . "_images\r\r\n\t WHERE idsec=" . SECTION_ID . " AND iditem=" . $_GET['idalb'] . "\r\r\n\t ORDER BY sort");
$this->Assign("images", $images);
}
$this->Assign("treebox", new A_CategoriesTree("albums"));
if (A::$OPTIONS['usecomments']) {
$this->Assign("commbox", new A_CommentsEditor(SECTION . "_albums"));
}
$this->Assign("optbox1", new A_OptionsBox("Внешний вид на сайте:", array('idgroup' => 1)));
$this->Assign("optbox2", new A_OptionsBox("Фото:", array('idgroup' => 2)));
$this->Assign("optbox3", new A_OptionsBox("Комментирование и голосование:", array('idgroup' => 3)));
$this->Assign("optbox4", new A_OptionsBox("Дополнительно:", array('idgroup' => 4)));
$this->Assign("fieldsbox", new A_FieldsEditor(SECTION . "_albums", array('tab' => 'opt', 'tab_opt' => 'fields')));
$this->Assign("rows", $rows);
$this->Assign("sort", $sort);
}
}
A::$OBSERVER->AddHandler('DeleteCategory', array('GalleryModule_Admin', 'DeleteCategory'));
A::$OBSERVER->AddHandler('MoveCategory', array('GalleryModule_Admin', 'MoveCategory'));
A::$OBSERVER->AddHandler('ActiveCategory', array('GalleryModule_Admin', 'ActiveCategory'));
A::$MAINFRAME = new GalleryModule_Admin();
示例11: foreach
$sort[] = $row['sort'];
$values[] = $row;
}
$values = array_multisort_key($values, 'name_' . LANG);
foreach ($values as $i => $row) {
A::$DB->execute("UPDATE " . STRUCTURE . " SET sort=" . $sort[$i] . " WHERE id=" . $row['id']);
}
}
return true;
}
function createData()
{
$fields = A::$DB->getFields(STRUCTURE);
foreach (A::$LANGUAGES as $key => $caption) {
if (!in_array('name_' . $key, $fields)) {
A::$DB->execute("ALTER TABLE " . STRUCTURE . " ADD `name_{$key}` varchar(150) DEFAULT NULL");
}
}
$listdata = array();
A::$DB->query("SELECT * FROM " . STRUCTURE . " ORDER BY sort");
while ($row = A::$DB->fetchRow()) {
$row['name'] = $row['name_' . LANG];
$listdata[] = $row;
}
A::$DB->free();
$this->Assign("listdata", $listdata);
$this->Assign("fieldsbox", new A_FieldsEditor(STRUCTURE, "fields", false, false));
}
}
A::$MAINFRAME = new ListData_Admin();
示例12: urldecode
$_REQUEST['description'] = strip_tags(trim($_REQUEST['description']));
$MURL = parse_url(trim($_REQUEST['move']));
$_REQUEST['move'] = !empty($MURL['host']) ? "http://" . $MURL['host'] : "";
if (!empty($MURL['path'])) {
$_REQUEST['move'] .= urldecode($MURL['path']);
}
$_REQUEST['notfound'] = isset($_REQUEST['notfound']) ? 'Y' : 'N';
$dataset = new A_DataSet(STRUCTURE);
$dataset->fields = array("url", "title", "keywords", "description", "move", "notfound");
return $dataset->Update();
}
function Del()
{
$dataset = new A_DataSet(STRUCTURE);
return $dataset->Delete();
}
function createData()
{
$pages = array();
$pager = new A_Pager(20);
$pager->query("SELECT * FROM " . STRUCTURE . " ORDER BY url");
while ($row = $pager->fetchRow()) {
$pages[] = $row;
}
$pager->free();
$this->Assign("pages", $pages);
$this->Assign("pages_pager", $pager);
}
}
A::$MAINFRAME = new Seo_Admin();
示例13: Save
}
}
/**
* Обработчик действия: Сохранение выбранных разделов.
*/
function Save()
{
return setTextOption(SECTION, 'sections', isset($_REQUEST['ids']) ? serialize($_REQUEST['ids']) : "");
}
/**
* Формирование данных доступных в шаблоне.
*/
function createData()
{
$checkeds = getTextOption(SECTION, 'sections');
$checkeds = !empty($checkeds) ? unserialize($checkeds) : array();
$sections = array();
A::$DB->query("\r\r\n\tSELECT * FROM " . DOMAIN . "_sections\r\r\n\tWHERE lang='" . LANG . "' OR lang='all' AND module<>'sitemap'\r\r\n\tORDER BY sort");
while ($row = A::$DB->fetchRow()) {
if (function_exists($row['module'] . '_createMap')) {
$row['checked'] = in_array($row['id'], $checkeds);
$sections[] = $row;
}
}
A::$DB->free();
$this->Assign("sections", $sections);
$this->AddJVar("csections", count($sections));
}
}
A::$MAINFRAME = new SiteMapModule_Admin();
示例14: createData
function createData()
{
$vars = array();
$urls = array();
A::$DB->query("SELECT * FROM " . STRUCTURE . " ORDER BY sort");
while ($row = A::$DB->fetchRow()) {
if (empty($_GET['idv'])) {
$data = !empty($row['data']) ? unserialize($row['data']) : array();
foreach ($data as $url => $value) {
$urls[$url] = $value;
}
}
$vars[] = $row;
}
A::$DB->free();
$this->Assign("vars", $vars);
if (!empty($_GET['idv'])) {
if ($var = A::$DB->getRowById($_GET['idv'], STRUCTURE)) {
$this->Assign("var", $var);
$data = !empty($var['data']) ? unserialize($var['data']) : array();
foreach ($data as $url => $value) {
$urls[$url] = $value;
}
}
}
ksort($urls);
$this->Assign("urls", $urls);
}
}
A::$MAINFRAME = new Vars_Admin();
示例15: isset
if (empty($_GET['tab']) && !empty($_COOKIE[STRUCTURE . '_idcat'])) {
$_GET['idcat'] = (int) $_COOKIE[STRUCTURE . '_idcat'];
$_REQUEST['tab'] = "banners";
}
if (!empty($_GET['idcat'])) {
if ($row = A::$DB->getRowById($idcat = (int) $_GET['idcat'], STRUCTURE . "_categories")) {
$this->Assign("category", $row);
$rows = (int) A_Session::get(STRUCTURE . "_rows", isset($_COOKIE[STRUCTURE . '_rows']) ? $_COOKIE[STRUCTURE . '_rows'] : 10);
$banners = array();
$pager = new A_Pager($rows);
$pager->tab = "banners";
$pager->query("\r\r\n\t\tSELECT * FROM " . STRUCTURE . "\r\r\n\t\tWHERE idcat={$idcat}\r\r\n\t\tORDER BY " . A_Session::get(STRUCTURE . "_sort", isset($_COOKIE[STRUCTURE . '_sort']) ? A::$DB->real_escape_string($_COOKIE[STRUCTURE . '_sort']) : "sort"));
while ($row = $pager->fetchRow()) {
$row['link'] = "http://" . DOMAINNAME . "/getfile/" . SNAME . "/click/?id=" . $row['id'];
$row['close'] = $row['active'] == 'N' || $row['date'] == 'Y' && !($row['date1'] < time() && time() < $row['date2']);
$banners[] = $row;
}
$pager->free();
$this->Assign("banners", $banners);
$this->Assign("banners_pager", $pager);
setcookie(STRUCTURE . "_idcat", $idcat, time() + 31104000);
} else {
setcookie(STRUCTURE . "_idcat", 0, time() - 3600);
}
}
$this->Assign("sort", A_Session::get(STRUCTURE . "_sort", isset($_COOKIE[STRUCTURE . '_sort']) ? A::$DB->real_escape_string($_COOKIE[STRUCTURE . '_sort']) : "sort"));
$this->Assign("rows", A_Session::get(STRUCTURE . "_rows", isset($_COOKIE[STRUCTURE . '_rows']) ? $_COOKIE[STRUCTURE . '_rows'] : 10));
}
}
A::$MAINFRAME = new Banners_Admin();