PDA

View Full Version : Resolved I don't know where to put it



jackson
12-17-2008, 09:07 AM
1) Script Title: Dynamic Countdown Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex6/dhtmlcount.htm

3) Describe problem: The script said put step one onto head section and step two to body section. I am putting this script into the bottom right of a footer of my PHP page. They have no head section. Where do I put it? Do I have to general a HTML page and if so, how I can tell the PHP to call for the JS function?


My footer.php is as follow:

<?php

if (isset($smarty))
{
$smarty->assign(array(
'HOOK_RIGHT_COLUMN' => Module::hookExec('rightColumn'),
'HOOK_FOOTER' => Module::hookExec('footer'),
'content_only' => intval(Tools::getValue('content_only'))));
$smarty->display(_PS_THEME_DIR_.'footer.tpl');
}

?>

my footer.tpl is as follow:

{if !$content_only}
</div>

<!-- Right -->
<div id="right_column" class="column">
{$HOOK_RIGHT_COLUMN}
</div>

<!-- Footer -->
<div id="footer">{$HOOK_FOOTER}</div>
</div>
{/if}
</body>
</html>
How do I make the JS script show up at the right bottom of my footer? Thanks a lot.

Snookerman
12-17-2008, 12:45 PM
Put the code in step one in the head section, before the </head> tag. You could also put it in external files (.css and .js) and link to them. Put the code in step two where you want your script to show, i.e. in the bottom right of your footer.

jackson
12-17-2008, 04:05 PM
Put the code in step one in the head section, before the </head> tag. You could also put it in external files (.css and .js) and link to them. Put the code in step two where you want your script to show, i.e. in the bottom right of your footer.


But in my PHP and tpl files, there is no head tag...

Snookerman
12-17-2008, 05:13 PM
But there still is a head tag in the page. Could you please post a link to your site so I can show you how to do this?

jackson
12-18-2008, 03:37 AM
But there still is a head tag in the page. Could you please post a link to your site so I can show you how to do this?

Hi, Snookerman,

Thank you very much for your reply.

my site is www.shubay.com.


Q1. How can I put the step one into an external file such as JS? Do I just copy and paste the entire step one and save it as a JS file? That is it? Do I need to add any codes?

Q2. How can I call it in my footer? Do I just copy step two into my footer and that is it?

Q3. Is there a way that I can change the word of "Christmas " to color red and font size 25px?

I am so sorry to bother you.


Thank you very much for your help.

Snookerman
12-18-2008, 06:58 AM
#1 Put the script code in an empty file and save it with the .js suffix and then link to it in the head section just like you did for the jQuery files:

<script type="text/javascript" src="/js/jquery/jquery.pack.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="/js/jquery/thisisthenewfile.js"></script>

The script code is the code in step 1 between the script tags. Don't include the script tags. The code should start with the DD copyright notice and end with return displaystring }

#2 Yes, just copy it and then modify it to have the date you want.

#3 Find this left until this Christmas in step one and replace it with this: left until this <span style="color:red;font-size:25px;">Christmas</span>

jackson
12-18-2008, 08:49 AM
#1 Put the script code in an empty file and save it with the .js suffix and then link to it in the head section just like you did for the jQuery files:

<script type="text/javascript" src="/js/jquery/jquery.pack.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="/js/jquery/thisisthenewfile.js"></script>

The script code is the code in step 1 between the script tags. Don't include the script tags. The code should start with the DD copyright notice and end with return displaystring }

#2 Yes, just copy it and then modify it to have the date you want.

#3 Find this left until this Christmas in step one and replace it with this: left until this <span style="color:red;font-size:25px;">Christmas</span>
Thank you very very much for your help.

Two more questions:

Q1: Do I put the step two in footer.php or footer.tpl?
Q2: If I begin from DD copyright for the JS file, where do I put the style CSS as indicate in the step one?

<style style="text/css">
.lcdstyle{ /*Example CSS to create LCD countdown look*/
background-color:#dce2de;
color:#d41213;
font: bold 18px MS Sans Serif;
padding: 3px;

}

.lcdstyle sup{ /*Example CSS to create LCD countdown look*/

font-size: 70%

}


</style>




Thank you again for all of your help.

Snookerman
12-18-2008, 11:32 AM
#1 is not really my thing, someone else will have to help you out with that one.

#2 You can do the same thing you did with the JavaScript. Take the style code without the style tags and save it in a blank file with the suffix .css and then add this to the head section where you added the script link:

<script type="text/javascript" src="/js/jquery/jquery.pack.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="/js/jquery/thisisthenewfile.js"></script>
<link type="text/css" rel="stylesheet" href="folderwithcssfile/cssfile.css" />

jackson
12-19-2008, 12:39 AM
#1 is not really my thing, someone else will have to help you out with that one.

#2 You can do the same thing you did with the JavaScript. Take the style code without the style tags and save it in a blank file with the suffix .css and then add this to the head section where you added the script link:

<script type="text/javascript" src="/js/jquery/jquery.pack.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="/js/jquery/thisisthenewfile.js"></script>
<link type="text/css" rel="stylesheet" href="folderwithcssfile/cssfile.css" />

I got it now. Thank you very much for all of your help. You have taught me a great valuable lesson that I can use for a lot of thing in the future. Thanks again.

Snookerman
12-19-2008, 07:21 AM
You're welcome! Good luck with your site!