PDA

View Full Version : ширифт в блоке


neon
01.07.2006, 20:49
Здравствуйте появилась вот такая проблема поставил блок навигации (не стандартный блок) и у меня появилась проблема, чо в нём не такой ширифт как во всей теме в стандартном блоке навигации всё ок <?php
// Настройки блока
$size_height = 18; // Размеры иконок меню по высоте
$size_width = 18; // Размеры иконок меню по ширене
$alpha_over = 30; // Прозрачность иконки меню при отсутствии на ней указателя мыши (0 - Невидима, 100 - Непрозрачна)
$alpha_set = 100; // Прозрачность иконки меню при наведении на неё указателем мыши (0 - Невидима, 100 - Непрозрачна)
$addmenukeys = true; // Разрешение(true)/запрещение(false) дополнительных ссылок в меню



// !!! Дальнейший код лучше не трогать, !!!
// !!! если вы не уверены в правильности своих действий. !!!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
global $prefix, $db, $admin;

if (eregi("block-Modules.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
$content = "\n\n
<!--------- Навигационная панель --------->
<style>
.onfocus {filter:alpha(opacity=$alpha_set); height: $size_height; width: $size_width; border: 0}
.offfocus {filter:alpha(opacity=$alpha_over); height: $size_height; width: $size_width; border: 0}
</style>

<script type='text/javascript'>
<!--";
if (is_admin($admin)) {
$content .= "
function flipBox(who) {
var tmp;
if (document.images[who].src.indexOf('_on') == -1) {
tmp = document.images[who].src.replace('_off', '_on');
document.getElementById('b_' + who).style.display = 'none';
document.images[who].src = tmp;}\n
else {tmp = document.images[who].src.replace('_on', '_off');
document.getElementById('b_' + who).style.display = 'block';
document.images[who].src = tmp;}
}";
}

$content .= "
function showObject(obj) {obj.className = 'onfocus'}
function hideObject(obj) {obj.className = 'offfocus'}
// -->
</script>";

$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/module.php")) {
include("themes/$ThemeSel/module.php");
if (is_active("$default_module") AND file_exists("modules/$default_module/index.php")) {$def_module = $default_module;} else {$def_module = "";}
}

/* Автоматическое удаление не существующих ссылок на модули в БД*/
$res = $db->sql_query("SELECT title FROM " . $prefix . "_modules");
while ($row2 = $db->sql_fetchrow($res)) {
$title = stripslashes($row2['title']);
$a = 0;
$handle=opendir('modules');
while ($file = readdir($handle)) {if ($file == $title) $a = 1;}
closedir($handle);
if ($a == 0) $db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'");
}

$row = $db->sql_fetchrow($db->sql_query("SELECT main_module FROM ".$prefix."_main"));
$main_module = $row['main_module'];
$content .= "\n\n<table width=100% border=0 cellpadding=1 cellspacing=0>";
if (($_SERVER['PHP_SELF']=='/index.php') AND ($_SERVER['QUERY_STRING']==''))
{$content .= "\n<tr>";
$content .= "<td width=$size_width><img src='images/icon_menu_home.gif' class='onfocus'>";
$content .= "<td valign=middle><b>"._HOME."</b></td></tr>";}
else
{$i = 0;
$content .= "\n<tr>";
$content .= "<td width=$size_width><a href='index.php'><img src='images/icon_menu_home.gif' name='img$i' class='offfocus' onmouseover='javascript:showObject(img$i)' onmouseout='javascript:hideObject(img$i)'></a>";
$content .= "<td valign=middle><a href='index.php' onmouseover='javascript:showObject(img$i)' onmouseout='javascript:hideObject(img$i)'>"._HOME."</a></td></tr>";}
$res = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC");
while ($row3 = $db->sql_fetchrow($res)) {
$m_title = stripslashes($row3['title']);
$m_img = file_exists("modules/$m_title/icon_menu_home.gif") ? "modules/$m_title/icon_menu_home.gif" : "images/icon_menu_defual.gif";
$custom_title = $row3['custom_title'] ? $row3['custom_title'] : ereg_replace("_", " ", $m_title);
$view = intval($row3['view']);
if ($m_title != $main_module) {
if ((is_admin($admin) AND $view == 2) OR $view != 2) {
if (($_SERVER['PHP_SELF']=='/modules.php') AND ($_SERVER['QUERY_STRING']=="name=$m_title"))
{$content .= "\n<tr>";
$content .= "<td width=$size_width><img src='$m_img' class='onfocus'>";
$content .= "<td valign=middle><b>$custom_title</b></td></tr>";
}
else
{$i++;
$content .= "\n<tr>";
$content .= "<td width=$size_width><a href='modules.php?name=$m_title'><img src='$m_img' name='img$i' class='offfocus' onmouseover='javascript:showObject(img$i)' onmouseout='javascript:hideObject(img$i)'></a>";
$content .= "<td valign=middle><a href='modules.php?name=$m_title' onmouseover='javascript:showObject(img$i)' onmouseout='javascript:hideObject(img$i)'>$custom_title</a></td></tr>";
}
}
}
}

if ($addmenukeys == true)
{
// -------------------------------------------------------------------
// ----- здесь можно добавить новые ссылки на любые html файлы -------



#$content .= "\n<tr><td width=$size_width><img src='images/icon_menu_defual.gif' height='$size_height' width='$size_width' border=0><td valign=middle><a href='Ссылка на ресурс 1'>Заголовок ресурса 1</a></td></tr>\n";
$content .= "\n<tr><td width=$size_width><img src='images/icon_menu_defual.gif' height='$size_height' width='$size_width' border=0><td valign=middle ><a href='http://10.192.22.73/ts2'>ts</a></td></tr>\n";



// -------------------------------------------------------------------
}
// Продолжение меню для админов (показывает ссылки на модули которые не активированы или скрыты от пользователей)
if (is_admin($admin)) {
$handle=opendir('modules');
while ($file = readdir($handle)) {
if (!ereg("[.]",$file)) $modlist .= "$file ";
}
closedir($handle);
$modlist = explode(" ", $modlist);
sort($modlist);
for ($i=0; $i < sizeof($modlist); $i++) {
if($modlist[$i] != "") {
$row4 = $db->sql_fetchrow($db->sql_query("SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'"));
$mid = intval($row4['mid']);
$mod_uname = ereg_replace("_", " ", $modlist[$i]);
if ($mid == "") $db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$mod_uname', '0', '0', '1', '0')");
}
}

$content .= "\n<tr><td colspan=2 style='border-bottom-style: solid; border-bottom-width: 1px'><br><b><small>Администратору:</td></tr>";
$content .= "\n<tr bgcolor=#CA0000><td align=center><IMG onclick=\"javascript:flipBox('box_menu')\" src='images/box_menu_on.gif' border=0 name=box_menu style='cursor: hand;'><td style=\"FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#CA0000,endColorStr=#FF8080); color=#FFFFFF;\"><b><a name=\"f\" style='cursor: hand;' onclick=\"javascript:flipBox('box_menu')\">"._INVISIBLEMODULES."</a></b></td></tr>";
$content .= "\n<tr><td colspan=2>";
$content .= "\n\n<DIV id=b_box_menu style='DISPLAY: none'>";
$result5 = $db->sql_query("SELECT title, custom_title FROM ".$prefix."_modules WHERE active='1' AND inmenu='0' ORDER BY title ASC");
while ($row5 = $db->sql_fetchrow($result5)) {
$mn_title = $row5['title'];
$custom_title = $row5['custom_title'];
$mn_title2 = ereg_replace("_", " ", $mn_title);
if ($custom_title != "") $mn_title2 = $custom_title;
if ($mn_title2 != "") {
$content .= "\n&nbsp;&raquo;&nbsp;<a href='modules.php?name=$mn_title'>$mn_title2</a><br>";
$dummy = 1;
} else {$a = 1;}
}
if ($a == 1 AND $dummy != 1) $content .= "\n&nbsp;&raquo;&nbsp;<i>"._NONE."</i><br>";
$content .= "\n</DIV></td></tr>";

$content .= "\n<tr bgcolor=#CA0000><td align=center><IMG style='cursor: hand;' onclick=\"javascript:flipBox('box_menu1')\" src='images/box_menu_on.gif' border=0 name=box_menu1><td style=\"FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#CA0000,endColorStr=#FF8080); color=#FFFFFF;\"><b><a name=\"f\" style='cursor: hand;' onclick=\"javascript:flipBox('box_menu1')\">"._NOACTIVEMODULES."</a></b></td></tr>";
$content .= "\n<tr><td colspan=2>";
$content .= "\n\n<DIV id=b_box_menu1 style='DISPLAY: none'>";
$result6 = $db->sql_query("SELECT title, custom_title FROM ".$prefix."_modules WHERE active='0' ORDER BY title ASC");
while ($row6 = $db->sql_fetchrow($result6)) {
$mn_title = $row6['title'];
$custom_title = $row6['custom_title'];
$mn_title2 = ereg_replace("_", " ", $mn_title);
if ($custom_title != "") $mn_title2 = $custom_title;
if ($mn_title2 != "") {
$content .= "\n&nbsp;&raquo;&nbsp;<a href='modules.php?name=$mn_title'>$mn_title2</a><br>";
$dummy = 1;
} else {$a = 1;}
}
if ($a == 1 AND $dummy != 1) $content .= "\n&nbsp;&raquo;&nbsp;<i>"._NONE."</i><br>";
$content .= "\n</DIV></td></tr>";
}
$content .= "\n</table>";
$content .= "\n<!--------- Конец Навигационной панели --------->";
?>

Soniks
02.07.2006, 10:48
neon возможно вам надо добавить стиль в таблицу этого блока, такойже как и у стандартного блока

neon
02.07.2006, 16:23
а как это сделать помоги пожалуйсто ) код дефолтного блока <?php

