[Customisation Database Commits] r259 - in /trunk/titania: config.example.php includes/core/config.php includes/core/titania.php includes/objects/faq.php

Nathan Guse exreaction at phpbb.com
Fri Jun 26 18:58:27 UTC 2009


Author: exreaction
Date: Fri Jun 26 18:58:26 2009
New Revision: 259

Log:
Better explanation for the titania_script_path

When generating the absolute_path, generate_board_url(true) should be followed by /

When generating the FAQ url, use $contrib->get_url() for the main part

Modified:
    trunk/titania/config.example.php
    trunk/titania/includes/core/config.php
    trunk/titania/includes/core/titania.php
    trunk/titania/includes/objects/faq.php

Modified: trunk/titania/config.example.php
==============================================================================
*** trunk/titania/config.example.php (original)
--- trunk/titania/config.example.php Fri Jun 26 18:58:26 2009
***************
*** 19,29 ****
  	'phpbb_root_path' => '../community/',
  
  	/**
! 	* Relative path from the phpBB installation.
  	*
! 	* @param	string	Path to the titania folder from phpBB
  	*/
! 	'titania_script_path' => 'titania/',
  
  	/**
  	* Prefix of the sql tables.  Not the prefix for the phpBB tables, prefix for the Titania tables only.
--- 19,29 ----
  	'phpbb_root_path' => '../community/',
  
  	/**
! 	* Relative path from the server root (generate_board_url(true))
  	*
! 	* @param	string	Path to the titania folder
  	*/
! 	'titania_script_path' => 'customisation/',
  
  	/**
  	* Prefix of the sql tables.  Not the prefix for the phpBB tables, prefix for the Titania tables only.

Modified: trunk/titania/includes/core/config.php
==============================================================================
*** trunk/titania/includes/core/config.php (original)
--- trunk/titania/includes/core/config.php Fri Jun 26 18:58:26 2009
***************
*** 37,43 ****
  			'language_path'				=> array('default' => TITANIA_ROOT . 'language/'),
  			'modules_path'				=> array('default' => TITANIA_ROOT . 'modules/'),
  			'phpbb_root_path'			=> array('default' => '../community/'),
! 			'titania_script_path'		=> array('default' => 'titania/'),
  			'phpbbcom_profile'			=> array('default' => true),
  			'phpbbcom_viewprofile_url'	=> array('default' => 'http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=%u'),
  			'table_prefix'				=> array('default' => 'customisation_'),
--- 37,43 ----
  			'language_path'				=> array('default' => TITANIA_ROOT . 'language/'),
  			'modules_path'				=> array('default' => TITANIA_ROOT . 'modules/'),
  			'phpbb_root_path'			=> array('default' => '../community/'),
! 			'titania_script_path'		=> array('default' => 'customisation/'),
  			'phpbbcom_profile'			=> array('default' => true),
  			'phpbbcom_viewprofile_url'	=> array('default' => 'http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=%u'),
  			'table_prefix'				=> array('default' => 'customisation_'),

Modified: trunk/titania/includes/core/titania.php
==============================================================================
*** trunk/titania/includes/core/titania.php (original)
--- trunk/titania/includes/core/titania.php Fri Jun 26 18:58:26 2009
***************
*** 101,107 ****
  		self::$cache = new titania_cache();
  
  		// Set the absolute path
! 		self::$absolute_path = generate_board_url(true) . self::$config->titania_script_path;
  		self::$absolute_board = generate_board_url() . '/';
  
  		// Set template path and template name
--- 101,107 ----
  		self::$cache = new titania_cache();
  
  		// Set the absolute path
! 		self::$absolute_path = generate_board_url(true) . '/' . self::$config->titania_script_path;
  		self::$absolute_board = generate_board_url() . '/';
  
  		// Set template path and template name

Modified: trunk/titania/includes/objects/faq.php
==============================================================================
*** trunk/titania/includes/objects/faq.php (original)
--- trunk/titania/includes/objects/faq.php Fri Jun 26 18:58:26 2009
***************
*** 82,88 ****
  	public function submit()
  	{
  		$this->contrib_id = titania::$contrib->contrib_id;
! 		
  		// Nobody parsed the text for storage before. Parse text with lowest settings.
  		if (!$this->text_parsed_for_storage)
  		{
--- 82,88 ----
  	public function submit()
  	{
  		$this->contrib_id = titania::$contrib->contrib_id;
! 
  		// Nobody parsed the text for storage before. Parse text with lowest settings.
  		if (!$this->text_parsed_for_storage)
  		{
***************
*** 229,262 ****
  	*/
  	public function get_url($action, $faq_id = false)
  	{
! 		$url = titania::$absolute_path;
! 		
! 		// For different items we will display the URL differently
! 		switch (titania::$contrib->contrib_type)
! 		{
! 			case TITANIA_TYPE_MOD :
! 				$url .= 'mod/';
! 			break;
! 
! 			case TITANIA_TYPE_STYLE :
! 				$url .= 'style/';
! 			break;
! 
! 			case TITANIA_TYPE_SNIPPET :
! 				$url .= 'snippet/';
! 			break;
! 
! 			case TITANIA_TYPE_LANG_PACK :
! 				$url .= 'translation/';
! 			break;
  
- 			default :
- 				$url .= 'contribution/';
- 			break;
- 		}
- 		
- 		$url .= titania::$contrib->contrib_id . '/faq';
- 		
  		if ((int) $faq_id)
  		{
  			$url .= "/$faq_id";
--- 229,236 ----
  	*/
  	public function get_url($action, $faq_id = false)
  	{
! 		$url = titania::$contrib->get_url() . '/faq';
  
  		if ((int) $faq_id)
  		{
  			$url .= "/$faq_id";




More information about the customisationdb-commits mailing list