function BulkMail() { global $C, $DB; $message = GetValue('bulk_email'); $t = new Template(); $t->assign_by_ref('config', $C); $result = $DB->Query('SELECT * FROM `tlx_accounts` JOIN `tlx_account_fields` USING (`username`)'); while ($account = $DB->NextRow($result)) { if ($account['status'] == STATUS_ACTIVE) { $t->assign_by_ref('account', $account); SendMail($account['email'], $message, $t, FALSE); } } $DB->Free($result); DeleteValue('bulk_email'); }
// Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // If you are using this script on one of the domains you have defined in the // Manage Domains interface, uncomment the following line and set the directory // path to your TGPX Server Edition installation //chdir('/full/path/to/tgpxse/install'); require_once 'includes/common.php'; require_once "{$GLOBALS['BASE_DIR']}/includes/template.class.php"; require_once "{$GLOBALS['BASE_DIR']}/includes/mysql.class.php"; require_once "{$GLOBALS['BASE_DIR']}/includes/validator.class.php"; SetupRequest(); $t = new Template(); $t->assign_by_ref('config', $C); $DB = new DB($C['db_hostname'], $C['db_username'], $C['db_password'], $C['db_name']); $DB->Connect(); $domain = $DB->Row('SELECT * FROM `tx_domains` WHERE `domain`=?', array(preg_replace('~^www\\.~i', '', strtolower($_SERVER['HTTP_HOST'])))); if ($_SERVER['REQUEST_METHOD'] == 'POST') { txReportAdd(); } else { txShReportAdd(); } $DB->Disconnect(); function txShReportAdd($errors = null) { global $DB, $C, $L, $t, $domain; $gallery = $DB->Row('SELECT * FROM `tx_galleries` WHERE `gallery_id`=?', array($_REQUEST['id'])); if (!$gallery) { $t->assign('error', $L['BAD_GALLERY_ID']);
function DisplayCategory() { global $C, $DB; $t = new Template(); $t->caching = TRUE; $t->cache_lifetime = $C['cache_category']; $custom_sort = isset($_GET['s']); $from_path = FALSE; $template = 'directory-category.tpl'; if ($custom_sort) { $t->caching = FALSE; } if ($C['mod_rewrite'] && !is_numeric($_GET['c'])) { $_GET['c'] = preg_replace('~^/|/$~', '', $_GET['c']); if (preg_match("~(.*?)/(\\d+)\\.{$C['extension']}\$~", $_GET['c'], $matches)) { $_GET['c'] = $matches[1]; $_GET['p'] = $matches[2]; } $from_path = TRUE; } $_GET['p'] = isset($_GET['p']) ? $_GET['p'] : 1; $cache_id = md5($_GET['c'] . '-' . $_GET['p']); if ($custom_sort || $C['custom_categories'] || !$t->is_cached($template, $cache_id)) { $DB->Connect(); // Get the category if ($from_path) { $category = $DB->Row('SELECT * FROM lx_categories WHERE path_hash=?', array(md5($_GET['c']))); } else { $category = $DB->Row('SELECT * FROM lx_categories WHERE category_id=?', array($_GET['c'])); } if ($category['template']) { $template = $category['template']; } if (!$category) { require_once 'includes/language.php'; $t->caching = FALSE; $t->assign('error', $L['NO_SUCH_PAGE']); $t->assign_by_ref('config', $C); $t->display('error-nice.tpl'); return; } } if ($custom_sort || !$t->is_cached($template, $cache_id)) { $category['path_parts'] = unserialize($category['path_parts']); $t->assign_by_ref('this_category', $category); $t->assign_by_ref('config', $C); $t->assign('page_num', $_GET['p']); $t->assign('get_c', $_GET['c']); $t->assign('template', $template); $t->assign_by_ref('request', $_GET); } $t->display($template, $cache_id); }
function txGalleryReject() { global $DB, $json, $C; VerifyPrivileges(P_GALLERY_MODIFY, TRUE); $reject_cache = array(); $t = new Template(); $t->assign_by_ref('config', $C); $result = GetWhichGalleries(); $amount = 0; while ($gallery = $DB->NextRow($result)) { if ($gallery['status'] == 'pending' || $gallery['status'] == 'unconfirmed') { DeleteGallery($gallery['gallery_id'], $gallery); // Send rejection e-mail if selected if (is_numeric($_REQUEST['multi_email'])) { if (!isset($reject_cache[$_REQUEST['multi_email']])) { $rejection = $DB->Row('SELECT * FROM `tx_rejections` WHERE `email_id`=?', array($_REQUEST['multi_email'])); $reject_cache[$_REQUEST['multi_email']] = $rejection; } $t->assign_by_ref('gallery', $gallery); SendMail($gallery['email'], $reject_cache[$_REQUEST['multi_email']]['plain'], $t, FALSE); } $amount++; } } $DB->Free($result); // Update administrator count of galleries rejected $DB->Update('UPDATE `tx_administrators` SET `rejected`=`rejected`+? WHERE `username`=?', array($amount, $_SERVER['REMOTE_USER'])); echo $json->encode(array('status' => JSON_SUCCESS, 'message' => "{$amount} galler" . ($amount == 1 ? 'y has' : 'ies have') . " been rejected")); }
function tlxAccountProcess() { global $DB, $json, $C, $L; VerifyPrivileges(P_ACCOUNT_MODIFY, TRUE); if (!is_array($_REQUEST['username'])) { $_REQUEST['username'] = array($_REQUEST['username']); } $t = new Template(); $t->assign_by_ref('config', $C); if ($_REQUEST['w'] == 'reject') { $action = 'rejected'; $rejections =& $DB->FetchAll('SELECT * FROM `tlx_rejections`', null, 'email_id'); foreach ($_REQUEST['username'] as $username) { $account = $DB->Row('SELECT * FROM `tlx_accounts` WHERE `username`=?', array($username)); DeleteAccount($account['username'], $account); // Send rejection e-mail if (isset($rejections[$_REQUEST['reject'][$username]])) { $t->assign_by_ref('account', $account); SendMail($account['email'], $rejections[$_REQUEST['reject'][$username]]['compiled'], $t, FALSE); } } } else { if ($_REQUEST['w'] == 'approve') { $action = 'approved'; foreach ($_REQUEST['username'] as $username) { $DB->Update('UPDATE `tlx_accounts` SET `status`=?,`date_activated`=? WHERE `username`=?', array(STATUS_ACTIVE, MYSQL_NOW, $username)); $account = $DB->Row('SELECT * FROM `tlx_accounts` WHERE `username`=?', array($username)); if ($C['email_new_accounts']) { $account['password'] = $L['ENCRYPTED_PASSWORD']; $t->assign_by_ref('account', $account); SendMail($account['email'], 'email-account-added.tpl', $t); } } } } echo $json->encode(array('status' => JSON_SUCCESS)); }
function DailyPartnerMaintenance() { global $DB, $C; $args = ParseCommandLine(); // Remove inactive partner accounts if (isset($args['remove-inactive']) && is_numeric($args['remove-inactive'])) { $min_last_submit = gmdate(DF_DATETIME, TimeWithTz() - $args['remove-inactive'] * 86400); $result = $DB->Query('SELECT * FROM `tx_partners` WHERE `date_last_submit` <= ? OR (`date_last_submit` IS NULL AND `date_added` <= ?)', array($min_last_submit, $min_last_submit)); while ($partner = $DB->NextRow($result)) { DeletePartner($partner['username'], $partner); } $DB->Free($result); } // Send an e-mail message to partner accounts that are inactive if (isset($args['email-inactive']) && is_numeric($args['email-inactive'])) { // Prepare the template $t = new Template(); $t->assign_by_ref('config', $C); $t->assign('inactive', $args['email-inactive']); // Determine the time range to select $start = gmdate(DF_DATE, strtotime('-' . $args['email-inactive'] . ' day', TimeWithTz())) . ' 00:00:00'; $end = gmdate(DF_DATE, strtotime('-' . $args['email-inactive'] . ' day', TimeWithTz())) . ' 23:59:59'; // Find matching partners $result = $DB->Query('SELECT * FROM `tx_partners` WHERE `date_last_submit` BETWEEN ? AND ? OR (`date_last_submit` IS NULL AND `date_added` BETWEEN ? AND ?)', array($start, $end, $start, $end)); while ($partner = $DB->NextRow($result)) { $t->assign_by_ref('partner', $partner); SendMail($partner['email'], 'email-partner-inactive.tpl', $t); } $DB->Free($result); } // Send an e-mail message to partner accounts that are expiring soon if (isset($args['email-expiring']) && is_numeric($args['email-expiring'])) { // Prepare the template $t = new Template(); $t->assign_by_ref('config', $C); // Determine the time range to select $start = gmdate(DF_DATE, strtotime('+' . $args['email-expiring'] . ' day', TimeWithTz())) . ' 00:00:00'; $end = gmdate(DF_DATE, strtotime('+' . $args['email-expiring'] . ' day', TimeWithTz())) . ' 23:59:59'; // Find matching partners $result = $DB->Query('SELECT * FROM `tx_partners` WHERE `date_end` BETWEEN ? AND ?', array($start, $end)); while ($partner = $DB->NextRow($result)) { $partner['date_end'] = strtotime($partner['date_end']); $t->assign_by_ref('partner', $partner); SendMail($partner['email'], 'email-partner-expiring.tpl', $t); } $DB->Free($result); } }
function lxMailUser() { global $DB, $C, $t; VerifyPrivileges(P_USER); UnixFormat($_REQUEST['plain']); UnixFormat($_REQUEST['html']); $message = "=>[subject]\n" . $_REQUEST['subject'] . "\n" . "=>[plain]\n" . trim($_REQUEST['plain']) . "\n" . "=>[html]\n" . trim($_REQUEST['html']); $t = new Template(); $t->assign_by_ref('config', $C); foreach (explode(',', $_REQUEST['to']) as $to_account) { $account = $DB->Row('SELECT * FROM lx_users JOIN lx_user_fields USING (username) WHERE lx_users.username=?', array($to_account)); if ($account) { $t->assign_by_ref('account', $account); SendMail($account['email'], $message, $t, FALSE); } } $message = 'The selected user accounts have been e-mailed'; include_once 'includes/message.php'; }
// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. require_once 'includes/common.php'; require_once "{$GLOBALS['BASE_DIR']}/includes/template.class.php"; require_once "{$GLOBALS['BASE_DIR']}/includes/mysql.class.php"; require_once "{$GLOBALS['BASE_DIR']}/includes/validator.class.php"; SetupRequest(); $DB = new DB($C['db_hostname'], $C['db_username'], $C['db_password'], $C['db_name']); $DB->Connect(); $t = new Template(); $t->assign_by_ref('config', $C); $v = new Validator(); $v->Register($_REQUEST['email'], V_EMAIL, $L['INVALID_EMAIL']); $v->Register($_REQUEST['name'], V_EMPTY, "{$L['REQUIRED_FIELD']}: {$L['NAME']}"); $v->Register($_REQUEST['comment'], V_EMPTY, "{$L['REQUIRED_FIELD']}: {$L['COMMENT']}"); $v->Register($_REQUEST['comment'], V_LENGTH, sprintf($L['COMMENT_LENGTH'], $C['min_comment_length'], $C['max_comment_length']), "{$C['min_comment_length']},{$C['max_comment_length']}"); // Verify captcha code if ($C['comments_captcha']) { VerifyCaptcha($v, 'linkxcaptcha_comment'); } $account = ValidUserLogin(); if ($C['user_for_comments']) { if ($account === FALSE || $account['status'] != 'active') { if ($account === FALSE) { $v->SetError($L['INVALID_LOGIN']); } else {
<?php require LIBPATH . '/system/Template.php'; $tpl = new Template(); global $php; $tpl->assign_by_ref('php_genv', $php->genv); $tpl->assign_by_ref('php', $php->env); if (defined('TPL_DIR')) { $tpl->template_dir = TPL_DIR; } elseif (is_dir(Swoole::$app_path . '/templates')) { $tpl->template_dir = Swoole::$app_path . '/templates'; } else { $tpl->template_dir = WEBPATH . "/templates"; } if (DEBUG == 'on') { $tpl->compile_check = true; } else { $tpl->compile_check = false; }
/** * Assign var by reference * @param string $tpl_var * @param mixed $value * @return View */ public function assign_by_ref($tpl_var, &$value) { $this->tpl->assign_by_ref($tpl_var, $value); return $this; }
astripslashes($_POST); } $_POST['s'] = trim($_POST['s']); $page = !empty($_POST['p']) ? $_POST['p'] : 1; $per_page = !empty($_POST['pp']) ? $_POST['pp'] : 20; $too_short = strlen($_POST['s']) < 4; $search_id = sha1("{$_POST['s']}-{$_POST['c']}-{$page}"); $t = new Template(); $t->caching = TRUE; $t->cache_lifetime = 3600; $t->assign('search_term', $_POST['s']); $t->assign('search_category', $_POST['c']); $t->assign('page', $page); $t->assign('per_page', $per_page); $t->assign('search_too_short', $too_short); $t->assign_by_ref('config', $C); if (!$too_short && !$t->is_cached('search-results.tpl', $search_id)) { $DB = new DB($C['db_hostname'], $C['db_username'], $C['db_password'], $C['db_name']); $DB->Connect(); $accounts = array(); $result = $DB->QueryWithPagination('SELECT * FROM `tlx_accounts` JOIN `tlx_account_hourly_stats` USING (`username`) WHERE ' . 'MATCH(`title`,`description`,`keywords`) AGAINST(? IN BOOLEAN MODE) AND ' . '`status`=? AND ' . '`disabled`=0 ' . (!empty($_POST['c']) && is_numeric($_POST['c']) ? ' AND `category_id`=' . $DB->Escape($_POST['c']) . ' ' : '') . 'ORDER BY `unique_in_total` DESC', array($_POST['s'], 'active'), $page, $per_page); if ($result['result']) { while ($account = $DB->NextRow($result['result'])) { $accounts[] = array_merge($account, $DB->Row('SELECT * FROM `tlx_account_fields` WHERE `username`=?', array($account['username']))); } $DB->Free($result['result']); unset($result['result']); } $categories = $DB->FetchAll('SELECT * FROM `tlx_categories` ORDER BY `name`'); if (!$categories) { $categories = array();
// You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. require_once 'includes/common.php'; require_once "{$GLOBALS['BASE_DIR']}/includes/template.class.php"; require_once "{$GLOBALS['BASE_DIR']}/includes/mysql.class.php"; require_once "{$GLOBALS['BASE_DIR']}/includes/validator.class.php"; SetupRequest(); $t = new Template(); $t->assign_by_ref('config', $C); $DB = new DB($C['db_hostname'], $C['db_username'], $C['db_password'], $C['db_name']); $DB->Connect(); $account = $DB->Row('SELECT * FROM `tlx_accounts` WHERE `username`=?', array($_REQUEST['id'])); if ($account) { $page = isset($_REQUEST['p']) ? $_REQUEST['p'] : 1; $per_page = isset($_REQUEST['pp']) ? $_REQUEST['pp'] : 20; $result = $DB->QueryWithPagination('SELECT * FROM `tlx_account_comments` WHERE `status`=? AND `username`=? ORDER BY `date_submitted` DESC', array('approved', $_REQUEST['id']), $page, $per_page); if ($result['result']) { while ($comment = $DB->NextRow($result['result'])) { $comment['date'] = strtotime($comment['date_submitted']); $comments[] = $comment; } $DB->Free($result['result']); unset($result['result']); }
function txAdministratorMail() { global $DB, $C, $t; VerifyAdministrator(); $message = PrepareMessage(); $t = new Template(); $t->assign_by_ref('config', $C); foreach (explode(',', $_REQUEST['to']) as $to_account) { $account = $DB->Row('SELECT * FROM `tx_administrators` WHERE `username`=?', array($to_account)); if ($account) { $t->assign_by_ref('account', $account); SendMail($account['email'], $message, $t, FALSE); } } $message = 'The selected administrator accounts have been e-mailed'; include_once 'includes/message.php'; }
} } $temp_categories = array(); foreach (explode(' ', $gallery['categories']) as $category_tag) { if ($categories[$category_tag]) { $temp_categories[] = $categories[$category_tag]; } } $gallery['categories'] = $temp_categories; $gallery['category'] = $gallery['categories'][0]['name']; $galleries[] = $gallery; } $DB->Free($result['result']); unset($result['result']); } $t->assign_by_ref('search_categories', $categories); $t->assign_by_ref('pagination', $result); $t->assign_by_ref('results', $galleries); } if (!$too_short && $page == 1 && $C['log_searches']) { if ($_COOKIE['txsearch'] != $_GET['s']) { logsearch(); } setcookie('txsearch', $_GET['s'], time() + 86400, '/', $C['cookie_domain']); } $t->assign_by_ref('config', $C); $t->assign('search_term', $_GET['s']); $t->assign('search_category', $_GET['c']); $t->assign('search_format', $_GET['f']); $t->assign('search_too_short', $too_short); $t->assign('page', $page);
/** * Process new user accounts (approve/reject) */ function lxNewUser() { global $json, $DB, $C; $t = new Template(); $t->assign_by_ref('config', $C); VerifyPrivileges(P_USER_MODIFY, TRUE); if (!is_array($_REQUEST['username'])) { $_REQUEST['username'] = array($_REQUEST['username']); } foreach ($_REQUEST['username'] as $username) { $account = $DB->Row('SELECT * FROM lx_users JOIN lx_user_fields USING (username) WHERE lx_users.username=?', array($username)); $t->assign_by_ref('account', $account); if ($_REQUEST['w'] == 'approve') { $account['status'] = 'active'; $DB->Update('UPDATE lx_users SET status=? WHERE username=?', array('active', $username)); // Send approval e-mail, if selected if ($_REQUEST['email'] == 'approval') { SendMail($account['email'], 'email-account-added.tpl', $t); } } else { if ($_REQUEST['w'] == 'reject') { // Remove this user's links $result = $DB->Query('SELECT * FROM lx_links WHERE username=?', array($username)); while ($link = $DB->NextRow($result)) { DeleteLink($link['link_id'], TRUE, $link); } $DB->Free($result); // Remove this user's comments $DB->Update('DELETE FROM lx_link_comments WHERE username=?', array($username)); // Remove this user $DB->Update('DELETE FROM lx_user_fields WHERE username=?', array($username)); $DB->Update('DELETE FROM lx_user_confirms WHERE username=?', array($username)); $DB->Update('DELETE FROM lx_users WHERE username=?', array($username)); // Send rejection e-mail, if selected if (!empty($_REQUEST['email']) && $_REQUEST['email'] != 'approval') { $rejection = $DB->Row('SELECT * FROM lx_rejections WHERE email_id=?', array($_REQUEST['email'])); if ($rejection) { SendMail($account['email'], $rejection['plain'], $t, FALSE); } } } } } echo $json->encode(array('status' => JSON_SUCCESS)); }
function Error($code, $string, $file, $line) { global $C, $DB; $reporting = error_reporting(); if ($reporting == 0 || !($code & $reporting)) { return; } $sapi = php_sapi_name(); if ($sapi != 'cli') { require_once "{$GLOBALS['BASE_DIR']}/includes/template.class.php"; $t = new Template(); } $file = basename($file); // Generate stack trace $backtrace = debug_backtrace(); for ($i = 1; $i < count($backtrace); $i++) { $tracefile = $backtrace[$i]; if (!$tracefile['line']) { continue; } $trace .= "{$tracefile['function']} in " . basename($tracefile['file']) . " on line {$tracefile['line']}<br />"; } if ($sapi != 'cli') { $t->assign('trace', $trace); $t->assign('error', $string); $t->assign('file', $file); $t->assign('line', $line); $t->assign_by_ref('config', $C); if (defined('TGPX')) { $t->assign('levelup', '../'); } $t->display('error-fatal.tpl'); } else { echo "Error on line {$line} of file {$file}\n" . "{$string}\n" . "Stack Trace:\n{$trace}\n"; } $error = "Error on line {$line} of file {$file}\n" . strip_tags(str_replace('<br />', "\n", $string)) . "\n\n" . "Stack Trace:\n" . str_replace('<br />', "\n", $trace) . "\n"; if (@get_class($DB) == 'DB' && isset($GLOBALS['build_history_id'])) { $DB->Update('UPDATE `tx_build_history` SET `error_message`=? WHERE `history_id`=?', array($error, $GLOBALS['build_history_id'])); } if ($GLOBALS['ERROR_LOG']) { FileAppend("{$GLOBALS['BASE_DIR']}/data/error_log", "[" . date('r') . "] {$error}\n"); } exit; }
function Error($code, $string, $file, $line) { global $C; $reporting = error_reporting(); if ($reporting == 0 || !($code & $reporting)) { return; } $sapi = php_sapi_name(); if ($sapi != 'cli') { require_once "{$GLOBALS['BASE_DIR']}/includes/template.class.php"; $t = new Template(); } $file = basename($file); // Generate stack trace $backtrace = debug_backtrace(); for ($i = 1; $i < count($backtrace); $i++) { $tracefile = $backtrace[$i]; if (!$tracefile['line']) { continue; } $trace .= "{$tracefile['function']} in " . basename($tracefile['file']) . " on line {$tracefile['line']}<br />"; } if ($sapi != 'cli') { $t->assign('trace', $trace); $t->assign('error', $string); $t->assign('file', $file); $t->assign('line', $line); $t->assign_by_ref('config', $C); if (defined('ToplistX')) { $t->assign('levelup', '../'); } $t->display('error-fatal.tpl'); } else { echo "Error on line {$line} of file {$file}\n" . "{$string}\n\n" . "STACK TRACE:\n" . str_replace('<br />', "\n", $trace) . "\n"; } exit; }
$info_base_product_price = $oCurrencies->display_price($product_info['products_price'] * $product_info['products_base_price'], oos_get_tax_rate($product_info['products_tax_class_id'])); if ($info_product_special_price != '') { $info_base_product_special_price = $oCurrencies->display_price($info_product_special_price * $product_info['products_base_price'], oos_get_tax_rate($product_info['products_tax_class_id'])); } } } if (OOS_BASE_PRICE == '0') { $info_product_price_list = $oCurrencies->display_price($product_info['products_price_list'], oos_get_tax_rate($product_info['products_tax_class_id'])); $oSmarty->assign('info_product_price_list', $info_product_price_list); } // assign Smarty variables; $oSmarty->assign_by_ref("oEvent", $oEvent); $oSmarty->assign('product_info', $product_info); $oSmarty->assign('oosDate', date('Y-m-d H:i:s')); $oSmarty->assign('oos_base', (($request_type == 'SSL') ? OOS_HTTPS_SERVER : OOS_HTTP_SERVER) . OOS_SHOP); $oSmarty->assign( array( 'request_type' => $request_type, 'theme_set' => $sTheme, 'theme_image' => 'themes/' . $sTheme . '/images', 'theme_css' => 'themes/' . $sTheme, 'lang' => $aLang,
@set_magic_quotes_runtime(0); if (function_exists('date_default_timezone_set')) { date_default_timezone_set('America/Chicago'); } if (get_magic_quotes_gpc()) { _ArrayStripSlashes($_GET); } $link = array('link_id' => $_GET['id']); $cache_id = md5($_GET['id']); // Indicate if logged in $C['logged_in'] = isset($_COOKIE['linkxuser']); $t = new Template(); $t->caching = $C['cache_details'] > 0; $t->cache_lifetime = $C['cache_details']; $t->cache_dir = 'templates/cache_details'; $t->assign_by_ref('link', $link); if (!$t->is_cached('directory-link-details.tpl', $cache_id)) { $DB = new DB($C['db_hostname'], $C['db_username'], $C['db_password'], $C['db_name']); $DB->Connect(); $link = $DB->Row('SELECT * FROM lx_links JOIN lx_link_fields USING (link_id) WHERE lx_links.link_id=?', array($_GET['id'])); if (!$link) { require_once 'includes/language.php'; $t->caching = FALSE; $t->assign('error', $L['NO_SUCH_PAGE']); $t->assign_by_ref('config', $C); $t->display('error-nice.tpl'); return; } // Get all categories for this link $categories = array(); $result = $DB->Query('SELECT * FROM lx_link_cats JOIN lx_categories USING (category_id) WHERE link_id=?', array($_GET['id']));