mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 06:07:32 +02:00
Change method of using 'up' and 'down' arrows to reorder lists so it works in all browsers (as sitelinks). Synchronise V1.0 and V2.0 code where practicable
This commit is contained in:
@@ -2,23 +2,31 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2012 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
|
* Links plugin
|
||||||
*
|
*
|
||||||
*
|
* $URL$
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/links_page/admin_linkspage_config.php,v $
|
|
||||||
* $Revision$
|
* $Revision$
|
||||||
* $Date$
|
* $Date$
|
||||||
* $Author$
|
* $Author$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once("../../class2.php");
|
/**
|
||||||
if (!getperms("P") || !plugInstalled('links_page'))
|
* e107 Links plugin
|
||||||
|
*
|
||||||
|
* @package e107_plugins
|
||||||
|
* @subpackage links
|
||||||
|
* @version $Id$;
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once('../../class2.php');
|
||||||
|
if (!getperms('P') || !plugInstalled('links_page'))
|
||||||
{
|
{
|
||||||
header("location:".e_BASE."index.php");
|
header('location:'.e_BASE.'index.php');
|
||||||
exit;
|
exit();
|
||||||
}
|
}
|
||||||
require_once(e_PLUGIN.'links_page/link_shortcodes.php');
|
require_once(e_PLUGIN.'links_page/link_shortcodes.php');
|
||||||
require_once(e_PLUGIN.'links_page/link_defines.php');
|
require_once(e_PLUGIN.'links_page/link_defines.php');
|
||||||
@@ -33,15 +41,16 @@ $eArrayStorage = new ArrayData();
|
|||||||
require_once(e_PLUGIN.'links_page/link_class.php');
|
require_once(e_PLUGIN.'links_page/link_class.php');
|
||||||
$lc = new linkclass;
|
$lc = new linkclass;
|
||||||
|
|
||||||
include_lan($plugindir."languages/".e_LANGUAGE."_admin_links_page.php");
|
include_lan(e_PLUGIN.'links_page/languages/'.e_LANGUAGE.'.php');
|
||||||
|
|
||||||
$linkspage_pref = $lc->getLinksPagePref();
|
$linkspage_pref = $lc->getLinksPagePref();
|
||||||
|
|
||||||
$deltest = array_flip($_POST);
|
//$deltest = array_flip($_POST); // Not used any more
|
||||||
|
|
||||||
|
|
||||||
if(e_QUERY)
|
if(e_QUERY)
|
||||||
{
|
{
|
||||||
$qs = explode(".", e_QUERY);
|
$qs = explode('.', e_QUERY);
|
||||||
|
|
||||||
if(is_numeric($qs[0]))
|
if(is_numeric($qs[0]))
|
||||||
{
|
{
|
||||||
@@ -49,84 +58,96 @@ if(e_QUERY)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$from = "0";
|
$from = '0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$incdec_action = '';
|
||||||
|
foreach($_POST as $k => $v)
|
||||||
|
{
|
||||||
|
if ((preg_match("#^(inc|dec)".URL_SEPARATOR."(\d+)".URL_SEPARATOR."(\d+)".URL_SEPARATOR."(\d+){0,1}_[x|y]#", $k, $matches)))
|
||||||
|
{
|
||||||
|
$incdec_action = $matches[1]; // (inc|dec)
|
||||||
|
$linkid = intval($matches[2]);
|
||||||
|
$link_order = intval($matches[3]);
|
||||||
|
$link_location = intval(varset($matches[4], ''));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($incdec_action)
|
||||||
|
{
|
||||||
|
case 'inc' :
|
||||||
|
$lc->dbOrderUpdateInc($linkid, $link_order, $link_location);
|
||||||
|
break;
|
||||||
|
case 'dec' :
|
||||||
|
$lc->dbOrderUpdateDec($linkid, $link_order, $link_location);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (isset($_POST['delete']))
|
if (isset($_POST['delete']))
|
||||||
{
|
{
|
||||||
$tmp = array_pop($tmp = array_flip($_POST['delete']));
|
$tmp = array_pop($tmp = array_flip($_POST['delete']));
|
||||||
list($delete, $del_id) = explode("_", $tmp);
|
list($delete, $del_id) = explode("_", $tmp);
|
||||||
$del_id = intval($del_id);
|
$del_id = intval($del_id);
|
||||||
}
|
}
|
||||||
|
elseif (isset($_POST['create_category']))
|
||||||
if (isset($_POST['create_category']))
|
|
||||||
{
|
{
|
||||||
$lc -> dbCategoryCreate();
|
$lc -> dbCategoryCreate();
|
||||||
}
|
}
|
||||||
|
elseif (isset($_POST['update_category']))
|
||||||
if (isset($_POST['update_category']))
|
|
||||||
{
|
{
|
||||||
$lc -> dbCategoryUpdate();
|
$lc -> dbCategoryUpdate();
|
||||||
}
|
}
|
||||||
|
elseif (isset($_POST['updateoptions']))
|
||||||
if (isset($_POST['updateoptions']))
|
|
||||||
{
|
{
|
||||||
$linkspage_pref = $lc -> UpdateLinksPagePref();
|
$linkspage_pref = $lc -> UpdateLinksPagePref();
|
||||||
$lc -> show_message(LCLAN_ADMIN_6);
|
$lc -> show_message(LCLAN_ADMIN_6);
|
||||||
}
|
}
|
||||||
|
elseif (isset($_POST['add_link']))
|
||||||
if (isset($_POST['add_link']))
|
|
||||||
{
|
{
|
||||||
$lc -> dbLinkCreate();
|
$lc -> dbLinkCreate();
|
||||||
}
|
}
|
||||||
|
|
||||||
//upload link icon
|
//upload link icon
|
||||||
if(isset($_POST['uploadlinkicon']))
|
elseif(isset($_POST['uploadlinkicon']))
|
||||||
{
|
{
|
||||||
$lc -> uploadLinkIcon();
|
$lc -> uploadLinkIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
//upload category icon
|
//upload category icon
|
||||||
if(isset($_POST['uploadcatlinkicon']))
|
elseif(isset($_POST['uploadcatlinkicon']))
|
||||||
{
|
{
|
||||||
$lc -> uploadCatLinkIcon();
|
$lc -> uploadCatLinkIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
//update link order
|
//update link order
|
||||||
if (isset($_POST['update_order']))
|
elseif (isset($_POST['update_order']))
|
||||||
{
|
{
|
||||||
$lc -> dbOrderUpdate($_POST['link_order']);
|
$lc -> dbOrderUpdate($_POST['link_order']);
|
||||||
}
|
}
|
||||||
|
|
||||||
//update link category order
|
//update link category order
|
||||||
if (isset($_POST['update_category_order']))
|
elseif (isset($_POST['update_category_order']))
|
||||||
{
|
{
|
||||||
$lc -> dbOrderCatUpdate($_POST['link_category_order']);
|
$lc -> dbOrderCatUpdate($_POST['link_category_order']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['inc']))
|
|
||||||
{
|
|
||||||
$lc -> dbOrderUpdateInc($_POST['inc']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_POST['dec']))
|
|
||||||
{
|
|
||||||
$lc -> dbOrderUpdateDec($_POST['dec']);
|
|
||||||
}
|
|
||||||
|
|
||||||
//delete link
|
//delete link
|
||||||
if (isset($delete) && ($delete == 'main') && $del_id)
|
if (isset($delete) && $del_id)
|
||||||
{
|
{
|
||||||
$sql->db_Select("links_page", "link_order", "link_id=".$del_id);
|
switch ($delete)
|
||||||
|
{
|
||||||
|
case 'main' : // Delete link
|
||||||
|
$sql->db_Select('links_page', 'link_order', 'link_id='.$del_id);
|
||||||
$row = $sql->db_Fetch();
|
$row = $sql->db_Fetch();
|
||||||
$sql2 = new db;
|
$sql2 = e107::getDb('sql2');
|
||||||
$sql->db_Select("links_page", "link_id", "link_order>'".$row['link_order']."' && link_category=".intval($row['link_category']));
|
$sql->db_Select("links_page", "link_id", "link_order>'".$row['link_order']."' && link_category='".$id."'");
|
||||||
while ($row = $sql->db_Fetch())
|
while ($row = $sql->db_Fetch()) {
|
||||||
{
|
$sql2->db_Update('links_page', "link_order=link_order-1 WHERE link_id='".$row['link_id']."'");
|
||||||
$sql2->db_Update("links_page", "link_order=link_order-1 WHERE link_id='".$row['link_id']."'");
|
|
||||||
}
|
}
|
||||||
if ($sql->db_Delete("links_page", "link_id=".$del_id))
|
if ($sql->db_Delete('links_page', 'link_id='.$del_id))
|
||||||
{
|
{
|
||||||
$msg = LCLAN_ADMIN_10." #".$del_id." ".LCLAN_ADMIN_11;
|
$msg = LCLAN_ADMIN_10." #".$del_id." ".LCLAN_ADMIN_11;
|
||||||
$data = array('method'=>'delete', 'table'=>'links_page', 'id'=>$del_id, 'plugin'=>'links_page', 'function'=>'delete');
|
$data = array('method'=>'delete', 'table'=>'links_page', 'id'=>$del_id, 'plugin'=>'links_page', 'function'=>'delete');
|
||||||
@@ -134,110 +155,106 @@ if (isset($delete) && ($delete == 'main') && $del_id)
|
|||||||
$admin_log->log_event('LINKS_02','ID: '.$del_id,E_LOG_INFORMATIVE,'');
|
$admin_log->log_event('LINKS_02','ID: '.$del_id,E_LOG_INFORMATIVE,'');
|
||||||
$lc->show_message($msg);
|
$lc->show_message($msg);
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
|
|
||||||
//delete category
|
case 'category' : //delete category
|
||||||
if (isset($delete) && ($delete == 'category') && $del_id)
|
|
||||||
{
|
|
||||||
//check if links are present for this category
|
//check if links are present for this category
|
||||||
if($sql->db_Select("links_page", "*", "link_category=".$del_id ))
|
if($sql->db_Select('links_page', '*', 'link_category='.$del_id))
|
||||||
{
|
{
|
||||||
$lc->show_message(LCLAN_ADMIN_12." #".$del_id." ".LAN_DELETED_FAILED."<br />".LCLAN_ADMIN_15);
|
$lc->show_message(LCLAN_ADMIN_12." #".$del_id." ".LAN_DELETED_FAILED."<br />".LCLAN_ADMIN_15);
|
||||||
//no? then we can safely remove this category
|
//no? then we can safely remove this category
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($sql->db_Delete("links_page_cat", "link_category_id=".$del_id))
|
if ($sql->db_Delete('links_page_cat', 'link_category_id='.$del_id))
|
||||||
{
|
{
|
||||||
$admin_log->log_event('LINKS_03','ID: '.$del_id,E_LOG_INFORMATIVE,'');
|
$admin_log->log_event('LINKS_03','ID: '.$del_id,E_LOG_INFORMATIVE,'');
|
||||||
$lc->show_message(LCLAN_ADMIN_12." #".$del_id." ".LCLAN_ADMIN_11);
|
$lc->show_message(LCLAN_ADMIN_12." #".$del_id." ".LCLAN_ADMIN_11);
|
||||||
unset($id);
|
unset($id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
|
|
||||||
//delete submitted link
|
case 'sn' : //delete submitted link
|
||||||
if (isset($delete) && ($delete == 'sn') && $del_id)
|
if ($sql->db_Delete('tmp', 'tmp_time='.$del_id))
|
||||||
{
|
|
||||||
if ($sql->db_Delete("tmp", "tmp_time=".$del_id))
|
|
||||||
{
|
{
|
||||||
$admin_log->log_event('LINKS_04','ID: '.$del_id,E_LOG_INFORMATIVE,'');
|
$admin_log->log_event('LINKS_04','ID: '.$del_id,E_LOG_INFORMATIVE,'');
|
||||||
$lc->show_message(LCLAN_ADMIN_13);
|
$lc->show_message(LCLAN_ADMIN_13);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//show link categories (cat edit)
|
//show link categories (cat edit)
|
||||||
if (!e_QUERY)
|
if (!e_QUERY)
|
||||||
{
|
{
|
||||||
$lc->show_categories("cat");
|
$lc->show_categories('cat');
|
||||||
}
|
}
|
||||||
|
elseif (isset($qs[0]))
|
||||||
|
{
|
||||||
|
switch ($qs[0])
|
||||||
|
{
|
||||||
|
case 'cat' :
|
||||||
|
if (isset($qs[1]))
|
||||||
|
{
|
||||||
//show cat edit form
|
//show cat edit form
|
||||||
if (isset($qs[0]) && $qs[0] == 'cat' && isset($qs[1]) && $qs[1] == 'edit' && isset($qs[2]) && is_numeric($qs[2]))
|
if (($qs[1] == 'edit') && isset($qs[2]) && is_numeric($qs[2]))
|
||||||
{
|
{
|
||||||
$lc->show_cat_create();
|
$lc->show_cat_create();
|
||||||
}
|
}
|
||||||
|
|
||||||
//show cat create form
|
//show cat create form
|
||||||
if (isset($qs[0]) && $qs[0] == 'cat' && isset($qs[1]) && $qs[1] == 'create' && !isset($qs[2]) )
|
elseif (($qs[1] == 'create') && !isset($qs[2]) )
|
||||||
{
|
{
|
||||||
$lc->show_cat_create();
|
$lc->show_cat_create();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (isset($qs[0]) && $qs[0] == 'link')
|
break;
|
||||||
|
case 'link' :
|
||||||
|
if (isset($qs[1]))
|
||||||
{
|
{
|
||||||
$gotVal = FALSE;
|
switch ($qs[1])
|
||||||
switch(varset($qs[1],''))
|
|
||||||
{
|
{
|
||||||
case 'view' : //view links in cat
|
case 'view' :
|
||||||
if (isset($qs[2]) && (is_numeric($qs[2]) || $qs[2] == "all") )
|
if (isset($qs[2]) && (is_numeric($qs[2]) || $qs[2] == "all") )
|
||||||
{
|
{
|
||||||
$lc->show_links();
|
$lc->show_links();
|
||||||
$gotVal = TRUE;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'edit' : //edit link
|
case 'edit' : // Edit link
|
||||||
if (isset($qs[2]) && is_numeric($qs[2]))
|
if (isset($qs[2]) && is_numeric($qs[2]))
|
||||||
{
|
{
|
||||||
$lc->show_link_create();
|
$lc->show_link_create();
|
||||||
$gotVal = TRUE;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'create' : //create link
|
case 'create' : // Create link
|
||||||
if (!isset($qs[2]) )
|
if (!isset($qs[2]) )
|
||||||
{
|
{
|
||||||
$lc->show_link_create();
|
$lc->show_link_create();
|
||||||
$gotVal = TRUE;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'sn' : //post submitted
|
case 'sn' : // Post submitted
|
||||||
if (isset($qs[2]) && is_numeric($qs[2]) )
|
if (isset($qs[2]) && is_numeric($qs[2]) )
|
||||||
{
|
{
|
||||||
$lc->show_link_create();
|
$lc->show_link_create();
|
||||||
$gotVal = TRUE;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default :
|
|
||||||
}
|
}
|
||||||
if (!$gotVal)
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$lc->show_categories("link");
|
$lc->show_categories('link'); //view categories (link select cat)
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
|
case 'sn' : //view submitted links
|
||||||
//view submitted links
|
|
||||||
if (isset($qs[0]) && $qs[0] == 'sn')
|
|
||||||
{
|
|
||||||
$lc->show_submitted();
|
$lc->show_submitted();
|
||||||
|
break;
|
||||||
|
case 'opt' : // Options
|
||||||
|
$lc->show_pref_options();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//options
|
|
||||||
if (isset($qs[0]) && $qs[0] == 'opt')
|
|
||||||
{
|
|
||||||
$lc->show_pref_options();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ##### Display options --------------------------------------------------------------------------
|
// ##### Display options --------------------------------------------------------------------------
|
||||||
function admin_linkspage_config_adminmenu()
|
function admin_linkspage_config_adminmenu()
|
||||||
@@ -246,17 +263,17 @@ function admin_linkspage_config_adminmenu()
|
|||||||
$act = varset($qs[0],'cat');
|
$act = varset($qs[0],'cat');
|
||||||
if($act == 'cat' && isset($qs[1]))
|
if($act == 'cat' && isset($qs[1]))
|
||||||
{
|
{
|
||||||
if($qs[1] == "create")
|
if($qs[1] == 'create')
|
||||||
{
|
{
|
||||||
$act .= ".create";
|
$act .= '.create';
|
||||||
}
|
}
|
||||||
elseif ($qs[1] == "edit")
|
elseif ($qs[1] == 'edit')
|
||||||
{
|
{
|
||||||
$act .= "";
|
$act .= '';
|
||||||
}
|
}
|
||||||
elseif ($qs[1] == "view")
|
elseif ($qs[1] == 'view')
|
||||||
{
|
{
|
||||||
$act .= "";
|
$act .= '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,7 +300,7 @@ function admin_linkspage_config_adminmenu()
|
|||||||
|
|
||||||
show_admin_menu(LCLAN_ADMINMENU_1, $act, $var);
|
show_admin_menu(LCLAN_ADMINMENU_1, $act, $var);
|
||||||
|
|
||||||
if($qs[0] != "opt")
|
if($qs[0] != 'opt')
|
||||||
{
|
{
|
||||||
unset($var);
|
unset($var);
|
||||||
$var=array();
|
$var=array();
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/links_page/link_class.php,v $
|
* $URL$
|
||||||
* $Revision$
|
* $Revision$
|
||||||
* $Date$
|
* $Date$
|
||||||
* $Author$
|
* $Author$
|
||||||
@@ -16,9 +16,11 @@
|
|||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
|
||||||
|
define('URL_SEPARATOR','X'); // Used in names of 'inc' and 'dec' fields
|
||||||
|
|
||||||
class linkclass
|
class linkclass
|
||||||
{
|
{
|
||||||
|
|
||||||
function LinkPageDefaultPrefs()
|
function LinkPageDefaultPrefs()
|
||||||
{
|
{
|
||||||
$linkspage_pref['link_page_categories'] = "0";
|
$linkspage_pref['link_page_categories'] = "0";
|
||||||
@@ -455,7 +457,7 @@ class linkclass
|
|||||||
$linkData['link_category_order'] = $link_t+1;
|
$linkData['link_category_order'] = $link_t+1;
|
||||||
$linkData['link_category_class'] = $tp -> toDB($_POST['link_category_class']);
|
$linkData['link_category_class'] = $tp -> toDB($_POST['link_category_class']);
|
||||||
$linkData['link_category_datestamp'] = time();
|
$linkData['link_category_datestamp'] = time();
|
||||||
$sql->db_Insert("links_page_cat", $linkData);
|
$sql->db_Insert('links_page_cat', $linkData);
|
||||||
$admin_log->logArrayAll('LINKS_05',$linkData);
|
$admin_log->logArrayAll('LINKS_05',$linkData);
|
||||||
$this->show_message(LCLAN_ADMIN_4);
|
$this->show_message(LCLAN_ADMIN_4);
|
||||||
}
|
}
|
||||||
@@ -505,15 +507,15 @@ class linkclass
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function dbOrderUpdateInc($inc)
|
function dbOrderUpdateInc($linkid, $link_order, $location)
|
||||||
{
|
{
|
||||||
global $sql, $admin_log;
|
global $sql, $admin_log;
|
||||||
$tmp = explode(".", $inc);
|
//$tmp = explode(".", $inc);
|
||||||
$linkid = intval($tmp[0]);
|
//$linkid = intval($tmp[0]);
|
||||||
$link_order = intval($tmp[1]);
|
//$link_order = intval($tmp[1]);
|
||||||
if(isset($tmp[2]))
|
//$location = $tmp[2];
|
||||||
|
if($location)
|
||||||
{
|
{
|
||||||
$location = intval($tmp[2]);
|
|
||||||
$sql->db_Update("links_page", "link_order=link_order+1 WHERE link_order='".($link_order-1)."' AND link_category=".$location);
|
$sql->db_Update("links_page", "link_order=link_order+1 WHERE link_order='".($link_order-1)."' AND link_category=".$location);
|
||||||
$sql->db_Update("links_page", "link_order=link_order-1 WHERE link_id='{$linkid}' AND link_category=".$location);
|
$sql->db_Update("links_page", "link_order=link_order-1 WHERE link_id='{$linkid}' AND link_category=".$location);
|
||||||
$admin_log->log_event('LINKS_09','ID: '.$location.' -inc- '.$link_order,E_LOG_INFORMATIVE,'');
|
$admin_log->log_event('LINKS_09','ID: '.$location.' -inc- '.$link_order,E_LOG_INFORMATIVE,'');
|
||||||
@@ -526,16 +528,16 @@ class linkclass
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function dbOrderUpdateDec($dec)
|
function dbOrderUpdateDec($linkid, $link_order, $location)
|
||||||
{
|
{
|
||||||
global $sql, $admin_log;
|
global $sql, $admin_log;
|
||||||
$tmp = explode(".", $dec);
|
//$tmp = explode(".", $dec);
|
||||||
$linkid = intval($tmp[0]);
|
//$linkid = intval($tmp[0]);
|
||||||
$link_order = intval($tmp[1]);
|
//$link_order = intval($tmp[1]);
|
||||||
if(isset($tmp[2]))
|
//$location = $tmp[2];
|
||||||
|
if($location)
|
||||||
{
|
{
|
||||||
$location = intval($tmp[2]);
|
$sql->db_Update("links_page", "link_order=link_order-1 WHERE link_order=".($link_order+1)." AND link_category=".$location);
|
||||||
$sql->db_Update("links_page", "link_order=link_order-1 WHERE link_order='".($link_order+1)."' AND link_category=".$location);
|
|
||||||
$sql->db_Update("links_page", "link_order=link_order+1 WHERE link_id='{$linkid}' AND link_category=".$location);
|
$sql->db_Update("links_page", "link_order=link_order+1 WHERE link_id='{$linkid}' AND link_category=".$location);
|
||||||
$admin_log->log_event('LINKS_11','ID: '.$location.' -dec- '.$link_order,E_LOG_INFORMATIVE,'');
|
$admin_log->log_event('LINKS_11','ID: '.$location.' -dec- '.$link_order,E_LOG_INFORMATIVE,'');
|
||||||
}
|
}
|
||||||
@@ -555,6 +557,7 @@ class linkclass
|
|||||||
{
|
{
|
||||||
$row = $sql->db_Fetch();
|
$row = $sql->db_Fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(varset($row['link_author']) != USERID)
|
if(varset($row['link_author']) != USERID)
|
||||||
{
|
{
|
||||||
js_location(SITEURL);
|
js_location(SITEURL);
|
||||||
@@ -838,6 +841,11 @@ class linkclass
|
|||||||
$ns->tablerender(LCLAN_PAGETITLE_1, $text);
|
$ns->tablerender(LCLAN_PAGETITLE_1, $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display list of links within a particular category
|
||||||
|
*/
|
||||||
function show_links()
|
function show_links()
|
||||||
{
|
{
|
||||||
global $sql, $qs, $rs, $ns, $tp, $from;
|
global $sql, $qs, $rs, $ns, $tp, $from;
|
||||||
@@ -898,15 +906,25 @@ class linkclass
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($row['link_order'] == "1"){
|
|
||||||
|
$name_suffix = URL_SEPARATOR.$linkid.URL_SEPARATOR.$row['link_order'].URL_SEPARATOR.$row['link_category'];
|
||||||
|
if($row['link_order'] == "1")
|
||||||
|
{
|
||||||
$up = " ";
|
$up = " ";
|
||||||
}else{
|
|
||||||
$up = "<input type='image' src='".LINK_ICON_ORDER_UP_BASE."' value='".$linkid.".".$row['link_order'].".".$row['link_category']."' name='inc' />";
|
|
||||||
}
|
}
|
||||||
if($row['link_order'] == $link_total){
|
else
|
||||||
|
{
|
||||||
|
//$up = "<input type='image' src='".LINK_ICON_ORDER_UP_BASE."' value='".$linkid.".".$row['link_order'].".".$row['link_category']."' name='inc' />";
|
||||||
|
$up = "<input type='image' src='".LINK_ICON_ORDER_UP_BASE."' name='inc".$name_suffix."' />";
|
||||||
|
}
|
||||||
|
if($row['link_order'] == $link_total)
|
||||||
|
{
|
||||||
$down = " ";
|
$down = " ";
|
||||||
}else{
|
}
|
||||||
$down = "<input type='image' src='".LINK_ICON_ORDER_DOWN_BASE."' value='".$linkid.".".$row['link_order'].".".$row['link_category']."' name='dec' />";
|
else
|
||||||
|
{
|
||||||
|
//$down = "<input type='image' src='".LINK_ICON_ORDER_DOWN_BASE."' value='".$linkid.".".$row['link_order'].".".$row['link_category']."' name='dec' />";
|
||||||
|
$down = "<input type='image' src='".LINK_ICON_ORDER_DOWN_BASE."' name='dec".$name_suffix."' />";
|
||||||
}
|
}
|
||||||
$text .= "
|
$text .= "
|
||||||
<tr>
|
<tr>
|
||||||
@@ -1038,7 +1056,15 @@ class linkclass
|
|||||||
unset($row['link_category_name'], $row['link_category_description'], $row['link_category_icon']);
|
unset($row['link_category_name'], $row['link_category_description'], $row['link_category_icon']);
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_categories($mode) {
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show a list of categories
|
||||||
|
*
|
||||||
|
* @param string $mode = (cat)
|
||||||
|
*/
|
||||||
|
function show_categories($mode)
|
||||||
|
{
|
||||||
global $sql, $rs, $ns, $tp, $fl;
|
global $sql, $rs, $ns, $tp, $fl;
|
||||||
|
|
||||||
if ($category_total = $sql->db_Select("links_page_cat", "*", "ORDER BY link_category_order ASC", "mode=no_where")) {
|
if ($category_total = $sql->db_Select("links_page_cat", "*", "ORDER BY link_category_order ASC", "mode=no_where")) {
|
||||||
@@ -1057,11 +1083,15 @@ class linkclass
|
|||||||
}
|
}
|
||||||
$text .= "
|
$text .= "
|
||||||
</tr>";
|
</tr>";
|
||||||
while ($row = $sql->db_Fetch()) {
|
while ($row = $sql->db_Fetch())
|
||||||
|
{
|
||||||
$linkcatid = $row['link_category_id'];
|
$linkcatid = $row['link_category_id'];
|
||||||
if ($row['link_category_icon']) {
|
if ($row['link_category_icon'])
|
||||||
|
{
|
||||||
$img = (strstr($row['link_category_icon'], "/") ? "<img src='".e_BASE.$row['link_category_icon']."' alt='' style='vertical-align:middle' />" : "<img src='".e_PLUGIN_ABS."links_page/cat_images/".$row['link_category_icon']."' alt='' style='vertical-align:middle' />");
|
$img = (strstr($row['link_category_icon'], "/") ? "<img src='".e_BASE.$row['link_category_icon']."' alt='' style='vertical-align:middle' />" : "<img src='".e_PLUGIN_ABS."links_page/cat_images/".$row['link_category_icon']."' alt='' style='vertical-align:middle' />");
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$img = " ";
|
$img = " ";
|
||||||
}
|
}
|
||||||
$text .= "
|
$text .= "
|
||||||
@@ -1071,16 +1101,26 @@ class linkclass
|
|||||||
<a href='".e_PLUGIN_ABS."links_page/links.php?cat.".$linkcatid."' rel='external'>".LINK_ICON_LINK."</a>
|
<a href='".e_PLUGIN_ABS."links_page/links.php?cat.".$linkcatid."' rel='external'>".LINK_ICON_LINK."</a>
|
||||||
".$row['link_category_name']."<br /><span class='smalltext'>".$row['link_category_description']."</span>
|
".$row['link_category_name']."<br /><span class='smalltext'>".$row['link_category_description']."</span>
|
||||||
</td>";
|
</td>";
|
||||||
if($mode == "cat"){
|
if($mode == "cat")
|
||||||
if($row['link_category_order'] == "1"){
|
{
|
||||||
|
$name_suffix = URL_SEPARATOR.$linkcatid.URL_SEPARATOR.$row['link_category_order'].URL_SEPARATOR;
|
||||||
|
if($row['link_category_order'] == "1")
|
||||||
|
{
|
||||||
$up = " ";
|
$up = " ";
|
||||||
}else{
|
|
||||||
$up = "<input type='image' src='".LINK_ICON_ORDER_UP_BASE."' value='".$linkcatid.".".$row['link_category_order']."' name='inc' />";
|
|
||||||
}
|
}
|
||||||
if($row['link_category_order'] == $category_total){
|
else
|
||||||
|
{
|
||||||
|
//$up = "<input type='image' src='".LINK_ICON_ORDER_UP_BASE."' value='".$linkcatid.".".$row['link_category_order']."' name='inc' />";
|
||||||
|
$up = "<input type='image' src='".LINK_ICON_ORDER_UP_BASE."' name='inc".$name_suffix."' />";
|
||||||
|
}
|
||||||
|
if($row['link_category_order'] == $category_total)
|
||||||
|
{
|
||||||
$down = " ";
|
$down = " ";
|
||||||
}else{
|
}
|
||||||
$down = "<input type='image' src='".LINK_ICON_ORDER_DOWN_BASE."' value='".$linkcatid.".".$row['link_category_order']."' name='dec' />";
|
else
|
||||||
|
{
|
||||||
|
//$down = "<input type='image' src='".LINK_ICON_ORDER_DOWN_BASE."' value='".$linkcatid.".".$row['link_category_order']."' name='dec' />";
|
||||||
|
$down = "<input type='image' src='".LINK_ICON_ORDER_DOWN_BASE."' name='dec".$name_suffix."' />";
|
||||||
}
|
}
|
||||||
$text .= "
|
$text .= "
|
||||||
<td style='width:10%; text-align:center; white-space: nowrap' class='forumheader3'>
|
<td style='width:10%; text-align:center; white-space: nowrap' class='forumheader3'>
|
||||||
@@ -1093,19 +1133,23 @@ class linkclass
|
|||||||
</td>
|
</td>
|
||||||
<td style='width:10%; text-align:center' class='forumheader3'>
|
<td style='width:10%; text-align:center' class='forumheader3'>
|
||||||
<select name='link_category_order[]' class='tbox'>";
|
<select name='link_category_order[]' class='tbox'>";
|
||||||
for($a = 1; $a <= $category_total; $a++) {
|
for($a = 1; $a <= $category_total; $a++)
|
||||||
|
{
|
||||||
$text .= $rs -> form_option($a, ($row['link_category_order'] == $a ? "1" : "0"), $linkcatid.".".$a, "");
|
$text .= $rs -> form_option($a, ($row['link_category_order'] == $a ? "1" : "0"), $linkcatid.".".$a, "");
|
||||||
}
|
}
|
||||||
$text .= $rs -> form_select_close()."
|
$text .= $rs -> form_select_close()."
|
||||||
</td>";
|
</td>";
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$text .= "<td style='width:10%; text-align:center; white-space: nowrap' class='forumheader3'>
|
$text .= "<td style='width:10%; text-align:center; white-space: nowrap' class='forumheader3'>
|
||||||
<a href='".e_SELF."?link.view.".$linkcatid."' title='".LCLAN_CAT_9."'>".LINK_ICON_EDIT."</a></td>";
|
<a href='".e_SELF."?link.view.".$linkcatid."' title='".LCLAN_CAT_9."'>".LINK_ICON_EDIT."</a></td>";
|
||||||
}
|
}
|
||||||
$text .= "
|
$text .= "
|
||||||
</tr>\n";
|
</tr>\n";
|
||||||
}
|
}
|
||||||
if($mode == "cat"){
|
if($mode == "cat")
|
||||||
|
{
|
||||||
$text .= "
|
$text .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader' colspan='4'> </td>
|
<td class='forumheader' colspan='4'> </td>
|
||||||
|
Reference in New Issue
Block a user