From 08bbd3f9127204aa4bc8be18fdc6ca6d68d88ff1 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Wed, 6 Apr 2011 18:31:26 +1000 Subject: Post saving/cache and Google Analytics integration --- inc/display.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'inc/display.php') diff --git a/inc/display.php b/inc/display.php index 88976457..72983a49 100644 --- a/inc/display.php +++ b/inc/display.php @@ -92,6 +92,14 @@ ))); } + function confirmLink($text, $title, $confirm, $href) { + global $config, $mod; + if($config['mod']['server-side_confirm']) + return '' . $text . ''; + else + return '' . $text . ''; + } + class Post { public function __construct($id, $thread, $subject, $email, $name, $trip, $body, $time, $thumb, $thumbx, $thumby, $file, $filex, $filey, $filesize, $filename, $ip, $root=null, $mod=false) { global $config; @@ -136,11 +144,11 @@ // Delete if($this->mod['type'] >= $config['mod']['delete']) - $built .= ' ' . $config['mod']['link_delete'] . ''; + $built .= ' ' . confirmLink($config['mod']['link_delete'], 'Delete', 'Are you sure you want to delete this?', $board['uri'] . '/delete/' . $this->id); // Delete all posts by IP if($this->mod['type'] >= $config['mod']['deletebyip']) - $built .= ' ' . $config['mod']['link_deletebyip'] . ''; + $built .= ' ' . confirmLink($config['mod']['link_deletebyip'], 'Delete all posts by IP', 'Are you sure you want to delete all posts by IP?', $board['uri'] . '/deletebyip/' . $this->id); // Ban if($this->mod['type'] >= $config['mod']['ban']) @@ -283,11 +291,11 @@ // Delete if($this->mod['type'] >= $config['mod']['delete']) - $built .= ' ' . $config['mod']['link_delete'] . ''; + $built .= ' ' . confirmLink($config['mod']['link_delete'], 'Delete', 'Are you sure you want to delete this?', $board['uri'] . '/delete/' . $this->id); // Delete all posts by IP if($this->mod['type'] >= $config['mod']['deletebyip']) - $built .= ' ' . $config['mod']['link_deletebyip'] . ''; + $built .= ' ' . confirmLink($config['mod']['link_deletebyip'], 'Delete all posts by IP', 'Are you sure you want to delete all posts by IP?', $board['uri'] . '/deletebyip/' . $this->id); // Ban if($this->mod['type'] >= $config['mod']['ban']) -- cgit v1.3