Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Would like help to make a rotating banner

Would like help to make a rotating banner

Views: 4,652

Results 1 to 20 of 22
2 Jan 2012, 4:11 PM
#1
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Would like help to make a rotating banner

Hello,
I have read the forums and tried two ways to input a rotating banner in my home page but with no luck.

On my home page https://www.cakekraft.co.uk i have a standard picture with text to the right, this is found in define_main_page.php
I can easily change things in here but i would like a rotating banner.

I have tried the javascript banner found in these forums and html rotator but they seem not to work.

I understand how to place the javascript in the page (cut and paste), change picture url etc, but i here you need some css?

Can someone offer me a link or some code to easily place 4-5 images that rotate after a set delay within the define_main_page.php

Many thanks
Nic.

2 Jan 2012, 8:27 PM
#3
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Re: Would like help to make a rotating banner

Thank you Bryan.
Ill go check it out.
:smile:

2 Jan 2012, 8:34 PM
#4
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Re: Would like help to make a rotating banner

Ah, i did try this, but i failed to get it to work.
Would i have to insert some code into admin/define pages editor/ define_main_page.php or does this do it automatically?
:dontgetit

2 Jan 2012, 8:43 PM
#5
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: Would like help to make a rotating banner

no you need to edit stylesheet and the tpl_index_default.php file located in the /includes/templates/YOUR TEMPLATE NAME/templates/ directory.

if you follow the instructions it is fairly easy, there is even the files to download ready to upload

bryan

3 Jan 2012, 8:06 PM
#6
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Re: Would like help to make a rotating banner

bn17311:

no you need to edit stylesheet and the tpl_index_default.php file located in the /includes/templates/YOUR TEMPLATE NAME/templates/ directory.

if you follow the instructions it is fairly easy, there is even the files to download ready to upload

bryan

Hello Bryan,

I did follow the instructions, which, as you said were easy, but i noticed that when i added my images (4 of them) the slider would rotate through them ok, but it would get to the last one, then display a blank page, then "jump" to the first one.

I checked all links etc and could not work out why.

I have removed it for now until i understand why this is happening.

Any ideas? :smile:

3 Jan 2012, 8:50 PM
#7
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: Would like help to make a rotating banner

hi,
i actually use the following code in tpl_index_default.php

then go in and create a banner using your images and give it a group name of slider

hope this helps. im not an expert but do use the code from the site supplied

bryan

<!-- bof Easy Slider 1.7 -->
<div id="container">
<div id="content">
<?php

global $db;
$sql = "SELECT banners_title,banners_url,banners_image FROM ".TABLE_BANNERS." z where status='1' and banners_group ='Slider'";
$result = $db->Execute($sql);
$path = HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES;
if ($result->RecordCount() > 0) {
echo '<div id="slider"><ul>';
while (!$result->EOF) {

echo '<li><a href="'.($result->fields['banners_url']).'"><img src="'.$path.($result->fields['banners_image']).'" class="clip" title="'.($result->fields['banners_title']).'" /></a></li>';

$result->MoveNext();
}
echo '</ul></div>';
} else {
echo 'no value';
}
?>
</div>
</div>
<!-- eof Easy Slider 1.7 --><div class="clearBoth"></div>
<?php } ?>
<!-- eof Easy Slider 1.7 -->
3 Jan 2012, 11:37 PM
#8
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Re: Would like help to make a rotating banner

Ok thank you.
It's a bit late now, so ill try again tomorrow :smile:
Cheers

4 Jan 2012, 3:13 PM
#9
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Re: Would like help to make a rotating banner

Ok i have tried both methods, the original one by Kerrin Hardy (website in previous posts) and also Bryan's method.

The problem i encounter is that i have my images in /images/1.jpg etc and all links point to them correctly, but as i have 3 images, the slider seems to go through the first 3, then use a random one (as a forth), then displays a blank screen and then finally "jumps" to the first one.
Plus, i do not have the buttons showing even though they are in the images folder.
:no:

I have double checked all files and as far as i can see all is correct.

You can check the banner out at the BOTTOM of my home page at https://www.cakekraft.co.uk

Many thanks
Nic.

4 Jan 2012, 4:59 PM
#10
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: Would like help to make a rotating banner

have you removed files from any previous banner you tried to install,

paste your code up for tpl index file and ill try it on mine

bryan

4 Jan 2012, 5:04 PM
#11
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Re: Would like help to make a rotating banner

Hi Bryan, here it is:

<?php /** * Template designed by 12leaves.com * 12leaves.com - Free ecommerce templates and design services * * Page Template * * Main index page<br /> * Displays greetings, welcome text (define-page content), and various centerboxes depending on switch settings in Admin<br /> * Centerboxes are called as necessary * * @package templateSystem * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_index_default.php 3464 2006-04-19 00:07:26Z ajeh $ */ ?> <div class="centerColumn" id="indexDefault"> <!-- <h1 id="indexDefaultHeading"><?php echo HEADING_TITLE; ?></h1> <?php if (SHOW_CUSTOMER_GREETING == 1) { ?> <?php echo zen_customer_greeting(); ?> <?php } ?> <?php if (TEXT_MAIN) { ?> <div id="" class="content"><?php echo TEXT_MAIN; ?></div> <?php } ?> --> <!-- deprecated - to use uncomment this section <?php if (TEXT_INFORMATION) { ?> <div id="" class="content"><?php echo TEXT_INFORMATION; ?></div> <?php } ?>--> <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?> <?php /** * get the Define Main Page Text */ ?><br class="clearBoth" /> <?php require($define_page); ?><br /><div id="indexDefaultMainContent2" class="content"><?php require($define_page2); ?></div><br /><br /><div id="indexDefaultMainContent3" class="content"><?php require($define_page3); ?></div><br /><br /><div id="indexDefaultMainContent4" class="content"><?php require($define_page4); ?></div> <?php } ?>

