Clan Adverts

DarkForge Gaming

www.clan-themes.co.uk :: View topic - Scrolling Title

 Welcome To Clan Themes 

As the board grows please remember the Search Option and we hope you find our community useful.

We also monitor Private Messages to stop members from abusing our sites system.
If you are asking for assistance please provide your site link and nuke version, Thanks.

Scrolling Title

4 Replies / 485 Views


Post new topic   Reply to topic  

   www.clan-themes.co.uk Forum Index » Java Scripts

View previous topic :: View next topic


cupoftea
Reputation: 13.6
Local time: 1:39 AM
Location: Behind My Computer
belgium.gif

Status: Offline
0.29 posts per day
Medals: 0

Joined: Apr 30, 2008
Last Visit: 01 Dec 2008
Posts: 64
Points: 610 

Post Scrolling Title Posted: Thu Jul 24, 2008 8:34 am   

Hey guys,

I have a javascript to make my site-title scroll. I works perfectly in html. How do I integrate into phpnuke? I've already tried, but it doesn't work:

Code:
...
##################################################
# Include some common header for HTML generation #
##################################################


function head() {
    global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle;
    $ThemeSel = get_theme();
    include_once("themes/$ThemeSel/theme.php");
    echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
    echo "<html>\n";
    echo "<head>\n";
    include("includes/dynamic_titles.php");
    //echo "<title>$sitename $pagetitle</title>\n";
?>
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
<!-- Hide script from older browsers
//Scrolling Message Across Title Bar
//By: Don Santiago
//Email: senor_santi@yahoo.com
//To change message edit below line
msg = "$sitename $pagetitle";
//To change message edit above lin
//
msg = "                                           ---                                           " + msg;
pos = 0;
function scrollMSG() {
document.title = msg.substring(pos, msg.length) + msg.substring(0, pos);
pos++;
if (pos >  msg.length) pos = 0
window.setTimeout("scrollMSG()",200);
}
// End hiding script from older browsers -->
</SCRIPT>
<?php
...


What did I do wrong?
 

Grtz, CupOfTea --- My Nuke Version: 8.0 ---  
View user's profileSend private messageVisit poster's websiteMSN Messenger Reply with quote

DreAdeDcoRpSE
Reputation: 738.9
votes: 5
Local time: 7:39 PM
Location: Back of your Mind
usa.gif

Status: Offline
1.13 posts per day
Medals: 2 (View more...)
Site Supporter (Amount: 1)
Forums Moderator
Forums Moderator
Joined: Sep 22, 2007
Last Visit: 02 Dec 2008
Posts: 497
Points: 11411 

View user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger Reply with quote

cupoftea
Reputation: 13.6
Local time: 1:39 AM
Location: Behind My Computer
belgium.gif

Status: Offline
0.29 posts per day
Medals: 0

Joined: Apr 30, 2008
Last Visit: 01 Dec 2008
Posts: 64
Points: 610 

Post Scrolling Title Posted: Thu Jul 24, 2008 1:04 pm   

Don't think you rlly know what I mean with scrolling title... I don't mean a marquee, I mean the thing you put between (title) and (/title) in html. Here's a website that has this kind of title.
 

 
View user's profileSend private messageVisit poster's websiteMSN Messenger Reply with quote


DreAdeDcoRpSE
Reputation: 738.9
votes: 5
Local time: 7:39 PM
Location: Back of your Mind
usa.gif

Status: Offline
1.13 posts per day
Medals: 2 (View more...)
Dedication (Amount: 1)
Forums Moderator
Forums Moderator
Joined: Sep 22, 2007
Last Visit: 02 Dec 2008
Posts: 497
Points: 11411 

Post Re: Scrolling Title Posted: Thu Jul 24, 2008 6:01 pm   

Shop Purchases:
Enemy Territory Theme (Aviator) for PHP Nuke · Clan Roster 2.0

Okay, scrap that script you have there. I just worked this one so its not calling on any other files as it looks like yours is doing. If it's not then it sure does it. but this one should work. I don't see why it wouldn't.



##############################################################################################################
##############################################################################################################

This is a 3 step setup.
Skill Level: Easy
Time to install: 1 min

Step 1.)

Open your ROOT/header.php with your favorite editor. (Dreamweaver, Notepad, Wordpad, ect...)

###---- Find ----###

Code:
echo "<title>$sitename $pagetitle</title>\n";


###---- Replace With ----###

Code:
echo "<SCRIPT LANGUAGE=\"JavaScript\">
<!-- Begin
var scrl = \" $sitename $pagetitle \";
function scrlsts() {
 scrl = scrl.substring(1, scrl.length) + scrl.substring(0, 1);
 document.title = scrl;
 setTimeout(\"scrlsts()\", 500);
 }
//  End -->
</script>";






Step 2.)

###---- Find in Line ----###

Code:
$sitename $pagetitle


###---- Edit With Your Message ----###

Example message:
Quote:
Welcome to $sitename!!! &nbsp*;&nbsp*;&nbsp*;&nbsp*;You are viewing $pagetitle, and I hope you enjoy your stay...&nbsp*;&nbsp*;&nbsp*;&nbsp*;


***Note:***
&nbsp*; is spaces, without the *, the more you put in, the more space you will add in the message. I added the * so you can see it.





Step 3.)

###---- Find ----###

?>

###----Add Before ----###

Code:
echo "<Body onLoad=\"scrlsts()\">";




I like to point out that this has the potential to slow down the load speed of your site for different users. I wanted to point that out for you and others that decide to use this script. Well, good luck and have fun with it.

If you have any other questions, feel free to ask.

Also like to add, your previous statement, this is a form of a marquee. Wink
 

 
View user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger Reply with quote

cupoftea
Reputation: 13.6
Local time: 1:39 AM
Location: Behind My Computer
belgium.gif

Status: Offline
0.29 posts per day
Medals: 0

Joined: Apr 30, 2008
Last Visit: 01 Dec 2008
Posts: 64
Points: 610 

Post Scrolling Title Posted: Tue Jul 29, 2008 7:16 am   

First of all I wanna say thanks for what you've done.
Well, it isn't a normal marquee that you use in plain html. you can't say (title)(marquee)THE_TITLE(/marquee)(/title). Angel
Just wanna ask, isn't it possible to instead of onload something that starts the scrolling after loading?
 

 
View user's profileSend private messageVisit poster's websiteMSN Messenger Reply with quote
Post new topic   Reply to topic  
   www.clan-themes.co.uk Forum Index » Java Scripts


 
4 Replies / 485 Views
Page 1 of 1
All times are GMT
Display posts from previous:   
 
Jump to:  
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
You cannot attach files in this forum
You can download files in this forum