[Customisation Database Commits] r873 - in /trunk/titania: config.example.php contributions/index.php contributions/support.php includes/core/config.php includes/functions_posting.php includes/objects/contribution.php language/en/contributions.php

Mickael SALFATI elglobo at phpbb-services.com
Wed Mar 24 23:20:18 GMT 2010


Author: Elglobo
Date: Wed Mar 24 23:20:18 2010
New Revision: 873

Log:
Add support_in_titania to know where support is provided:
- On forum, we hide the support tab in titania to simple users and MOD author/Team cannot open new support thread. We check also if user don't go directly via URL to support tab.
- On titania, the release topic is lock.

We adapt also label in contribution details to display Announcement topic or Support topic.

Modified:
    trunk/titania/config.example.php
    trunk/titania/contributions/index.php
    trunk/titania/contributions/support.php
    trunk/titania/includes/core/config.php
    trunk/titania/includes/functions_posting.php
    trunk/titania/includes/objects/contribution.php
    trunk/titania/language/en/contributions.php

Modified: trunk/titania/config.example.php
==============================================================================
*** trunk/titania/config.example.php (original)
--- trunk/titania/config.example.php Wed Mar 24 23:20:18 2010
***************
*** 84,87 ****
--- 84,92 ----
  	*/
  	'forum_mod_robot' => 0,
  	'forum_style_robot' => 0,
+ 	
+ 	/**
+ 	* Do we support contributions in titania ?
+ 	*/
+ 	'support_in_titania' => 1,
  );
\ No newline at end of file

Modified: trunk/titania/contributions/index.php
==============================================================================
*** trunk/titania/contributions/index.php (original)
--- trunk/titania/contributions/index.php Wed Mar 24 23:20:18 2010
***************
*** 117,132 ****
  			'title'		=> 'CONTRIB_FAQ',
  			'url'		=> titania::$contrib->get_url('faq'),
  		),
- 		'support' => array(
- 			'title'		=> 'CONTRIB_SUPPORT',
- 			'url'		=> titania::$contrib->get_url('support'),
- 		),
  		'manage' => array(
  			'title'		=> 'CONTRIB_MANAGE',
  			'url'		=> titania::$contrib->get_url('manage'),
  			'auth'		=> (((titania::$contrib->is_author || titania::$contrib->is_active_coauthor) && titania::$contrib->contrib_status != TITANIA_CONTRIB_CLEANED) || phpbb::$auth->acl_get('u_titania_mod_contrib_mod') || titania_types::$types[titania::$contrib->contrib_type]->acl_get('moderate'))
  		),
  	);
  
  	// Display nav menu
  	$page = request_var('page', '');
--- 117,140 ----
  			'title'		=> 'CONTRIB_FAQ',
  			'url'		=> titania::$contrib->get_url('faq'),
  		),
  		'manage' => array(
  			'title'		=> 'CONTRIB_MANAGE',
  			'url'		=> titania::$contrib->get_url('manage'),
  			'auth'		=> (((titania::$contrib->is_author || titania::$contrib->is_active_coauthor) && titania::$contrib->contrib_status != TITANIA_CONTRIB_CLEANED) || phpbb::$auth->acl_get('u_titania_mod_contrib_mod') || titania_types::$types[titania::$contrib->contrib_type]->acl_get('moderate'))
  		),
  	);
+ 	
+ 	$nav_ary_support = array(
+ 		'support' => array(
+ 			'title'		=> 'CONTRIB_SUPPORT',
+ 			'url'		=> titania::$contrib->get_url('support'),
+ 		),
+ 	);
+ 	
+ 	if (titania::$config->support_in_titania || (!titania::$config->support_in_titania && (titania::$access_level == TITANIA_ACCESS_TEAMS || titania::$contrib->is_author || titania::$contrib->is_active_coauthor)))
+ 	{
+ 		$nav_ary = array_merge($nav_ary, $nav_ary_support);
+ 	}
  
  	// Display nav menu
  	$page = request_var('page', '');

Modified: trunk/titania/contributions/support.php
==============================================================================
*** trunk/titania/contributions/support.php (original)
--- trunk/titania/contributions/support.php Wed Mar 24 23:20:18 2010
***************
*** 16,21 ****
--- 16,26 ----
  	exit;
  }
  
