aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2017-04-26 19:58:29 -0400
committerMarc Alexander <admin@m-a-styles.de>2017-04-26 19:58:29 -0400
commit8179e56b028d76c0c9f13c9b064068e546f68a6a (patch)
treeea34821fe5fc85fd57db500412d297cdad1efe39 /phpBB
parent38d8787854a5e711f5e57f7e219671834503029a (diff)
parente53343857a2c54f7d14f8ce420b9db1d75a62c16 (diff)
downloadforums-8179e56b028d76c0c9f13c9b064068e546f68a6a.tar
forums-8179e56b028d76c0c9f13c9b064068e546f68a6a.tar.gz
forums-8179e56b028d76c0c9f13c9b064068e546f68a6a.tar.bz2
forums-8179e56b028d76c0c9f13c9b064068e546f68a6a.tar.xz
forums-8179e56b028d76c0c9f13c9b064068e546f68a6a.zip
Merge branch '3.1.x' into 3.2.x
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions_posting.php30
1 files changed, 29 insertions, 1 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 7bc9608536..92679f8503 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1165,7 +1165,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
*/
function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $softdelete_reason = '')
{
- global $db, $user, $phpbb_container;
+ global $db, $user, $phpbb_container, $phpbb_dispatcher;
global $config, $phpEx, $phpbb_root_path;
// Specify our post mode
@@ -1416,6 +1416,34 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $
sync('topic_reported', 'topic_id', array($topic_id));
}
+ /**
+ * This event is used for performing actions directly after a post or topic
+ * has been deleted.
+ *
+ * @event core.delete_post_after
+ * @var int forum_id Post forum ID
+ * @var int topic_id Post topic ID
+ * @var int post_id Post ID
+ * @var array data Post data
+ * @var bool is_soft Soft delete flag
+ * @var string softdelete_reason Soft delete reason
+ * @var string post_mode delete_topic, delete_first_post, delete_last_post or delete
+ * @var mixed next_post_id Next post ID in the topic (post ID or false)
+ *
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'forum_id',
+ 'topic_id',
+ 'post_id',
+ 'data',
+ 'is_soft',
+ 'softdelete_reason',
+ 'post_mode',
+ 'next_post_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_post_after', compact($vars)));
+
return $next_post_id;
}
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
#!/usr/bin/perl -wT
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
#                 Gervase Markham <gerv@gerv.net>

use strict;

use lib qw(.);

use File::Temp;

use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Bug;

Bugzilla->login();

my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
my $vars = {};
# Connect to the shadow database if this installation is using one to improve
# performance.
my $dbh = Bugzilla->switch_to_shadow_db();

local our (%seen, %edgesdone, %bugtitles);

# CreateImagemap: This sub grabs a local filename as a parameter, reads the 
# dot-generated image map datafile residing in that file and turns it into
# an HTML map element. THIS SUB IS ONLY USED FOR LOCAL DOT INSTALLATIONS.
# The map datafile won't necessarily contain the bug summaries, so we'll
# pull possible HTML titles from the %bugtitles hash (filled elsewhere
# in the code)

# The dot mapdata lines have the following format (\nsummary is optional):
# rectangle (LEFTX,TOPY) (RIGHTX,BOTTOMY) URLBASE/show_bug.cgi?id=BUGNUM BUGNUM[\nSUMMARY]

sub CreateImagemap {
    my $mapfilename = shift;
    my $map = "<map name=\"imagemap\">\n";
    my $default;

    open MAP, "<$mapfilename";
    while(my $line = <MAP>) {
        if($line =~ /^default ([^ ]*)(.*)$/) {
            $default = qq{<area alt="" shape="default" href="$1">\n};
        }

        if ($line =~ /^rectangle \((.*),(.*)\) \((.*),(.*)\) (http[^ ]*)(.*)?$/) {
            my ($leftx, $rightx, $topy, $bottomy, $url) = ($1, $3, $2, $4, $5);

            # Pick up bugid from the mapdata label field. Getting the title from
            # bugtitle hash instead of mapdata allows us to get the summary even