[Customisation Database Commits] r300 - in /trunk/titania: .htaccess includes/functions_display.php install.php

Francis Lewis francis at adventonegraphics.com
Thu Jul 16 05:29:22 UTC 2009


Author: Handyman
Date: Thu Jul 16 05:29:20 2009
New Revision: 300

Log:
Ran stress test on Titania - failed miserably on the performance for viewing MODs in category.
 * Performance increase for viewing MOD's in a given category.
 * Fixed #8 - Create Contribution link.

Modified:
    trunk/titania/.htaccess
    trunk/titania/includes/functions_display.php
    trunk/titania/install.php

Modified: trunk/titania/.htaccess
==============================================================================
*** trunk/titania/.htaccess (original)
--- trunk/titania/.htaccess Thu Jul 16 05:29:20 2009
***************
*** 22,29 ****
--- 22,32 ----
  
  #contributions
  RewriteCond %{REQUEST_FILENAME} !-f
+ Rewriterule ^(mod|style|snippet|translation|contributions?)/(create)/?$					./contributions/index.php?page=$2 [NC]
+ RewriteCond %{REQUEST_FILENAME} !-f
  Rewriterule ^(mod|style|snippet|translation|contributions?)/([^/]+)/?([^/]+)?/?([^/]+)?$		./contributions/index.php?c=$2&page=$3 [NC]
  
+ 
  #rating
  RewriteCond %{REQUEST_FILENAME} !-f
  Rewriterule ^rate/?([^/]+)?$					./index.php?action=rate [NC]

Modified: trunk/titania/includes/functions_display.php
==============================================================================
*** trunk/titania/includes/functions_display.php (original)
--- trunk/titania/includes/functions_display.php Thu Jul 16 05:29:20 2009
***************
*** 143,158 ****
  		break;
  
  		case 'category' :
! 			$sql = 'SELECT * FROM ' . TITANIA_CONTRIB_IN_CATEGORIES_TABLE . ' cic, ' . TITANIA_CONTRIBS_TABLE . ' c, ' . USERS_TABLE . ' u
! 				WHERE cic.category_id = ' . (int) $id . '
! 					AND c.contrib_id = cic.contrib_id
! 					AND u.user_id = c.contrib_user_id
! 					AND c.contrib_visible = 1
! 				ORDER BY c.contrib_id DESC';
  		break;
  	}
  
! 	$result = phpbb::$db->sql_query($sql);
  
  	$contrib_type = 0;
  	while ($row = phpbb::$db->sql_fetchrow($result))
--- 143,177 ----
  		break;
  
  		case 'category' :
! 			$sql = phpbb::$db->sql_build_query('SELECT', array(
! 				// DO NOT change to *, we do not need all rows from ANY table with the query!
! 				'SELECT'	=> 'c.contrib_name, c.contrib_name_clean, c.contrib_status, c.contrib_downloads, c.contrib_views, c.contrib_rating, c.contrib_rating_count, c.contrib_type, u.username, u.user_colour, u.username_clean',
! 
! 				'FROM'		=> array(
! 					TITANIA_CONTRIB_IN_CATEGORIES_TABLE 	=> 'cic',
! 				),
! 
! 				'LEFT_JOIN'	=> array(
! 					array(
! 						'FROM'	=> array(TITANIA_CONTRIBS_TABLE	=> 'c'),
! 						'ON'	=> 'cic.contrib_id = c.contrib_id'
! 					),
! 					array(
! 						'FROM'	=> array(USERS_TABLE	=> 'u'),
! 						'ON'	=> 'u.user_id = c.contrib_user_id'
! 					),
! 				),
! 
! 				'WHERE'		=> 'cic.category_id = ' . (int) $id . '
! 					AND c.contrib_visible = 1',
! 
! 				'ORDER_BY'	=> 'c.contrib_id DESC',
! 			));
  		break;
  	}
  
! 	// @todo Build sorting and limits
! 	$result = phpbb::$db->sql_query_limit($sql, 25);
  
  	$contrib_type = 0;
  	while ($row = phpbb::$db->sql_fetchrow($result))

Modified: trunk/titania/install.php
==============================================================================
*** trunk/titania/install.php (original)
--- trunk/titania/install.php Thu Jul 16 05:29:20 2009
***************
*** 431,437 ****
  			array('ROLE_USER_STANDARD', array('titania_contrib_submit')),
  		),
  	),
! 	
  	// IF YOU ADD A NEW VERSION DO NOT FORGET TO INCREMENT THE VERSION NUMBER IN common.php!
  );
  
--- 431,437 ----
  			array('ROLE_USER_STANDARD', array('titania_contrib_submit')),
  		),
  	),
! 
  	// IF YOU ADD A NEW VERSION DO NOT FORGET TO INCREMENT THE VERSION NUMBER IN common.php!
  );
  




More information about the customisationdb-commits mailing list