Support Forums

Banner Script

This is a discussion on Banner Script within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Can anyone recommend a free banner script, or one that is relatively cheap that works with 68classifieds? I have been ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 08-10-2008, 08:53 AM   #1
Member
 
Join Date: Jul 2008
Posts: 76
Rep Power: 8
centinel3 is on a distinguished road
Default Banner Script

Can anyone recommend a free banner script, or one that is relatively cheap that works with 68classifieds? I have been trying to get my old banner script to work with no such luck.

This is the banner script that I'm using:

I have this in the layout.tpl head:
<script type="text/javascript" src="banners.js"></script>

This in the header:
<div id="banner">
{literal}
<script type="text/javascript">
show_banners();
</script>
{/literal}
</div>


This is the banner script:
// Simple banner rotator
// (c) spyka Web Group 2008
// version info: 1.1.2
// Download & support: http://www.spyka.net
// Forums: http://www.spyka.net/forums
// Please keep this notice in place

function banner(name, url, image, date)
{
this.name = name;
this.url = url;
this.image = image;
this.date = date;
}

var banners = new Array();
///////////////////////////////////////////////////////////////////////////////////
//
// START EDITS HERE
//
///////////////////////////////////////////////////////////////////////////////////

// Full documentation & support: http://www.spyka.net/forums

// if 1, all images will be resized to img_width and img_height, else images will display their correct size
var force_size = 1;
// desired height and width of images, only takes affect if above is = 1
var img_width = 400;
var img_height = 100;

// banner list syntax: banners[x] = new banner(website_name, website_url, website_image_url, show_until_date); DATE FORMAT: dd/mm/yyyy
banners[0] = new banner('Place your Ad Here', 'mailto:[email protected]', 'http://closeoutfloorsamples.com/images/bannerADS/place_AD_here.png', '29/10/3000');
banners[1] = new banner('Highland Home Gallery', 'http://www.highlandhomegallery.com', 'http://closeoutfloorsamples.com/images/bannerADS/highlandhomegallery.png', '29/10/3000');
banners[2] = new banner('Being Properties', 'http://www.beingproperties.com', 'http://closeoutfloorsamples.com/images/bannerADS/beingproperties.png', '29/10/3000');

///////////////////////////////////////////////////////////////////////////////////
//
// END EDITS HERE
//
///////////////////////////////////////////////////////////////////////////////////

function show_banners()
{
var am = banners.length;
var rand = Math.floor(Math.random()*am);
var bn = banners[rand];

var image_size = (force_size == 1) ? ' width="' + img_width + '" height="' + img_height + '"' : '';
var html = '<a href="' + bn.url + '" title="' + bn.name + '" target="_blank"><img border="0" src="' + bn.image + '"' + image_size + ' alt="' + bn.name+ '" /></a>';

// get current date string
var now = new Date();

var input = bn.date;
input = input.split('/', 3);
var end_date = new Date();
end_date = end_date.setFullYear(parseFloat(input[2]), parseFloat(input[1]), parseFloat(input[0]));

(now < end_date) ? document.write(html) : show_banners();
}



This is really important for me to get working and would love to be steered in the right direction.
Chris
centinel3 is offline   Reply With Quote
Old 08-10-2008, 01:58 PM   #2
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,747
Rep Power: 51
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

I use phpadsnew (free/open source). It's changed it's name a few times and is now called openX.

As far as the script that you are currently using goes, it may be that you don't have the proper coding in the header. As far as I can recall, you can't use <div> in the header.

Try changing your header code to this:
PHP Code:
<script type="text/javascript">
{
literal}
<!--
show_banners();
//-->
{/literal}
</script> 
-Mike
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified)
Sandbox (v3.1.10, v4.0.9, 4.1.5)
Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 08-10-2008, 08:44 PM   #3
Member
 
Join Date: Jul 2008
Posts: 76
Rep Power: 8
centinel3 is on a distinguished road
Default i'll check it out again

I tried fixing the script file the way you typed it and had no luck.

Also, I tried openx this morning and couldn't even get the wizard going initially. I uploaded the open folder to my server, set up a new database, then pointed my browser to the folder so I could get the script to set up what it needed to (http://www.closeoutfloorsamples.com/openx) like the instructions said and got an error. I'm going to try again tomorrow though, maybe it was the fact that I was at home on a slow connection and didn't DL correctly.