+ if (!titania::$config->support_in_titania && titania::$access_level == TITANIA_ACCESS_PUBLIC)
+ {
+ 	titania::needs_auth();
+ }
+ 
  $post_id = request_var('p', 0);
  $topic_id = request_var('t', 0);
  
***************
*** 92,98 ****
  
  	titania::page_header('CONTRIB_SUPPORT');
  
! 	if (phpbb::$auth->acl_get('u_titania_topic'))
  	{
  		phpbb::$template->assign_var('U_POST_TOPIC', titania_url::append_url(titania::$contrib->get_url('support'), array('action' => 'post')));
  	}
--- 97,103 ----
  
  	titania::page_header('CONTRIB_SUPPORT');
  
! 	if (phpbb::$auth->acl_get('u_titania_topic') && titania::$config->support_in_titania)
  	{
  		phpbb::$template->assign_var('U_POST_TOPIC', titania_url::append_url(titania::$contrib->get_url('support'), array('action' => 'post')));
  	}

Modified: trunk/titania/includes/core/config.php
==============================================================================
*** trunk/titania/includes/core/config.php (original)
--- trunk/titania/includes/core/config.php Wed Mar 24 23:20:18 2010
***************
*** 81,86 ****
--- 81,88 ----
  			'forum_style_database'		=> array('default' => 0),
  			'forum_mod_robot'			=> array('default' => 0),
  			'forum_style_robot'			=> array('default' => 0),
+ 			
+ 			'support_in_titania'		=> array('default' => 1),
  		));
  	}
  }

Modified: trunk/titania/includes/functions_posting.php
==============================================================================
*** trunk/titania/includes/functions_posting.php (original)
--- trunk/titania/includes/functions_posting.php Wed Mar 24 23:20:18 2010
***************
*** 277,283 ****
  		'post_time'				=> time(),
  		'poster_ip'				=> phpbb::$user->ip,
  		'post_edit_locked'		=> 0,
- 		'topic_status'			=> POST_NORMAL,
  		'topic_type'			=> POST_NORMAL,
  		'post_approved'			=> true,
  	);
--- 277,282 ----
***************
*** 360,366 ****
  		'notify_set'			=> 0,
  		'poster_ip'				=> $options['poster_ip'],
  		'post_edit_locked'		=> (int) $options['post_edit_locked'],
- 		'topic_status'			=> $options['topic_status'],
  		'bbcode_bitfield'		=> $message_parser->bbcode_bitfield,
  		'bbcode_uid'			=> $message_parser->bbcode_uid,
  		'message'				=> $message_parser->message,
--- 359,364 ----
***************
*** 371,376 ****
--- 369,384 ----
  
  	// Aaaand, submit it.
  	submit_post('post', $options['topic_title'], $user_data['username'], $options['topic_type'], $poll, $data, true);
+ 	
+ 	// If we provide support in titania, we lock the topic
+ 	if (titania::$config->support_in_titania)
+ 	{
+ 		$sql = 'UPDATE ' . TOPICS_TABLE . '
+ 			SET topic_status = ' . ITEM_LOCKED . '
+ 			WHERE topic_id = ' . $data['topic_id'] . '
+ 				AND topic_moved_id = 0';
+ 		phpbb::$db->sql_query($sql);
+ 	}
  
  	// And restore it
  	phpbb::$user->data = $old_data;
***************
*** 400,406 ****
  		'post_time'				=> time(),
  		'poster_ip'				=> phpbb::$user->ip,
  		'post_edit_locked'		=> 0,
- 		'topic_status'			=> POST_NORMAL,
  		'topic_type'			=> POST_NORMAL,
  		'post_approved'			=> true,
  	);
--- 408,413 ----
***************
*** 503,509 ****
  		'notify_set'			=> 0,
  		'poster_ip'				=> $options['poster_ip'],
  		'post_edit_locked'		=> (int) $options['post_edit_locked'],
- 		'topic_status'			=> $options['topic_status'],
  		'bbcode_bitfield'		=> $message_parser->bbcode_bitfield,
  		'bbcode_uid'			=> $message_parser->bbcode_uid,
  		'message'				=> $message_parser->message,
--- 510,515 ----

