mirror of
https://github.com/e107inc/e107.git
synced 2025-07-28 18:30:53 +02:00
Added trigger hook support
Source file organisation Some bug fixes
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/download.php,v $
|
||||
| $Revision: 1.5 $
|
||||
| $Date: 2009-02-11 21:41:54 $
|
||||
| $Revision: 1.6 $
|
||||
| $Date: 2009-05-03 21:16:15 $
|
||||
| $Author: bugrain $
|
||||
|
|
||||
+----------------------------------------------------------------------------+
|
||||
@@ -78,6 +78,7 @@ else
|
||||
$id = intval($tmp[1]);
|
||||
$errnum = intval(varset($tmp[2],0));
|
||||
}
|
||||
|
||||
switch ($action)
|
||||
{
|
||||
case 'list' : // Category-based listing
|
||||
@@ -122,11 +123,15 @@ else
|
||||
require_once(HEADERF);
|
||||
switch ($errnum)
|
||||
{
|
||||
case 1 :
|
||||
$errmsg = LAN_dl_63; // No permissions
|
||||
case 1 : // No permissions
|
||||
if (strlen($pref['download_denied']) > 0) {
|
||||
$errmsg = $tp->toHTML($pref['download_denied'],true);
|
||||
} else {
|
||||
$errmsg = LAN_dl_63;
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
$errmsg = LAN_dl_62; // Quota exceeded
|
||||
case 2 : // Quota exceeded
|
||||
$errmsg = LAN_dl_62;
|
||||
break;
|
||||
default:
|
||||
$errmsg = LAN_dl_61." ".$errnum; // Generic error - shouldn't happen
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/download_shortcodes.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2009-02-11 21:41:54 $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2009-05-03 21:16:15 $
|
||||
| $Author: bugrain $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -279,7 +279,7 @@ class download_shortcodes
|
||||
{
|
||||
global $pref,$dl,$tp;
|
||||
if ($pref['agree_flag'] == 1) {
|
||||
return "<a href='".e_BASE."request.php?".$dl['download_id']."' onclick= \"return confirm('".$tp->toJS($tp->toHTML($pref['agree_text'],FALSE,'DESCRIPTION'))."');\" title='".LAN_dl_46."'>".$dl['download_name']."</a>";
|
||||
return "xxx<a href='".e_BASE."request.php?".$dl['download_id']."' onclick= \"return confirm('".$tp->toJS($tp->toHTML($pref['agree_text'],FALSE,'DESCRIPTION'))."');\" title='".LAN_dl_46."'>".$dl['download_name']."</a>";
|
||||
} else {
|
||||
return "<a href='".e_BASE."request.php?".$dl['download_id']."' title='".LAN_dl_46."'>".$dl['download_name']."</a>";
|
||||
}
|
||||
@@ -352,7 +352,7 @@ class download_shortcodes
|
||||
global $pref,$dlrow,$tp;
|
||||
$click = "";
|
||||
if ($pref['agree_flag'] == 1) {
|
||||
$click = " onclick='return confirm(\"".$tp->toJS($tp->toHTML($pref['agree_text'],FALSE,'DESCRIPTION'))."\")'";
|
||||
$click = " onclick='return confirm(\"".$tp->toJS($tp->toHTML($pref['agree_text'],true,'emotes, no_tags'))."\")'";
|
||||
}
|
||||
$dnld_link = "<a href='".e_BASE."request.php?".$dlrow['download_id']."'{$click}>";
|
||||
if ($dlrow['download_mirror'])
|
||||
@@ -368,7 +368,7 @@ class download_shortcodes
|
||||
}
|
||||
else
|
||||
{
|
||||
return $dnld_link." <img src='".IMAGE_DOWNLOAD."' alt='*' style='border:0' /></a>";
|
||||
return $dnld_link." xxx<img src='".IMAGE_DOWNLOAD."' alt='*' style='border:0' /></a>";
|
||||
}
|
||||
}
|
||||
function get_download_view_filesize()
|
||||
|
45
e107_plugins/download/e_tagwords.php
Normal file
45
e107_plugins/download/e_tagwords.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
class e_tagwords_download
|
||||
{
|
||||
function e_tagwords_download()
|
||||
{
|
||||
$this->e107 = e107::getInstance();
|
||||
|
||||
$this->settings = array();
|
||||
|
||||
$this->settings['plugin'] = "";
|
||||
$this->settings['table'] = "download";
|
||||
$this->settings['db_id'] = "download_id";
|
||||
$this->settings['caption'] = "download";
|
||||
}
|
||||
|
||||
function getLink($id)
|
||||
{
|
||||
if($this->row=='')
|
||||
{
|
||||
$this->row = $this->getRecord($id);
|
||||
}
|
||||
$url = e_BASE."download.php?view.".$this->row['download_id'];
|
||||
return "<a href='".$url."'>".$this->e107->tp->toHTML($this->row['download_name'], TRUE, '')."</a>";
|
||||
}
|
||||
|
||||
function getRecord($id)
|
||||
{
|
||||
$this->row = '';
|
||||
|
||||
$qry = "SELECT d.*
|
||||
FROM #download as d
|
||||
WHERE d.download_id='{$id}' AND d.download_class REGEXP '".e_CLASS_REGEXP."' ";
|
||||
|
||||
if($this->e107->sql->db_Select_gen($qry))
|
||||
{
|
||||
$this->row=$this->e107->sql->db_Fetch();
|
||||
}
|
||||
return $this->row;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
1598
e107_plugins/download/handlers/adminDownload_class.php
Normal file
1598
e107_plugins/download/handlers/adminDownload_class.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/handlers/download_class.php,v $
|
||||
| $Revision: 1.1 $
|
||||
| $Date: 2009-02-11 21:41:54 $
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2009-05-03 21:16:15 $
|
||||
| $Author: bugrain $
|
||||
|
|
||||
+----------------------------------------------------------------------------+
|
||||
@@ -22,8 +22,10 @@ if (!plugInstalled('download')) { exit(); }
|
||||
|
||||
class download
|
||||
{
|
||||
var $e107;
|
||||
function download()
|
||||
{
|
||||
$this->e107 = e107::getInstance();
|
||||
}
|
||||
function displayCategoryList() {
|
||||
}
|
||||
@@ -46,7 +48,7 @@ class download
|
||||
$dlbreadcrumb['fieldlist'] = implode(",", array_keys($dlbreadcrumb));
|
||||
return $dlbreadcrumb;
|
||||
}
|
||||
function getCategorySelectList($currentID=0, $blankText="", $incSubSub=true, $groupOnMain=true)
|
||||
function getCategorySelectList($currentID=0, $incSubSub=true, $groupOnMain=true, $blankText=" ", $name="download_category")
|
||||
{
|
||||
global $sql,$parm;
|
||||
$boxinfo = "\n";
|
||||
@@ -63,7 +65,7 @@ class download
|
||||
return "Error reading categories<br />";
|
||||
exit;
|
||||
}
|
||||
$boxinfo .= "<select name='download_category' id='download_category' class='tbox'>
|
||||
$boxinfo .= "<select name='{$name}' id='download_category' class='tbox'>
|
||||
<option value=''>{$blankText}</option>\n";
|
||||
// Its a structured display option - need a 2-step process to create a tree
|
||||
$catlist = array();
|
||||
|
@@ -4,8 +4,8 @@
|
||||
| e107 website system - Language File.
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/languages/English/lan_download_admin.php,v $
|
||||
| $Revision: 1.5 $
|
||||
| $Date: 2009-02-11 21:41:54 $
|
||||
| $Revision: 1.6 $
|
||||
| $Date: 2009-05-03 21:16:15 $
|
||||
| $Author: bugrain $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -36,7 +36,7 @@ define("DOWLAN_25", "Submit Download");
|
||||
|
||||
define("DOWLAN_27", "Download");
|
||||
define("DOWLAN_28", "None");
|
||||
define("DOWLAN_29", "Downloads Front Page");
|
||||
define("DOWLAN_29", "Downloads");
|
||||
define("DOWLAN_30", "Create Download");
|
||||
define("DOWLAN_31", "Categories");
|
||||
define("DOWLAN_32", "Downloads Options");
|
||||
@@ -64,6 +64,7 @@ define("DOWLAN_53", "Subcategory");
|
||||
define("DOWLAN_54", "Download Options");
|
||||
define("DOWLAN_55", "Number of downloads to display per page");
|
||||
define("DOWLAN_56", "Sort by ");
|
||||
define("DOWLAN_57", "Clear filters");
|
||||
|
||||
|
||||
define("DOWLAN_59", "Filename");
|
||||
@@ -169,6 +170,10 @@ define("DOWLAN_177", "Maintenance options");
|
||||
define("DOWLAN_178", "No category");
|
||||
define("DOWLAN_179", "Select an option from the Maintenance Options menu");
|
||||
define("DOWLAN_180", "File size (database/disk)");
|
||||
define("DOWLAN_181", "Not readable");
|
||||
define("DOWLAN_182", "Timestamp");
|
||||
define("DOWLAN_183", "Filter options");
|
||||
define("DOWLAN_184", "Batch options");
|
||||
|
||||
define("DOWLAN_HELP_1", "Download Help");
|
||||
define("DOWLAN_HELP_2", "<p>Create/edit a download.</p><p>Enter only one of: File, URL or Mirror.</p><p>Ensure you select a category, otherwise your download will not be visible on the downloads page.</p><p>");
|
||||
|
Reference in New Issue
Block a user