Thread Author: coldfire
Thread ID: 1482
Thread Info
Es gibt 5 Beiträge zu diesem Thema, und es wurde 2629 mal angesehen.
Wer ist hier? 1 Gäste
 Thema drucken
MG Navigation Panel für v6
coldfire
Schönen guten Abend zusammen.
Da meine Homepage noch auf v6 läuft und es zur Zeit viel zu aufwändig wäre einen umzug auf v7 in betracht zu ziehen, hab ich mir gedacht bau ich doch das MG Navigation Panel für v6 um.
Da ich in diesem Gebiet noch nicht Superman bin, hab ich mit diversen Problemen zu kämpfen.
Ich habe die Originaldatei mg_navigation_panel.php so geändert:
Original
[geshi=php]<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| MG Navigation Panel v1.0
| Copyright © 2009 MarcusG
| http://www.marcusg.de
+--------------------------------------------------------+
| Filename: mg_navigation_panel.php
| Author: MarcusG
| Original Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
add_to_head('<link rel="stylesheet" href="'.INFUSIONS.'mg_navigation_panel/inc/mg_navigation.css" type="text/css" media="screen" />');
add_to_head('<script type="text/javascript" src="'.INFUSIONS.'mg_navigation_panel/inc/jquery.cookie.js"></script>');
add_to_head('<script type="text/javascript" src="'.INFUSIONS.'mg_navigation_panel/inc/mg_navigation.js"></script>');
//add_to_head('<script type="text/javascript" src="'.INFUSIONS.'mg_navigation_panel/inc/grade.js"></script>');

//this function is to validate image names for turkish cat names
function trascii($text) {
$search = array("Ç", "Ý", "Ð", "Ö", "Þ", "Ü", "ç", "ý", "ð", "ö", "þ", "ü");
$replace = array("c", "i", "g", "o", "s", "u", "c", "i", "g", "o", "s", "u");
$text = str_replace($search, $replace, $text);
return $text;
}
$list_open = false;

openside($locale['global_001']);
$result = dbquery(
"SELECT tl.link_name, tl.link_url, tl.link_window, tl.link_order FROM ".DB_SITE_LINKS." tl
WHERE ".groupaccess('tl.link_visibility')." AND link_position<='2'
ORDER BY link_order"
);
if (dbrows($result)) {
echo "<div id='navigation' class='mgmenu'>\n"; // start sidebar
while($data = dbarray($result)) {
if ($data['link_name'] != "---" && $data['link_url'] == "---") {
if ($list_open) { echo "</ul></div>\n"; $list_open = false; }
$linkname = trascii(strtolower(str_replace(" ","_",$data['link_name'])));
if (file_exists(INFUSIONS."mg_navigation_panel/images/".$linkname.".png")) {
$nav_img = "<img src='".INFUSIONS."mg_navigation_panel/images/".$linkname.".png' border='0' alt='".$linkname."' />&nbsp;\n";
} else {
$nav_img = "";
}
echo "<h2 id='".$linkname."Link'>".$nav_img.$data['link_name']."</h2>\n";
echo "<div id='".$linkname."Content'>\n";
} else if ($data['link_name'] == "---" && $data['link_url'] == "---") {
if ($list_open) { echo "</ul></div>\n"; $list_open = false; }
} else {
if (!$list_open) { echo "<ul>\n"; $list_open = true; }
$link_target = ($data['link_window'] == "1" ? " target='_blank'" : "");
if (strstr($data['link_url'], "http://") || strstr($data['link_url'], "https://")) {
echo "<li><a href='".$data['link_url']."'".$link_target." class='side'><span>".$data['link_name']."</span></a></li>\n";
} else {
echo "<li><a href='".BASEDIR.$data['link_url']."'".$link_target." class='side'><span>".$data['link_name']."</span></a></li>\n";
}
}
}
if ($list_open) { echo "</ul></div>\n"; }
echo "</div>\n"; // end sidebar

} else {
echo $locale['global_002'];
}
closeside();
?>[/geshi]