Modified: trunk/titania/includes/objects/contribution.php
==============================================================================
*** trunk/titania/includes/objects/contribution.php (original)
--- trunk/titania/includes/objects/contribution.php Wed Mar 24 23:20:18 2010
***************
*** 545,550 ****
--- 545,551 ----
  			'CONTRIB_RATING_STRING'			=> (!$simple) ? $this->rating->get_rating_string() : '',
  			
  			'CONTRIB_ANNOUNCEMENT_TOPIC'	=> ($this->contrib_release_topic_id) ? sprintf(phpbb::$user->lang['ANNOUNCEMENT_TOPIC_VIEW'], '<a href="' . phpbb::append_sid('viewtopic', 't='.$this->contrib_release_topic_id) . '">', '</a>') : false,
+ 			'L_ANNOUNCEMENT_TOPIC'			=> (titania::$config->support_in_titania) ? phpbb::$user->lang['ANNOUNCEMENT_TOPIC'] : phpbb::$user->lang['ANNOUNCEMENT_TOPIC_SUPPORT'],
  
  			// Download data
  			'CONTRIB_DOWNLOADS'				=> $this->contrib_downloads,

Modified: trunk/titania/language/en/contributions.php
==============================================================================
*** trunk/titania/language/en/contributions.php (original)
--- trunk/titania/language/en/contributions.php Wed Mar 24 23:20:18 2010
***************
*** 37,42 ****
--- 37,43 ----
  
  $lang = array_merge($lang, array(
  	'ANNOUNCEMENT_TOPIC' 				=> 'Announcement topic',
+ 	'ANNOUNCEMENT_TOPIC_SUPPORT'		=> 'Support topic',
  	'ANNOUNCEMENT_TOPIC_VIEW'			=> '%sView%s',
  	
  	'NO_REVISIONS' => 'No Revisions',
***************
*** 107,113 ****
  
  [b]Modification overview page:[/b] [url=%9$s]View[/url]
  
! [color=blue][b]Support for this modification needs to be asked within this topic. The phpBB Team is not responsible or required to give anyone support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB MODifications Team may not be able to provide support.[/b][/color]',
  	'MOD_UPDATE_PUBLIC'					=> '[color=darkred][b]MOD Updated to version %s
  See first post for Download Link[/b][/color]',
  	'MPV_RESULTS'						=> '<strong>Please check over the MPV results and make sure that nothing needs to be fixed.<br /><br />If you do not think anything requires fixing or you are not sure, just hit continue below.</strong>',
--- 108,114 ----
  
  [b]Modification overview page:[/b] [url=%9$s]View[/url]
  
! [color=blue][b]The phpBB Team is not responsible or required to give anyone support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB MODifications Team may not be able to provide support.[/b][/color]',
  	'MOD_UPDATE_PUBLIC'					=> '[color=darkred][b]MOD Updated to version %s
  See first post for Download Link[/b][/color]',
  	'MPV_RESULTS'						=> '<strong>Please check over the MPV results and make sure that nothing needs to be fixed.<br /><br />If you do not think anything requires fixing or you are not sure, just hit continue below.</strong>',
***************
*** 157,163 ****
  
  [b]Style overview page:[/b] [url=%9$s]View[/url]
  
! [color=blue][b]Support for this Style needs to be asked within this topic. The phpBB Team is not responsible or required to give anyone support for this Style. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB Styles Team may not be able to provide support.[/b][/color]',
  	'STYLE_UPDATE_PUBLIC'				=> '[color=darkred][b]Style Updated to version %s
  See first post for Download Link[/b][/color]',
  	'SUBDIRECTORY_LIMIT'				=> 'Packages are not allowed to be more than 50 subdirectories deep at any point.',
--- 158,164 ----
  
  [b]Style overview page:[/b] [url=%9$s]View[/url]
  
! [color=blue][b]The phpBB Team is not responsible or required to give anyone support for this Style. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB Styles Team may not be able to provide support.[/b][/color]',
  	'STYLE_UPDATE_PUBLIC'				=> '[color=darkred][b]Style Updated to version %s
  See first post for Download Link[/b][/color]',
  	'SUBDIRECTORY_LIMIT'				=> 'Packages are not allowed to be more than 50 subdirectories deep at any point.',




More information about the customisationdb-commits mailing list