[Customisation Database Commits] r1160 - /trunk/titania/contributions/index.php

Nathan Guse exreaction at phpbb.com
Wed Apr 28 04:45:24 BST 2010


Author: exreaction
Date: Wed Apr 28 04:45:24 2010
New Revision: 1160

Log:
Hide the FAQ tab if there are no FAQ entries for the public

Modified:
    trunk/titania/contributions/index.php

Modified: trunk/titania/contributions/index.php
==============================================================================
*** trunk/titania/contributions/index.php (original)
--- trunk/titania/contributions/index.php Wed Apr 28 04:45:24 2010
***************
*** 103,108 ****
--- 103,118 ----
  		}
  	}
  
+ 	// Hide the FAQ tab if no FAQ entries for public
+ 	if (titania::$access_level == TITANIA_ACCESS_PUBLIC)
+ 	{
+ 		$sql = 'SELECT COUNT(faq_id) AS cnt FROM ' . TITANIA_CONTRIB_FAQ_TABLE . '
+ 			WHERE contrib_id = ' . titania::$contrib->contrib_id;
+ 		phpbb::$db->sql_query($sql);
+ 		$faq_count = phpbb::$db->sql_fetchfield('cnt');
+ 		phpbb::$db->sql_freeresult();
+ 	}
+ 
  	/**
  	* Menu Array
  	*
***************
*** 120,125 ****
--- 130,136 ----
  		'faq' => array(
  			'title'		=> 'CONTRIB_FAQ',
  			'url'		=> titania::$contrib->get_url('faq'),
+ 			'auth'		=> (titania::$access_level != TITANIA_ACCESS_PUBLIC || $faq_count) ? true : false,
  		),
  		'support' => array(
  			'title'		=> 'CONTRIB_SUPPORT',




More information about the customisationdb-commits mailing list