Modifiziert
[geshi=php]<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| MG Navigation Panel v1.0
| Copyright © 2009 MarcusG
| http://www.marcusg.de
+--------------------------------------------------------+
| Filename: mg_navigation_panel.php
| Author: MarcusG
| Original Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }

echo '
<link rel="stylesheet" href="'.INFUSIONS.'mg_navigation_panel/inc/mg_navigation.css" type="text/css" media="screen" />
<script type="text/javascript" src="'.INFUSIONS.'mg_navigation_panel/inc/jquery.cookie.js"></script>
<script type="text/javascript" src="'.INFUSIONS.'mg_navigation_panel/inc/mg_navigation.js"></script>';

//this function is to validate image names for turkish cat names
function trascii($text) {
$search = array("Ç", "Ý", "Ð", "Ö", "Þ", "Ü", "ç", "ý", "ð", "ö", "þ", "ü");
$replace = array("c", "i", "g", "o", "s", "u", "c", "i", "g", "o", "s", "u");
$text = str_replace($search, $replace, $text);
return $text;
}
$list_open = false;

openside($locale['global_001']);
$result = dbquery("SELECT tl.link_name, tl.link_url, tl.link_window, tl.link_order FROM ".$db_prefix."site_links tl
WHERE ".groupaccess('tl.link_visibility')." AND link_position<='2'
ORDER BY link_order"
);
if (dbrows($result)) {
echo "<div id='navigation' class='mgmenu'>\n"; // start sidebar
while($data = dbarray($result)) {
if ($data['link_name'] != "---" && $data['link_url'] == "---") {
if ($list_open) { echo "</ul></div>\n"; $list_open = false; }
$linkname = trascii(strtolower(str_replace(" ","_",$data['link_name'])));
if (file_exists(INFUSIONS."mg_navigation_panel/images/".$linkname.".png")) {
$nav_img = "<img src='".INFUSIONS."mg_navigation_panel/images/".$linkname.".png' border='0' alt='".$linkname."' />&nbsp;\n";
} else {
$nav_img = "";
}
echo "<h2 id='".$linkname."Link'>".$nav_img.$data['link_name']."</h2>\n";
echo "<div id='".$linkname."Content'>\n";
} else if ($data['link_name'] == "---" && $data['link_url'] == "---") {
if ($list_open) { echo "</ul></div>\n"; $list_open = false; }
} else {
if (!$list_open) { echo "<ul>\n"; $list_open = true; }
$link_target = ($data['link_window'] == "1" ? " target='_blank'" : "");
if (strstr($data['link_url'], "http://") || strstr($data['link_url'], "https://")) {
echo "<li><a href='".$data['link_url']."'".$link_target." class='side'><span>".$data['link_name']."</span></a></li>\n";
} else {
echo "<li><a href='".BASEDIR.$data['link_url']."'".$link_target." class='side'><span>".$data['link_name']."</span></a></li>\n";
}
}
}
if ($list_open) { echo "</ul></div>\n"; }
echo "</div>\n"; // end sidebar

} else {
echo $locale['global_002'];
}
closeside();
?>[/geshi]

Das Ergebnis ist schon mal ganz gut.
Die Navi wird dann so angezeigt
www.abload.de/thumb/unbenanntf0cy.jpg
Leider findet kein auf- und zuklappen statt.
Die Links sind aber anklickbar
auch die pfeile werden verfälsch dargestellt fährt man über den link
www.abload.de/thumb/unbenannt-1918a.jpg

was habe ich falsch gemacht oder übersehen? bin für jede hilfe dankbar;)
mfg
 
SC-Ad-Bot
 
ObiWan
Mhm, die 2 Scripte haste auch in den jeweiligen Verzeichnis?
PHP-Fusion World - Hier gibts massig Spiele und Stuff für deine Community
Bei WBB World: PHPFWBB 1.x.x Schnittstelle (eine Registrierung, problemloses einloggen auf beiden Systemen)
... und vieles mehr.
 