<!-- bof Easy Slider 1.7 -->

<div id="container"> <div id="content"> <div id="slider"> <ul> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="/images/1.jpg" /></a> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="/images/2.jpg" /></a> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="/images/3.jpg" /></a> </li></ul> </div> </div> </div> <!-- eof Easy Slider 1.7 --> <?php $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MAIN); while (!$show_display_category->EOF) { ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_FEATURED_PRODUCTS') { ?> <?php /** * display the Featured Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_SPECIALS_PRODUCTS') { ?> <?php /** * display the Special Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_NEW_PRODUCTS') { ?> <?php /** * display the New Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_UPCOMING') { ?> <?php /** * display the Upcoming Products Center Box */ ?> <?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); ?><?php } ?> <?php $show_display_category->MoveNext(); } // !EOF ?> <?php if ($this_is_home_page) { ?> <!--bof-banner #1 display --> <?php if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <!--bof-banner #2 display --> <?php if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <!--bof-banner #3 display --> <?php if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <!--bof-banner #4 display --> <?php if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerFour" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <!--bof-banner #5 display --> <?php if (SHOW_BANNERS_GROUP_SET5 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET5)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerFive" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <!--bof- banner #6 display --> <?php if (SHOW_BANNERS_GROUP_SET6 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET6)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <?php }?> </div>
5 Jan 2012, 6:42 PM
#12
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Re: Would like help to make a rotating banner

Did you manage to get it to work Bryan?
If not i'll see if anyone would like to do it for me, im willing to pay a fee as i am desperate to get it done before the weekend (got banners being done)
Any volunteers :P

5 Jan 2012, 6:59 PM
#13
sakhsen avatar

sakhsen

New Zenner

Join Date:
Jan 2012
Location:
India
Posts:
3
Plugin Contributions:
0

Re: Would like help to make a rotating banner

You can have a good jquery running banner like the one in www.sakhsen.com/sakhzencart and change the appearance of the template. You can also add flash like the bottom banner with swf.

5 Jan 2012, 7:17 PM
#14
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Re: Would like help to make a rotating banner

sakhsen:

You can have a good jquery running banner like the one in www.sakhsen.com/sakhzencart and change the appearance of the template. You can also add flash like the bottom banner with swf.

Where would i get this banner and code from?
Thanks
Nic.

5 Jan 2012, 8:14 PM
#15
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: Would like help to make a rotating banner

hi,
no not sure where your error is, have installed this a few times and works every time

sorry cant help any further, maybe someone with more knowledge will come along, i suggest leave it on so anyone looking can see what is happening

bryan

5 Jan 2012, 11:57 PM
#16
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Re: Would like help to make a rotating banner

bn17311:

hi,
no not sure where your error is, have installed this a few times and works every time

sorry cant help any further, maybe someone with more knowledge will come along, i suggest leave it on so anyone looking can see what is happening

bryan

Ok Bryan, thankyou for helping.
Regards
Nic.

6 Jan 2012, 12:42 PM
#17
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Re: Would like help to make a rotating banner

Ok i still have the banner up at the bottom of my homepage for people to take a look and see if they have any ideas why i have the following problems:

All code followed 4 times over as per instructions, all link correct and Bryan (poster above) has taken my script and it works for him.

Problem:
4 pictures loaded in slider, the four pictures play fine, then a 5th one (which in fact is the forth one in my list) plays, followed by a blank screen, then a "jump" to the first one again.
It does not seem to run continuously plus it places an extra picture and a blank picture.

I have checked all of the coding etc and all is correct, no matter where i place this code i still get the same problems.

I would try another banner / slider but not sure of any apart from this one.

Can anyone please see what i am doing wrong or even advise on something that would work in my define_main_page.php.

Best regards
Nic.

6 Jan 2012, 8:41 PM
#18
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Re: Would like help to make a rotating banner

Ok, i ahve just installed this mod twice!
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=2042

And yet still i have the same problem :blink:

I have come to the conclusion that there must be some conflict somewhere, for two add ons (both sliders) to not "slide" or display properly.

Im sorry if i am a pain, but if anyone can shed any light on the reason why this is happening or getting it to work on v.1.3.9h i would be most grateful.

Best regards,
Nic.

6 Jan 2012, 9:48 PM
#19
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: Would like help to make a rotating banner

try disabling other stuf on site, try the scrolling text left column first try to work out if there is a conflict

bryan

6 Jan 2012, 11:39 PM
#20
bridge32 avatar

bridge32

Zen Follower

Join Date:
Jun 2011
Posts:
145
Plugin Contributions:
0

Re: Would like help to make a rotating banner

Thanks bryan, will do.