Dear Rav, i'd like to put a javascript effect to make a the modules titles glowing (in the style.css these are marked by font class="title").
Where and HOW should I add the following code?
Code:
<script language="JavaScript1.2">
function glowit(which){
if (document.all.glowtext[which].filters[0].strength==3)
document.all.glowtext[which].filters[0].strength=2
else
document.all.glowtext[which].filters[0].strength=3
}
function glowit2(which){
if (document.all.glowtext.filters[0].strength==3)
document.all.glowtext.filters[0].strength=2
else
document.all.glowtext.filters[0].strength=3
}
function startglowing(){
if (document.all.glowtext&&glowtext.length){
for (i=0;i<glowtext.length;i++)
eval('setInterval("glowit('+i+')",150)')
}
else if (glowtext)
setInterval("glowit2(0)",150)
}
if (document.all)
window.onload=startglowing
</script>
Of course I have to add the style definition in the css file. No problem in doing this. But where shall I put the following HTML code?
Code:
<span id="glowtext">Your text</span>
Same place as the javascript code?
TNX in advance...
Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
Posted:
Wed Oct 15, 2003 7:31 am
You have a couple of options for the block of JavaScript code. I would try placing it in includes/my_header.php. Add it with code like this
Code:
<?
$jsCode = <<<_JS_
<script language="JavaScript1.2">
function glowit(which){
if (document.all.glowtext[which].filters[0].strength==3)
document.all.glowtext[which].filters[0].strength=2
else
document.all.glowtext[which].filters[0].strength=3
}
function glowit2(which){
if (document.all.glowtext.filters[0].strength==3)
document.all.glowtext.filters[0].strength=2
else
document.all.glowtext.filters[0].strength=3
}
function startglowing(){
if (document.all.glowtext&&glowtext.length){
for (i=0;i<glowtext.length;i++)
eval('setInterval("glowit('+i+')",150)')
}
else if (glowtext)
setInterval("glowit2(0)",150)
}
if (document.all)
window.onload=startglowing
</script>
_JS_;
echo $jsCode;
?>
For the other line, you will need to experiment a little. I believe it should go in the blocks/block-Modules.php file. You will need to add it to the $content variable to span the module title. You will want to find the $mn_title2 variable and 'wrap' it in the span tags.
You have a couple of options for the block of JavaScript code. I would try placing it in includes/my_header.php. Add it with code like this
Just done!
Raven wrote:
For the other line, you will need to experiment a little. I believe it should go in the blocks/block-Modules.php file. You will need to add it to the $content variable to span the module title. You will want to find the $mn_title2 variable and 'wrap' it in the span tags.
Mmmm I don't thinkI've undestood, sorry! . Anyway, I made something else. I modified the mainfile.php and the effect is there. But not everywhere I want.
Pls, Rav, could u have a look at this link?
Only registered users can see links on this board! Get registered or login to the forums!
I would like the effect to be also in "Current Active Topics".
Sorry, Rav, but I don't seem to find it. There are similar lines, but not those ones. I attach he code:
Code:
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 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 = "";
}
}
/* If the module doesn't exist, it will be removed from the database automaticaly */
$sql = "SELECT title FROM ".$prefix."_modules";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$title = $row[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'");
}
}
/* Now we make the Modules block with the correspondent links */
$content .= "<strong><big>·</big></strong> <a href=\"index.php\">"._HOME."</a><br>\n";
$sql = "SELECT title, custom_title, view FROM ".$prefix."_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$m_title = $row[title];
$custom_title = $row[custom_title];
$view = $row[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>·</big></strong> <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] != "") {
$sql = "SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$mid = $row[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')");
}
}
}
$content .= "<br><center><b>"._INVISIBLEMODULES."</b><br>";
$content .= "<font class=\"tiny\">"._ACTIVEBUTNOTSEE."</font></center><br>";
$sql = "SELECT title, custom_title FROM ".$prefix."_modules WHERE active='1' AND inmenu='0' ORDER BY title ASC";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$mn_title = $row[title];
$custom_title = $row[custom_title];
$mn_title2 = ereg_replace("_", " ", $mn_title);
if ($custom_title != "") {
$mn_title2 = $custom_title;
}
if ($mn_title2 != "") {
$content .= "<strong><big>·</big></strong> <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>·</big></strong> <i>"._NONE."</i><br>\n";
}
$content .= "<br><center><b>"._NOACTIVEMODULES."</b><br>";
$content .= "<font class=\"tiny\">"._FORADMINTESTS."</font></center><br>";
$sql = "SELECT title, custom_title FROM ".$prefix."_modules WHERE active='0' ORDER BY title ASC";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$mn_title = $row[title];
$custom_title = $row[custom_title];
$mn_title2 = ereg_replace("_", " ", $mn_title);
if ($custom_title != "") {
$mn_title2 = $custom_title;
}
if ($mn_title2 != "") {
$content .= "<strong><big>·</big></strong> <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>·</big></strong> <i>"._NONE."</i><br>\n";
}
}
?>
Consider that I don't want to modify the block menu, but the titles of the modules displaying after clicking on the correspondent link in the modules block. TNX!
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum