[fusionregistry-commitlog] SF.net SVN: fusionregistry: [40] branches/stable_3_0_x/upload/sources
Brought to you by:
copland007
From: SVN c. <fus...@li...> - 2008-02-13 05:13:46
|
Revision: 40 http://fusionregistry.svn.sourceforge.net/fusionregistry/?rev=40&view=rev Author: copland007 Date: 2008-02-12 21:13:52 -0800 (Tue, 12 Feb 2008) Log Message: ----------- Add cache support to build_category_html() Modified Paths: -------------- branches/stable_3_0_x/upload/sources/components_acp/fusionscripts/fusionregistry/ad_rating_fields.php branches/stable_3_0_x/upload/sources/components_public/fusionscripts/fusionregistry/lib/functions.php Modified: branches/stable_3_0_x/upload/sources/components_acp/fusionscripts/fusionregistry/ad_rating_fields.php =================================================================== --- branches/stable_3_0_x/upload/sources/components_acp/fusionscripts/fusionregistry/ad_rating_fields.php 2008-02-12 06:54:16 UTC (rev 39) +++ branches/stable_3_0_x/upload/sources/components_acp/fusionscripts/fusionregistry/ad_rating_fields.php 2008-02-13 05:13:52 UTC (rev 40) @@ -446,7 +446,7 @@ } // Save it back to the cache_store - $this->ipsclass->update_cache( array( 'name' => 'registry_rating_defs', 'array' => 1, 'deletefirst' => 1, 'donow' => 0 ) ); + $this->ipsclass->update_cache( array( 'name' => 'registry_rating_defs', 'array' => 1, 'deletefirst' => 1, 'donow' => 0 ) ); } } -?> \ No newline at end of file +?> Modified: branches/stable_3_0_x/upload/sources/components_public/fusionscripts/fusionregistry/lib/functions.php =================================================================== --- branches/stable_3_0_x/upload/sources/components_public/fusionscripts/fusionregistry/lib/functions.php 2008-02-12 06:54:16 UTC (rev 39) +++ branches/stable_3_0_x/upload/sources/components_public/fusionscripts/fusionregistry/lib/functions.php 2008-02-13 05:13:52 UTC (rev 40) @@ -106,20 +106,26 @@ */ function build_category_html($data = array()) { + // Load the cache + $this->ipsclass->init_load_cache( array( 'registry_categories' ) ); + // Build the category select HTML $categories_html = '<select name="category" class="forminput">'; - $this->ipsclass->DB->query("SELECT * FROM ibf_registry_categories ORDER BY title ASC"); - while ( $cat_row = $this->ipsclass->DB->fetch_row() ) + if ( isset( $this->ipsclass->cache['registry_categories'] ) && + is_array( $this->ipsclass->cache['registry_categories'] ) ) { - if ( $cat_row['id'] == $data['selected'] ) + foreach ( $this->ipsclass->cache['registry_categories'] as $cat_id => $cat_title ) { - $categories_html .= '<option value="'.$cat_row['id'].'" selected="selected">'.$cat_row['title'].'</option>'; + if ( $cat_id == $data['selected'] ) + { + $categories_html .= '<option value="'.$cat_id.'" selected="selected">'.$cat_title.'</option>'; + } + else + { + $categories_html .= '<option value="'.$cat_id.'">'.$cat_title.'</option>'; + } } - else - { - $categories_html .= '<option value="'.$cat_row['id'].'">'.$cat_row['title'].'</option>'; - } } // Finish off the category select HTML @@ -378,4 +384,4 @@ } } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |