本文整理汇总了PHP中gcms::retURL方法的典型用法代码示例。如果您正苦于以下问题:PHP gcms::retURL方法的具体用法?PHP gcms::retURL怎么用?PHP gcms::retURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gcms
的用法示例。
在下文中一共展示了gcms::retURL方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rawurlencode
}
if (!$error) {
$save['last_update'] = $mmktime;
if ($id == 0) {
// ใหม่
$id = $db->add(DB_EMAIL_TEMPLATE, $save);
} else {
// แก้ไข
$db->edit(DB_EMAIL_TEMPLATE, $id, $save);
}
$ret['lastupdate'] = gcms::mktime2date($mmktime);
if (isset($_POST['email_copy_to'])) {
$ret['email_copy_to'] = rawurlencode($save['copy_to']);
}
$ret['email_id'] = $id;
$ret['error'] = 'SAVE_COMPLETE';
$ret['location'] = gcms::retURL(WEB_URL . '/admin/index.php', array('module' => 'mailtemplate'));
} else {
// คืนค่า input ตัวแรกที่ error
if ($input) {
$ret['input'] = $input;
}
$ret['error'] = $error;
}
}
}
} else {
$ret['error'] = 'ACTION_ERROR';
}
// คืนค่าเป็น JSON
echo gcms::array2json($ret);
示例2: COUNT
// อัปเดทหมวดหมู่
if ($save['category_id'] > 0) {
// อัปเดทจำนวนเรื่อง และ ความคิดเห็น ในหมวด
$sql1 = "SELECT COUNT(*) FROM `" . DB_INDEX . "` WHERE `category_id`=C.`category_id` AND `module_id`='{$index['module_id']}' AND `index`='0'";
$sql2 = "SELECT `id` FROM `" . DB_INDEX . "` WHERE `category_id`=C.`category_id` AND `module_id`='{$index['module_id']}' AND `index`='0'";
$sql2 = "SELECT COUNT(*) FROM `" . DB_COMMENT . "` WHERE `index_id` IN ({$sql2}) AND `module_id`='{$index['module_id']}'";
$sql = "UPDATE `" . DB_CATEGORY . "` AS C SET C.`c1`=({$sql1}),C.`c2`=({$sql2}) WHERE C.`module_id`='{$index['module_id']}'";
$db->query($sql);
}
if (is_file(ROOT_PATH . 'modules/document/news.php')) {
// news
include ROOT_PATH . 'modules/document/news.php';
}
// return
$ret['error'] = 'SAVE_COMPLETE';
$ret['location'] = gcms::retURL(WEB_URL . '/admin/index.php', array('module' => 'document-setup', 'id' => $index['module_id']));
} else {
$ret['error'] = $error;
if ($input) {
$ret['input'] = $input;
}
if ($tab) {
$ret['tab'] = $tab;
}
}
} else {
// ไม่สามารถเขียนหรือแก้ไขได้
$ret['error'] = 'NOT_ALLOWED';
}
}
}
示例3: preg_replace
} else {
$save['width'] = $info['width'];
$save['height'] = $info['height'];
// ชื่อไฟล์ใหม่
$save['logo'] = "{$textlink['id']}.{$info['ext']}";
if (!@copy($logo['tmp_name'], DATA_PATH . 'image/' . $save['logo'])) {
$ret['error'] = 'DO_NOT_UPLOAD';
$error = true;
}
}
}
if (!$error) {
$save['text'] = preg_replace('/(<br[\\s\\/]+>)/iu', '<br>', $save['text']);
if ($id == 0) {
// ใหม่
$save['link_order'] = $textlink['link_order'];
$save['published'] = 1;
$id = $db->add(DB_TEXTLINK, $save);
} else {
// edit
$db->edit(DB_TEXTLINK, $id, $save);
}
// คืนค่า
$ret['error'] = 'SAVE_COMPLETE';
$ret['location'] = gcms::retURL(WEB_URL . '/admin/index.php', array('module' => 'textlink-setup', 'name' => $save['name']));
}
}
}
// คืนค่า JSON
echo gcms::array2json($ret);
}
示例4: implode
$save['config'] = implode("\n", $cfg);
// save
if ($id == 0) {
// เพิ่มหมวดใหม่
$save['id'] = $index['id'];
$save['module_id'] = $index['module_id'];
$db->add(DB_CATEGORY, $save);
// คืนค่า
$ret['error'] = 'ADD_COMPLETE';
} else {
// แก้ไข
$db->edit(DB_CATEGORY, $index['id'], $save);
// คืนค่า
$ret['error'] = 'EDIT_SUCCESS';
}
$ret['location'] = gcms::retURL(WEB_URL . '/admin/index.php', array('module' => 'board-category', 'id' => $index['module_id']));
// อัปเดทจำนวนกระทู้ และ ความคิดเห็น ในหมวด
$sql1 = "SELECT COUNT(*) FROM `" . DB_BOARD_Q . "` WHERE `category_id`=C.`category_id` AND `module_id`='{$index['module_id']}'";
$sql2 = "SELECT `id` FROM `" . DB_BOARD_Q . "` WHERE `category_id`=C.`category_id` AND `module_id`='{$index['module_id']}'";
$sql2 = "SELECT COUNT(*) FROM `" . DB_BOARD_R . "` WHERE `index_id` IN ({$sql2}) AND `module_id`='{$index['module_id']}'";
$sql = "UPDATE `" . DB_CATEGORY . "` AS C SET C.`c1`=({$sql1}),C.`c2`=({$sql2}) WHERE C.`module_id`='{$index['module_id']}'";
$db->query($sql);
} else {
// error
$ret['error'] = $error;
if ($input) {
$ret['input'] = $input;
}
}
} else {
$ret['error'] = 'ACTION_ERROR';
示例5: array
} else {
$save[$lng] = $save2[$lng][''];
}
}
// save
if ($id == 0) {
$id = $db->add(DB_LANGUAGE, $save);
$ret['error'] = 'SAVE_COMPLETE';
} else {
$db->edit(DB_LANGUAGE, $id, $save);
$ret['error'] = 'EDIT_SUCCESS';
}
// อ่านไฟล์ภาษาใหม่
gcms::saveLanguage();
// back
if (isset($_POST['next'])) {
$ret['location'] = gcms::retURL(WEB_URL . '/admin/index.php?' . $_POST['next'], array());
} else {
$ret['location'] = gcms::retURL(WEB_URL . '/admin/index.php', array('module' => 'language', 'js' => $save['js']));
}
}
}
} else {
$ret['error'] = 'ACTION_ERROR';
}
}
} else {
$ret['error'] = 'ACTION_ERROR';
}
// คืนค่าเป็น JSON
echo gcms::array2json($ret);
示例6: foreach
foreach (explode(',', $save['reciever']) as $item) {
if ($item != -1) {
$reciever[$item] = $item;
}
}
if (sizeof($reciever) > 0) {
$sql = "SELECT `fname`,`lname`,`email` FROM `" . DB_USER . "` WHERE `status` IN (" . implode(',', $reciever) . ")";
foreach ($db->customQuery($sql) as $item) {
// ส่งอีเมล์
$replace = array();
$replace['/%FNAME%/'] = $item['fname'];
$replace['/%LNAME%/'] = $item['lname'];
$replace['/%URL%/'] = WEB_URL . "/index.php?module={$index['module']}";
gcms::sendMail(1, 'edocument', $replace, $item['email']);
}
$ret['error'] = 'EDOCUMENT_SAVE_AND_SEND_SUCCESS';
}
}
// ส่งค่ากลับ
$ret['location'] = gcms::retURL(WEB_URL . '/admin/index.php', array('module' => 'edocument-setup'));
} else {
$ret['error'] = $error;
$ret['input'] = $input;
}
}
}
} else {
$ret['error'] = 'ACTION_ERROR';
}
// คืนค่าเป็น JSON
echo gcms::array2json($ret);
示例7: filesize
$ret['input'] = 'download_file';
} else {
$save['size'] = filesize($f);
if ($save['name'] == '') {
$info = pathinfo($save['file']);
$save['name'] = $info['filename'];
$save['ext'] = $info['extension'];
}
}
}
if (!isset($ret['error'])) {
$save['last_update'] = $mmktime;
if ($id == 0) {
// ใหม่
$save['module_id'] = $index['module_id'];
$save['create_date'] = $mmktime;
$db->add(DB_DOWNLOAD, $save);
} else {
// แก้ไข
$db->edit(DB_DOWNLOAD, $id, $save);
}
// คืนค่า
$ret['error'] = 'SAVE_COMPLETE';
$ret['location'] = gcms::retURL(WEB_URL . '/admin/index.php', array('module' => 'download-setup'));
}
}
} else {
$ret['error'] = 'ACTION_ERROR';
}
// คืนค่าเป็น JSON
echo gcms::array2json($ret);