Skip to content

Commit

Permalink
Trash flag cache after deleting a user
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcgirr83 committed Dec 5, 2024
1 parent ef7a10c commit 1529f5d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "phpbb-extension",
"description": "Allows a user to be able to choose a national flag and have a top (those with the most users selecting the flag) number of flags display on the index page of a phpBB forum. Header is link to a listing of all users of a flag. Clicking on user count of the flag displays the users that have that flag set. This extension requires at least phpBB version 3.3.4. Must have version 2.0.0 of Collapsible Forum Categories to take advantage of that extension.",
"homepage": "https://github.com/rmcgirr83/nationalflags",
"version": "2.4.1",
"time": "2024-12-01",
"version": "2.4.2",
"time": "2024-12-05",
"keywords": [
"phpbb",
"extension",
Expand Down
18 changes: 17 additions & 1 deletion event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ static public function getSubscribedEvents()
'core.viewforum_modify_page_title' => 'viewforum_modify_page_title',
'core.viewforum_modify_topicrow' => 'viewforum_modify_topicrow',
'paybas.recenttopics.modify_tpl_ary' => 'recenttopics_modify_tpl_ary',
'core.delete_user_after' => 'delete_user_after',
];
}

Expand Down Expand Up @@ -620,7 +621,11 @@ public function viewforum_modify_topicrow($event)
$event['topic_row'] = $template_vars;
}


/* recenttopics_modify_tpl_ary
* @param object The event object
* @return string A flag image
* @access public
*/
public function recenttopics_modify_tpl_ary($event)
{
$row = $event['row'];
Expand All @@ -639,4 +644,15 @@ public function recenttopics_modify_tpl_ary($event)

$event['tpl_ary'] = $template_vars;
}

/* delete_user_after
* @param object The event object
* @return string A flag image
* @access public
*/
public function delete_user_after($event)
{
//call function to trash the users_and_flags cache so it's regenerated
$this->nationalflags->trash_the_cache();
}
}

0 comments on commit 1529f5d

Please sign in to comment.