/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2005 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/

if (eregi("block-Modules.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

global $prefix, $db, $admin;

$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/module.php")) {
include("themes/$ThemeSel/module.php");
if (is_active("$default_module") AND file_exists("modules/$default_module/index.php")) {
$def_module = $default_module;
} else {
$def_module = "";
}
}

$row = $db->sql_fetchrow($db->sql_query("SELECT main_module FROM ".$prefix."_main"));
$main_module = filter($row['main_module'], nohtml);

/* If the module doesn't exist, it will be removed from the database automaticaly */
$result2 = $db->sql_query("SELECT title FROM " . $prefix . "_modules");
while ($row2 = $db->sql_fetchrow($result2)) {
$title = filter($row2['title'], nohtml);
$a = 0;
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ($file == $title) {
$a = 1;
}
}
closedir($handle);
if ($a == 0) {
$db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'");
}
}

/* Now we make the Modules block with the correspondent links */

$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"index.php\">"._HOME."</a><br>\n";
$result3 = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC");
while ($row3 = $db->sql_fetchrow($result3)) {
$m_title = filter($row3['title'], nohtml);
$custom_title = filter($row3['custom_title'], nohtml);
$view = intval($row3['view']);
$m_title2 = ereg_replace("_", " ", $m_title);
if ($custom_title != "") {
$m_title2 = $custom_title;
}
if ($m_title != $main_module) {
if ((is_admin($admin) AND $view == 2) OR $view != 2) {
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=$m_title\">$m_title2</a><br>\n";
}
}
}

