mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Bugtracker #3847 - sitelinks order not working with Opera, IE
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/links.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/links.php,v $
|
||||||
| $Revision: 1.7 $
|
| $Revision: 1.8 $
|
||||||
| $Date: 2007-09-29 20:20:36 $
|
| $Date: 2007-10-13 19:08:37 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
|
|
|
|
||||||
| links.php?debug shows stored data for each link after name (before constant conversion)
|
| links.php?debug shows stored data for each link after name (before constant conversion)
|
||||||
@@ -45,29 +45,41 @@ require_once(e_HANDLER."ren_help.php");
|
|||||||
$rs = new form;
|
$rs = new form;
|
||||||
$linkpost = new links;
|
$linkpost = new links;
|
||||||
|
|
||||||
if (e_QUERY) {
|
$action = '';
|
||||||
$tmp = explode('.', e_QUERY);
|
if (e_QUERY)
|
||||||
$action = $tmp[0];
|
{
|
||||||
$sub_action = $tmp[1];
|
$tmp = explode('.', e_QUERY);
|
||||||
$id = $tmp[2];
|
$action = $tmp[0];
|
||||||
unset($tmp);
|
$sub_action = $tmp[1];
|
||||||
|
$id = $tmp[2];
|
||||||
|
unset($tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define("URL_SEPARATOR",'X'); // Used in names of 'inc' and 'dec' fields
|
||||||
|
|
||||||
|
$incdec_action = '';
|
||||||
foreach(array_keys($_POST) as $k)
|
foreach(array_keys($_POST) as $k)
|
||||||
{
|
{
|
||||||
if (preg_match("#(.*?)_delete_(\d+)(.*)#", $k, $matches))
|
if (preg_match("#(.*?)_delete_(\d+)(.*)#", $k, $matches))
|
||||||
{
|
{
|
||||||
$delete = $matches[1];
|
$delete = $matches[1];
|
||||||
$del_id = $matches[2];
|
$del_id = $matches[2];
|
||||||
}
|
}
|
||||||
|
elseif (!$incdec_action && (preg_match("#^(inc|dec)".URL_SEPARATOR."(\d+)".URL_SEPARATOR."(\d+)_[x|y]#", $k, $matches)))
|
||||||
|
{
|
||||||
|
$incdec_action = $matches[1];
|
||||||
|
$linkid = intval($matches[2]);
|
||||||
|
$link_order = intval($matches[3]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['generate_sublinks']) && isset($_POST['sublink_type']) && $_POST['sublink_parent'] !="" ){
|
if(isset($_POST['generate_sublinks']) && isset($_POST['sublink_type']) && $_POST['sublink_parent'] !="" )
|
||||||
|
{
|
||||||
$subtype = $_POST['sublink_type'];
|
$subtype = $_POST['sublink_type'];
|
||||||
$sublink = $linkpost->sublink_list($subtype);
|
$sublink = $linkpost->sublink_list($subtype);
|
||||||
if(!is_object($sql2)){
|
if(!is_object($sql2))
|
||||||
$sql2 = new db;
|
{
|
||||||
|
$sql2 = new db;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql -> db_Select("links", "*", "link_id = '".$_POST['sublink_parent']."'");
|
$sql -> db_Select("links", "*", "link_id = '".$_POST['sublink_parent']."'");
|
||||||
@@ -98,22 +110,15 @@ if(isset($_POST['generate_sublinks']) && isset($_POST['sublink_type']) && $_POST
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['inc']))
|
if ($incdec_action == 'inc')
|
||||||
{
|
{
|
||||||
$qs = explode(".", $_POST['inc']);
|
$sql->db_Update("links", "link_order=link_order+1 WHERE link_order='".intval($link_order-1)."'");
|
||||||
$linkid = $qs[0];
|
$sql->db_Update("links", "link_order=link_order-1 WHERE link_id='".intval($linkid)."'");
|
||||||
$link_order = $qs[1];
|
|
||||||
$sql->db_Update("links", "link_order=link_order+1 WHERE link_order='".intval($link_order-1)."'");
|
|
||||||
$sql->db_Update("links", "link_order=link_order-1 WHERE link_id='".intval($linkid)."'");
|
|
||||||
}
|
}
|
||||||
|
elseif ($incdec_action =='dec')
|
||||||
if (isset($_POST['dec']))
|
|
||||||
{
|
{
|
||||||
$qs = explode(".", $_POST['dec']);
|
$sql->db_Update("links", "link_order=link_order-1 WHERE link_order='".intval($link_order+1)."'");
|
||||||
$linkid = $qs[0];
|
$sql->db_Update("links", "link_order=link_order+1 WHERE link_id='".intval($linkid)."'");
|
||||||
$link_order = $qs[1];
|
|
||||||
$sql->db_Update("links", "link_order=link_order-1 WHERE link_order='".intval($link_order+1)."'");
|
|
||||||
$sql->db_Update("links", "link_order=link_order+1 WHERE link_id='".intval($linkid)."'");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['update']))
|
if (isset($_POST['update']))
|
||||||
@@ -330,11 +335,11 @@ class links
|
|||||||
$this->aIdOptPrep = $this->prepOpts($this->aIdOptData);
|
$this->aIdOptPrep = $this->prepOpts($this->aIdOptData);
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_row($row2, $indent = FALSE) {
|
function display_row($row2, $indent = FALSE)
|
||||||
|
{
|
||||||
global $sql, $rs, $ns, $tp, $linkArray, $previous_cat, $imode;
|
global $sql, $rs, $ns, $tp, $linkArray, $previous_cat, $imode;
|
||||||
extract($row2);
|
extract($row2);
|
||||||
|
|
||||||
//
|
|
||||||
if($link_category > 1 && $link_category != $previous_cat)
|
if($link_category > 1 && $link_category != $previous_cat)
|
||||||
{
|
{
|
||||||
$text .= "
|
$text .= "
|
||||||
@@ -359,42 +364,43 @@ class links
|
|||||||
$link_name.= ' ['.$link_url.']';
|
$link_name.= ' ['.$link_url.']';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($indent) {
|
if ($indent)
|
||||||
$subimage = "<img src='".e_IMAGE."packs/".$imode."/admin_images/sublink.png' alt='' />";
|
{
|
||||||
$subspacer = ($indent > 1) ? " style='padding-left: ".(($indent - 1) * 16)."px'" : "";
|
$subimage = "<img src='".e_IMAGE."packs/".$imode."/admin_images/sublink.png' alt='' />";
|
||||||
$subindent = "<td".$subspacer.">".$subimage."</td>";
|
$subspacer = ($indent > 1) ? " style='padding-left: ".(($indent - 1) * 16)."px'" : "";
|
||||||
|
$subindent = "<td".$subspacer.">".$subimage."</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= "<tr><td class='forumheader3' style='text-align: center; vertical-align: middle' title='".$link_description."'>";
|
$text .= "<tr><td class='forumheader3' style='text-align: center; vertical-align: middle' title='".$link_description."'>";
|
||||||
$text .= $link_button ? "<img src='".e_IMAGE."icons/".$link_button."' alt='' /> ":
|
$text .= $link_button ? "<img src='".e_IMAGE."icons/".$link_button."' alt='' /> ":
|
||||||
"";
|
"";
|
||||||
$text .= "</td><td class='forumheader3' title='".$link_description."'>
|
$text .= "</td><td class='forumheader3' title='".$link_description."'>
|
||||||
<table cellspacing='0' cellpadding='0' border='0' style='width: 100%'>
|
<table cellspacing='0' cellpadding='0' border='0' style='width: 100%'>
|
||||||
<tr>
|
<tr>
|
||||||
".$subindent."
|
".$subindent."
|
||||||
<td style='".($indent ? "" : "font-weight:bold;")."width: 100%'>".$link_name."</td>
|
<td style='".($indent ? "" : "font-weight:bold;")."width: 100%'>".$link_name."</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>";
|
</td>";
|
||||||
$text .= "<td style='text-align:center; white-space: nowrap' class='forumheader3'>";
|
$text .= "<td style='text-align:center; white-space: nowrap' class='forumheader3'>";
|
||||||
$text .= "<a href='".e_SELF."?create.sub.{$link_id}'><img src='".e_IMAGE."packs/".$imode."/admin_images/sublink_16.png' title='".LINKLAN_10."' alt='".LINKLAN_10."' /></a> ";
|
$text .= "<a href='".e_SELF."?create.sub.{$link_id}'><img src='".e_IMAGE."packs/".$imode."/admin_images/sublink_16.png' title='".LINKLAN_10."' alt='".LINKLAN_10."' /></a> ";
|
||||||
$text .= "<a href='".e_SELF."?create.edit.{$link_id}'>".ADMIN_EDIT_ICON."</a> ";
|
$text .= "<a href='".e_SELF."?create.edit.{$link_id}'>".ADMIN_EDIT_ICON."</a> ";
|
||||||
$text .= "<input type='image' title='".LAN_DELETE."' name='main_delete_{$link_id}' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(LCLAN_58." [ $link_name ]")."') \" />";
|
$text .= "<input type='image' title='".LAN_DELETE."' name='main_delete_{$link_id}' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(LCLAN_58." [ $link_name ]")."') \" />";
|
||||||
$text .= "</td>";
|
$text .= "</td>";
|
||||||
$text .= "<td style='text-align:center' class='forumheader3'>".r_userclass("link_class[".$link_id."]", $link_class, "off", "public,guest,nobody,member,admin,classes")."</td>";
|
$text .= "<td style='text-align:center' class='forumheader3'>".r_userclass("link_class[".$link_id."]", $link_class, "off", "public,guest,nobody,member,admin,classes")."</td>";
|
||||||
$text .= "<td style='text-align:center; white-space: nowrap' class='forumheader3'>";
|
$text .= "<td style='text-align:center; white-space: nowrap' class='forumheader3'>";
|
||||||
$text .= "<input type='image' src='".e_IMAGE."packs/".$imode."/admin_images/up.png' title='".LCLAN_30."' value='".$link_id.".".$link_order."' name='inc' />";
|
$name_suffix = URL_SEPARATOR.$link_id.URL_SEPARATOR.$link_order;
|
||||||
$text .= "<input type='image' src='".e_IMAGE."packs/".$imode."/admin_images/down.png' title='".LCLAN_31."' value='".$link_id.".".$link_order."' name='dec' />";
|
$text .= "<input name='inc".$name_suffix."' type='image' src='".e_IMAGE."packs/".$imode."/admin_images/up.png' title='".LCLAN_30."' />";
|
||||||
$text .= "</td>";
|
$text .= "<input name='dec".$name_suffix."' type='image' src='".e_IMAGE."packs/".$imode."/admin_images/down.png' title='".LCLAN_31."' />";
|
||||||
$text .= "<td style='text-align:center' class='forumheader3'>";
|
$text .= "</td>";
|
||||||
$text .= "<select name='link_order[]' class='tbox'>\n";
|
$text .= "<td style='text-align:center' class='forumheader3'>";
|
||||||
$text .= $this->genOpts( $this->aIdOptPrep, $this->aIdOptTest, $link_order, $link_id );
|
$text .= "<select name='link_order[]' class='tbox'>\n";
|
||||||
$text .= "</select>";
|
$text .= $this->genOpts( $this->aIdOptPrep, $this->aIdOptTest, $link_order, $link_id );
|
||||||
$text .= "</td>";
|
$text .= "</select>";
|
||||||
$text .= "</tr>";
|
$text .= "</td>";
|
||||||
|
$text .= "</tr>";
|
||||||
return $text;
|
|
||||||
|
|
||||||
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user