Changeset 5 for branches/portal_by_daris
- Timestamp:
- 02/07/09 08:33:30 (3 years ago)
- Location:
- branches/portal_by_daris
- Files:
-
- 2 added
- 22 modified
-
admin/pages.php (modified) (1 diff)
-
admin/panels.php (modified) (22 diffs)
-
admin/portal.php (modified) (1 diff)
-
include/cache.php (modified) (3 diffs)
-
include/functions.php (added)
-
include/rewrite_rules.php (modified) (1 diff)
-
include/url/Default.php (modified) (1 diff)
-
include/url/File_based.php (modified) (1 diff)
-
include/url/File_based_(fancy).php (modified) (1 diff)
-
include/url/Folder_based.php (modified) (1 diff)
-
include/url/Folder_based_(fancy).php (modified) (1 diff)
-
index.php (modified) (1 diff)
-
install.php (modified) (2 diffs)
-
lang/English/admin_pages.php (modified) (2 diffs)
-
lang/English/admin_panels.php (added)
-
page.php (modified) (1 diff)
-
panels.php (modified) (4 diffs)
-
panels/active_topics.php (modified) (2 diffs)
-
panels/example.php (modified) (2 diffs)
-
panels/menu.php (modified) (1 diff)
-
panels/pages.php (modified) (1 diff)
-
panels/recent_posts.php (modified) (1 diff)
-
panels/top_posters.php (modified) (1 diff)
-
panels/who_is_online.php (modified) (2 diffs)
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> -
branches/portal_by_daris/include/cache.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> … … 22 22 'FROM' => 'panels AS pn', 23 23 'WHERE' => 'pn.enable=1', 24 'ORDER BY' => 'pn. side, pn.position'24 'ORDER BY' => 'pn.location, pn.position' 25 25 ); 26 26 … … 31 31 while ($cur_panel = $forum_db->fetch_assoc($result)) 32 32 { 33 if (!isset($output[$cur_panel[' side']]))34 $output[$cur_panel[' side']] = array();33 if (!isset($output[$cur_panel['location']])) 34 $output[$cur_panel['location']] = array(); 35 35 36 $output[$cur_panel[' side']][] = array(37 ' title' => $cur_panel['title'],36 $output[$cur_panel['location']][] = array( 37 'name' => $cur_panel['name'], 38 38 'position' => $cur_panel['position'], 39 39 'content' => $cur_panel['content'], -
branches/portal_by_daris/include/rewrite_rules.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> -
branches/portal_by_daris/include/url/Default.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> -
branches/portal_by_daris/include/url/File_based.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> -
branches/portal_by_daris/include/url/File_based_(fancy).php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> -
branches/portal_by_daris/include/url/Folder_based.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> -
branches/portal_by_daris/include/url/Folder_based_(fancy).php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> -
branches/portal_by_daris/index.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> -
branches/portal_by_daris/install.php
r4 r5 63 63 'default' => 0 64 64 ), 65 ' title' => array(65 'name' => array( 66 66 'datatype' => 'VARCHAR(255)', 67 67 'allow_null' => true … … 75 75 'allow_null' => true 76 76 ), 77 ' side' => array(77 'location' => array( 78 78 'datatype' => 'INT(10) UNSIGNED', 79 79 'allow_null' => true, -
branches/portal_by_daris/lang/English/admin_pages.php
r4 r5 8 8 'Edit' => 'Edit', 9 9 'Delete' => 'Delete', 10 'Page name' => 'Page name:',10 'Page name' => 'Page name:', 11 11 'Delete page' => 'Delete page', 12 'Delete page warning' => ' <strong>WARNING!</strong> Deleting a page will delete all posts (if any) in that page!',13 'Edit page' => 'Edit page',12 'Delete page warning' => 'Are you sure you want to delete this page?', 13 'Edit page' => 'Edit page', 14 14 'Edit page details legend' => 'Page details:', 15 'Category assignment' => 'Assign to category:',16 'Pages in category' => 'Pages in category: %s',17 'Edit page perms legend' => 'Page group permissions (non default permissions are suffixed "(S)":',18 'Position label' => 'Position:',19 15 'Add to category label' => 'Add to category:', 20 16 'Page content' => 'Page content:', … … 24 20 'Confirm delete page' => 'You are deleting the page "%s"', 25 21 'Add page' => 'Add page', 26 'Add page head' => 'Add a new page',22 'Add page head' => 'Add a new page', 27 23 'Add page legend' => 'Add page:', 28 24 'Page added' => 'Page added.', 29 25 'Page deleted' => 'Page deleted.', 30 'Pages updated' => 'Pages updated.',31 26 'Page updated' => 'Page updated.', 32 27 'Must enter page message' => 'You must enter a page name.', -
branches/portal_by_daris/page.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> -
branches/portal_by_daris/panels.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> … … 25 25 ); 26 26 27 foreach ($forum_panels as $ side=> $panels)27 foreach ($forum_panels as $location => $panels) 28 28 { 29 foreach ($panels as $ panel)29 foreach ($panels as $cur_panel) 30 30 { 31 31 ob_start(); 32 32 33 $content_class = 'panel-content'; 33 // default class for content element, panels can change it 34 $cur_panel['class'] = 'panel-content'; 34 35 35 $file = FORUM_ROOT.'extensions/'.$ panel['file'];36 $file = FORUM_ROOT.'extensions/'.$cur_panel['file']; 36 37 37 38 // if panel file exists require it 38 if ($ panel['file'] != '' && file_exists($file) && is_file($file))39 if ($cur_panel['file'] != '' && file_exists($file) && is_file($file)) 39 40 require_once $file; 40 41 41 42 // else evaluate panel content 42 43 else 43 eval('?>'.$ panel['content']);44 eval('?>'.$cur_panel['content']); 44 45 45 46 46 $c ontent= ob_get_contents();47 $cur_panel['content'] = ob_get_contents(); 47 48 ob_end_clean(); 48 49 49 if ( $content == '')50 if (!$cur_panel['content']) 50 51 continue; 51 52 … … 54 55 55 56 <div class="main-head"> 56 <h2 class="hn"><span><?php echo $ panel['title'] ?></span></h2>57 <h2 class="hn"><span><?php echo $cur_panel['name'] ?></span></h2> 57 58 </div> 58 59 59 <div class="main-content <?php echo $c ontent_class?>">60 <?php echo $c ontent?>60 <div class="main-content <?php echo $cur_panel['class'] ?>"> 61 <?php echo $cur_panel['content'] ?> 61 62 62 63 </div> … … 66 67 67 68 // insert panel html to specified side 68 $panels_output[$ side][] = ob_get_contents();69 $panels_output[$location][] = ob_get_contents(); 69 70 70 71 ob_end_clean(); -
branches/portal_by_daris/panels/active_topics.php
r2 r5 1 1 <?php 2 /** 3 * Lists the topics in the specified forum. 4 * 5 * @copyright Copyright (C) 2008 PunBB, partially based on code copyright (C) 2008 FluxBB.org 6 * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher 7 * @package PunBB 8 */2 /*********************************************************************** 3 4 PunBB extension 5 Portal 6 Daris <daris91@gmail.com> 7 8 ************************************************************************/ 9 9 10 10 … … 14 14 15 15 $count = 5; // active topics count 16 $c ontent_class= 'forum';16 $cur_panel['class'] = 'forum'; 17 17 18 18 // Load the viewforum.php language file -
branches/portal_by_daris/panels/example.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> … … 13 13 exit; 14 14 15 $ panel['title'] = 'Example panel'; // title for panel (if it isn't set, will be used panel name15 $cur_panel['title'] = 'Example panel'; // title for panel (if it isn't set, will be used panel name) 16 16 17 17 echo 'This is an example panel'; -
branches/portal_by_daris/panels/menu.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> -
branches/portal_by_daris/panels/pages.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> -
branches/portal_by_daris/panels/recent_posts.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> -
branches/portal_by_daris/panels/top_posters.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> -
branches/portal_by_daris/panels/who_is_online.php
r2 r5 2 2 /*********************************************************************** 3 3 4 FluxBB extension4 PunBB extension 5 5 Portal 6 6 Daris <daris91@gmail.com> … … 104 104 else 105 105 { 106 $ panel['title'] = $lang_common['Login'];106 $cur_panel['title'] = $lang_common['Login']; 107 107 108 108 require_once FORUM_ROOT.'lang/'.$forum_user['language'].'/login.php';