/* If you're Admin you and only you can see Inactive modules and test it */
/* If you copied a new module is the /modules/ directory, it will be added to the database */

if (is_admin($admin)) {
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ( (!ereg("[.]",$file)) ) {
$modlist .= "$file ";
}
}
closedir($handle);
$modlist = explode(" ", $modlist);
sort($modlist);
for ($i=0; $i < sizeof($modlist); $i++) {
if($modlist[$i] != "") {
$row4 = $db->sql_fetchrow($db->sql_query("SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'"));
$mid = intval($row4['mid']);
$mod_uname = ereg_replace("_", " ", $modlist[$i]);
if ($mid == "") {
$db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$mod_uname', '0', '0', '1', '0')");
}
}
}
$content .= "<br><center><b>"._INVISIBLEMODULES."</b><br>";
$content .= "<font class=\"tiny\">"._ACTIVEBUTNOTSEE."</font></center><br>";
$result5 = $db->sql_query("SELECT title, custom_title FROM ".$prefix."_modules WHERE active='1' AND inmenu='0' ORDER BY title ASC");
while ($row5 = $db->sql_fetchrow($result5)) {
$mn_title = filter($row5['title'], nohtml);
$custom_title = filter($row5['custom_title'], nohtml);
$mn_title2 = ereg_replace("_", " ", $mn_title);
if ($custom_title != "") {
$mn_title2 = $custom_title;
}
if ($mn_title2 != "") {
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=$mn_title\">$mn_title2</a><br>\n";
$dummy = 1;
} else {
$a = 1;
}
}
if ($a == 1 AND $dummy != 1) {
$content .= "<strong><big>&middot;</big></strong>&nbsp;<i>"._NONE."</i><br>\n";
}
$content .= "<br><center><b>"._NOACTIVEMODULES."</b><br>";
$content .= "<font class=\"tiny\">"._FORADMINTESTS."</font></center><br>";
$result6 = $db->sql_query("SELECT title, custom_title FROM ".$prefix."_modules WHERE active='0' ORDER BY title ASC");
while ($row6 = $db->sql_fetchrow($result6)) {
$mn_title = filter($row6['title'], nohtml);
$custom_title = filter($row6['custom_title'], nohtml);
$mn_title2 = ereg_replace("_", " ", $mn_title);
if ($custom_title != "") {
$mn_title2 = $custom_title;
}
if ($mn_title2 != "") {
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=$mn_title\">$mn_title2</a><br>\n";
$dummy = 1;
} else {
$a = 1;
}
}
if ($a == 1 AND $dummy != 1) {
$content .= "<strong><big>&middot;</big></strong>&nbsp;<i>"._NONE."</i><br>\n";
}
}

?>

neon
06.07.2006, 02:34
проблема всё ешё не решена ))

Soniks
11.07.2006, 23:44
neon мне код приводить не надо я его и так знаю, а надо всего лишь найти в нем те строки в котором вам нужно изменить шрифт и указать там нужный класс, например tiny или какой другой...