diff --git a/e107_plugins/download/download_shortcodes.php b/e107_plugins/download/download_shortcodes.php index 1d0ebd766..5f28a7ef6 100644 --- a/e107_plugins/download/download_shortcodes.php +++ b/e107_plugins/download/download_shortcodes.php @@ -781,7 +781,14 @@ class download_shortcodes extends e_shortcode function sc_download_report_link() { $pref = e107::getPref(); - return (check_class($pref['download_reportbroken'])) ? "".LAN_dl_45."" : ""; + if(check_class($pref['download_reportbroken'])) + { + //$url = e_PLUGIN_ABS."download/download.php?action=report&id=".$this->var['download_id']; + $url = e107::url('download','report', $this->var); + return "".LAN_dl_45.""; + } + + return ''; } function sc_download_view_caption() diff --git a/e107_plugins/download/e_url.php b/e107_plugins/download/e_url.php index f03c2252a..3259b44fc 100644 --- a/e107_plugins/download/e_url.php +++ b/e107_plugins/download/e_url.php @@ -114,6 +114,13 @@ class download_url // plugin-folder + '_url' 'redirect' => '{e_PLUGIN}download/request.php?id=$1', // file-path of what to load when the regex returns true. ); + $config['report'] = array( + 'regex' => '^{alias}/report/([\d]*)/(.*)$', + 'sef' => '{alias}/report/{download_id}/{download_sef}', + 'redirect' => '{e_PLUGIN}download/download.php?action=report&id=$1', // file-path of what to load when the regex returns true. + + ); + $config['image'] = array( 'regex' => '^{alias}/image/([\d]*)/(.*)$', 'sef' => '{alias}/image/{download_id}/{download_sef}', diff --git a/e107_plugins/download/handlers/download_class.php b/e107_plugins/download/handlers/download_class.php index 038e1e19c..89825c63f 100644 --- a/e107_plugins/download/handlers/download_class.php +++ b/e107_plugins/download/handlers/download_class.php @@ -781,12 +781,21 @@ class download $dlrow = $sql->fetch(); - extract($dlrow); + // extract($dlrow); + + $download_name = $tp->toDB($dlrow['download_name']); + $download_id = (int) $dlrow['download_id']; + + $breadcrumb = array(); + $breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => e107::url('download','index', $dlrow)); + $breadcrumb[] = array('text' => $dlrow['download_category_name'], 'url' => e107::url('download','category', $dlrow)); // e_SELF."?action=list&id=".$dlrow['download_category_id']); + $breadcrumb[] = array('text' => $dlrow['download_name'], 'url' => e107::url('download','item', $dlrow)); //e_SELF."?action=view&id=".$dlrow['download_id']); + $breadcrumb[] = array('text' => LAN_dl_45, 'url' => null); if (isset($_POST['report_download'])) { $report_add = $tp->toDB($_POST['report_add']); - $download_name = $tp->toDB($download_name); + $user = USER ? USERNAME : LAN_GUEST; if ($pref['download_email']) @@ -798,36 +807,38 @@ class download sendemail(SITEADMINEMAIL, $subject, $report); } - $sql->insert('generic', "0, 'Broken Download', ".time().",'".USERID."', '{$download_name}', {$id}, '{$report_add}'"); + $sql->insert('generic', "0, 'Broken Download', ".time().",'".USERID."', '{$download_name}', {$download_id}, '{$report_add}'"); - define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME." / ".LAN_dl_47); - + define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME." / ".LAN_dl_45); + + $text = $frm->breadcrumb($breadcrumb); - $text = LAN_dl_48."

".LAN_dl_49.""; + $text .= "
".LAN_dl_48."
+ ".LAN_dl_49.""; return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, $text, 'download-report', true); } else { - define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME." / ".LAN_dl_51." ".$download_name); + define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME." / ".LAN_dl_45." ".$download_name); // require_once(HEADERF); - $breadcrumb = array(); - $breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => e_SELF); - $breadcrumb[] = array('text' => $dlrow['download_category_name'], 'url' => e_SELF."?action=list&id=".$dlrow['download_category_id']); - $breadcrumb[] = array('text' => $dlrow['download_name'], 'url' => e_SELF."?action=view&id=".$dlrow['download_id']); - $breadcrumb[] = array('text' => LAN_dl_50, 'url' => null); + $text = $frm->breadcrumb($breadcrumb); - - $text .= "
-
- ".LAN_DOWNLOAD.": ".$download_name." -
-
".LAN_dl_54."
".LAN_dl_55."
-
".$frm->textarea('report_add')."
-
+ + + $formUrl = e107::url('download', 'report', $dlrow); + $fileUrl = e107::url('download', 'view', $dlrow); + + $text .= " +
+

".LAN_DOWNLOAD.": ".$download_name."

+

".LAN_dl_54."
".LAN_dl_55."

+
+
".$frm->textarea('report_add', '')."
+
".$frm->button('report_download',LAN_dl_45,'submit')."
";