<option selected="selected" label="none" value="none">select a category</option>'; foreach ($cats as $cat) { if ($cat['level'] == 1) { if ($selects != '') { $selects .= '</optgroup>'; } $selects .= '<optgroup label="' . $cat['crumb'] . '">'; } else { $selects .= '<option value="' . $cat['cid'] . '"' . (isset($_GET['c']) && $cat['cid'] == intval($_GET['c']) || $cat['cid'] == $in['cat'] ? ' selected="selected"' : '') . '>' . $cat['crumb'] . '</option>'; } } $selects .= '</optgroup></select>'; } require_once 'header.php'; $images = DL_Image::output_list($mng_id, $in['screen']); $cpgtpl->assign_vars(array('DL_MENU' => dl_menu(), 'DL_ERRORS' => !empty($errors), 'DL_WARNINGS' => !empty($warnings), 'DL_MIRRORS' => DL_Mirror::output_list($mng_id), 'DL_IMAGES' => $images, 'IS_NEW_DL' => !can_admin($module_name), 'CAN_ADMIN' => can_admin($module_name), 'B_SCREENSHOT' => $dl_config['screen_active'] || can_admin($module_name), 'B_ADD_IMAGE' => $dl_config['screen_active'] && $images < $dl_config['screen_max'], 'B_NOTES' => false, 'B_REASON' => false, 'B_UPL_FILE' => $dl_config['upl_file'] || can_admin($module_name), 'B_UPL_IMAGE' => $dl_config['upl_image'] || can_admin($module_name), 'B_PENDING' => false, 'B_FETCH_PAD' => $fetch_pad, 'B_REM_MD5' => $dl_config['md5_remote'], 'L_YES' => _YES, 'L_NO' => _NO, 'L_DELETE' => _DELETE, 'L_UPDATE' => 'Update', 'L_CATEGORY' => _CATEGORY, 'L_SHORT_DESC' => 'Short Description', 'L_MAX_CHARS' => sprintf(_M_CHARS, 255), 'L_DESCRIPTION' => _DESCRIPTION, 'L_AUTHORNAME' => _AUTHORNAME, 'L_AUTHOREMAIL' => _AUTHOREMAIL, 'L_MD5' => 'MD5', 'S_BBCODE' => bbcode_table('in[desc_long]', 'add_download', true), 'DL_TITLE' => htmlprepare($in['title']), 'DL_ACCESS' => group_selectbox('in[access]', $in['access']), 'DL_CATSEL' => $selects, 'DL_DESC_SHORT' => htmlprepare($in['desc_short']), 'DL_DESC_LONG' => htmlprepare($in['desc_long']), 'DL_NOTES' => '', 'DL_REASON' => '', 'DL_NAME' => htmlprepare($in['name']), 'DL_EMAIL' => $in['email'], 'U_DL_FORM' => URL::index('&file=add'))); foreach ($errors as $error) { $cpgtpl->assign_block_vars('dl_errors', array('S_ENTRY' => $error)); } foreach ($warnings as $warning) { $cpgtpl->assign_block_vars('dl_warnings', array('S_ENTRY' => $warning)); } $result = $db->sql_uquery("SELECT * FROM " . $dl_prefix . "_fields \n\tWHERE visible > 0" . (!can_admin($module_name) ? ' AND visible < 3' : '') . " \n\tORDER BY title"); while ($field = $db->sql_fetchrow($result)) { $f_title = defined($field['title']) ? constant($field['title']) : $field['title']; $f_title = $field['visible'] == 2 ? '* ' . $f_title : $f_title; if ($field['type'] == 1 || $field['type'] == 3) { $f_value = isset($in[$field['field']]) ? intval($in[$field['field']]) : $field['size']; $f_value = $f_value > 0 ? array(' checked="checked"', '') : array('', ' checked="checked"'); $cpgtpl->assign_block_vars('fields', array('TITLE' => $f_title, 'TYPE' => $field['type'], 'NAME' => $field['field'], 'S_YES' => $f_value[0], 'S_NO' => $f_value[1])); } else {
if ($mode == 'mod') { $result = $db->sql_query('SELECT title, inmenu AS active, cat_id FROM ' . $prefix . '_modules WHERE mid=' . $lid); } elseif ($mode == 'link') { $result = $db->sql_query('SELECT * FROM ' . $prefix . '_modules_links WHERE lid=' . $lid); } if ($mode != 'new' && $db->sql_numrows($result) > 0 || $mode == 'new') { $link = $mode == 'new' ? array('cat_id' => 0, 'view' => 0) : $db->sql_fetchrow($result); $array = array('0' => '[' . _NONE . ']'); $cats = $db->sql_query("SELECT cid, name FROM " . $prefix . "_modules_cat ORDER BY name"); while ($cat = $db->sql_fetchrow($cats)) { $array["{$cat['cid']}"] = defined($cat['name']) ? constant($cat['name']) : $cat['name']; } cpg_mm_admin_header($mode != 'new' ? 'Edit Link' : _CPG_MMADDLINK); $cpgmm_edit = array('EDITLINK' => true, 'EDITCAT' => false, 'LNK' => $_GET['editlnk'], 'MOD' => $_GET['editlnk'] == 'mod', 'NEW' => $_GET['editlnk'] == 'new', 'LID' => $lid, 'S_CATEGORY' => _CATEGORY, 'S_ACTIVE' => _ACTIVE, 'S_SUBMIT_VALUE' => $mode != 'new' ? _SAVECHANGES : _CPG_MMADDLINK, 'SEL_CAT' => select_box('lnkcat', $link['cat_id'], $array), 'SEL_ACTIVE' => yesno_option('lnkactive', $mode != 'new' ? $link['active'] : 1)); if ($_GET['editlnk'] != 'mod') { $cpgmm_edit += array('S_URL' => _URL, 'S_VIEWPRIV' => _VIEWPRIV, 'SEL_GROUP' => group_selectbox('lnkview', $link['view'], true), 'S_TITLE_VALUE' => $mode != 'new' ? htmlprepare($link['title']) : '', 'S_LINK_VALUE' => $mode != 'new' ? $link['link'] : '', 'SEL_LINK' => select_box('lnktype', $mode != 'new' ? $link['link_type'] : 0, array(0 => 'getlink', 1 => 'link', 2 => 'web'))); } if ($_GET['editlnk'] != 'new') { $cpgmm_edit += array('S_LINK_TITLE' => $link['title']); } $cpgtpl->assign_vars($cpgmm_edit); $cpgtpl->set_handle('body', 'admin/cpgmm_edit.html'); $cpgtpl->display('body'); } else { cpg_error(_CPG_MMNOLINK); } } elseif (isset($_GET['savelnk'])) { $mode = $_GET['savelnk']; if ($_POST['lnktitle'] == '' && $mode != 'mod') { cpg_error(_CPG_MMLNKEMPTY); }
$act_alt = _ACTIVE; } else { $act_img = 'unchecked.gif'; $act_alt = _INACTIVE; } echo '<tr' . $bgcolor . '> <td align="center"><strong>' . $mid . '</strong></td> <td align="left" style="width:100%;">' . $title . '</td> <td align="center">' . $mlanguage . '</td> <td align="center" style="white-space:nowrap;">' . $mview . '</td> <td align="center"><a href="' . URL::admin('&status=' . $mid) . '"><img src="images/' . $act_img . '" alt="' . $act_alt . '" title="' . $act_alt . '" /></a></td> <td align="right" style="white-space:nowrap;"><a href="' . URL::admin('&edit=' . $mid) . '">' . _EDIT . '</a> / <a href="' . URL::admin('&del=' . $mid) . '">' . _DELETE . '</a> </td></tr>'; } echo '</table><br />'; CloseTable(); echo '<br />'; OpenTable(); echo '<div style="text-align:center;" class="option">' . _ADDMSG . '</div><br /> <form name="message" action="' . URL::admin('messages&save=0') . '" method="post" enctype="multipart/form-data" accept-charset="utf-8">' . '<strong>' . _MESSAGETITLE . '</strong><br />' . '<input type="text" name="title" value="" size="50" maxlength="100" /><br /><br />' . '<strong>' . _MESSAGECONTENT . '</strong><br />' . bbcode_table('content', 'message', 1) . '<div style="float:left;"> <textarea name="content" rows="15" wrap="virtual" cols="63" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);"></textarea></div> <div style="float: left; margin-left: 5px">' . smilies_table('inline', 'content', 'message') . '</div><br /><br />'; if ($MAIN_CFG['global']['multilingual']) { echo '<strong>' . _LANGUAGE . '</strong> ' . lang_selectbox($MAIN_CFG['global']['language'], 'language') . '<br /><br />'; } else { echo '<input type="hidden" name="language" value="" />'; } echo '<strong>' . _EXPIRATION . '</strong> ' . select_box('expire', 0, array(86400 => '1 ' . _DAY, 172800 => '2 ' . _DAYS, 432000 => '5 ' . _DAYS, 1296000 => '15 ' . _DAYS, 2592000 => '30 ' . _DAYS, 0 => _UNLIMITED)) . '<br /><br />' . '<strong>' . _ACTIVATE2 . '</strong> ' . yesno_option('active', 1) . '<br /><br /><strong>' . _VIEWPRIV . '</strong> ' . group_selectbox('view', 0, true) . '<br /><br /><input type="submit" value="' . _ADDMSG . '" /></form>'; } } CloseTable();
<option selected="selected" label="none" value="none">select a category</option>'; foreach ($cats as $cat) { if ($cat['level'] == 1) { if ($selects != '') { $selects .= '</optgroup>'; } $selects .= '<optgroup label="' . $cat['crumb'] . '">'; } else { $selects .= '<option value="' . $cat['cid'] . '"' . ($cat['cid'] == $in['cat'] ? ' selected="selected"' : '') . '>' . $cat['crumb'] . '</option>'; } } $selects .= '</optgroup></select>'; } require_once 'header.php'; $images = DL_Image::output_list($mng_id, $in['screen']); $cpgtpl->assign_vars(array('DL_MENU' => '<span class="gen"><strong>My Downloads</strong></span><br /><a href="' . URL::index() . '">Main Page</a> | <a href="' . URL::index('&file=manage') . '">Current Downloads</a> | <a href="' . URL::index('&file=manage&s=1') . '">Pending Downloads</a> | <a href="' . URL::index('&file=manage&s=2') . '">Broken D/L Reports</a>', 'DL_ERRORS' => !empty($errors), 'DL_WARNINGS' => !empty($warnings), 'DL_MIRRORS' => DL_Mirror::output_list($mng_id), 'DL_IMAGES' => $images, 'IS_NEW_DL' => false, 'CAN_ADMIN' => can_admin($module_name), 'B_SCREENSHOT' => $dl_config['screen_active'] || can_admin($module_name), 'B_ADD_IMAGE' => $dl_config['screen_active'] && $images < $dl_config['screen_max'], 'B_NOTES' => can_admin($module_name), 'B_REASON' => true, 'B_UPL_FILE' => $dl_config['upl_file'] || can_admin($module_name), 'B_UPL_IMAGE' => $dl_config['upl_image'] || can_admin($module_name), 'B_PENDING' => $row['active'] == 2 && can_admin($module_name), 'B_FETCH_PAD' => false, 'B_REM_MD5' => $dl_config['md5_remote'], 'L_YES' => _YES, 'L_NO' => _NO, 'L_DELETE' => _DELETE, 'L_UPDATE' => 'Update', 'L_CATEGORY' => _CATEGORY, 'L_SHORT_DESC' => 'Short Description', 'L_MAX_CHARS' => sprintf(_M_CHARS, 255), 'L_DESCRIPTION' => _DESCRIPTION, 'L_AUTHORNAME' => _AUTHORNAME, 'L_AUTHOREMAIL' => _AUTHOREMAIL, 'L_MD5' => 'MD5', 'L_PENDING' => 'Pending', 'S_BBCODE' => bbcode_table('in[desc_long]', 'add_download', true), 'DL_TITLE' => htmlprepare($in['title']), 'DL_ACCESS' => group_selectbox('in[access]', $in['access']), 'DL_CATSEL' => $selects, 'DL_DESC_SHORT' => htmlprepare($in['desc_short']), 'DL_DESC_LONG' => htmlprepare($in['desc_long']), 'DL_NOTES' => isset($in['notes']) ? htmlprepare($in['notes']) : '', 'DL_REASON' => htmlprepare($in['reason']), 'DL_NAME' => htmlprepare($in['name']), 'DL_EMAIL' => $in['email'], 'U_DL_FORM' => URL::index('&file=manage&edit=' . $mng_id))); foreach ($errors as $error) { $cpgtpl->assign_block_vars('dl_errors', array('S_ENTRY' => $error)); } foreach ($warnings as $warning) { $cpgtpl->assign_block_vars('dl_warnings', array('S_ENTRY' => $warning)); } $result = $db->sql_uquery("SELECT * FROM " . $dl_prefix . "_fields \n\t\tWHERE visible > 0" . (!can_admin($module_name) ? ' AND visible < 3' : '') . " \n\t\tORDER BY title"); while ($field = $db->sql_fetchrow($result)) { $f_title = defined($field['title']) ? constant($field['title']) : $field['title']; $f_title = $field['visible'] == 2 ? '* ' . $f_title : $f_title; if ($field['type'] == 1 || $field['type'] == 3) { $f_value = isset($in[$field['field']]) ? intval($in[$field['field']]) : $field['size']; $f_value = $f_value > 0 ? array(' checked="checked"', '') : array('', ' checked="checked"'); $cpgtpl->assign_block_vars('fields', array('TITLE' => $f_title, 'TYPE' => $field['type'], 'NAME' => $field['field'], 'S_YES' => $f_value[0], 'S_NO' => $f_value[1])); } else {
function BlocksEdit($bid) { global $prefix, $db, $MAIN_CFG, $pagetitle, $cpgtpl; $pagetitle .= ' ' . _BC_DELIM . ' ' . _EDITBLOCK; require 'header.php'; GraphicAdmin('_AMENU1'); list($title, $bkey, $content, $url, $bposition, $weight, $active, $refresh, $blanguage, $blockfile, $view) = $db->sql_ufetchrow("SELECT title, bkey, content, url, bposition, weight, active, refresh, blanguage, blockfile, view FROM " . $prefix . "_blocks WHERE bid='" . $bid . "'", SQL_NUM); $typebb = $typerss = $typefile = false; $blocks_edit_vars = array('S_NAME' => $title, 'S_BID' => $bid, 'S_WEIGHT' => $weight, 'S_NAME_DEF' => (defined($title) ? constant($title) : str_replace('_', ' ', $title)) . ":", 'U_BLOCKS' => URL::admin('blocks'), 'MULTILANG' => $MAIN_CFG['global']['multilingual'], 'BPOSITION' => $bposition, 'SEL_POSITION' => select_box('bposition', $bposition, array('l' => _LEFT, 'c' => _CENTERUP, 'd' => _CENTERDOWN, 'r' => _RIGHT)), 'SEL_ACTIVATE' => yesno_option('active', $active), 'SEL_GROUP' => group_selectbox('view', $view, true), 'S_VIEW_COMMENT' => 'Default ' . _ACTIVE); if ($MAIN_CFG['global']['multilingual']) { $blocks_edit_vars += array('SEL_LANG' => lang_selectbox($blanguage, 'blanguage')); } switch ($bkey) { case 'file': $typefile = true; $blocksdir = dir('blocks'); while ($func = $blocksdir->read()) { if (substr($func, 0, 6) == 'block-') { $bl = str_replace('_', ' ', substr($func, 6, -4)); $blockslist[$func] = $bl; } } closedir($blocksdir->handle); ksort($blockslist); $blocks_edit_vars += array('S_BLOCK_OP' => select_box('blockfile', $blockfile, $blockslist), 'S_BLOCK_INFO' => _FILEINCLUDE); break; case 'rss': $typerss = true; $blocks_edit_vars += array('S_BLOCK_OP' => $url, 'SEL_REFRESH' => select_box('refresh', $refresh, array('1800' => '1/2 ' . _HOUR, '3600' => '1 ' . _HOUR, '18000' => '5 ' . _HOURS, '36000' => '10 ' . _HOURS, '86400' => '24 ' . _HOURS))); break; case 'admin': case 'custom': $typebb = true; $blocks_edit_vars += array('S_BLOCK_OP' => bbcode_table('content', 'blocksedit', 1), 'S_BLOCK_INFO' => $content); break; default: break; } $blocks_list = blocks_list(); foreach ($blocks_list as $module => $data) { $cpgtpl->assign_block_vars($data['mid'] == -1 ? 'admin' : (is_active($module) ? 'active' : 'inactive'), array('S_MOD_VALUE' => $data['mid'], 'S_MOD_TITLE' => defined($data['title']) ? constant($data['title']) : $data['title'], 'S_MOD_SELECTED' => isset($data[$bid]) ? ' selected="selected"' : '')); } $blocks_edit_vars += array('TYPEFILE' => $typefile, 'TYPERSS' => $typerss, 'TYPEBB' => $typebb); $cpgtpl->assign_vars($blocks_edit_vars); $cpgtpl->set_handle('body', 'admin/blocks_edit.html'); $cpgtpl->display('body'); }
define('ADMIN_MOD_INSTALL', 1); include $inst_file; if (class_exists($title)) { $editmodule = new $title(); } } require 'header.php'; GraphicAdmin('_AMENU1'); OpenTable(); $a = $title == $MAIN_CFG['global']['main_module'] ? ' - (' . _INHOME . ')' : ''; echo open_form(URL::admin('modules'), '', $title . $a) . '<label class="ulog" for="custom_title">' . _CUSTOMTITLE . '</label> <input type="text" name="custom_title" id="custom_title" value="' . $custom_title . '" size="30" maxlength="255" /><br />'; if ($title == $MAIN_CFG['global']['main_module']) { echo '<input type="hidden" name="view" value="0" />'; } else { echo '<label class="ulog" for="view">' . _VIEWPRIV . '</label>' . group_selectbox('view', $view) . '<br />'; } echo '<label class="ulog" for="inmenu">' . _SHOWINMENU . '</label>' . yesno_option('inmenu', $inmenu) . '<br /> <label class="ulog" for="blocks">' . _BLOCKS . '</label>' . select_box('blocks', $blocks, array('0' => _NONE, '1' => _LEFT, '2' => _RIGHT, '3' => _BOTH)) . '<br /><br /> <input type="hidden" name="save" value="' . $mid . '" /> <input type="submit" value="' . _SAVECHANGES . '" />' . close_form(); if (isset($editmodule)) { if ($version != $editmodule->version) { $version .= ' <a href="' . URL::admin('&upgrade=' . $mid) . '">' . sprintf(_UPGRADE, $editmodule->version) . '</a>'; } $dbsize = 0; $backup = ''; if (isset($editmodule->dbtables) && !empty($editmodule->dbtables)) { if (0 === strpos(SQL_LAYER, 'mysql')) { if ($result = $db->sql_query("SHOW TABLE STATUS FROM {$dbname}", true)) { while ($table = $db->sql_fetchrow($result)) {