Changeset 5 for branches/portal_by_daris/admin
- Timestamp:
- 02/07/09 08:33:30 (3 years ago)
- Location:
- branches/portal_by_daris/admin
- Files:
-
- 3 modified
-
pages.php (modified) (1 diff)
-
panels.php (modified) (22 diffs)
-
portal.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/portal_by_daris/admin/pages.php
r4 r5 1 1 <?php 2 /** 3 * Forum management page 4 * 5 * Allows administrators to add, modify, and remove forums. 6 * 7 * @copyright Copyright (C) 2008 FluxBB.org, based on code copyright (C) 2002-2008 PunBB.org 8 * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher 9 * @package FluxBB 10 */ 2 /*********************************************************************** 3 4 PunBB extension 5 Portal 6 Daris <daris91@gmail.com> 7 8 ************************************************************************/ 11 9 12 10 -
branches/portal_by_daris/admin/panels.php
r2 r5 1 1 <?php 2 /** 3 * Forum management page. 4 * 5 * Allows administrators to add, modify, and remove forums. 6 * 7 * @copyright Copyright (C) 2008 PunBB, partially based on code copyright (C) 2008 FluxBB.org 8 * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher 9 * @package PunBB 10 */ 2 /*********************************************************************** 3 4 PunBB extension 5 Portal 6 Daris <daris91@gmail.com> 7 8 ************************************************************************/ 11 9 12 10 13 11 if (!defined('FORUM_ROOT')) 14 define('FORUM_ROOT', '../../../ /');12 define('FORUM_ROOT', '../../../'); 15 13 require FORUM_ROOT.'include/common.php'; 16 14 require FORUM_ROOT.'include/common_admin.php'; … … 33 31 require PORTAL_ROOT.'include/functions.php'; 34 32 35 $ side_names = array(33 $location_names = array( 36 34 0 => 'Left side', 37 35 1 => 'Center top', … … 43 41 if (isset($_POST['add_panel'])) 44 42 { 45 $panel_ title = forum_trim($_POST['title']);46 $ side = intval($_POST['side']);43 $panel_name = forum_trim($_POST['name']); 44 $location = intval($_POST['location']); 47 45 $file = $_POST['file']; 48 46 $position = intval($_POST['position']); … … 50 48 ($hook = get_hook('afo_add_forum_form_submitted')) ? eval($hook) : null; 51 49 52 if ($panel_ title == '')50 if ($panel_name == '') 53 51 message($lang_admin_panels['Must enter forum message']); 54 52 55 53 $query = array( 56 'INSERT' => ' title, side, file, position',54 'INSERT' => 'name, location, file, position', 57 55 'INTO' => 'panels', 58 'VALUES' => '\''.$forum_db->escape($panel_ title).'\', '.$side.', \''.$forum_db->escape($file).'\', '.$position56 'VALUES' => '\''.$forum_db->escape($panel_name).'\', '.$location.', \''.$forum_db->escape($file).'\', '.$position 59 57 ); 60 58 … … 112 110 { 113 111 $query = array( 114 'SELECT' => 'pn. title',112 'SELECT' => 'pn.name', 115 113 'FROM' => 'panels AS pn', 116 114 'WHERE' => 'pn.id='.$panel_to_delete … … 122 120 message($lang_common['Bad request']); 123 121 124 $panel_ title = $forum_db->result($result);122 $panel_name = $forum_db->result($result); 125 123 126 124 … … 130 128 array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])), 131 129 array($lang_admin_common['Start'], forum_link($forum_url['admin_index'])), 132 array($lang_admin_ common['Forums'], forum_link($forum_url['admin_panels'])),130 array($lang_admin_panels['Panels'], forum_link($forum_url['admin_panels'])), 133 131 $lang_admin_panels['Delete panel'] 134 132 ); … … 147 145 ?> 148 146 <div class="main-subhead"> 149 <h2 class="hn"><span><?php printf($lang_admin_panels['Confirm delete panel'], forum_htmlencode($panel_ title)) ?></span></h2>147 <h2 class="hn"><span><?php printf($lang_admin_panels['Confirm delete panel'], forum_htmlencode($panel_name)) ?></span></h2> 150 148 </div> 151 149 <div class="main-content main-frm"> … … 242 240 ($hook = get_hook('xn_portal_by_daris_apn_save_panel_form_submitted')) ? eval($hook) : null; 243 241 244 $ title = trim($_POST['title']);242 $name = trim($_POST['name']); 245 243 $content = forum_linebreaks(trim($_POST['content'])); 246 $ side = intval($_POST['side']);244 $location = intval($_POST['location']); 247 245 $file = trim($_POST['file']); 248 246 … … 253 251 $query = array( 254 252 'UPDATE' => 'panels', 255 'SET' => ' title=\''.$forum_db->escape($title).'\', content=\''.$forum_db->escape($content).'\', file=\''.$forum_db->escape($file).'\', side='.$side,253 'SET' => 'name=\''.$forum_db->escape($name).'\', content=\''.$forum_db->escape($content).'\', file=\''.$forum_db->escape($file).'\', location='.$location, 256 254 'WHERE' => 'id='.$panel_id 257 255 ); … … 269 267 // Fetch panel info 270 268 $query = array( 271 'SELECT' => 'pn.id, pn. title, pn.content, pn.file, pn.side',269 'SELECT' => 'pn.id, pn.name, pn.content, pn.file, pn.location', 272 270 'FROM' => 'panels AS pn', 273 271 'WHERE' => 'pn.id='.$panel_id … … 306 304 ?> 307 305 <div class="main-subhead"> 308 <h2 class="hn"><span><?php printf($lang_admin_panels['Edit panel head'], forum_htmlencode($cur_panel[' title'])) ?></span></h2>306 <h2 class="hn"><span><?php printf($lang_admin_panels['Edit panel head'], forum_htmlencode($cur_panel['name'])) ?></span></h2> 309 307 </div> 310 308 <div class="main-content main-frm"> … … 322 320 <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> 323 321 <div class="sf-box text"> 324 <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel name'] ?></span> </label><br />325 <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name=" title" size="35" value="<?php echo forum_htmlencode($cur_panel['title']) ?>" /></span>322 <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel name'] ?></span> <small><?php echo $lang_admin_panels['Panel name help'] ?></small></label><br /> 323 <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="name" size="50" value="<?php echo forum_htmlencode($cur_panel['name']) ?>" /></span> 326 324 </div> 327 325 </div> … … 338 336 <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> 339 337 <div class="sf-box select"> 340 <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel side'] ?></span></label><br />341 <span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name=" side">342 <?php 343 foreach ($ side_names as $side=> $name)344 echo '<option value="'.$ side.'"'.($cur_panel['side'] == $side? ' selected="selected"' : '').'>'.$lang_admin_panels[$name].'</option>';338 <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel location'] ?></span></label><br /> 339 <span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name="location"> 340 <?php 341 foreach ($location_names as $location => $name) 342 echo '<option value="'.$location.'"'.($cur_panel['location'] == $location ? ' selected="selected"' : '').'>'.$lang_admin_panels[$name].'</option>'; 345 343 ?> 346 344 </select></span> … … 382 380 array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])), 383 381 array($lang_admin_common['Start'], forum_link($forum_url['admin_index'])), 384 array($lang_admin_ common['Forums'], forum_link($forum_url['admin_panels']))382 array($lang_admin_panels['Panels'], forum_link($forum_url['admin_panels'])) 385 383 ); 386 384 … … 412 410 <div class="sf-box text"> 413 411 <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel name'] ?></span></label><br /> 414 <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name=" title" size="35" maxlength="80" /></span>412 <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="name" size="50" /></span> 415 413 </div> 416 414 </div> … … 418 416 <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> 419 417 <div class="sf-box select"> 420 <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel side'] ?></span></label><br />421 <span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name=" side">422 <?php 423 foreach ($ side_names as $side=> $name)424 echo '<option value="'.$ side.'">'.$lang_admin_panels[$name].'</option>';418 <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel location'] ?></span></label><br /> 419 <span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name="location"> 420 <?php 421 foreach ($location_names as $location => $name) 422 echo '<option value="'.$location.'">'.$lang_admin_panels[$name].'</option>'; 425 423 ?> 426 424 </select></span> … … 449 447 // Display all the panels 450 448 $query = array( 451 'SELECT' => 'pn.id, pn. title, pn.content, pn.position, pn.side, pn.enable, pn.file',449 'SELECT' => 'pn.id, pn.name, pn.content, pn.position, pn.location, pn.enable, pn.file', 452 450 'FROM' => 'panels AS pn', 453 'ORDER BY' => 'pn. side, pn.position'451 'ORDER BY' => 'pn.location, pn.position' 454 452 ); 455 453 … … 481 479 { 482 480 483 if ($cur_panel[' side'] != $cur_category) // A new category since last iteration?481 if ($cur_panel['location'] != $cur_category) // A new category since last iteration? 484 482 { 485 483 if ($i > 2) echo "\t\t\t".'</div>'."\n"; … … 488 486 ?> 489 487 <div class="content-head"> 490 <h3 class="hn"><span><?php printf($lang_admin_panels['Panels for'], $lang_admin_panels[$ side_names[$cur_panel['side']]]) ?></span></h3>488 <h3 class="hn"><span><?php printf($lang_admin_panels['Panels for'], $lang_admin_panels[$location_names[$cur_panel['location']]]) ?></span></h3> 491 489 </div> 492 490 <div class="frm-group frm-hdgroup group<?php echo ++$forum_page['group_count'] ?>"> … … 494 492 <?php 495 493 496 $cur_category = $cur_panel[' side'];494 $cur_category = $cur_panel['location']; 497 495 } 498 496 … … 506 504 <div class="mf-field mf-field1 forum-field"> 507 505 <span class="aslabel"><?php echo $lang_admin_panels['Panel name'] ?></span> 508 <span class="fld-input"><?php echo forum_htmlencode($cur_panel[' title']) ?></span>506 <span class="fld-input"><?php echo forum_htmlencode($cur_panel['name']) ?></span> 509 507 </div> 510 508 <?php ($hook = get_hook('afo_pre_edit_cur_forum_position')) ? eval($hook) : null; ?> -
branches/portal_by_daris/admin/portal.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com>