Created
June 19, 2014 08:37
-
-
Save nickvergessen/386c19c606c9bf1e032f to your computer and use it in GitHub Desktop.
This file contains 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
Move [c]$active_f_row = $active_t_row = array();[/c] to the top of the function, | |
Add event before [c]if ($userdata['user_posts'] > 5000)[/c] and make the if condition a event variable as well as active_t_row, active_f_row | |
if active_t/f_row are both not empty anymore, skip the [c]if (!empty($forum_ary))[/c] |
This file contains 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
[b]Variables:[/b] | |
[list] | |
[*]$link_topic | |
[*]$link_forum | |
[*]$link_pm | |
[*]$insert_url | |
[*]$view_url | |
[*]$title | |
[*]$skip_row[/list] | |
[b]Before:[/b][code]$template->assign_block_vars('draftrow', array([/code] | |
Directly add [c]topic_poster[/c] to the query |
This file contains 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
Should not be needed. We just load all for this user and then check the permissions before displaying them? |
This file contains 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
We should fix phpbb and deduplicate this into a parent method, then only 1 event should be required |
if (!empty($forum_ary))
You mean... skip all the code for when that condition returns true?
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 4606a9f..ba4fa76 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -1061,14 +1061,21 @@ function display_user_activity(&$userdata)
global $auth, $template, $db, $user;
global $phpbb_root_path, $phpEx, $phpbb_container;
+ $active_f_row = $active_t_row = array();
// Do not display user activity for users having more than 5000 posts...
- if ($userdata['user_posts'] > 5000)
+ $display_activity = $userdata['user_posts'] <= 5000;
+
+ // brunoais event here
+
+ if (!$display_activity)
{
return;
}
$forum_ary = array();
+ if (empty($active_f_row) || empty($active_t_row))
+ {
$forum_read_ary = $auth->acl_getf('f_read');
foreach ($forum_read_ary as $forum_id => $allowed)
{
@@ -1079,8 +1086,8 @@ function display_user_activity(&$userdata)
}
$forum_ary = array_diff($forum_ary, $user->get_passworded_forums());
+ }
- $active_f_row = $active_t_row = array();
if (!empty($forum_ary))
{
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
Edit the query in phpBB's code to include the topic poster?
yes
Where would be the best place to check them, then? In all places where f_read permission checks are, there's still no info about which topics are being checked (AFAIK). Did I miss anything?
<nickvergessen> you can check that in the event before $template->assign_block_vars('draftrow', array(
<nickvergessen> thats why I added a condition to skip it
<nickvergessen> after the event you add if ($skip_row) { continue; }
Should I do a ticket about that?
looking into it at the moment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if (!empty($forum_ary))
You mean... skip all the code for when that condition returns true?
Edit the query in phpBB's code to include the topic poster?
Where would be the best place to check them, then? In all places where f_read permission checks are, there's still no info about which topics are being checked (AFAIK). Did I miss anything?
Should I do a ticket about that?