PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
morpheus_75
Involved
Involved


Joined: Oct 07, 2003
Posts: 302

PostPosted: Wed Oct 15, 2003 3:57 am Reply with quote Back to top

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...
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Oct 15, 2003 7:31 am Reply with quote Back to top

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
morpheus_75
Involved
Involved


Joined: Oct 07, 2003
Posts: 302

PostPosted: Fri Oct 17, 2003 9:37 am Reply with quote Back to top

Raven wrote:
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! Embarassed . 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".
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Fri Oct 17, 2003 6:00 pm Reply with quote Back to top

This line of code is in the block-modules.php file twice
Code:
      $content .= "<OPTION VALUE=\"modules.php?name=$mn_title\"><big>&middot;</big>&nbsp;$mn_title2";
Try modifying it to this
Code:
      $content .= "<OPTION VALUE=\"modules.php?name=$mn_title\"><big>&middot;</big>&nbsp;<span id="glowtext">$mn_title2</span>";
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
morpheus_75
Involved
Involved


Joined: Oct 07, 2003
Posts: 302

PostPosted: Sat Oct 18, 2003 3:14 am Reply with quote Back to top

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 = "";
   }
    }

    $sql = "SELECT main_module FROM ".$prefix."_main";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $main_module = $row[main_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>&middot;</big></strong>&nbsp;<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>&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] != "") {
      $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>&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>";
   $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>&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";
   }
    }

?>


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! Wink
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sat Oct 18, 2003 5:02 am Reply with quote Back to top

It's right there in the code you posted. Search for mn_title2 and m_title2.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
morpheus_75
Involved
Involved


Joined: Oct 07, 2003
Posts: 302

PostPosted: Sun Oct 19, 2003 5:14 am Reply with quote Back to top

TNX Rav! Things have been a bit more complicated, but at the moment everything has been settled. Wink
View user's profile Send private message
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum