Przedszkolak
Postów: 6
Data rejestracji: 05.03.2009 18:30
|
Witam
Mam problem ze zrobieniem rozwijanej górnej belki, skórka CFR_Fans_Theme. Chyba ta skóra posiada możliwość dodania listy rozwijanej. Zerknijcie na to bo nie mogę sobie z tym poradzić.
theme.php
<?php
if (!defined("IN_FUSION")) { die("Access Denied"); }
require_once INCLUDES."theme_functions_include.php";
define("THEME_WIDTH", "1000");
define("THEME_BULLET", "<span class='bullet'><img src='".THEME."images/bullet.png'></span>");
//v7 sublinks
function thesublinks($sep="·",$class="") {
echo "<script type='text/javascript' src='".THEME."/fader.js'></script>";
$i = 0; $res = "";
$sres = dbquery("SELECT * FROM ".DB_PREFIX."site_links WHERE link_position>='2' AND ".groupaccess('link_visibility')." AND link_url!='---' ORDER BY link_order ASC");
if (dbrows($sres)) {
while($sdata = dbarray($sres)) {
if ($i != 0) { $res .= " ".$sep."\n"; } else { $res .= "\n"; }
$link_target = $sdata['link_window'] == "1" ? " target='_blank'" : "";
$link_class = $class ? " class='$class'" : "";
if (strstr($sdata['link_url'], "http://") || strstr($sdata['link_url'], "https://")) {
$res .= "<a href='".$sdata['link_url']."'".$link_target.$link_class.">".$sdata['link_name']."</a>";
} else {
$res .= "<a href='".BASEDIR.$sdata['link_url']."'".$link_target.$link_class.">".$sdata['link_name']."</a>";
}
$i++;
}
}
if ($i != 0) { return $res; } else { return " "; }
}
function render_page($license=false) {
global $settings, $main_style;
//Header
echo "<table cellpadding='0' cellspacing='0' width='".THEME_WIDTH."' align='center'><tr><td>
<table cellpadding='0' cellspacing='0' width='".THEME_WIDTH."' style='border: 0px; margin: 0px auto'>
<tr><td>
<img src='".THEME."images/header.jpg' alt='".$settings['sitename']."' width='1000' height='200' />";
echo "</td></tr></table>\n";
//sublinks css
echo "<table width='".THEME_WIDTH."' border='0' cellspacing='0' cellpadding='0'><tr><td>";
echo "<div id='altlinkler'>";
echo "<ul><li>".thesublinks("</li>\n<li>");
echo "</li></ul><div class='clear-both'> </div></div>";
echo "</td></tr></table>";
//Content
echo "<table cellpadding='0' cellspacing='0' width='".THEME_WIDTH."'>\n<tr>\n";
if (LEFT) { echo "<td class='side-border-left' valign='top'>".LEFT."</td>"; }
echo "<td class='main-bg' valign='top'>".U_CENTER.CONTENT.L_CENTER."</td>";
if (RIGHT) { echo "<td class='side-border-right' valign='top'>".RIGHT."</td>"; }
echo "</tr>\n</table>\n";
//Footer
echo "<div id='footer'><table cellpadding='0' cellspacing='0' width='1000' class='footermain'>
<tr>
<td class='footer_t'>".showcopyright()." <br>CFR Fans Theme By <strong><a href='http://www.enculescu.com' onclick='window.open(this.href); return false;' onkeypress='window.open(this.href); return false;'><font color='black'>Enculescu</font></a></strong>
</td>
</tr>
</table>
</div>
</td></tr></table>
\n";
}
function render_news($subject, $news, $info) {
echo "<div class='capmain'>$subject</div>\n";
echo "<div class='main-body floatfix'>".$news."</div>\n";
echo "<div class='news-footer'>\n";
echo newsposter($info,"·").newsopts($info,"·").itemoptions("N",$info['news_id']);
echo "</div>\n";
}
function render_article($subject, $article, $info) {
echo "<div class='border tablebreak'>";
echo "<div class='capmain'>$subject</div>\n";
echo "<div class='main-body floatfix'>".($info['article_breaks'] == "y" ? nl2br($article) : $article)."</div>\n";
echo "<div class='news-footer'>\n";
echo articleposter($info,"·").articleopts($info,"·").itemoptions("A",$info['article_id']);
echo "</div>\n";
echo "</div>";
}
function opentable($title) {
echo "<table cellpadding='0' cellspacing='0' width='100%' class='border tablebreak'>
<tr>
<td class='capmain'>$title</td>
</tr>
<tr>
<td class='main-body'>\n";
}
function closetable() {
echo "</td>
</tr>
</table>\n";
}
function openside($title, $collapse = false, $state = "on") {
echo "<div class='border tablebreak'>";
global $panel_collapse; $panel_collapse = $collapse;
echo "<div class='border'>\n";
echo "<div class='scapmain'>";
if ($collapse == true) {
$boxname = str_replace(" ", "", $title);
echo "<div style='float:right;'>".panelbutton($state,$boxname)."</div>";
}
echo $title."</div>\n<div class='side-body floatfix'>\n";
if ($collapse == true) { echo panelstate($state, $boxname); }
}
function closeside($collapse = false) {
global $panel_collapse;
if ($panel_collapse == true) { echo "</div>\n"; }
echo "</div>\n</div>\n";
echo "</div>";
}
?>
fader.js
/******************************************************************
* Script name: Link fader (http://design64.net/js/linkfader.html)
* Version: 1.0
* Date: 12.05.02
* Usage: Freeware - You may modify this script as you wish,
* as long as you don't remove this header comment.
*
* Script by: Fayez Zaheer (viol8r on #webdesign [irc.zanet.org.za])
* Email:
* Web site: http://design64.net
* Original idea: http://anarchos.xs.mw/fade.phtml
* Script featured on JavaScript Kit (http://www.javascriptkit.com)
******************************************************************/
// DELETE COMMENTS THAT START WITH // TO MAKE THE FILE SIZE SMALLER.
// This script will no longer overwrite your current onmouseover and
// onmouseout attributes - it will instead skip those links. If you would
// still like to fade them, add findLink(this.id) to your onmouseover
// and clearFade() to your onmouseout, like so -
<a href="index.php" onmouseover="findLink(this.id); yourFunction()"
onmouseout="clearFade(); yourSecondFunction()">
// Make sure to put it BEFORE any "return" statements otherwise
// the fade will not execute.
// Fade-to colour without the # (6 character value only!)
var fadeTo = "FFFFFF";
// Fade in colour increment/decrement by
var fiBy = 6;
// Fade out colour increment/decrement by
var foBy = 10;
// Speed - milliseconds between each colour change in the fade
// Less than 10ms doesn't really make all that much difference, so
// 10 is the minimum effective value.
var speed = 10;
// Class name of links to NOT fade (i.e. ignore)
// var ignoreClass = "somebogusvalue" if you don't want to
// use this feature. Alternatively, add onmouseover="clearFade()"
// to the link you do not wish to fade.
var ignoreClass = "ignore";
// No more changes required (unless you know what you are doing)
// Enjoy... and email me and let me know what site(s) you are using it on :)
var opera, ie, dom, x = 0, oc, fader, ocs = new Array();
if (navigator.userAgent.indexOf("Opera") != -1) opera = true
else if (document.all && !opera) ie = true
else if (!document.all && document.getElementById) dom = true;
function convertRGB(z)
{
var newfcS = "", splitter = "";
splitter = z.split(",");
splitter[0] = parseInt(splitter[0].substring(4, splitter[0].length));
splitter[1] = parseInt(splitter[1]);
splitter[2] = parseInt(splitter[2].substring(0, splitter[2].length-1));
for (var q = 0; q < 3; q++)
{
splitter[q] = splitter[q].toString(16);
if (splitter[q].length == 1) splitter[q] = "0" + splitter[q];
newfcS += splitter[q];
}
return newfcS;
}
function currentColour(index)
{
var temp, cc;
if (opera) cc = document.links[index].style.color
else if (ie) cc = document.links[index].currentStyle.color
else if (dom) cc = document.defaultView.getComputedStyle(document.links[index], '').getPropertyValue("color");
if (cc.length == 4 && cc.substring(0, 1) == "#")
{
temp = "";
for (var a = 0; a < 3; a++)
temp += cc.substring(a+1, a+2) + cc.substring(a+1, a+2);
cc = temp;
}
else if (cc.indexOf("rgb") != -1) cc = convertRGB(cc)
else if (cc.length == 7) cc = cc.substring(1, 7)
else cc = fadeTo;
return cc;
}
function convert2Dec(hex)
{
var rgb = new Array();
for (var u = 0; u < 3; u++)
rgb[u] = parseInt(hex.substring(u*2, u*2+2), 16);
return rgb;
}
function newRGB(f, n, d)
{
var change;
if (d == 1) change = fiBy
else change = foBy;
for (var g = 0; g < 3; g++)
{
if (n[g] > f[g] && n[g] - change >= 0) n[g] -= change;
if (n[g] < f[g] && n[g] + change <= 255) n[g] += change;
}
return n;
}
function fade(index, d)
{
var fc, nc, temp = new Array(), finished = false;
nc = convert2Dec(currentColour(index));
if (d == 1) fc = convert2Dec(fadeTo)
else fc = convert2Dec(ocs[x]);
temp = convert2Dec(currentColour(index));
nc = newRGB(fc, nc, d);
if ((nc[0] == temp[0]) && (nc[1] == temp[1]) && (nc[2] == temp[2]))
finished = true;
if (!finished) document.links[x].style.color = "rgb(" + nc[0] + "," + nc[1] + "," + nc[2] + ")"
else clearInterval(fader);
}
function findLink(over)
{
if (document.layers) return;
if (fader)
{
clearInterval(fader);
document.links[x].style.color = "#" + ocs[x];
}
if (over && !this.id) this.id = over;
x = 0;
while (!(this.id == document.links[x].id) && (x < document.links.length))
x++;
if (this.id == document.links[x].id)
{
oc = currentColour(x);
fader = setInterval("fade(" + x + ", 1)", speed);
}
}
function clearFade()
{
if (document.layers) return;
if (fader) clearInterval(fader);
fader = setInterval("fade(" + x + ", 0)", speed);
}
function init()
{
for (var i = 0; i < document.links.length; i++)
{
ocs[i] = currentColour(i);
var currentOver = document.links[i].onmouseover;
var currentOut = document.links[i].onmouseout;
var ignoreIt = document.links[i].className == ignoreClass;
if (!ignoreIt) document.links[i].id = "link" + i;
if (!currentOver && !currentOut && !ignoreIt)
{
document.links[i].onmouseover = findLink;
document.links[i].onmouseout = clearFade;
}
}
}
if (opera || ie || dom) window.onload = init;
|