Created
October 5, 2013 14:14
-
-
Save marc1706/6841419 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<pmd-cpd> | |
<duplication lines="8" tokens="36"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/session.php" line="373"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/session.php" line="692"/> | |
<codefragment> if (strpos($this->ip, ':') !== false && strpos($this->data['session_ip'], ':') !== false) | |
{ | |
$s_ip = short_ipv6($this->data['session_ip'], $config['ip_check']); | |
$u_ip = short_ipv6($this->ip, $config['ip_check']); | |
} | |
else | |
{ | |
$s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check'])); | |
</codefragment> | |
</duplication> | |
<duplication lines="11" tokens="36"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/feed/topics.php" line="81"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/feed/overall.php" line="80"/> | |
<codefragment> 'ORDER_BY' => 'p.post_time DESC', | |
); | |
return true; | |
} | |
function adjust_item(&$item_row, &$row) | |
{ | |
parent::adjust_item($item_row, $row); | |
$item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title']; | |
</codefragment> | |
</duplication> | |
<duplication lines="16" tokens="33"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/feed/topics.php" line="38"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/feed/news.php" line="66"/> | |
<codefragment> $in_fid_ary = array_diff($forum_ids_read, $this->get_excluded_forums(), $this->get_passworded_forums()); | |
if (empty($in_fid_ary)) | |
{ | |
return false; | |
} | |
// We really have to get the post ids first! | |
$sql = 'SELECT topic_first_post_id, topic_time | |
FROM ' . TOPICS_TABLE . ' | |
WHERE ' . $this->db->sql_in_set('forum_id', $in_fid_ary) . ' | |
AND topic_moved_id = 0 | |
AND topic_visibility = ' . ITEM_APPROVED . ' | |
ORDER BY topic_time DESC'; | |
$result = $this->db->sql_query_limit($sql, $this->num_items); | |
$post_ids = array(); | |
</codefragment> | |
</duplication> | |
<duplication lines="21" tokens="13"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/auth/provider/apache.php" line="25"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/auth/provider/db.php" line="27"/> | |
<codefragment>class apache extends \phpbb\auth\provider\base | |
{ | |
/** | |
* phpBB passwords manager | |
* | |
* @var \phpbb\passwords\manager | |
*/ | |
protected $passwords_manager; | |
/** | |
* Apache Authentication Constructor | |
* | |
* @param \phpbb\db\driver\driver $db | |
* @param \phpbb\config\config $config | |
* @param \phpbb\passwords\manager $passwords_manager | |
* @param \phpbb\request\request $request | |
* @param \phpbb\user $user | |
* @param string $phpbb_root_path | |
* @param string $php_ext | |
*/ | |
public function __construct(\phpbb\db\driver\driver $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request $request, \phpbb\user $user, $phpbb_root_path, $php_ext) | |
</codefragment> | |
</duplication> | |
<duplication lines="23" tokens="30"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/groupposition/legend.php" line="228"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/groupposition/teampage.php" line="581"/> | |
<codefragment> return false; | |
} | |
/** | |
* Get group type language var | |
* | |
* @param int $group_type group_type from the groups-table | |
* @return string name of the language variable for the given group-type. | |
*/ | |
static public function group_type_language($group_type) | |
{ | |
switch ($group_type) | |
{ | |
case GROUP_OPEN: | |
return 'GROUP_REQUEST'; | |
case GROUP_CLOSED: | |
return 'GROUP_CLOSED'; | |
case GROUP_HIDDEN: | |
return 'GROUP_HIDDEN'; | |
case GROUP_SPECIAL: | |
return 'GROUP_SPECIAL'; | |
case GROUP_FREE: | |
return 'GROUP_OPEN'; | |
</codefragment> | |
</duplication> | |
<duplication lines="26" tokens="49"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/cache/driver/file.php" line="444"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/cache/driver/memory.php" line="348"/> | |
<codefragment> function sql_exists($query_id) | |
{ | |
return isset($this->sql_rowset[$query_id]); | |
} | |
/** | |
* Fetch row from cache (database) | |
*/ | |
function sql_fetchrow($query_id) | |
{ | |
if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id])) | |
{ | |
return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++]; | |
} | |
return false; | |
} | |
/** | |
* Fetch a field from the current row of a cached database result (database) | |
*/ | |
function sql_fetchfield($query_id, $field) | |
{ | |
if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id])) | |
{ | |
return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++][$field] : false; | |
</codefragment> | |
</duplication> | |
<duplication lines="13" tokens="16"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/avatar/driver/driver.php" line="126"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/passwords/driver/base.php" line="56"/> | |
<codefragment> public function get_name() | |
{ | |
return $this->name; | |
} | |
/** | |
* Sets the name of the driver. | |
* | |
* @param string $name Driver name | |
*/ | |
public function set_name($name) | |
{ | |
$this->name = $name; | |
</codefragment> | |
</duplication> | |
<duplication lines="35" tokens="59"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/search/fulltext_postgres.php" line="359"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/search/fulltext_mysql.php" line="370"/> | |
<codefragment> return false; | |
} | |
// generate a search_key from all the options to identify the results | |
$search_key = md5(implode('#', array( | |
implode(', ', $this->split_words), | |
$type, | |
$fields, | |
$terms, | |
$sort_days, | |
$sort_key, | |
$topic_id, | |
implode(',', $ex_fid_ary), | |
$post_visibility, | |
implode(',', $author_ary) | |
))); | |
if ($start < 0) | |
{ | |
$start = 0; | |
} | |
// try reading the results from cache | |
$result_count = 0; | |
if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE) | |
{ | |
return $result_count; | |
} | |
$id_ary = array(); | |
$join_topic = ($type == 'posts') ? false : true; | |
// Build sql strings for sorting | |
$sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); | |
</codefragment> | |
</duplication> | |
<duplication lines="83" tokens="148"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/search/fulltext_postgres.php" line="518"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/search/fulltext_mysql.php" line="514"/> | |
<codefragment> $id_ary[] = $row[$field]; | |
} | |
$this->db->sql_freeresult($result); | |
$id_ary = array_unique($id_ary); | |
} | |
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page | |
$this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir); | |
$id_ary = array_slice($id_ary, 0, (int) $per_page); | |
return $result_count; | |
} | |
/** | |
* Performs a search on an author's posts without caring about message contents. Depends on display specific params | |
* | |
* @param string $type contains either posts or topics depending on what should be searched for | |
* @param boolean $firstpost_only if true, only topic starting posts will be considered | |
* @param array $sort_by_sql contains SQL code for the ORDER BY part of a query | |
* @param string $sort_key is the key of $sort_by_sql for the selected sorting | |
* @param string $sort_dir is either a or d representing ASC and DESC | |
* @param string $sort_days specifies the maximum amount of days a post may be old | |
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched | |
* @param string $post_visibility specifies which types of posts the user can view in which forums | |
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched | |
* @param array $author_ary an array of author ids | |
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match | |
* @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered | |
* @param int $start indicates the first index of the page | |
* @param int $per_page number of ids each page is supposed to contain | |
* @return boolean|int total number of results | |
*/ | |
public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page) | |
{ | |
// No author? No posts | |
if (!sizeof($author_ary)) | |
{ | |
return 0; | |
} | |
// generate a search_key from all the options to identify the results | |
$search_key = md5(implode('#', array( | |
'', | |
$type, | |
($firstpost_only) ? 'firstpost' : '', | |
'', | |
'', | |
$sort_days, | |
$sort_key, | |
$topic_id, | |
implode(',', $ex_fid_ary), | |
$post_visibility, | |
implode(',', $author_ary), | |
$author_name, | |
))); | |
if ($start < 0) | |
{ | |
$start = 0; | |
} | |
// try reading the results from cache | |
$result_count = 0; | |
if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE) | |
{ | |
return $result_count; | |
} | |
$id_ary = array(); | |
// Create some display specific sql strings | |
if ($author_name) | |
{ | |
// first one matches post of registered users, second one guests and deleted users | |
$sql_author = '(' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')'; | |
} | |
else | |
{ | |
$sql_author = $this->db->sql_in_set('p.poster_id', $author_ary); | |
} | |
$sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; | |
$sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : ''; | |
</codefragment> | |
</duplication> | |
<duplication lines="15" tokens="45"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/search/fulltext_postgres.php" line="711"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/search/fulltext_mysql.php" line="681"/> | |
<codefragment> if ($start >= $result_count) | |
{ | |
$start = floor(($result_count - 1) / $per_page) * $per_page; | |
$result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); | |
while ($row = $this->db->sql_fetchrow($result)) | |
{ | |
$id_ary[] = (int) $row[$field]; | |
} | |
$this->db->sql_freeresult($result); | |
$id_ary = array_unique($id_ary); | |
} | |
if (sizeof($id_ary)) | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="19"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/firebird.php" line="530"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mssql_odbc.php" line="375"/> | |
<codefragment> @ibase_free_result($result); | |
$splittime = explode(' ', microtime()); | |
$splittime = $splittime[0] + $splittime[1]; | |
$this->sql_report('record_fromcache', $query, $endtime, $splittime); | |
break; | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="16"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mssql_odbc.php" line="186"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mssqlnative.php" line="326"/> | |
<codefragment> if (defined('DEBUG')) | |
{ | |
$this->sql_report('stop', $query); | |
} | |
if ($cache && $cache_ttl) | |
{ | |
$this->open_queries[(int) $this->query_result] = $this->query_result; | |
</codefragment> | |
</duplication> | |
<duplication lines="23" tokens="67"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mssql_odbc.php" line="181"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mssql.php" line="160"/> | |
<codefragment> if (($this->query_result = @odbc_exec($this->db_connect_id, $query)) === false) | |
{ | |
$this->sql_error($query); | |
} | |
if (defined('DEBUG')) | |
{ | |
$this->sql_report('stop', $query); | |
} | |
if ($cache && $cache_ttl) | |
{ | |
$this->open_queries[(int) $this->query_result] = $this->query_result; | |
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl); | |
} | |
else if (strpos($query, 'SELECT') === 0 && $this->query_result) | |
{ | |
$this->open_queries[(int) $this->query_result] = $this->query_result; | |
} | |
} | |
else if (defined('DEBUG')) | |
{ | |
$this->sql_report('fromcache', $query); | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="19"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/firebird.php" line="530"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mssql.php" line="464"/> | |
<codefragment> @ibase_free_result($result); | |
$splittime = explode(' ', microtime()); | |
$splittime = $splittime[0] + $splittime[1]; | |
$this->sql_report('record_fromcache', $query, $endtime, $splittime); | |
break; | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="14"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mssql.php" line="160"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mysql.php" line="190"/> | |
<codefragment> if (($this->query_result = @mssql_query($query, $this->db_connect_id)) === false) | |
{ | |
$this->sql_error($query); | |
} | |
if (defined('DEBUG')) | |
{ | |
$this->sql_report('stop', $query); | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="19"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/firebird.php" line="530"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mysql.php" line="464"/> | |
<codefragment> @ibase_free_result($result); | |
$splittime = explode(' ', microtime()); | |
$splittime = $splittime[0] + $splittime[1]; | |
$this->sql_report('record_fromcache', $query, $endtime, $splittime); | |
break; | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="16"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mssql_odbc.php" line="186"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/oracle.php" line="443"/> | |
<codefragment> if (defined('DEBUG')) | |
{ | |
$this->sql_report('stop', $query); | |
} | |
if ($cache && $cache_ttl) | |
{ | |
$this->open_queries[(int) $this->query_result] = $this->query_result; | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="19"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/firebird.php" line="530"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/oracle.php" line="795"/> | |
<codefragment> @ibase_free_result($result); | |
$splittime = explode(' ', microtime()); | |
$splittime = $splittime[0] + $splittime[1]; | |
$this->sql_report('record_fromcache', $query, $endtime, $splittime); | |
break; | |
</codefragment> | |
</duplication> | |
<duplication lines="13" tokens="27"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mssql.php" line="160"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/sqlite.php" line="144"/> | |
<codefragment> if (($this->query_result = @mssql_query($query, $this->db_connect_id)) === false) | |
{ | |
$this->sql_error($query); | |
} | |
if (defined('DEBUG')) | |
{ | |
$this->sql_report('stop', $query); | |
} | |
if ($cache && $cache_ttl) | |
{ | |
$this->open_queries[(int) $this->query_result] = $this->query_result; | |
</codefragment> | |
</duplication> | |
<duplication lines="6" tokens="18"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/firebird.php" line="532"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/sqlite.php" line="359"/> | |
<codefragment> $splittime = explode(' ', microtime()); | |
$splittime = $splittime[0] + $splittime[1]; | |
$this->sql_report('record_fromcache', $query, $endtime, $splittime); | |
break; | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="14"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mssql_odbc.php" line="181"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/postgres.php" line="203"/> | |
<codefragment> if (($this->query_result = @odbc_exec($this->db_connect_id, $query)) === false) | |
{ | |
$this->sql_error($query); | |
} | |
if (defined('DEBUG')) | |
{ | |
$this->sql_report('stop', $query); | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="19"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/firebird.php" line="530"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/postgres.php" line="483"/> | |
<codefragment> @ibase_free_result($result); | |
$splittime = explode(' ', microtime()); | |
$splittime = $splittime[0] + $splittime[1]; | |
$this->sql_report('record_fromcache', $query, $endtime, $splittime); | |
break; | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="19"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/firebird.php" line="530"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/driver/mysqli.php" line="455"/> | |
<codefragment> @ibase_free_result($result); | |
$splittime = explode(' ', microtime()); | |
$splittime = $splittime[0] + $splittime[1]; | |
$this->sql_report('record_fromcache', $query, $endtime, $splittime); | |
break; | |
</codefragment> | |
</duplication> | |
<duplication lines="6" tokens="15"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/tools.php" line="142"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/tools.php" line="172"/> | |
<codefragment> 'mssql' => array( | |
'INT:' => '[int]', | |
'BINT' => '[float]', | |
'UINT' => '[int]', | |
'UINT:' => '[int]', | |
'TINT:' => '[int]', | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="15"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/tools.php" line="1771"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/tools.php" line="1886"/> | |
<codefragment> if (version_compare(sqlite_libversion(), '3.0') == -1) | |
{ | |
$sql = "SELECT sql | |
FROM sqlite_master | |
WHERE type = 'table' | |
AND name = '{$table_name}' | |
ORDER BY type DESC, name;"; | |
$result = $this->db->sql_query($sql); | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="12"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/tools.php" line="1778"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/tools.php" line="2087"/> | |
<codefragment> $result = $this->db->sql_query($sql); | |
if (!$result) | |
{ | |
break; | |
} | |
$row = $this->db->sql_fetchrow($result); | |
</codefragment> | |
</duplication> | |
<duplication lines="9" tokens="29"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/migration/data/v310/notifications.php" line="27"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php" line="66"/> | |
<codefragment> 'add_tables' => array( | |
$this->table_prefix . 'notification_types' => array( | |
'COLUMNS' => array( | |
'notification_type' => array('VCHAR:255', ''), | |
'notification_type_enabled' => array('BOOL', 1), | |
), | |
'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'), | |
), | |
$this->table_prefix . 'notifications' => array( | |
</codefragment> | |
</duplication> | |
<duplication lines="8" tokens="6"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php" line="189"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php" line="66"/> | |
<codefragment> if ($converted_forums < $limit) | |
{ | |
// There are no more topics, we are done | |
return; | |
} | |
// There are still more topics to query, return the next start value | |
return $start + $limit; | |
</codefragment> | |
</duplication> | |
<duplication lines="9" tokens="14"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/migration/tool/permission.php" line="613"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/db/migration/tool/config.php" line="141"/> | |
<codefragment> $arguments[1], | |
$arguments[0], | |
); | |
break; | |
} | |
if ($call) | |
{ | |
return call_user_func_array(array(&$this, $call), $arguments); | |
</codefragment> | |
</duplication> | |
<duplication lines="39" tokens="68"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/notification/type/report_pm.php" line="191"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/notification/type/report_post.php" line="158"/> | |
<codefragment> $this->get_data('reason_description') | |
); | |
} | |
/** | |
* Get the user's avatar | |
*/ | |
public function get_avatar() | |
{ | |
return $this->user_loader->get_avatar($this->get_data('reporter_id')); | |
} | |
/** | |
* Users needed to query before this notification can be displayed | |
* | |
* @return array Array of user_ids | |
*/ | |
public function users_to_query() | |
{ | |
return array($this->get_data('reporter_id')); | |
} | |
/** | |
* Function for preparing the data for insertion in an SQL query | |
* (The service handles insertion) | |
* | |
* @param array $post Data from submit_post | |
* @param array $pre_create_data Data from pre_create_insert_array() | |
* | |
* @return array Array of data ready to be inserted into the database | |
*/ | |
public function create_insert_array($post, $pre_create_data = array()) | |
{ | |
$this->set_data('reporter_id', $this->user->data['user_id']); | |
$this->set_data('reason_title', strtoupper($post['reason_title'])); | |
$this->set_data('reason_description', $post['reason_description']); | |
$this->set_data('report_text', $post['report_text']); | |
return parent::create_insert_array($post, $pre_create_data); | |
</codefragment> | |
</duplication> | |
<duplication lines="17" tokens="45"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/notification/type/quote.php" line="113"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/notification/type/post.php" line="129"/> | |
<codefragment> sort($users); | |
$auth_read = $this->auth->acl_get_list($users, 'f_read', $post['forum_id']); | |
if (empty($auth_read)) | |
{ | |
return array(); | |
} | |
$notify_users = $this->check_user_notification_options($auth_read[$post['forum_id']]['f_read'], $options); | |
// Try to find the users who already have been notified about replies and have not read the topic since and just update their notifications | |
$update_notifications = array(); | |
$sql = 'SELECT n.* | |
FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt | |
WHERE n.notification_type_id = ' . (int) $this->notification_type_id . ' | |
AND n.item_parent_id = ' . (int) self::get_item_parent_id($post) . ' | |
</codefragment> | |
</duplication> | |
<duplication lines="12" tokens="21"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/notification/type/approve_post.php" line="51"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/notification/type/approve_topic.php" line="51"/> | |
<codefragment> public static $notification_option = array( | |
'id' => 'moderation_queue', | |
'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE', | |
'group' => 'NOTIFICATION_GROUP_POSTING', | |
); | |
/** | |
* Is available | |
*/ | |
public function is_available() | |
{ | |
return !$this->auth->acl_get('m_approve'); | |
</codefragment> | |
</duplication> | |
<duplication lines="30" tokens="78"> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/notification/type/quote.php" line="100"/> | |
<file path="/home/marc/Dokumente/Entwicklung/phpbb3/phpBB/phpbb/notification/type/bookmark.php" line="81"/> | |
<codefragment> WHERE ' . $this->db->sql_in_set('username_clean', $usernames) . ' | |
AND user_id <> ' . (int) $post['poster_id']; | |
$result = $this->db->sql_query($sql); | |
while ($row = $this->db->sql_fetchrow($result)) | |
{ | |
$users[] = $row['user_id']; | |
} | |
$this->db->sql_freeresult($result); | |
if (empty($users)) | |
{ | |
return array(); | |
} | |
sort($users); | |
$auth_read = $this->auth->acl_get_list($users, 'f_read', $post['forum_id']); | |
if (empty($auth_read)) | |
{ | |
return array(); | |
} | |
$notify_users = $this->check_user_notification_options($auth_read[$post['forum_id']]['f_read'], $options); | |
// Try to find the users who already have been notified about replies and have not read the topic since and just update their notifications | |
$update_notifications = array(); | |
$sql = 'SELECT n.* | |
FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt | |
WHERE n.notification_type_id = ' . (int) $this->notification_type_id . ' | |
AND n.item_parent_id = ' . (int) self::get_item_parent_id($post) . ' | |
</codefragment> | |
</duplication> | |
</pmd-cpd> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment