Previous Thread
Next Thread
Print Thread
Hop To
#201721 11/19/2007 11:44 PM
Joined: Nov 2007
Posts: 53
P
journeyman
journeyman
P Offline
Joined: Nov 2007
Posts: 53
I want to advertise for a couple of my buddies. What are the steps (please give me the step by step dumbest person you can think of version) to get these rolling......Blake


The beating will continue until morale improves....
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Step 1: Where do you wan to adds to display?

ubb itself can display adds in top (header), at the bottom (footer), at the side, or right below the first post of a forum (all 3 custom islands).


[Linked Image from siemons.org]
Joined: Nov 2007
Posts: 53
P
journeyman
journeyman
P Offline
Joined: Nov 2007
Posts: 53
I want the ads banner at the footer of the page.....Blake


The beating will continue until morale improves....
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Display settings > general > html includes > default footer.

insert the html there you want for your adds.


[Linked Image from siemons.org]
Joined: Nov 2007
Posts: 53
P
journeyman
journeyman
P Offline
Joined: Nov 2007
Posts: 53
and I would like them to change between each other. I am guessing I have to build a banner with some type of flash or something.........Blake


The beating will continue until morale improves....
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
There are a number of options - but I think you just need a banner script.

The script could call a random banner or in a certain sequence.

Such examples have been posted on this site a number of times expecially regarding avatars.

Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
I have a script that can display a random banner just about anywhere. It is a very small hack in one file, and you just change any template and insert small code to actually display the banner on that point.


[Linked Image from siemons.org]
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Have a look here.

Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
that displays a random image, but with a banner you would actually also want the ability to link.


[Linked Image from siemons.org]
Joined: Nov 2007
Posts: 53
P
journeyman
journeyman
P Offline
Joined: Nov 2007
Posts: 53
Originally Posted by blaaskaak
I have a script that can display a random banner just about anywhere. It is a very small hack in one file, and you just change any template and insert small code to actually display the banner on that point.

You guys need a lesson in talking to dumb people (grin). That sounds exactly like what I am looking for. I just need to find that file and then figure out how to put it on my board with my guys website link in it. That should only take me about 3 days.........grin


The beating will continue until morale improves....
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
This works for me.....

Code
<script language=JavaScript>
var ad=new Array()
ad[0]='http://www.mysite.com/banners/1.gif';
ad[1]='http://www.mysite.com/banners/2.gif';
ad[2]='http://www.mysite.com/banners/3.gif';

var links=new Array()
links[0]='http://www.1_site.com';
links[1]='http://www.2_site.com';
links[2]='http://www.3_site.com';

var xy=Math.floor(Math.random()*ad.length);
document.write('<a href="'+links[xy]+'" target="_self"><img src="'+ad[xy]+'" width="468" height="60" border="0" alt="Click here"></a>');
</script>


Just drop it in where you want the banner to be.
Of course visitors will need javascript enabled - so you may want to consider a php option. smile


Joined: Jun 2006
Posts: 1,344
G
veteran
veteran
G Offline
Joined: Jun 2006
Posts: 1,344
Here is a script i use. I called it random.php and created another file called banners.txt This is already set up to open in a new window and displays new banner when screen refreshes. Just call the random.php file were you want your banners

random.php
Code
<?

// Generate random microtime
@srand((double)microtime()*1000000);


// This is the main function that displays the banner
function banner($select, $host, $host2)
{
// This variable lets us know that we have now attempted to display a banner
$attempted = true;

// This variable reads the banners.txt file contents
$lines = @file("http://www.path/to/banners.txt");

// This variable counts the number of lines in the banners.txt file
$count = @count($lines);

// This variable selects a random line number
$random = @rand(0,$count-1);

// This variable sets our randomly selected banner
$selected = $lines[$random];

// This variable separates the image and URL from each other
$pieces = @explode(",", $selected);


/* Make sure we don't attempt to display a banner
more than $max_attempts times (prevents an infinite loop).
If you do, you need to add banners to your
banners.txt file */

$max_attempts = 200;

$attempts = 0;

	// Check to be sure the banner is not for this web site
	// If it is, recall the function for another banner

	IF ($host == $pieces[0] AND $attempts <= $max_attempts OR $host2 == $pieces[0] AND 		$attempts <= $max_attempts) {
	++$attempts;
	banner ("display", $host, $host2);
	}

	/* This displays the banner if one is present.
	If more than 3 attempts are tried, it will be
	Displayed regardless of whether or not it is
	for this web site. */

	ELSE {
echo ("<center><A HREF=\"$pieces[0]\" TARGET=\"new\"><IMG SRC=\"$pieces[1]\" BORDER=0></A></center>");	}

}

