| 1 | <?php |
|---|
| 2 | /*********************************************************************** |
|---|
| 3 | |
|---|
| 4 | PunBB extension |
|---|
| 5 | Portal |
|---|
| 6 | Daris <daris91@gmail.com> |
|---|
| 7 | |
|---|
| 8 | ************************************************************************/ |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | // Make sure no one attempts to run this script "directly" |
|---|
| 12 | if (!defined('FORUM')) |
|---|
| 13 | exit; |
|---|
| 14 | |
|---|
| 15 | if (file_exists(FORUM_ROOT.'extensions/portal_by_daris/lang/'.$forum_user['language'].'/admin_portal.php')) |
|---|
| 16 | require FORUM_ROOT.'extensions/portal_by_daris/lang/'.$forum_user['language'].'/admin_portal.php'; |
|---|
| 17 | else |
|---|
| 18 | require FORUM_ROOT.'extensions/portal_by_daris/lang/English/admin_portal.php'; |
|---|
| 19 | |
|---|
| 20 | // Setup the form |
|---|
| 21 | $forum_page['part_count'] = $forum_page['fld_count'] = $forum_page['set_count'] = 0; |
|---|
| 22 | |
|---|
| 23 | // Setup breadcrumbs |
|---|
| 24 | $forum_page['crumbs'] = array( |
|---|
| 25 | array($forum_config['o_board_title'], forum_link($forum_url['index'])), |
|---|
| 26 | array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])), |
|---|
| 27 | array($lang_admin_common['Settings'], forum_link($forum_url['admin_settings_setup'])), |
|---|
| 28 | $lang_admin_portal['Portal'] |
|---|
| 29 | ); |
|---|
| 30 | |
|---|
| 31 | ($hook = get_hook('aop_portal_pre_header_load')) ? eval($hook) : null; |
|---|
| 32 | |
|---|
| 33 | define('FORUM_PAGE_SECTION', 'settings'); |
|---|
| 34 | define('FORUM_PAGE', 'admin-settings-portal'); |
|---|
| 35 | require FORUM_ROOT.'header.php'; |
|---|
| 36 | |
|---|
| 37 | ob_start(); |
|---|
| 38 | |
|---|
| 39 | // Reset counter |
|---|
| 40 | $forum_page['group_count'] = $forum_page['item_count'] = 0; |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | ?> |
|---|
| 44 | <div class="main-content main-frm"> |
|---|
| 45 | <div class="content-head"> |
|---|
| 46 | <h2 class="hn"><span><?php echo $lang_admin_portal['Index page head'] ?></span></h2> |
|---|
| 47 | </div> |
|---|
| 48 | <form class="frm-form" method="post" accept-charset="utf-8" action="<?php echo forum_link($forum_url['admin_settings_portal']) ?>"> |
|---|
| 49 | <div class="hidden"> |
|---|
| 50 | <input type="hidden" name="csrf_token" value="<?php echo generate_form_token(forum_link($forum_url['admin_settings_portal'])) ?>" /> |
|---|
| 51 | <input type="hidden" name="form_sent" value="1" /> |
|---|
| 52 | </div> |
|---|
| 53 | <?php ($hook = get_hook('aop_maintenance_pre_maintenance_fieldset')) ? eval($hook) : null; ?> |
|---|
| 54 | <fieldset class="frm-group group<?php echo ++$forum_page['group_count'] ?>"> |
|---|
| 55 | <legend class="group-legend"><strong><?php echo $lang_admin_portal['Forums for news legend'] ?></strong></legend> |
|---|
| 56 | <?php ($hook = get_hook('aop_maintenance_pre_maintenance_checkbox')) ? eval($hook) : null; ?> |
|---|
| 57 | <div class="txt-set set<?php echo ++$forum_page['item_count'] ?>"> |
|---|
| 58 | <div class="txt-box textarea"> |
|---|
| 59 | <label for="fld<?php echo $forum_page['fld_count']+1 ?>"><span><?php echo $lang_admin_portal['Forums for news label'] ?></span></label> |
|---|
| 60 | <div class="txt-input"> |
|---|
| 61 | <div class="checklist"> |
|---|
| 62 | <?php |
|---|
| 63 | |
|---|
| 64 | $forums_for_news = explode(',', $forum_config['o_portal_news_forums']); |
|---|
| 65 | |
|---|
| 66 | // Get the list of categories and forums |
|---|
| 67 | $query = array( |
|---|
| 68 | 'SELECT' => 'c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url', |
|---|
| 69 | 'FROM' => 'categories AS c', |
|---|
| 70 | 'JOINS' => array( |
|---|
| 71 | array( |
|---|
| 72 | 'INNER JOIN' => 'forums AS f', |
|---|
| 73 | 'ON' => 'c.id=f.cat_id' |
|---|
| 74 | ), |
|---|
| 75 | array( |
|---|
| 76 | 'LEFT JOIN' => 'forum_perms AS fp', |
|---|
| 77 | 'ON' => '(fp.forum_id=f.id AND fp.group_id='.$forum_user['g_id'].')' |
|---|
| 78 | ) |
|---|
| 79 | ), |
|---|
| 80 | 'WHERE' => '(fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL', |
|---|
| 81 | 'ORDER BY' => 'c.disp_position, c.id, f.disp_position' |
|---|
| 82 | ); |
|---|
| 83 | |
|---|
| 84 | ($hook = get_hook('se_qr_get_cats_and_forums')) ? eval($hook) : null; |
|---|
| 85 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); |
|---|
| 86 | |
|---|
| 87 | $cur_category = 0; |
|---|
| 88 | while ($cur_forum = $forum_db->fetch_assoc($result)) |
|---|
| 89 | { |
|---|
| 90 | ($hook = get_hook('se_forum_loop_start')) ? eval($hook) : null; |
|---|
| 91 | |
|---|
| 92 | if ($cur_forum['cid'] != $cur_category) // A new category since last iteration? |
|---|
| 93 | { |
|---|
| 94 | if ($cur_category) |
|---|
| 95 | echo "\t\t\t\t\t\t\t".'</fieldset>'."\n"; |
|---|
| 96 | |
|---|
| 97 | echo "\t\t\t\t\t\t\t".'<fieldset>'."\n\t\t\t\t\t\t\t\t".'<legend><span>'.forum_htmlencode($cur_forum['cat_name']).':</span></legend>'."\n"; |
|---|
| 98 | $cur_category = $cur_forum['cid']; |
|---|
| 99 | } |
|---|
| 100 | |
|---|
| 101 | echo "\t\t\t\t\t\t\t\t".'<div class="checklist-item"><span class="fld-input"><input type="checkbox" id="fld'.(++$forum_page['fld_count']).'" name="form[portal_news_forums][]" value="'.$cur_forum['fid'].'"'.(in_array($cur_forum['fid'], $forums_for_news) ? ' checked="checked"' : '').'/></span> <label for="fld'.$forum_page['fld_count'].'">'.forum_htmlencode($cur_forum['forum_name']).'</label></div>'."\n"; |
|---|
| 102 | } |
|---|
| 103 | |
|---|
| 104 | ?> |
|---|
| 105 | </fieldset> |
|---|
| 106 | </div> |
|---|
| 107 | </div> |
|---|
| 108 | </div> |
|---|
| 109 | </div> |
|---|
| 110 | <? ($hook = get_hook('aop_maintenance_pre_maintenance_fieldset')) ? eval($hook) : null; ?> |
|---|
| 111 | <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
|---|
| 112 | <div class="sf-box text"> |
|---|
| 113 | <label for="fld<?php echo ++$forum_page['fld_count'] ?>"> |
|---|
| 114 | <span><?php echo $lang_admin_portal['News count label'] ?></span> |
|---|
| 115 | </label><br /> |
|---|
| 116 | <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[portal_news_count]" size="5" maxlength="5" value="<?php echo forum_htmlencode($forum_config['o_portal_news_count']) ?>" /></span> |
|---|
| 117 | </div> |
|---|
| 118 | </div> |
|---|
| 119 | <?php ($hook = get_hook('aop_maintenance_pre_maintenance_fieldset')) ? eval($hook) : null; ?> |
|---|
| 120 | <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
|---|
| 121 | <div class="sf-box text"> |
|---|
| 122 | <label for="fld<?php echo ++$forum_page['fld_count'] ?>"> |
|---|
| 123 | <span><?php echo $lang_admin_portal['News description length'] ?></span> |
|---|
| 124 | </label><br /> |
|---|
| 125 | <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[portal_news_description_length]" size="5" maxlength="5" value="<?php echo forum_htmlencode($forum_config['o_portal_news_description_length']) ?>" /></span> |
|---|
| 126 | </div> |
|---|
| 127 | </div> |
|---|
| 128 | <?php ($hook = get_hook('aop_maintenance_pre_maintenance_fieldset_end')) ? eval($hook) : null; ?> |
|---|
| 129 | </fieldset> |
|---|
| 130 | <?php |
|---|
| 131 | |
|---|
| 132 | ($hook = get_hook('aop_features_sig_fieldset_end')) ? eval($hook) : null; |
|---|
| 133 | |
|---|
| 134 | // Reset counter |
|---|
| 135 | $forum_page['group_count'] = $forum_page['item_count'] = 0; |
|---|
| 136 | |
|---|
| 137 | ?> |
|---|
| 138 | <div class="content-head"> |
|---|
| 139 | <h2 class="hn"><span><?php echo $lang_admin_portal['Size head'] ?></span></h2> |
|---|
| 140 | </div> |
|---|
| 141 | |
|---|
| 142 | <fieldset class="frm-group group<?php echo ++$forum_page['group_count'] ?>"> |
|---|
| 143 | <legend class="group-legend"><strong><?php echo $lang_admin_portal['Size legend'] ?></strong></legend> |
|---|
| 144 | <?php ($hook = get_hook('aop_maintenance_pre_maintenance_fieldset')) ? eval($hook) : null; ?> |
|---|
| 145 | <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
|---|
| 146 | <div class="sf-box text"> |
|---|
| 147 | <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_portal['Left side width'] ?></span><small><?php echo $lang_admin_portal['Left side width help'] ?></small></label><br /> |
|---|
| 148 | <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[portal_left_width]" size="3" maxlength="3" value="<?php echo $forum_config['o_portal_left_width'] ?>" /></span> |
|---|
| 149 | </div> |
|---|
| 150 | </div> |
|---|
| 151 | <?php ($hook = get_hook('aop_maintenance_pre_maintenance_fieldset')) ? eval($hook) : null; ?> |
|---|
| 152 | <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
|---|
| 153 | <div class="sf-box text"> |
|---|
| 154 | <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_portal['Right side width'] ?></span><small><?php echo $lang_admin_portal['Right side width help'] ?></small></label><br /> |
|---|
| 155 | <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[portal_right_width]" size="3" maxlength="3" value="<?php echo $forum_config['o_portal_right_width'] ?>" /></span> |
|---|
| 156 | </div> |
|---|
| 157 | </div> |
|---|
| 158 | <?php ($hook = get_hook('aop_maintenance_pre_maintenance_fieldset_end')) ? eval($hook) : null; ?> |
|---|
| 159 | </fieldset> |
|---|
| 160 | <?php |
|---|
| 161 | |
|---|
| 162 | |
|---|
| 163 | ($hook = get_hook('aop_features_sig_fieldset_end')) ? eval($hook) : null; |
|---|
| 164 | |
|---|
| 165 | // Reset counter |
|---|
| 166 | $forum_page['group_count'] = $forum_page['item_count'] = 0; |
|---|
| 167 | |
|---|
| 168 | ?> |
|---|
| 169 | <div class="content-head"> |
|---|
| 170 | <h2 class="hn"><span><?php echo $lang_admin_portal['Advanced settings head'] ?></span></h2> |
|---|
| 171 | </div> |
|---|
| 172 | |
|---|
| 173 | <fieldset class="frm-group group<?php echo ++$forum_page['group_count'] ?>"> |
|---|
| 174 | <legend class="group-legend"><strong><?php echo $lang_admin_portal['Advanced settings legend'] ?></strong></legend> |
|---|
| 175 | <?php ($hook = get_hook('aop_maintenance_pre_maintenance_fieldset')) ? eval($hook) : null; ?> |
|---|
| 176 | <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
|---|
| 177 | <div class="sf-box checkbox"> |
|---|
| 178 | <span class="fld-input"><input type="checkbox" id="fld<?php echo ++$forum_page['fld_count'] ?>" name="form[portal_panels_all_pages]" value="1"<?php if ($forum_config['o_portal_panels_all_pages'] == '1') echo ' checked="checked"' ?> /></span> |
|---|
| 179 | <label for="fld<?php echo $forum_page['fld_count'] ?>"><span><?php echo $lang_admin_portal['Panels on all pages'] ?></span> <?php echo $lang_admin_portal['Panels on all pages info'] ?></label> |
|---|
| 180 | </div> |
|---|
| 181 | </div> |
|---|
| 182 | <?php ($hook = get_hook('aop_maintenance_pre_maintenance_fieldset_end')) ? eval($hook) : null; ?> |
|---|
| 183 | </fieldset> |
|---|
| 184 | |
|---|
| 185 | <?php ($hook = get_hook('aop_maintenance_maintenance_fieldset_end')) ? eval($hook) : null; ?> |
|---|
| 186 | <div class="frm-buttons"> |
|---|
| 187 | <span class="submit"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" /></span> |
|---|
| 188 | </div> |
|---|
| 189 | </form> |
|---|
| 190 | </div> |
|---|
| 191 | <?php |
|---|
| 192 | |
|---|