[ticket/11103] Code cleanup

PHPBB3-11103
This commit is contained in:
Nathan Guse 2012-10-29 18:15:01 -05:00
parent e549b7663d
commit ecf6f1eb8c
4 changed files with 2 additions and 64 deletions

View file

@ -231,7 +231,7 @@ class phpbb_notification_manager
return; return;
} }
$time = ($time) ?: time(); $time = ($time !== false) ? $time : time();
$sql = 'UPDATE ' . NOTIFICATIONS_TABLE . " $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . "
SET unread = 0 SET unread = 0

View file

@ -78,38 +78,6 @@ class phpbb_notification_type_approve_post extends phpbb_notification_type_post
))); )));
} }
/**
* Pre create insert array function
* This allows you to perform certain actions, like run a query
* and load data, before create_insert_array() is run. The data
* returned from this function will be sent to create_insert_array().
*
* @param array $post Post data from submit_post
* @param array $notify_users Notify users list
* Formated from find_users_for_notification()
* @return array Whatever you want to send to create_insert_array().
*/
public function pre_create_insert_array($post, $notify_users)
{
/*if (!sizeof($notify_users))
{
return array();
}
// Mark the topic unread before the post
$sql = 'UPDATE ' . TOPICS_TRACK_TABLE . '
SET mark_time = ' . (int) ($post['post_time'] - 1) . '
WHERE topic_id = ' . (int) $post['topic_id'] . '
AND ' . $this->db->sql_in_set('user_id', array_keys($notify_users));
$this->db->sql_query($sql);*/
// In the parent class, this is used to check if the post is already
// read by a user and marks the notification read if it was marked read.
// Returning an empty array in effect, forces it to be marked as unread
// (and also saves a query)
return array();
}
/** /**
* Function for preparing the data for insertion in an SQL query * Function for preparing the data for insertion in an SQL query
* (The service handles insertion) * (The service handles insertion)

View file

@ -78,36 +78,6 @@ class phpbb_notification_type_approve_topic extends phpbb_notification_type_topi
))); )));
} }
/**
* Pre create insert array function
* This allows you to perform certain actions, like run a query
* and load data, before create_insert_array() is run. The data
* returned from this function will be sent to create_insert_array().
*
* @param array $post Post data from submit_post
* @param array $notify_users Notify users list
* Formated from find_users_for_notification()
* @return array Whatever you want to send to create_insert_array().
*/
public function pre_create_insert_array($post, $notify_users)
{
/*if (!sizeof($notify_users))
{
return array();
}
// Mark the topic unread
$sql = 'DELETE FROM ' . TOPICS_TRACK_TABLE . '
WHERE topic_id = ' . (int) $post['topic_id'] . '
AND ' . $this->db->sql_in_set('user_id', array_keys($notify_users));
$this->db->sql_query($sql*/
// In the parent class, this is used to check if the post is already
// read by a user and marks the notification read if it was marked read.
// Returning an empty array in effect, forces it to be marked as unread
return array();
}
/** /**
* Function for preparing the data for insertion in an SQL query * Function for preparing the data for insertion in an SQL query
* (The service handles insertion) * (The service handles insertion)