mirror of
https://github.com/e107inc/e107.git
synced 2025-07-28 18:30:53 +02:00
Move list_new functionality for downloads in to download plugin
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Download e_list Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/section/list_download.php,v $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2009-01-28 08:48:14 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| ©Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/e_list.php,v $
|
||||
| $Revision: 1.1 $
|
||||
| $Date: 2009-05-04 19:57:23 $
|
||||
| $Author: bugrain $
|
||||
|
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
@@ -39,15 +42,15 @@ class list_download
|
||||
|
||||
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
|
||||
|
||||
$qry = "SELECT d.download_id, d.download_name, d.download_author, d.download_datestamp,
|
||||
dc.download_category_id, dc.download_category_name, dc.download_category_class
|
||||
$qry = "SELECT d.download_id, d.download_name, d.download_author, d.download_datestamp,
|
||||
dc.download_category_id, dc.download_category_name, dc.download_category_class
|
||||
FROM #download AS d
|
||||
LEFT JOIN #download_category AS dc ON d.download_category=dc.download_category_id
|
||||
WHERE dc.download_category_class REGEXP '".e_CLASS_REGEXP."' AND d.download_class REGEXP '".e_CLASS_REGEXP."' AND d.download_active != '0' ".$qry."
|
||||
WHERE dc.download_category_class REGEXP '".e_CLASS_REGEXP."' AND d.download_class REGEXP '".e_CLASS_REGEXP."' AND d.download_active != '0' ".$qry."
|
||||
ORDER BY download_datestamp DESC LIMIT 0,".intval($this->parent->settings['amount'])." ";
|
||||
|
||||
$downloads = $this->parent->e107->sql->db_Select_gen($qry);
|
||||
if($downloads == 0)
|
||||
if($downloads == 0)
|
||||
{
|
||||
$list_data = LIST_DOWNLOAD_2;
|
||||
}
|
||||
@@ -70,11 +73,10 @@ class list_download
|
||||
}
|
||||
//return array with 'records', (global)'caption', 'display'
|
||||
return array(
|
||||
'records'=>$list_data,
|
||||
'caption'=>$list_caption,
|
||||
'records'=>$list_data,
|
||||
'caption'=>$list_caption,
|
||||
'display'=>$list_display
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -9,9 +9,9 @@
|
||||
* List Language
|
||||
*
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/languages/English.php,v $
|
||||
| $Revision: 1.6 $
|
||||
| $Date: 2009-01-27 21:34:02 $
|
||||
| $Author: lisa_ $
|
||||
| $Revision: 1.7 $
|
||||
| $Date: 2009-05-04 19:57:48 $
|
||||
| $Author: bugrain $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -48,12 +48,9 @@ define("LIST_COMMENT_5", "poll");
|
||||
define("LIST_COMMENT_6", "docs");
|
||||
define("LIST_COMMENT_7", "bugtrack");
|
||||
define("LIST_COMMENT_8", "content");
|
||||
define("LIST_COMMENT_9", "download");
|
||||
define("LIST_COMMENT_9", "");
|
||||
define("LIST_COMMENT_10", "ideas");
|
||||
|
||||
define("LIST_DOWNLOAD_1", "downloads");
|
||||
define("LIST_DOWNLOAD_2", "no downloads");
|
||||
|
||||
define("LIST_MEMBER_1", "members");
|
||||
define("LIST_MEMBER_2", "no members");
|
||||
|
||||
|
@@ -9,9 +9,9 @@
|
||||
* List Class
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_class.php,v $
|
||||
* $Revision: 1.8 $
|
||||
* $Date: 2009-01-27 23:46:12 $
|
||||
* $Author: lisa_ $
|
||||
* $Revision: 1.9 $
|
||||
* $Date: 2009-05-04 19:57:48 $
|
||||
* $Author: bugrain $
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
@@ -37,10 +37,10 @@ class listclass
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
*
|
||||
* @param string $mode the mode of the caller (default, admin)
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
*/
|
||||
function listclass($mode='')
|
||||
{
|
||||
@@ -51,13 +51,13 @@ class listclass
|
||||
|
||||
//language
|
||||
@include_lan($this->plugin_dir."languages/".e_LANGUAGE.".php");
|
||||
|
||||
|
||||
//template
|
||||
if (is_readable(THEME."list_template.php"))
|
||||
{
|
||||
require_once(THEME."list_template.php");
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
require_once($this->plugin_dir."list_template.php");
|
||||
}
|
||||
@@ -74,15 +74,15 @@ class listclass
|
||||
}
|
||||
|
||||
//default sections (present in this list plugin)
|
||||
$this->defaultArray = array("news", "comment", "download", "members");
|
||||
$this->defaultArray = array("news", "comment", "members");
|
||||
}
|
||||
|
||||
/**
|
||||
* helper method, parse the template
|
||||
*
|
||||
*
|
||||
* @param string $template the template to parse
|
||||
* @return string
|
||||
*
|
||||
*
|
||||
*/
|
||||
function parseTemplate($template)
|
||||
{
|
||||
@@ -93,9 +93,9 @@ class listclass
|
||||
|
||||
/**
|
||||
* get preferences, retrieve all preferences from core table
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
*
|
||||
*/
|
||||
function getListPrefs()
|
||||
{
|
||||
@@ -120,10 +120,10 @@ class listclass
|
||||
|
||||
/**
|
||||
* prepareSection checks if the sections should be displayed
|
||||
*
|
||||
*
|
||||
* @param string $mode the mode of the area (menu/page - new/recent)
|
||||
* @return array
|
||||
*
|
||||
*
|
||||
*/
|
||||
function prepareSection($mode)
|
||||
{
|
||||
@@ -143,10 +143,10 @@ class listclass
|
||||
|
||||
/**
|
||||
* prepareSectionArray parses the preferences for each section
|
||||
*
|
||||
*
|
||||
* @param string $mode the mode of the area (menu/page - new/recent)
|
||||
* @return array
|
||||
*
|
||||
*
|
||||
*/
|
||||
function prepareSectionArray($mode)
|
||||
{
|
||||
@@ -176,9 +176,9 @@ class listclass
|
||||
|
||||
/**
|
||||
* getDefaultSections loads all default 'core' sections from the constructor
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
*/
|
||||
function getDefaultSections()
|
||||
{
|
||||
@@ -194,16 +194,16 @@ class listclass
|
||||
//content needs this to split each main parent into separate sections
|
||||
/**
|
||||
* getContentSections loads all top level content categories
|
||||
*
|
||||
*
|
||||
* @param string $mode (default, add)
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
*/
|
||||
function getContentSections($mode='')
|
||||
{
|
||||
global $pref;
|
||||
|
||||
if (!$content_install = isset($pref['plug_installed']['content']))
|
||||
if (!$content_install = isset($pref['plug_installed']['content']))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -232,9 +232,9 @@ class listclass
|
||||
|
||||
/**
|
||||
* getSections loads all sections
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
*/
|
||||
function getSections()
|
||||
{
|
||||
@@ -265,9 +265,9 @@ class listclass
|
||||
|
||||
/**
|
||||
* getDefaultPrefs retrieve all default preferences (if none present)
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
*
|
||||
*/
|
||||
function getDefaultPrefs()
|
||||
{
|
||||
@@ -398,10 +398,10 @@ class listclass
|
||||
|
||||
/**
|
||||
* displaySection, prepare and render a section
|
||||
*
|
||||
*
|
||||
* @param array $arr the array of preferences for this section
|
||||
* @return string
|
||||
*
|
||||
*
|
||||
*/
|
||||
function displaySection($arr)
|
||||
{
|
||||
@@ -447,10 +447,10 @@ class listclass
|
||||
|
||||
/**
|
||||
* parseRecord renders the items within a section
|
||||
*
|
||||
*
|
||||
* @param string $area the area for display
|
||||
* @return string
|
||||
*
|
||||
*
|
||||
*/
|
||||
function parseRecord($area)
|
||||
{
|
||||
@@ -485,9 +485,9 @@ class listclass
|
||||
|
||||
/**
|
||||
* load_elist loads and checks all e_list.php files
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
*
|
||||
*/
|
||||
function load_elist()
|
||||
{
|
||||
@@ -532,10 +532,10 @@ class listclass
|
||||
|
||||
/**
|
||||
* load_data calls the class from the e_list file and retrieves the data
|
||||
*
|
||||
*
|
||||
* @param string $file the section to load (class name)
|
||||
* @return array
|
||||
*
|
||||
*
|
||||
*/
|
||||
function load_data($file)
|
||||
{
|
||||
@@ -566,9 +566,9 @@ class listclass
|
||||
|
||||
/**
|
||||
* get datestamp last visit
|
||||
*
|
||||
*
|
||||
* @return int datestamp
|
||||
*
|
||||
*
|
||||
*/
|
||||
function getlvisit()
|
||||
{
|
||||
@@ -598,10 +598,10 @@ class listclass
|
||||
|
||||
/**
|
||||
* get bullet icon, either use the icon set in admin or the default theme bullet
|
||||
*
|
||||
*
|
||||
* @param string $icon the icon to use as set in admin
|
||||
* @return string $bullet
|
||||
*
|
||||
*
|
||||
*/
|
||||
function getBullet($icon)
|
||||
{
|
||||
@@ -636,10 +636,10 @@ class listclass
|
||||
|
||||
/**
|
||||
* helper method, parse heading to specific length with postfix
|
||||
*
|
||||
*
|
||||
* @param string $heading the heading from the item record
|
||||
* @return string $heading the parsed heading
|
||||
*
|
||||
*
|
||||
*/
|
||||
function parse_heading($heading)
|
||||
{
|
||||
@@ -652,10 +652,10 @@ class listclass
|
||||
|
||||
/**
|
||||
* helper method, format the date
|
||||
*
|
||||
*
|
||||
* @param int $datestamp the datestamp of the item record
|
||||
* @return string the formatted date
|
||||
*
|
||||
*
|
||||
*/
|
||||
function getListDate($datestamp)
|
||||
{
|
||||
@@ -690,9 +690,9 @@ class listclass
|
||||
|
||||
/**
|
||||
* display timelapse element (on newpage)
|
||||
*
|
||||
*
|
||||
* @return string the timelapse element
|
||||
*
|
||||
*
|
||||
*/
|
||||
function displayTimelapse()
|
||||
{
|
||||
@@ -731,9 +731,9 @@ class listclass
|
||||
|
||||
/**
|
||||
* display the page (either recent or new)
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
*
|
||||
*/
|
||||
function displayPage()
|
||||
{
|
||||
@@ -744,7 +744,7 @@ class listclass
|
||||
{
|
||||
$this->list_pref = $this->getListPrefs();
|
||||
}
|
||||
|
||||
|
||||
//get sections
|
||||
$this->sections = $this->prepareSection($this->mode);
|
||||
$arr = $this->prepareSectionArray($this->mode);
|
||||
@@ -790,9 +790,9 @@ class listclass
|
||||
|
||||
/**
|
||||
* display the menu (either recent or new)
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
*
|
||||
*/
|
||||
function displayMenu()
|
||||
{
|
||||
|
Reference in New Issue
Block a user