[Customisation Database Commits] r252 - in /trunk/titania: authors/ contributions/ includes/ includes/core/ includes/objects/
Nathan Guse
exreaction at phpbb.com
Thu Jun 25 03:29:58 UTC 2009
Author: exreaction
Date: Thu Jun 25 03:29:56 2009
New Revision: 252
Log:
A bit of cleanup mostly
Added:
trunk/titania/contributions/support.php (with props)
Removed:
trunk/titania/includes/objects/review.php
Modified:
trunk/titania/authors/index.php
trunk/titania/contributions/index.php
trunk/titania/includes/constants.php
trunk/titania/includes/core/titania.php
trunk/titania/includes/functions_display.php
trunk/titania/includes/objects/author.php
trunk/titania/includes/objects/category.php
trunk/titania/includes/objects/post.php
trunk/titania/includes/objects/topic.php
Modified: trunk/titania/authors/index.php
==============================================================================
*** trunk/titania/authors/index.php (original)
--- trunk/titania/authors/index.php Thu Jun 25 03:29:56 2009
***************
*** 43,77 ****
*
* 'filename' => array(
* 'title' => 'nav menu title',
* 'auth' => ($can_see_page) ? true : false, // Not required, always true if missing
* ),
*/
! $pages = array(
'details' => array(
'title' => 'AUTHOR_DETAILS',
),
'contributions' => array(
'title' => 'AUTHOR_CONTRIBUTIONS',
),
);
// Display nav menu
! foreach ($pages as $name => $data)
! {
! // If they do not have authorization, skip.
! if (isset($data['auth']) && !$data['auth'])
! {
! continue;
! }
!
! phpbb::$template->assign_block_vars('nav_menu', array(
! 'L_TITLE' => (isset(phpbb::$user->lang[$data['title']])) ? phpbb::$user->lang[$data['title']] : $data['title'],
!
! 'U_TITLE' => titania::$author->get_url() . (($name != 'details') ? '/' . $name : ''),
!
! 'S_SELECTED' => ($page == $name) ? true : false,
! ));
! }
// And now to load the appropriate page...
switch ($page)
--- 43,65 ----
*
* 'filename' => array(
* 'title' => 'nav menu title',
+ * 'url' => $page_url,
* 'auth' => ($can_see_page) ? true : false, // Not required, always true if missing
* ),
*/
! $nav_ary = array(
'details' => array(
'title' => 'AUTHOR_DETAILS',
+ 'url' => titania::$author->get_url(),
),
'contributions' => array(
'title' => 'AUTHOR_CONTRIBUTIONS',
+ 'url' => titania::$author->get_url() . '/contributions',
),
);
// Display nav menu
! titania::generate_nav($nav_ary, $page);
// And now to load the appropriate page...
switch ($page)
Modified: trunk/titania/contributions/index.php
==============================================================================
*** trunk/titania/contributions/index.php (original)
--- trunk/titania/contributions/index.php Thu Jun 25 03:29:56 2009
***************
*** 49,89 ****
*
* 'filename' => array(
* 'title' => 'nav menu title',
* 'auth' => ($can_see_page) ? true : false, // Not required, always true if missing
* ),
*/
! $pages = array(
'details' => array(
'title' => 'CONTRIB_DETAILS',
),
'faq' => array(
'title' => 'CONTRIB_FAQ',
),
);
// Display nav menu
! foreach ($pages as $name => $data)
! {
! // If they do not have authorization, skip.
! if (isset($data['auth']) && !$data['auth'])
! {
! continue;
! }
!
! phpbb::$template->assign_block_vars('nav_menu', array(
! 'L_TITLE' => (isset(phpbb::$user->lang[$data['title']])) ? phpbb::$user->lang[$data['title']] : $data['title'],
!
! 'U_TITLE' => titania::$contrib->get_url() . (($name != 'details') ? '/' . $name : ''),
!
! 'S_SELECTED' => ($page == $name) ? true : false,
! ));
! }
// And now to load the appropriate page...
switch ($page)
{
case 'details' :
case 'faq' :
include(TITANIA_ROOT . 'contributions/' . $page . '.' . PHP_EXT);
break;
--- 49,82 ----
*
* 'filename' => array(
* 'title' => 'nav menu title',
+ * 'url' => $page_url,
* 'auth' => ($can_see_page) ? true : false, // Not required, always true if missing
* ),
*/
! $nav_ary = array(
'details' => array(
'title' => 'CONTRIB_DETAILS',
+ 'url' => titania::$contrib->get_url(),
),
'faq' => array(
'title' => 'CONTRIB_FAQ',
+ 'url' => titania::$contrib->get_url() . '/faq',
+ ),
+ 'support' => array(
+ 'title' => 'CONTRIB_SUPPORT',
+ 'url' => titania::$contrib->get_url() . '/support',
),
);
// Display nav menu
! titania::generate_nav($nav_ary, $page);
// And now to load the appropriate page...
switch ($page)
{
case 'details' :
case 'faq' :
+ case 'support' :
include(TITANIA_ROOT . 'contributions/' . $page . '.' . PHP_EXT);
break;
Added: trunk/titania/contributions/support.php
==============================================================================
*** trunk/titania/contributions/support.php (added)
--- trunk/titania/contributions/support.php Thu Jun 25 03:29:56 2009
***************
*** 0 ****
--- 1,29 ----
+ <?php
+ /**
+ *
+ * @package titania
+ * @version $Id$
+ * @copyright (c) 2008 phpBB Customisation Database Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ *
+ */
+
+ /**
+ * @ignore
+ */
+ if (!defined('IN_TITANIA'))
+ {
+ exit;
+ }
+
+ switch ($action)
+ {
+ case 'post' :
+ break;
+
+ case 'edit' :
+ break;
+
+ case 'delete' :
+ break;
+ }
\ No newline at end of file
Propchange: trunk/titania/contributions/support.php
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: trunk/titania/includes/constants.php
==============================================================================
*** trunk/titania/includes/constants.php (original)
--- trunk/titania/includes/constants.php Thu Jun 25 03:29:56 2009
***************
*** 80,85 ****
--- 80,86 ----
define('TITANIA_POST_DEFAULT', 1);
define('TITANIA_POST_QUEUE', 2);
define('TITANIA_POST_TRACKER', 3);
+ define('TITANIA_POST_REVIEW', 4);
// Access Levels
define('TITANIA_ACCESS_TEAMS', 0);
Modified: trunk/titania/includes/core/titania.php
==============================================================================
*** trunk/titania/includes/core/titania.php (original)
--- trunk/titania/includes/core/titania.php Thu Jun 25 03:29:56 2009
***************
*** 248,279 ****
}
/**
! * Titania Logout method to redirect the user to the Titania root instead of the phpBB Root
! *
! * @param bool $return if we are within a method, we can use the error_box instead of a trigger_error on the redirect.
! */
! public static function logout($return = false)
{
! if (phpbb::$user->data['user_id'] != ANONYMOUS && isset($_GET['sid']) && !is_array($_GET['sid']) && $_GET['sid'] === phpbb::$user->session_id)
! {
! phpbb::$user->session_kill();
! phpbb::$user->session_begin();
! $message = phpbb::$user->lang['LOGOUT_REDIRECT'];
! }
! else
{
! $message = (phpbb::$user->data['user_id'] == ANONYMOUS) ? phpbb::$user->lang['LOGOUT_REDIRECT'] : phpbb::$user->lang['LOGOUT_FAILED'];
! }
! if ($return)
! {
! return $message;
! }
! meta_refresh(3, titania_sid('index'));
! $message = $message . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_INDEX'], '<a href="' . titania_sid('index') . '">', '</a> ');
! trigger_error($message);
}
/**
--- 248,276 ----
}
/**
! * Generate the navigation tabs/menu for display
! *
! * @param array $nav_ary The array of data to output
! * @param string $current_page The current page
! */
! public static function generate_nav($nav_ary, $current_page)
{
! foreach ($nav_ary as $page => $data)
{
! // If they do not have authorization, skip.
! if (isset($data['auth']) && !$data['auth'])
! {
! continue;
! }
! phpbb::$template->assign_block_vars('nav_menu', array(
! 'L_TITLE' => (isset(phpbb::$user->lang[$data['title']])) ? phpbb::$user->lang[$data['title']] : $data['title'],
! 'U_TITLE' => $data['url'],
! 'S_SELECTED' => ($page == $current_page) ? true : false,
! ));
! }
}
/**
***************
*** 395,400 ****
--- 392,426 ----
}
/**
+ * Titania Logout method to redirect the user to the Titania root instead of the phpBB Root
+ *
+ * @param bool $return if we are within a method, we can use the error_box instead of a trigger_error on the redirect.
+ */
+ public static function logout($return = false)
+ {
+ if (phpbb::$user->data['user_id'] != ANONYMOUS && isset($_GET['sid']) && !is_array($_GET['sid']) && $_GET['sid'] === phpbb::$user->session_id)
+ {
+ phpbb::$user->session_kill();
+ phpbb::$user->session_begin();
+ $message = phpbb::$user->lang['LOGOUT_REDIRECT'];
+ }
+ else
+ {
+ $message = (phpbb::$user->data['user_id'] == ANONYMOUS) ? phpbb::$user->lang['LOGOUT_REDIRECT'] : phpbb::$user->lang['LOGOUT_FAILED'];
+ }
+
+ if ($return)
+ {
+ return $message;
+ }
+
+ meta_refresh(3, titania_sid('index'));
+
+ $message = $message . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_INDEX'], '<a href="' . titania_sid('index') . '">', '</a> ');
+ trigger_error($message);
+ }
+
+ /**
* Wrapper for phpBB function trigger_error (with added http response code)
*
* @param string $error_msg error message or language string
Modified: trunk/titania/includes/functions_display.php
==============================================================================
*** trunk/titania/includes/functions_display.php (original)
--- trunk/titania/includes/functions_display.php Thu Jun 25 03:29:56 2009
***************
*** 140,143 ****
));
}
phpbb::$db->sql_freeresult($result);
! }
--- 140,143 ----
));
}
phpbb::$db->sql_freeresult($result);
! }
\ No newline at end of file
Modified: trunk/titania/includes/objects/author.php
==============================================================================
*** trunk/titania/includes/objects/author.php (original)
--- trunk/titania/includes/objects/author.php Thu Jun 25 03:29:56 2009
***************
*** 154,167 ****
}
/**
- * Get profile data
- */
- public function get_profile_data()
- {
- return $this->sql_data;
- }
-
- /**
* Get username string
*
* @param mixed $mode Can be titania (for full with author view page for link), profile (for getting an url to the profile), username (for obtaining the username), colour (for obtaining the user colour), full (for obtaining a html string representing a coloured link to the users profile) or no_profile (the same as full but forcing no profile link)
--- 154,159 ----
***************
*** 197,203 ****
{
if ($this->user_id)
{
! return append_sid(PHPBB_ROOT_PATH . 'memberlist.' . PHP_EXT, 'u=' . $this->user_id);
}
return '';
--- 189,195 ----
{
if ($this->user_id)
{
! return append_sid(titania::$absolute_board . 'memberlist.' . PHP_EXT, 'u=' . $this->user_id);
}
return '';
Modified: trunk/titania/includes/objects/category.php
==============================================================================
*** trunk/titania/includes/objects/category.php (original)
--- trunk/titania/includes/objects/category.php Thu Jun 25 03:29:56 2009
***************
*** 213,224 ****
'U_VIEW_CATEGORY' => $this->get_url(),
);
! if (!$return)
{
! phpbb::$template->assign_vars($display);
! return;
}
! return $display;
}
}
--- 213,223 ----
'U_VIEW_CATEGORY' => $this->get_url(),
);
! if ($return)
{
! return $display;
}
! phpbb::$template->assign_vars($display);
}
}
Modified: trunk/titania/includes/objects/post.php
==============================================================================
*** trunk/titania/includes/objects/post.php (original)
--- trunk/titania/includes/objects/post.php Thu Jun 25 03:29:56 2009
***************
*** 81,93 ****
'post_time' => array('default' => (int) titania::$time),
'post_edited' => array('default' => 0), // Post edited; 0 for not edited, timestamp if (when) last edited
'post_subject' => array('default' => ''),
'post_text' => array('default' => ''),
'post_text_bitfield' => array('default' => ''),
'post_text_uid' => array('default' => ''),
'post_text_options' => array('default' => 7),
- 'post_reason' => array('default' => ''), // Reason for deleting/editing
));
switch ($type)
--- 81,96 ----
'post_time' => array('default' => (int) titania::$time),
'post_edited' => array('default' => 0), // Post edited; 0 for not edited, timestamp if (when) last edited
+ 'post_deleted' => array('default' => 0), // Post deleted; 0 for not edited, timestamp if (when) last edited
+
+ 'post_edit_user' => array('default' => 0), // The last user to edit/delete the post
+ 'post_edit_reason' => array('default' => ''), // Reason for deleting/editing
'post_subject' => array('default' => ''),
'post_text' => array('default' => ''),
'post_text_bitfield' => array('default' => ''),
'post_text_uid' => array('default' => ''),
'post_text_options' => array('default' => 7),
));
switch ($type)
***************
*** 102,107 ****
--- 105,115 ----
$this->post_type = TITANIA_POST_QUEUE;
break;
+ case 'review' :
+ case TITANIA_POST_REVIEW :
+ $this->post_type = TITANIA_POST_REVIEW;
+ break;
+
default :
$this->post_type = TITANIA_POST_DEFAULT;
break;
***************
*** 129,164 ****
}
/**
! * Submit Post
*/
! public function submit()
{
! // If not editing an existing post we need to create a topic
! if (!$this->post_id)
! {
! if (!$this->acl_get('post'))
! {
! trigger_error('NO_AUTH');
! }
!
! $this->topic->__set_array(array(
! 'topic_access' => $this->post_access,
! 'topic_approved' => $this->post_approved,
! 'topic_user_id' => $this->post_user_id,
! 'topic_time' => $this->post_time,
! 'topic_subject' => $this->post_subject,
! ));
! }
! else
{
! if (!$this->acl_get('edit'))
! {
! trigger_error('NO_AUTH');
! }
}
// Update the postcount for the topic and submit the topic
! $this->topic->update_postcount($this->post_access, ((isset($this->sql_data['post_access'])) ? $this->sql_data['post_access'] : false), false);
$this->topic->submit();
$this->topic_id = $this->topic->topic_id;
--- 137,161 ----
}
/**
! * Post a post
*/
! public function post()
{
! if (!$this->acl_get('post'))
{
! trigger_error('NO_AUTH');
}
+ $this->topic->__set_array(array(
+ 'topic_access' => $this->post_access,
+ 'topic_approved' => $this->post_approved,
+ 'topic_user_id' => $this->post_user_id,
+ 'topic_time' => $this->post_time,
+ 'topic_subject' => $this->post_subject,
+ ));
+
// Update the postcount for the topic and submit the topic
! $this->topic->update_postcount($this->post_access, false, false);
$this->topic->submit();
$this->topic_id = $this->topic->topic_id;
***************
*** 172,223 ****
}
/**
! * Parse text to store in database
! *
! * @param bool $allow_bbcode
! * @param bool $allow_urls
! * @param bool $allow_smilies
! *
! * @return void
! */
! public function generate_text_for_storage($allow_bbcode = true, $allow_urls = true, $allow_smilies = true)
{
! generate_text_for_storage($this->post_text, $this->post_text_uid, $this->post_text_bitfield, $this->post_text_options, $allow_bbcode, $allow_urls, $allow_smilies);
! $this->text_parsed_for_storage = true;
! }
! /**
! * Parse text for display
! *
! * @return string text content from database for display
! */
! public function generate_text_for_display()
! {
! return generate_text_for_display($this->post_text, $this->post_text_uid, $this->post_text_bitfield, $this->post_text_options);
! }
! /**
! * Parse text for edit
! *
! * @return string text content from database for editing
! */
! public function generate_text_for_edit()
! {
! return generate_text_for_edit($this->post_text, $this->post_text_uid, $this->post_text_options);
}
/**
* Soft delete a post
*/
! public function soft_delete()
{
if (!$this->acl_get('soft_delete'))
{
trigger_error('NO_AUTH');
}
! $this->post_access = TITANIA_ACCESS_TEAMS;
$this->topic->update_postcount($this->post_access, $this->sql_data['post_access'], false);
--- 169,223 ----
}
/**
! * Edit a post
! */
! public function edit()
{
! if (!$this->post_id)
! {
! return false;
! }
! if (!$this->acl_get('edit'))
! {
! trigger_error('NO_AUTH');
! }
! $this->topic->__set_array(array(
! 'topic_access' => $this->post_access,
! 'topic_approved' => $this->post_approved,
! 'topic_user_id' => $this->post_user_id,
! 'topic_time' => $this->post_time,
! 'topic_subject' => $this->post_subject,
! ));
! // Update the postcount for the topic and submit the topic
! $this->topic->update_postcount($this->post_access, $this->sql_data['post_access'], false);
! $this->topic->submit();
!
! $this->topic_id = $this->topic->topic_id;
!
! if (!$this->text_parsed_for_storage)
! {
! $this->generate_text_for_storage();
! }
!
! return parent::submit();
}
/**
* Soft delete a post
*/
! public function soft_delete($reason = '')
{
if (!$this->acl_get('soft_delete'))
{
trigger_error('NO_AUTH');
}
! $this->post_deleted = titania::$time;
! $this->post_edit_user = phpbb::$user->data['user_id'];
! $this->post_edit_reason = $reason;
$this->topic->update_postcount($this->post_access, $this->sql_data['post_access'], false);
***************
*** 236,242 ****
$this->topic->submit();
! $this->submit();
}
/**
--- 236,242 ----
$this->topic->submit();
! parent::submit();
}
/**
***************
*** 263,269 ****
$this->topic->submit();
! $this->submit();
}
/**
--- 263,269 ----
$this->topic->submit();
! parent::submit();
}
/**
***************
*** 297,305 ****
}
/**
! * Catch an attempt to delete the post (must use the hard_delete function)
! */
! public function delete() { $this->hard_delete(); }
/**
* Check if the current user has permission to do something
--- 297,336 ----
}
/**
! * Parse text to store in database
! *
! * @param bool $allow_bbcode
! * @param bool $allow_urls
! * @param bool $allow_smilies
! *
! * @return void
! */
! public function generate_text_for_storage($allow_bbcode = true, $allow_urls = true, $allow_smilies = true)
! {
! generate_text_for_storage($this->post_text, $this->post_text_uid, $this->post_text_bitfield, $this->post_text_options, $allow_bbcode, $allow_urls, $allow_smilies);
!
! $this->text_parsed_for_storage = true;
! }
!
! /**
! * Parse text for display
! *
! * @return string text content from database for display
! */
! public function generate_text_for_display()
! {
! return generate_text_for_display($this->post_text, $this->post_text_uid, $this->post_text_bitfield, $this->post_text_options);
! }
!
! /**
! * Parse text for edit
! *
! * @return string text content from database for editing
! */
! public function generate_text_for_edit()
! {
! return generate_text_for_edit($this->post_text, $this->post_text_uid, $this->post_text_options);
! }
/**
* Check if the current user has permission to do something
***************
*** 361,364 ****
--- 392,418 ----
return false;
}
+
+ /**
+ * Catch an attempt to use submit
+ */
+ public function submit()
+ {
+ if (!$this->post_id)
+ {
+ return $this->post();
+ }
+ else
+ {
+ return $this->edit();
+ }
+ }
+
+ /**
+ * Catch an attempt to delete the post (must use the hard_delete function)
+ */
+ public function delete()
+ {
+ $this->hard_delete();
+ }
}
Removed: trunk/titania/includes/objects/review.php
==============================================================================
*** trunk/titania/includes/objects/review.php (original)
--- trunk/titania/includes/objects/review.php (removed)
***************
*** 1,260 ****
- <?php
- /**
- *
- * @package Titania
- * @version $Id$
- * @copyright (c) 2008 phpBB Customisation Database Team
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- *
- */
-
- /**
- * @ignore
- */
- if (!defined('IN_TITANIA'))
- {
- exit;
- }
-
- if (!class_exists('titania_database_object'))
- {
- require TITANIA_ROOT . 'includes/core/object.' . PHP_EXT;
- }
-
- /**
- * Class to abstract contribution reviews.
- * @package Titania
- */
- class titania_review extends titania_database_object
- {
- /**
- * SQL Table
- *
- * @var string
- */
- protected $sql_table = CUSTOMISATION_REVIEWS_TABLE;
-
- /**
- * SQL identifier field
- *
- * @var string
- */
- protected $sql_id_field = 'review_id';
-
- /**
- * Text parsed for storage
- *
- * @var bool
- */
- private $text_parsed_for_storage = false;
-
- /**
- * Constructor
- *
- * @param int $review_id
- */
- public function __construct($review_id = false)
- {
- // Configure object properties
- $this->object_config = array_merge($this->object_config, array(
- 'review_id' => array('default' => 0),
- 'contrib_id' => array('default' => 0),
- 'review_text' => array('default' => ''),
- 'review_text_bitfield' => array('default' => '', 'readonly' => true),
- 'review_text_uid' => array('default' => '', 'readonly' => true),
- 'review_text_options' => array('default' => 7, 'readonly' => true),
- 'review_rating' => array('default' => 3),
- 'review_user_id' => array('default' => 0),
- 'review_status' => array('default' => 1),
- 'review_time' => array('default' => 0),
- ));
-
- if ($review_id === false)
- {
- // We're going to create a new review
- $this->review_time = titania::$time;
- $this->review_user_id = phpbb::$user->data['user_id'];
- }
- else
- {
- // We're going to perform operations on an existing review
- $this->review_id = $review_id;
- }
- }
-
- /**
- * Update data or submit new review
- *
- * @return bool
- */
- public function submit()
- {
- // Nobody parsed the text for storage before. Parse text with lowest settings.
- if (!$this->text_parsed_for_storage)
- {
- $this->generate_text_for_storage(false, false, false);
- }
-
- return parent::submit();
- }
-
- /**
- * Get review data from the database
- *
- * @return bool
- */
- public function load()
- {
- $status = parent::load();
-
- if ($status)
- {
- $this->text_parsed_for_storage = true;
- }
-
- return $status;
- }
-
- /**
- * Parse text to store in database
- *
- * @param bool $allow_bbcode
- * @param bool $allow_urls
- * @param bool $allow_smilies
- *
- * @return void
- */
- public function generate_text_for_storage($allow_bbcode, $allow_urls, $allow_smilies)
- {
- $review_text = $this->review_text;
- $review_text_uid = $this->review_text_uid;
- $review_text_bitfield = $this->review_text_bitfield;
- $review_text_options = $this->review_text_options;
-
- generate_text_for_storage($review_text, $review_text_uid, $review_text_bitfield, $review_text_options, $allow_bbcode, $allow_urls, $allow_smilies);
-
- $this->review_text = $review_text;
- $this->review_text_uid = $review_text_uid;
- $this->review_text_bitfield = $review_text_bitfield;
- $this->review_text_options = $review_text_options;
-
- $this->text_parsed_for_storage = true;
- }
-
- /**
- * Parse text for display
- *
- * @return string text content from database for display
- */
- private function generate_text_for_display()
- {
- return generate_text_for_display($this->review_text, $this->review_text_uid, $this->review_text_bitfield, $this->review_text_options);
- }
-
- /**
- * Parse text for edit
- *
- * @return string text content from database for editing
- */
- private function generate_text_for_edit()
- {
- return generate_text_for_edit($this->review_text, $this->review_text_uid, $this->review_text_options);
- }
-
- /**
- * Getter function for review_text
- *
- * @param bool $editable
- *
- * @return string generate_text_for edit if editable is true, or display if false
- */
- public function get_review_text($editable = false)
- {
- // Text needs to be from database or parsed for database.
- if (!$this->text_parsed_for_storage)
- {
- $this->generate_text_for_storage(false, false, false);
- }
-
- if ($editable)
- {
- return $this->generate_text_for_edit();
- }
- else
- {
- return $this->generate_text_for_display();
- }
- }
-
- /**
- * Setter function for review_text
- *
- * @param string $text
- * @param string $uid
- * @param string $bitfield
- * @param int $flags
- *
- * @return void
- */
- public function set_review_text($text, $uid = false, $bitfield = false, $flags = false)
- {
- $this->review_text = $text;
- $this->text_parsed_for_storage = false;
-
- if ($uid !== false)
- {
- $this->review_text_uid = $uid;
- }
-
- if ($bitfield !== false)
- {
- $this->review_text_bitfield = $bitfield;
- }
-
- if ($flags !== false)
- {
- $this->review_text_options = $flags;
- }
- }
-
-
-
- /**
- * Display rating menu if user has not rated this contrib previously
- *
- * @return unknown
- */
- public function rating_menu($contrib_id)
- {
- $s_rating_options = '';
- foreach (phpbb::$user->lang['ratings'] as $rating => $lang)
- {
- $s_rating_options .= '<option value="' . $rating . '">' . $lang . '</option>';
- }
-
- return $s_rating_options;
- }
-
- /**
- * Obtain an array of reviews by contrib.
- *
- * @param int $contrib
- * @param string $order_by @todo
- */
- public function obtain_contrib_reviews($contrib_id, $order_by = false)
- {
- $reviews = array();
-
- $sql = 'SELECT *
- FROM ' . CUSTOMISATION_REVIEWS_TABLE . '
- WHERE contrib_id = ' . (int) $contrib_id;
- $result = phpbb::$db->sql_query($sql);
- while ($row = phpbb::$db->sql_fetchrow($result))
- {
- $reviews[$row['review_id']] = $row;
- }
- phpbb::$db->sql_freeresult($result);
-
- return $reviews;
- }
- }
\ No newline at end of file
--- 0 ----
Modified: trunk/titania/includes/objects/topic.php
==============================================================================
*** trunk/titania/includes/objects/topic.php (original)
--- trunk/titania/includes/objects/topic.php Thu Jun 25 03:29:56 2009
***************
*** 60,65 ****
--- 60,66 ----
'topic_locked' => array('default' => false),
'topic_approved' => array('default' => true),
'topic_reported' => array('default' => false), // True if any posts in the topic are reported
+ 'topic_deleted' => array('default' => false), // True if the topic is soft deleted
'topic_user_id' => array('default' => (int) phpbb::$user->data['user_id']),
***************
*** 68,73 ****
--- 69,80 ----
'topic_posts' => array('default' => ''), // Post count; separated by : between access levels ('10:9:8' = 10 team; 9 Mod Author; 8 Public)
'topic_subject' => array('default' => ''),
+
+ 'topic_last_post_id' => array('default' => 0),
+ 'topic_last_post_user_id' => array('default' => 0),
+ 'topic_last_post_user_colour' => array('default' => ''),
+ 'topic_last_post_time' => array('default' => (int) titania::$time),
+ 'topic_last_post_subject' => array('default' => ''),
));
switch ($type)
***************
*** 82,87 ****
--- 89,99 ----
$this->topic_type = TITANIA_POST_QUEUE;
break;
+ case 'review' :
+ case TITANIA_POST_REVIEW :
+ $this->topic_type = TITANIA_POST_REVIEW;
+ break;
+
default :
$this->topic_type = TITANIA_POST_DEFAULT;
break;
More information about the customisationdb-commits
mailing list