// Grab our current host name
$host = "http://" . $_SERVER[HTTP_HOST];

// Remove the "www." from the host name
$host2 = str_replace("www.","",$host);

// If we haven't tried to display a banner, do it now
IF (!isset($attempted))
{
banner ("display", $host, $host2);
}

?>

banners.txt
repeat on separate line for each site
Code
http://www.website.com,http://www.website.com/path to/banner image

Joined: Nov 2007
Posts: 53
P
journeyman
journeyman
P Offline
Joined: Nov 2007
Posts: 53
Guys this is awesome, now where do I put all that stuff, in the server or somewhere in ubb.threads? I told you I was dumb.......Blake


The beating will continue until morale improves....
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358


[Linked Image from siemons.org]
Joined: Jun 2006
Posts: 1,344
G
veteran
veteran
G Offline
Joined: Jun 2006
Posts: 1,344
Yes, put it up on the server. I also created a directory in my images folder called banners, were i put all the banner images. BTW, the only thing you will need to change in the random script is line 13.

Joined: Nov 2007
Posts: 53
P
journeyman
journeyman
P Offline
Joined: Nov 2007
Posts: 53
Originally Posted by gliderdad
Here is a script i use. I called it random.php and created another file called banners.txt This is already set up to open in a new window and displays new banner when screen refreshes. Just call the random.php file were you want your banners

random.php
Code
<?

// Generate random microtime
@srand((double)microtime()*1000000);


// This is the main function that displays the banner
function banner($select, $host, $host2)
{
// This variable lets us know that we have now attempted to display a banner
$attempted = true;

// This variable reads the banners.txt file contents
$lines = @file("http://www.path/to/banners.txt");

// This variable counts the number of lines in the banners.txt file
$count = @count($lines);

// This variable selects a random line number
$random = @rand(0,$count-1);

// This variable sets our randomly selected banner
$selected = $lines[$random];

// This variable separates the image and URL from each other
$pieces = @explode(",", $selected);


/* Make sure we don't attempt to display a banner
more than $max_attempts times (prevents an infinite loop).
If you do, you need to add banners to your
banners.txt file */

$max_attempts = 200;

$attempts = 0;

	// Check to be sure the banner is not for this web site
	// If it is, recall the function for another banner

	IF ($host == $pieces[0] AND $attempts <= $max_attempts OR $host2 == $pieces[0] AND 		$attempts <= $max_attempts) {
	++$attempts;
	banner ("display", $host, $host2);
	}

	/* This displays the banner if one is present.
	If more than 3 attempts are tried, it will be
	Displayed regardless of whether or not it is
	for this web site. */

	ELSE {
echo ("<center><A HREF=\"$pieces[0]\" TARGET=\"new\"><IMG SRC=\"$pieces[1]\" BORDER=0></A></center>");	}

}

// Grab our current host name
$host = "http://" . $_SERVER[HTTP_HOST];

// Remove the "www." from the host name
$host2 = str_replace("www.","",$host);

// If we haven't tried to display a banner, do it now
IF (!isset($attempted))
{
banner ("display", $host, $host2);
}

?>

banners.txt
repeat on separate line for each site
Code
http://www.website.com,http://www.website.com/path to/banner image

I copy and pasted this in the ubb.threads "HTML INCLUDES" for a footer and I got a syntax error on line 65 or some BS. I really envy you guys that know how to do this stuff....Blake


The beating will continue until morale improves....

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
0 members (), 1,073 guests, and 180 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)