FluxBB.org

Changeset 566

Show
Ignore:
Timestamp:
08/31/08 12:15:42 (4 months ago)
Author:
Ben
Message:

Adding InnoDB support for MySQL and MySQLi.
The db_update.php needs to be looked at, since the database version number has to be boosted to do the conversion currently.

Location:
fluxbb/branches/fluxbb-1.3-dev/upload
Files:
2 added
21 modified

Legend:

Unmodified
Added
Removed
  • fluxbb/branches/fluxbb-1.3-dev/upload/admin/db_update.php

    r544 r566  
    9090 
    9191// If MySQL, make sure it's at least 4.1.2 
    92 if ($db_type == 'mysql' || $db_type == 'mysqli') 
     92if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
    9393{ 
    9494        $result = $forum_db->query('SELECT VERSION()') or error(__FILE__, __LINE__); 
     
    474474        case 'start': 
    475475                // Put back dropped search tables 
    476                 if (!$forum_db->table_exists('search_cache') && ($db_type == 'mysql' || $db_type == 'mysqli')) 
     476                if (!$forum_db->table_exists('search_cache') && ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')) 
    477477                { 
    478478                        $schema = array( 
     
    606606 
    607607                // Make sure the collation on "word" in the search_words table is utf8_bin 
    608                 if ($db_type == 'mysql' || $db_type == 'mysqli') 
     608                if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
    609609                { 
    610610                        $result = $forum_db->query('SHOW FULL COLUMNS FROM '.$forum_db->prefix.'search_words') or error(__FILE__, __LINE__); 
     
    672672                $forum_db->add_field('extension_hooks', 'priority', 'TINYINT(1)', false, 5, 'installed'); 
    673673 
    674                 if ($db_type == 'mysql' || $db_type == 'mysqli') 
     674                if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
    675675                { 
    676676                        // Make all e-mail fields VARCHAR(80) 
     
    696696                        case 'mysql': 
    697697                        case 'mysqli': 
     698                        case 'mysql_innodb': 
     699                        case 'mysqli_innodb': 
    698700                                $forum_db->query('ALTER TABLE '.$forum_db->prefix.'posts CHANGE poster_ip poster_ip VARCHAR(39)') or error(__FILE__, __LINE__); 
    699701                                $forum_db->query('ALTER TABLE '.$forum_db->prefix.'users CHANGE registration_ip registration_ip VARCHAR(39) NOT NULL DEFAULT \'0.0.0.0\'') or error(__FILE__, __LINE__); 
     
    867869                                case 'mysql': 
    868870                                case 'mysqli': 
     871                                case 'mysql_innodb': 
     872                                case 'mysqli_innodb': 
    869873                                        $forum_db->add_index('online', 'user_id_ident_idx', array('user_id', 'ident(25)'), true); 
    870874                                        break; 
     
    884888                        case 'mysql': 
    885889                        case 'mysqli': 
     890                        case 'mysql_innodb': 
     891                        case 'mysqli_innodb': 
    886892                                $forum_db->add_index('online', 'ident_idx', array('ident(25)')); 
    887893                                break; 
     
    953959                        $forum_db->query('DELETE FROM '.$forum_db->prefix.'extension_hooks WHERE extension_id = \''.$cur_ext['id'].'\'') or error(__FILE__, __LINE__); 
    954960                        $forum_db->query('DELETE FROM '.$forum_db->prefix.'extensions WHERE id = \''.$cur_ext['id'].'\'') or error(__FILE__, __LINE__); 
     961                } 
     962 
     963                // If the tables aren't already InnoDB, make it so 
     964                // This should only occur if config.php is manually changed to use InnoDB 
     965                if ($db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
     966                { 
     967                        $result = $forum_db->query('SHOW TABLE STATUS FROM `'.$db_name.'` LIKE \''.$db_prefix.'%\''); 
     968                        while ($row = $forum_db->fetch_assoc($result)) 
     969                                if($row['Engine'] != 'InnoDB') 
     970                                        $forum_db->query('ALTER TABLE '.$row['Name'].' ENGINE = \'InnoDB\''); 
    955971                } 
    956972 
     
    12361252        case 'conv_tables': 
    12371253                // Do the cumbersome charset conversion of MySQL tables/columns 
    1238                 if ($db_type == 'mysql' || $db_type == 'mysqli') 
     1254                if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
    12391255                { 
    12401256                        echo 'Converting table '.$forum_db->prefix.'bans 
<br />'."\n"; flush(); 
  • fluxbb/branches/fluxbb-1.3-dev/upload/admin/index.php

    r563 r566  
    117117 
    118118// Collect some additional info about MySQL 
    119 if ($db_type == 'mysql' || $db_type == 'mysqli') 
     119if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
    120120{ 
    121121        $db_version = 'MySQL '.$db_version; 
  • fluxbb/branches/fluxbb-1.3-dev/upload/admin/install.php

    r543 r566  
    8282        $dual_mysql = false; 
    8383        $db_extensions = array(); 
     84        $mysql_innodb = false; 
    8485        if (function_exists('mysqli_connect')) 
     86        { 
    8587                $db_extensions[] = array('mysqli', 'MySQL Improved'); 
     88                $db_extensions[] = array('mysqli_innodb', 'MySQL Improved (InnoDB)'); 
     89                $mysql_innodb = true; 
     90        } 
    8691        if (function_exists('mysql_connect')) 
    8792        { 
    8893                $db_extensions[] = array('mysql', 'MySQL Standard'); 
    89  
    90                 if (count($db_extensions) > 1) 
     94                $db_extensions[] = array('mysql_innodb', 'MySQL Standard (InnoDB)'); 
     95                $mysql_innodb = true; 
     96 
     97                if (count($db_extensions) > 2) 
    9198                        $dual_mysql = true; 
    9299        } 
     
    143150                        <p><?php echo $lang_install['Part1 intro'] ?></p> 
    144151                        <ul class="spaced"> 
    145                                 <li><span><strong><?php echo $lang_install['Database type'] ?></strong> <?php echo $lang_install['Database type info'] ?><?php if ($dual_mysql) echo ' '.$lang_install['Mysql type info'] ?></span></li> 
     152                                <li><span><strong><?php echo $lang_install['Database type'] ?></strong> <?php echo $lang_install['Database type info']; if ($dual_mysql) echo ' '.$lang_install['Mysql type info']; if ($mysql_innodb) echo ' '.$lang_install['MySQL InnoDB info'] ?></span></li> 
    146153                                <li><span><strong><?php echo $lang_install['Database server'] ?></strong> <?php echo $lang_install['Database server info'] ?></span></li> 
    147154                                <li><span><strong><?php echo $lang_install['Database name'] ?></strong> <?php echo $lang_install['Database name info'] ?></span></li> 
     
    361368                        break; 
    362369 
     370                case 'mysql_innodb': 
     371                        require FORUM_ROOT.'include/dblayer/mysql_innodb.php'; 
     372                        break; 
     373 
     374                case 'mysqli_innodb': 
     375                        require FORUM_ROOT.'include/dblayer/mysqli_innodb.php'; 
     376                        break; 
     377 
    363378                case 'pgsql': 
    364379                        require FORUM_ROOT.'include/dblayer/pgsql.php'; 
     
    378393 
    379394        // If MySQL, make sure it's at least 4.1.2 
    380         if ($db_type == 'mysql' || $db_type == 'mysqli') 
     395        if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
    381396        { 
    382397                $result = $forum_db->query('SELECT VERSION()') or error(__FILE__, __LINE__); 
     
    400415                error(sprintf($lang_install['FluxBB already installed'], $db_prefix, $db_name)); 
    401416 
     417        // Check if InnoDB is available 
     418        if ($db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
     419        { 
     420                $result = $forum_db->query('SHOW VARIABLES LIKE \'have_innodb\''); 
     421                if((strtoupper($forum_db->result($result)) != 'YES')) 
     422                        error($lang_install['InnoDB not enabled']); 
     423        } 
    402424 
    403425        // Start a transaction 
     
    852874        ); 
    853875 
    854         if ($db_type == 'mysql' || $db_type == 'mysqli') 
     876        if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
    855877        { 
    856878                $schema['UNIQUE KEYS']['user_id_ident_idx'] = array('user_id', 'ident(25)'); 
    857879                $schema['INDEXES']['ident_idx'] = array('ident(25)'); 
    858880        } 
     881 
     882        if ($db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
     883                $schema['ENGINE'] = 'InnoDB'; 
    859884 
    860885        $forum_db->create_table('online', $schema); 
     
    10221047        ); 
    10231048 
    1024         if ($db_type == 'mysql' || $db_type == 'mysqli') 
     1049        if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
    10251050                $schema['INDEXES']['ident_idx'] = array('ident(8)'); 
    10261051 
     
    13891414        ); 
    13901415 
    1391         if ($db_type == 'mysql' || $db_type == 'mysqli') 
     1416        if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
    13921417                $schema['INDEXES']['username_idx'] = array('username(8)'); 
    13931418 
  • fluxbb/branches/fluxbb-1.3-dev/upload/admin/reindex.php

    r563 r566  
    6868                        case 'mysql': 
    6969                        case 'mysqli': 
     70                        case 'mysql_innodb': 
     71                        case 'mysqli_innodb': 
    7072                                $result = $forum_db->query('ALTER TABLE '.$forum_db->prefix.'search_words auto_increment=1') or error(__FILE__, __LINE__); 
    7173                                break; 
  • fluxbb/branches/fluxbb-1.3-dev/upload/delete.php

    r564 r566  
    131131 
    132132// Generate the post heading 
    133 $forum_page['post_ident'] = array(); 
    134 $forum_page['post_ident']['byline'] = '<span class="post-byline">'.sprintf((($cur_post['is_topic']) ? $lang_delete['Topic byline'] : $lang_delete['Reply byline']), '<strong>'.forum_htmlencode($cur_post['poster']).'</strong>').'</span>'; 
    135 $forum_page['post_ident']['link'] = '<span class="post-link"><a class="permalink" href="'.forum_link($forum_url['post'], $cur_post['tid']).'">'.format_time($cur_post['posted']).'</a></span>'; 
     133$forum_page['item_ident'] = array( 
     134        'user'  => '<cite>'.($cur_post['is_topic'] ? sprintf($lang_delete['Topic by'], forum_htmlencode($cur_post['poster'])) : sprintf($lang_delete['Reply by'], forum_htmlencode($cur_post['poster']))).'</cite>', 
     135        'date'  => '<span>'.format_time($cur_post['posted']).'</span>' 
     136); 
    136137 
    137138($hook = get_hook('dl_pre_item_ident_merge')) ? (defined('FORUM_USE_INCLUDE') ? include $hook : eval($hook)) : null; 
     139 
     140$forum_page['item_head'] = '<a href="'.forum_link($forum_url['post'], $cur_post['tid']).'">'.implode(' ', $forum_page['item_ident']).'</a>'; 
    138141 
    139142// Generate the post title 
     
    144147 
    145148$forum_page['item_subject'] = forum_htmlencode($forum_page['item_subject']); 
     149 
    146150 
    147151// Setup breadcrumbs 
     
    156160 
    157161define ('FORUM_PAGE', 'postdelete'); 
     162define ('FORUM_PAGE_TYPE', 'basic'); 
    158163require FORUM_ROOT.'header.php'; 
    159164 
     
    173178                <div class="post singlepost"> 
    174179                        <div class="posthead"> 
    175                                 <h3 class="hn post-ident"><?php echo implode(' ', $forum_page['post_ident']) ?></h3> 
     180                                <h3 class="hn"><?php echo $forum_page['item_head'] ?></h3> 
    176181<?php ($hook = get_hook('dl_new_post_head_option')) ? (defined('FORUM_USE_INCLUDE') ? include $hook : eval($hook)) : null; ?> 
    177182                        </div> 
    178183                        <div class="postbody"> 
     184                                <div class="user"> 
     185                                        <h4 class="user-ident"><strong class="username"><?php echo forum_htmlencode($cur_post['poster']) ?></strong></h4> 
     186<?php ($hook = get_hook('dl_new_post_user_data')) ? (defined('FORUM_USE_INCLUDE') ? include $hook : eval($hook)) : null; ?> 
     187                                </div> 
    179188                                <div class="post-entry"> 
    180189                                        <h4 class="entry-title hn"><?php echo $forum_page['item_subject'] ?></h4> 
  • fluxbb/branches/fluxbb-1.3-dev/upload/edit.php

    r564 r566  
    218218                require FORUM_ROOT.'include/parser.php'; 
    219219 
    220         // Generate the post heading 
    221         $forum_page['post_ident'] = array(); 
    222         $forum_page['post_ident']['num'] = '<span class="post-num">#</span>'; 
    223         $forum_page['post_ident']['byline'] = '<span class="post-byline">'.sprintf((($id == $cur_post['first_post_id']) ? $lang_post['Topic byline'] : $lang_post['Reply byline']), '<strong>'.forum_htmlencode($cur_post['poster']).'</strong>').'</span>'; 
    224         $forum_page['post_ident']['link'] = '<span class="post-link">'.format_time(time()).'</span>'; 
     220        $forum_page['preview_ident'] = array( 
     221                'user'  => '<span class="username">'.sprintf($lang_post['Preview by'], '<strong>'.forum_htmlencode($cur_post['poster']).'</strong>').'</span>', 
     222                'link'  => format_time(time()) 
     223        ); 
    225224 
    226225        $forum_page['preview_message'] = parse_message($message, $hide_smilies); 
     226        $forum_page['preview_poster'] = '<strong class="username">'.forum_htmlencode($cur_post['poster']).'</strong>'; 
    227227 
    228228        ($hook = get_hook('ed_preview_pre_display')) ? (defined('FORUM_USE_INCLUDE') ? include $hook : eval($hook)) : null; 
     
    235235                <div class="post singlepost"> 
    236236                        <div class="posthead"> 
    237                                 <h3 class="hn"><?php echo implode(' ', $forum_page['post_ident']) ?></h3> 
     237                                <h3 class="hn"><?php echo implode(' ', $forum_page['preview_ident']) ?></h3> 
    238238<?php ($hook = get_hook('ed_preview_new_post_head_option')) ? (defined('FORUM_USE_INCLUDE') ? include $hook : eval($hook)) : null; ?> 
    239239                        </div> 
  • fluxbb/branches/fluxbb-1.3-dev/upload/footer.php

    r563 r566  
    1717 
    1818($hook = get_hook('ft_about_output_start')) ? (defined('FORUM_USE_INCLUDE') ? include $hook : eval($hook)) : null; 
     19 
     20?> 
     21<div id="brd-about" class="gen-content"> 
     22<?php 
     23 
    1924($hook = get_hook('ft_about_pre_quickjump')) ? (defined('FORUM_USE_INCLUDE') ? include $hook : eval($hook)) : null; 
    2025 
     
    4449?> 
    4550        <p id="copyright">Powered by <strong><a href="http://fluxbb.org/">FluxBB</a><?php if ($forum_config['o_show_version'] == '1') echo ' '.$forum_config['o_cur_version']; ?></strong></p> 
     51</div> 
    4652<?php 
    4753 
  • fluxbb/branches/fluxbb-1.3-dev/upload/header.php

    r565 r566  
    143143$gen_elements = array(); 
    144144 
    145 // Forum page id and classes 
    146 if (substr(FORUM_PAGE, 0, 5) == 'admin') 
    147         define('FORUM_PAGE_TYPE', 'admin-page'); 
    148 else 
    149 { 
    150         if (!empty($forum_page['page_post'])) 
    151                 define('FORUM_PAGE_TYPE', 'paged-page'); 
    152         else if (!empty($forum_page['main_menu'])) 
    153                 define('FORUM_PAGE_TYPE', 'menu-page'); 
    154         else 
    155                 define('FORUM_PAGE_TYPE', 'basic-page'); 
    156 } 
    157  
    158 $gen_elements['<!-- forum_page -->'] = 'id="brd-'.FORUM_PAGE.'" class="brd-page '.FORUM_PAGE_TYPE.'"'; 
     145// Forum page class 
     146$gen_elements['<!-- forum_page -->'] = 'id="brd-'.FORUM_PAGE.'"'; 
    159147 
    160148// Skip link 
     
    276264$main_elements['<!-- forum_crumbs_end -->'] = (FORUM_PAGE != 'index') ? '<div id="brd-crumbs-end" class="crumbs gen-content">'."\n\t".'<p>'.generate_crumbs(false).'</p>'."\n".'</div>' : ''; 
    277265 
     266// Page type class 
     267$main_elements['<!-- forum_page_type -->'] = (defined('FORUM_PAGE_TYPE')) ? FORUM_PAGE_TYPE.((substr(FORUM_PAGE, 0, 5) == 'admin') ? ' admin' : '') : ((substr(FORUM_PAGE, 0, 5) == 'admin') ? 'admin' : 'basic'); 
     268 
    278269// Main section heading 
    279 $main_elements['<!-- forum_main_head -->'] =  '<div class="main-head">'."\n\t".'<h1 class="hn"><span>'.((isset($forum_page['main_head'])) ? $forum_page['main_head'] : end($forum_page['crumbs'])).(isset($forum_page['main_head_pages']) ? ' <small>'.$forum_page['main_head_pages'].'</small>' : '').'</span></h1>'."\n".'</div>'; 
     270$main_elements['<!-- forum_main_head -->'] =  '<div class="main-head">'."\n\t\t".'<h1 class="hn"><span>'.((isset($forum_page['main_head'])) ? $forum_page['main_head'] : end($forum_page['crumbs'])).'</span></h1>'."\n\t".'</div>'; 
    280271 
    281272// Top pagination and post links 
  • fluxbb/branches/fluxbb-1.3-dev/upload/include/dblayer/common_db.php

    r479 r566  
    3838                break; 
    3939 
     40        case 'mysql_innodb': 
     41                require FORUM_ROOT.'include/dblayer/mysql_innodb.php'; 
     42                break; 
     43 
     44        case 'mysqli_innodb': 
     45                require FORUM_ROOT.'include/dblayer/mysqli_innodb.php'; 
     46                break; 
     47 
    4048        case 'pgsql': 
    4149                require FORUM_ROOT.'include/dblayer/pgsql.php'; 
  • fluxbb/branches/fluxbb-1.3-dev/upload/index.php

    r563 r566  
    6666define('FORUM_ALLOW_INDEX', 1); 
    6767define('FORUM_PAGE', 'index'); 
     68define('FORUM_PAGE_TYPE', 'index'); 
    6869require FORUM_ROOT.'header.php'; 
    6970 
  • fluxbb/branches/fluxbb-1.3-dev/upload/lang/English/install.php

    r543 r566  
    1818'Database type info'            =>      'FluxBB currently supports MySQL, PostgreSQL and SQLite. If your database of choice is missing from the drop-down menu below, it means this PHP environment does not have support for that particular database. More information regarding support for particular versions of each database can be found in the FAQ.', 
    1919'Mysql type info'                       =>      'FluxBB has detected that your PHP environment supports two different ways of communicating with MySQL. The two options are called "<em>standard</em>" and "<em>improved</em>". If you are uncertain which one to use, start by trying improved and if that fails, try standard.', 
     20'MySQL InnoDB info'                     =>      'FluxBB has detected that your MySQL server might support <a href="http://dev.mysql.com/doc/refman/5.0/en/innodb-overview.html">InnoDB</a>. This would be a good choice if you are planning to run a large forum. If you are uncertain, it is recommended to not use InnoDB.', 
    2021'Database server info'          =>      'Enter the address of the database server (example: <em>localhost</em>, <em>mysql1.example.com</em> or <em>208.77.188.166</em>). You can specify a custom port number if your database doesn\'t run on the default port (example: <em>localhost:3580</em>). For SQLite support, just enter anything or leave it at \'localhost\'.', 
    2122'Database name info'            =>      'Enter the name of the database that FluxBB will be installed into. The database must exist. For SQLite, this is the relative path to the database file. If the SQLite database file does not exist, FluxBB will attempt to create it.', 
     
    7374'SQLite prefix collision'       =>      'The table prefix \'sqlite_\' is reserved for use by the SQLite engine. Please choose a different prefix.', 
    7475'FluxBB already installed'      =>      'A table called "%1$susers" is already present in the database "%2$s". This could mean that FluxBB is already installed or that another piece of software is installed and is occupying one or more of the table names FluxBB requires. If you want to install multiple copies of FluxBB in the same database, you must choose a different table prefix.', 
     76'InnoDB not enabled'            =>      'InnoDB does not seem to be enabled. Please choose a database layer that does not have InnoDB support, or enable InnoDB on your MySQL server.', 
    7577 
    7678// Used in the install 
  • fluxbb/branches/fluxbb-1.3-dev/upload/login.php

    r563 r566  
    4040        ); 
    4141 
    42         if ($db_type == 'mysql' || $db_type == 'mysqli') 
     42        if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 
    4343                $query['WHERE'] = 'username=\''.$forum_db->escape($form_username).'\''; 
    4444        else 
     
    268268 
    269269        define ('FORUM_PAGE', 'reqpass'); 
     270        define ('FORUM_PAGE_TYPE', 'basic'); 
    270271        require FORUM_ROOT.'header.php'; 
    271272 
     
    364365 
    365366define('FORUM_PAGE', 'login'); 
     367define('FORUM_PAGE_TYPE', 'basic'); 
    366368require FORUM_ROOT.'header.php'; 
    367369 
  • fluxbb/branches/fluxbb-1.3-dev/upload/misc.php

    r563 r566  
    259259 
    260260        define('FORUM_PAGE', 'formemail'); 
     261        define('FORUM_PAGE_TYPE', 'basic'); 
    261262        require FORUM_ROOT.'header.php'; 
    262263 
     
    459460 
    460461        define('FORUM_PAGE', 'report'); 
     462        define('FORUM_PAGE_TYPE', 'report'); 
    461463        require FORUM_ROOT.'header.php'; 
    462464 
  • fluxbb/branches/fluxbb-1.3-dev/upload/moderate.php

    r565 r566  
    417417        $forum_page['start_from'] = $forum_user['disp_posts'] * ($forum_page['page'] - 1); 
    418418        $forum_page['finish_at'] = min(($forum_page['start_from'] + $forum_user['disp_posts']), ($cur_topic['num_replies'] + 1)); 
    419         $forum_page['items_info'] = generate_items_info($lang_misc['Posts'], ($forum_page['start_from'] + 1), ($cur_topic['num_replies'] + 1)); 
     419        $forum_page['page_info'] = generate_page_info($lang_misc['Posts'], ($forum_page['start_from'] + 1), ($cur_topic['num_replies'] + 1)); 
    420420 
    421421        // Generate paging links 
     
    451451        $forum_page['main_head'] = sprintf($lang_misc['Moderate topic head'], forum_htmlencode($cur_topic['subject'])); 
    452452 
    453         if ($forum_page['num_pages'] > 1) 
    454                 $forum_page['main_head_pages'] = sprintf($lang_common['Page info'], $forum_page['page'], $forum_page['num_pages']); 
    455  
    456453        ($hook = get_hook('mr_post_actions_pre_header_load')) ? (defined('FORUM_USE_INCLUDE') ? include $hook : eval($hook)) : null; 
    457454 
    458455        define('FORUM_PAGE', 'modtopic'); 
     456        define('FORUM_PAGE_TYPE','topic'); 
    459457        require FORUM_ROOT.'header.php'; 
    460458 
     
    466464?> 
    467465        <div class="main-pagehead"> 
    468                 <h2 class="hn"><span><?php echo $forum_page['items_info'] ?></span></h2> 
     466                <h2 class="hn"><span><?php echo $forum_page['page_info'] ?></span></h2> 
    469467        </div> 
    470468        <form id="mr-post-actions-form" class="newform" method="post" accept-charset="utf-8" action="<?php echo $forum_page['form_action'] ?>"> 
     
    508506                ++$forum_page['item_count']; 
    509507 
    510                 $forum_page['post_ident'] = array(); 
    511508                $forum_page['message'] = array(); 
    512                 $forum_page['author_title'] = ''; 
    513509                $forum_page['user_ident'] = array(); 
    514510                $cur_post['username'] = $cur_post['poster']; 
    515511 
    516512                // Generate the post heading 
    517                 $forum_page['post_ident']['num'] = '<span class="post-num">'.forum_number_format($forum_page['start_from'] + $forum_page['item_count']).'</span>'; 
    518  
    519                 if ($cur_post['poster_id'] > 1) 
    520                         $forum_page['post_ident']['byline'] = '<span class="post-byline">'.sprintf((($cur_post['id'] == $cur_topic['first_post_id']) ? $lang_topic['Topic byline'] : $lang_topic['Reply byline']), (($forum_user['g_view_users'] == '1') ? '<a title="'.sprintf($lang_topic['Go to profile'], forum_htmlencode($cur_post['username'])).'" href="'.forum_link($forum_url['user'], $cur_post['poster_id']).'">'.forum_htmlencode($cur_post['username']).'</a>' : '<strong>'.forum_htmlencode($cur_post['username']).'</strong>')).'</span>'; 
    521                 else 
    522                         $forum_page['post_ident']['byline'] = '<span class="post-byline">'.sprintf((($cur_post['id'] == $cur_topic['first_post_id']) ? $lang_topic['Topic byline'] : $lang_topic['Reply byline']), '<strong>'.forum_htmlencode($cur_post['username']).'</strong>').'</span>'; 
    523  
    524                 $forum_page['post_ident']['link'] = '<span class="post-link"><a class="permalink" rel="bookmark" title="'.$lang_topic['Permalink post'].'" href="'.forum_link($forum_url['post'], $cur_post['id']).'">'.format_time($cur_post['posted']).'</a></span>'; 
     513                $forum_page['item_ident'] = array( 
     514                        'num'   => '<strong>'.forum_number_format($forum_page['start_from'] + $forum_page['item_count']).'</strong>', 
     515                        'user'  => '<cite>'.($cur_topic['posted'] == $cur_post['posted'] ? sprintf($lang_topic['Topic by'], forum_htmlencode($cur_post['username'])) : sprintf($lang_topic['Reply by'], forum_htmlencode($cur_post['username']))).'</cite>', 
     516                        'date'  => '<span>'.format_time($cur_post['posted']).'</span>' 
     517                ); 
    525518 
    526519                ($hook = get_hook('mr_row_pre_item_ident_merge')) ? (defined('FORUM_USE_INCLUDE') ? include $hook : eval($hook)) : null; 
     520 
     521                $forum_page['item_head'] = '<a class="permalink" rel="bookmark" title="'.$lang_topic['Permalink post'].'" href="'.forum_link($forum_url['post'], $cur_post['id']).'">'.implode(' ', $forum_page['item_ident']).'</a>'; 
    527522 
    528523                // Generate the checkbox field 
     
    531526 
    532527                // Generate author identification 
    533                 $forum_page['author_ident']['username'] = '<li class="username">'.(($cur_post['poster_id'] > '1') ? '<a title="'.sprintf($lang_topic['Go to profile'], forum_htmlencode($cur_post['username'])).'" href="'.forum_link($forum_url['user'], $cur_post['poster_id']).'">'.forum_htmlencode($cur_post['username']).'</a>' : '<strong>'.forum_htmlencode($cur_post['username']).'</strong>').'</li>'; 
    534                 $forum_page['author_ident']['usertitle'] = '<li class="usertitle"><span>'.get_title($cur_post).'</span></li>'; 
     528                $forum_page['user_ident']['username'] = (($cur_post['poster_id'] > 1) ? '<strong class="username"><a title="'.sprintf($lang_topic['Go to profile'], forum_htmlencode($cur_post['username'])).'" href="'.forum_link($forum_url['user'], $cur_post['poster_id']).'">'.forum_htmlencode($cur_post['username'