If this is what you recommend I'll take your word on it. I read through their site and have to say that I like the functionality of it. Goes pretty deep.

Chris
centinel3 is offline   Reply With Quote
Old 08-10-2008, 10:09 PM   #4
Coder
 
Join Date: Mar 2006
Posts: 4,978
Rep Power: 121
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by centinel3
I tried fixing the script file the way you typed it and had no luck.

Also, I tried openx this morning and couldn't even get the wizard going initially. I uploaded the open folder to my server, set up a new database, then pointed my browser to the folder so I could get the script to set up what it needed to (http://www.closeoutfloorsamples.com/openx) like the instructions said and got an error. I'm going to try again tomorrow though, maybe it was the fact that I was at home on a slow connection and didn't DL correctly.

If this is what you recommend I'll take your word on it. I read through their site and have to say that I like the functionality of it. Goes pretty deep.

Chris
For the banner script code above, did you put all that in the template or is that in a different file?
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 08-10-2008, 10:16 PM   #5
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,747
Rep Power: 51
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Quote:
Originally Posted by centinel3
I tried fixing the script file the way you typed it and had no luck.

Also, I tried openx this morning and couldn't even get the wizard going initially. I uploaded the open folder to my server, set up a new database, then pointed my browser to the folder so I could get the script to set up what it needed to (http://www.closeoutfloorsamples.com/openx) like the instructions said and got an error. I'm going to try again tomorrow though, maybe it was the fact that I was at home on a slow connection and didn't DL correctly.

If this is what you recommend I'll take your word on it. I read through their site and have to say that I like the functionality of it. Goes pretty deep.

Chris
I misread your original post (head/header). It seems to me that the actual issue may be the path to your "banner.js" Is that javascript actually in your root of the classifieds site?

-Mike
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified)
Sandbox (v3.1.10, v4.0.9, 4.1.5)
Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 08-10-2008, 10:58 PM   #6
Member
 
Join Date: Jul 2008
Posts: 76
Rep Power: 8
centinel3 is on a distinguished road
Default yes

Yes. the banners.js was located in the root folder of my domain. i also tried it in my CFS templates folder, though figured that it wasn't going to work there. Not sure what's up. I have been messing with this for the past few days with no such luck man. Do you think that because my domain is a subdomain that it isn't going to work properly? that's the only thing I can come up with at this point. I'm leaning toward no, but I'm running out of possibilities here. Everything has a way of working out, it's a matter of time and patience. I appreciate your input. If you have any thoughts I'd love to hear'em.

chris
centinel3 is offline   Reply With Quote
Old 08-10-2008, 11:07 PM   #7
Member
 
Join Date: Jul 2008
Posts: 76
Rep Power: 8
centinel3 is on a distinguished road
Default larry

i DL'd the openx folder from their site, then uploaded it to my main root folder (which is a subdomain if that matters). Should I have put it in my template folder first, then tried to launch the setup wizard through the browser?

chris
centinel3 is offline   Reply With Quote
Old 08-11-2008, 08:21 PM   #8
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,747
Rep Power: 51
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

openX is completely independent from the 68c. You can set it up wherever you would like to. I use one installation to serve the ads on all of my web sites. It's installed in a completely different domain then my classifieds. The magic is in the javascript code that it creates for you to paste into whatever web page that you would like.

-Mike
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified)
Sandbox (v3.1.10, v4.0.9, 4.1.5)
Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 08-11-2008, 11:09 PM   #9
Member
 
Join Date: Jul 2008
Posts: 76
Rep Power: 8
centinel3 is on a distinguished road
Default very cool

Apparently Something happened when I uploaded openx the first time. I gave it another go this morning and got it up and running just fine. The program is very deep and there is a slight learning curve to it, but I have to say that I like it a lot. Thank you again for the point in the right direction. This was the last big hurdle. I launched a couple of days ago and am glad the banner script is up and running.

Again, much thanks!!
Chris
centinel3 is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Host or Script problem? Grebogreen v3.1 Questions & Support 3 05-08-2007 10:49 AM
Updated - maffo banner mod Maffo v3.1 Questions & Support 4 01-25-2007 01:35 PM
Need Banner Ad Rotator Script with: garysr Templates, HTML, CSS, and Design Help 6 06-26-2006 09:53 AM
AdPeeps banner script - who is using this? Chaslie Off Topic 2 06-20-2006 12:14 PM


All times are GMT -4. The time now is 04:10 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0