You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 64 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Adding tracking code to footer. [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
BillShiver
Nuke Soldier
Nuke Soldier


Joined: Jan 30, 2003
Posts: 34

Location: USA

PostPosted: Sun Jun 01, 2003 10:57 am Reply with quoteBack to top

Even though I have donated to Nukecops, I didn't know exactly where to post this, so here goes.

I've searched and read a lot of posts about javascript, but can't seem to get my problem licked using the methods suggested.

I want to include a tracking code in the footer section. Here is the code:

<script language="javascript">
var data, p;
var agt=navigator.userAgent.toLowerCase();
var img=escape("./buttons/b5.jpg");
document.cookie='__support_check=1';
p='http';
if((location.href.substr(0,6)=='https:')||(location.href.substr(0,6)=='HTTPS:')) {p='https';} data = '&agt=' + escape(agt) + '&img=' + img + '&r=' + escape(document.referrer) + '&aN=' + escape(navigator.appName) + '&lg=' + escape(navigator.systemLanguage) + '&OS=' + escape(navigator.platform) + '&aV=' + escape(navigator.appVersion);
if(navigator.appVersion.substring(0,1)>'3') {data = data + '&cd=' + screen.colorDepth + '&p=' + escape(screen.width+ 'x'+screen.height) + '&je=' + navigator.javaEnabled();};
document.write('<a href="http://www.outdoorscentral.com/stats/template.php?a=outdoorscentral">');
document.write('<img border=0 hspace=0 '+'vspace=0 src="http://www.outdoorscentral.com/stats/counter.php?a=outdoorscentral' + data + '"> </a>');
</script>
<noscript>
<a href="http://www.outdoorscentral.com/stats/template.php?a=outdoorscentral">
<img border=0 hspace=0 vspace=0 src="http://www.outdoorscentral.com/stats/counter.php?a=outdoorscentral"></a></noscript>

I have tried the admin footer and tried adding it to the footer file. Any help on this one would be greatly appreciated.

Thanks
Bill Shiver
Find all posts by BillShiverView user's profileSend private messageVisit poster's website
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Sun Jun 01, 2003 11:13 am Reply with quoteBack to top

If you've read my many posts on this, then you know to use the $content = <<<_JAVASCRIPT_ tags correct? So embedding the JavaScript is not your problem, correct? So then is your problem just a matter of knowing what script to place it in? In other words, can you embed this code and make it work, just to know that you have the methodology down
Code:

$jscode = <<<_JAVASCRIPT_
<script>alert('Yes!');</script>
_JAVASCRIPT_;
echo $jscode;

If you can't get this to popup a js window then you are not embedding the code correctly. If you can, then you are embedding it correctly and it's a script placement issue.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
BillShiver
Nuke Soldier
Nuke Soldier


Joined: Jan 30, 2003
Posts: 34

Location: USA

PostPosted: Sun Jun 01, 2003 12:56 pm Reply with quoteBack to top

Raven, I cut out your sample and it pops up fine in an html doc, but I cannot get it to work in the footer of the nuke site. I know its something dumb, but it just doesn't work. I tried going into admin and inserting it into the footer box. No luck. I tried inserting it into the theme's footer html, and no luck.

I appreciate your help but I'm having no luck. Add that to the fact I'm a dummy and that about says it all.

Thanks
Bill
Find all posts by BillShiverView user's profileSend private messageVisit poster's website
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Sun Jun 01, 2003 2:21 pm Reply with quoteBack to top

Show me how you tried to insert it into the footer.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
BillShiver
Nuke Soldier
Nuke Soldier


Joined: Jan 30, 2003
Posts: 34

Location: USA

PostPosted: Sun Jun 01, 2003 2:24 pm Reply with quoteBack to top

Well, I cut out the code, opened admin and pasted the code into the footer no. 3 box. That did't work. I use NukeNews theme, so I opened the footer.html and pasted the code into that. All it did was show the code text at the bottom of the page. I apologize for being dense, but I'm pretty new at this.

Thanks again,

Bill
Find all posts by BillShiverView user's profileSend private messageVisit poster's website
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Sun Jun 01, 2003 2:29 pm Reply with quoteBack to top

Try modifying footer.php Wink .

In general, if you are adding it to HTML, then you must wrap it in <? ?> because it is PHP code, not HTML.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
BillShiver
Nuke Soldier
Nuke Soldier


Joined: Jan 30, 2003
Posts: 34

Location: USA

PostPosted: Sun Jun 01, 2003 5:03 pm Reply with quoteBack to top

I've tried footer.php, footer.html, all the footers in the theme and the global footer. I've tried wrapping with <? ?> and when I do that it just shows the code printed in text on the page.

If I understand correctly, something like this should work.

<?
$jscode = <<<_JAVASCRIPT_
<script>MY Script Code Inserted Here</script>
_JAVASCRIPT_;
echo $jscode;
?>

By the way, I tried with with and without a return after JAVASCRIPT_, it didn't make a differece.

Thanks for your help on this, but its beginning to look like this code just won't work on the page.

Bill
Find all posts by BillShiverView user's profileSend private messageVisit poster's website
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Sun Jun 01, 2003 5:07 pm Reply with quoteBack to top

Yes it will. I tried it. I am going to post footer.php with some test code to prove it to you Wink I'll be back .....

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Sun Jun 01, 2003 5:11 pm Reply with quoteBack to top

Here is the test code added to function footmsg() in footer.php; it works perfectly.
Code:
function footmsg() {
    global $foot1, $foot2, $foot3, $copyright, $total_time, $start_time;
    $mtime = microtime();
    $mtime = explode(" ",$mtime);
    $mtime = $mtime[1] + $mtime[0];
    $end_time = $mtime;
    $total_time = ($end_time - $start_time);
    $total_time = ""._PAGEGENERATION." ".substr($total_time,0,5)." "._SECONDS."";
    echo "<font class=\"footmsg\">\n";
    if ($foot1 != "") {
   echo "$foot1<br>\n";
    }
    if ($foot2 != "") {
   echo "$foot2<br>\n";
    }
    if ($foot3 != "") {
   echo "$foot3<br>\n";
    }
    // DO NOT REMOVE THE FOLLOWING COPYRIGHT LINE. YOU'RE NOT ALLOWED TO REMOVE NOR EDIT THIS.
    echo "$copyright<br>$total_time<br>\n</font>\n";
$jscode=<<<_JSTEST_
<script>alert('Hello World');</script>
_JSTEST_;
echo $jscode;

}

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.269 Seconds - 390 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::