coldfire
die beiden scripte werden geladen. zumindest zeigt mir das die webdeveloper toolbar von firefox an wenn ich mir alle java scripts auf der webseite anzeigen lasse.
auch die css wird geladen:?

die dinge die ich geändert habe wären


[geshi=php]if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }[/geshi]
in v6 wird das ja noch so gelöst


[geshi=php]
echo '

<link rel="stylesheet" href="'.INFUSIONS.'mg_navigation_panel/inc/mg_navigation.css" type="text/css" media="screen" />

<script type="text/javascript" src="'.INFUSIONS.'mg_navigation_panel/inc/jquery.cookie.js"></script>

<script type="text/javascript" src="'.INFUSIONS.'mg_navigation_panel/inc/mg_navigation.js"></script>';[/geshi]
hier habe ich die funktion add_to_head entfernt, da diese erst in v7 implementiert wurde und v6 nicht kennt

[geshi=php]$result = dbquery("SELECT tl.link_name, tl.link_url, tl.link_window, tl.link_order FROM ".$db_prefix."site_links tl
WHERE ".groupaccess('tl.link_visibility')." AND link_position<='2'
ORDER BY link_order"[/geshi]

und als letztes der datenbankaufruf mit db_prefix
Bearbeitet von coldfire am 16.08.2009 um 20:14
 
coldfire
vieles scheint auch mit den veränderten v7 themes zusammenhängen hab ich grad gemerkt. ich werde mich mal dranmachen die klassen anzupassen
 
coldfire
so das ding läuft nun auf v6..
allerdings hat die mg_navbar einen bug bzw ist sie nicht kompatibel mit einem codesnippet das einen teamspeakserver im seitenpanel darstellt.
hier mal der entsprechende code
[geshi=php]openside("Teamspeak");
echo "<script language='javascript' type='text/javascript' charset='iso-8859-1' src='http://www.tsviewer.com/ts_viewer_pur.php?ID=95860&bg=transparent&type=8f8f8f&type_size=10&type_family=1&info=1&channels=1&users=1&js=1&type_s_color=faf5f5&type_s_weight=bold&type_s_style=normal&type_s_variant=normal&type_s_decoration=none&type_s_color_h=faf5f5&type_s_weight_h=bold&type_s_style_h=normal&type_s_variant_h=normal&type_s_decoration_h=underline&type_i_color=faf5f5&type_i_weight=bold&type_i_style=normal&type_i_variant=normal&type_i_decoration=none&type_i_color_h=525284&type_i_weight_h=normal&type_i_style_h=normal&type_i_variant_h=normal&type_i_decoration_h=underline&type_c_color=faf5f5&type_c_weight=bold&type_c_style=normal&type_c_variant=normal&type_c_decoration=none&type_c_color_h=525284&type_c_weight_h=normal&type_c_style_h=normal&type_c_variant_h=normal&type_c_decoration_h=underline&type_u_color=faf5f5&type_u_weight=bold&type_u_style=normal&type_u_variant=normal&type_u_decoration=none&type_u_color_h=525284&type_u_weight_h=normal&type_u_style_h=normal&type_u_variant_h=normal&type_u_decoration_h=none'></script><noscript>Enable JavaScript or visit <a href='http://www.tsviewer.com/index.php?page=ts_viewer&ID=95860'>TeamSpeak Viewer</a> to display the TeamSpeak server.</noscript>";
closeside();[/geshi]
mfg
 
Springe ins Forum:

 Ähnliche Themen 

TEST
Thema Forum Antworten Letzter Beitrag
Whats New Panel Infusionen 2 02.06.2019 um 00:50
Advanced Whats New Panel Allgemeine Diskussionen 3 23.10.2018 um 19:43
slideshow panel (mitte) Allgemeine Diskussionen 9 24.06.2018 um 17:08
warnuwetter panel Infusionen 5 16.01.2018 um 19:41
[suche] Social Networks Panel Infusionen 7 06.06.2017 um 17:08
PHPFusion DE NSS