We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
  • Pages:
  • 1
  • 3
Random Affilaites
Topic Started: Jun 25 2005, 11:57 PM (1,128 Views)
commander-ZNS
Member
[ *  *  *  * ]
Guys I need a script for my site http://www.k-gfx.zerax.net/index.php . So you see where it says AFFILIATES on the left under the poll.. Ok over there I want 6 random affalites to show. 2 affialites will be on the top and 2 will be in the middle and the rest 2 will be on the bottom. Also out of those 6 random affililaites , always want 1 of them to always show. Like the last one. Meanng the affailtie row 3 column 2, there will be 5 affialtes for APPLY NOW in diffrent colors. So the row 3 column 2 affialie will always be the APPLY NOW affiliete and in random colors. So I have 5 diffrent images of APPLY NOW and they must show randomly in row 3 column 2.




Random Affilaites to Show in row 3 coloum 2.









Offline Profile Quote Post Goto Top
 
FearKiller
Member Avatar
www.drewscripts.com
[ *  *  *  *  * ]
So is this round 2 of your identical topic on the second page? We've already given you both PHP and Javascript coding that will generate these random images for you.
Offline Profile Quote Post Goto Top
 
commander-ZNS
Member
[ *  *  *  * ]
the last one doens't work
Offline Profile Quote Post Goto Top
 
Jory
Member Avatar
Member
[ *  *  *  *  *  * ]
The last what doens't work?

If you mean the last script: It does, all those scripts worked.
I think
Offline Profile Quote Post Goto Top
 
commander-ZNS
Member
[ *  *  *  * ]
I don't know how to use it
Offline Profile Quote Post Goto Top
 
Jory
Member Avatar
Member
[ *  *  *  *  *  * ]
OK, you just take the following code, and put it whereever you want the Apply Now Buttons to show up.

Quote:
 
<?php
$url = 'http://www.applynow.com';
$img = array();
$img[] = 'http://www.applynow.com/buttons/button1.png';
$img[] = 'http://www.applynow.com/buttons/button2.png';

$img_count = count($img);
$img_number = rand(0,$img_count);
$img_of_choise = $img[$img_number];

echo  '<a href="' . $url . '" target="_blanc"><img src="' . $img_of_choise . '" border="0" /></a>'
?>


Just ad lines like the ones in
blue and purple to ad images.
And change the red to the url of where ever it should link to.
( The ' and ' around it MUST remain!! )

So:
Paste code into the place where you want the random pict/link thing.
Change link to correct one.
Ad images.

Understandable?
Offline Profile Quote Post Goto Top
 
commander-ZNS
Member
[ *  *  *  * ]
Ok thanks alot now I get it. But what about the part for all the other affialites.

Look at this picture. Do you see those RED boxes. I want them to be random also. How do i do that?

Offline Profile Quote Post Goto Top
 
Jory
Member Avatar
Member
[ *  *  *  *  *  * ]
The same way, just ad different picts to the array? :unsure:
Offline Profile Quote Post Goto Top
 
commander-ZNS
Member
[ *  *  *  * ]
ok so that script is for ONE affaite image to show randomly from a list of them?

I don't want it like that. I want a script where it should 5 (FIVE) images randomly from a list of imagis and links for those images.
Offline Profile Quote Post Goto Top
 
FearKiller
Member Avatar
www.drewscripts.com
[ *  *  *  *  * ]
Code:
 
<?php
$affs = array();
$affs[] = 'http://www.site1.com img1.gif';
$affs[] = 'http://www.site2.com img2.gif';
$affs[] = 'http://www.site3.com img3.gif';
$affs[] = 'http://www.site4.com img4.gif';

$rand_img = array_rand($imgs, 5);

foreach($rand_img as $img_value) {
$linkimg = explode(' ', $img_value);
echo '<a href="', $linkimg[0], '"><img src="', $linkimg[1], '" alt="', $linkimg[0], "\" />\n";
}
?>


Okay, this is the very very very similar code from the other topic. What you do is edit each part after $affs[]. Put the link to the affiliated site first, then put a space (" "), and then put the path to image for that affiliate. Say you wanted to link to Yahoo and MSN using the images "yahoo.gif" and "msn.gif," the edited portion of the code would look like this (assuming that these images are saved to your server and are in an image directory called "images" that is in your public_html aka www aka root directory)

Code:
 
$affs[] = 'http://www.yahoo.com /images/yahoo.gif';
$affs[] = 'http://www.msn.com /images/msn.gif';


That's the best I can explain how to do it.
Offline Profile Quote Post Goto Top
 
commander-ZNS
Member
[ *  *  *  * ]
Ok thats a great script but like can you make it so its not saved to my server? like i get to use a url of the image not on my serer
Offline Profile Quote Post Goto Top
 
FearKiller
Member Avatar
www.drewscripts.com
[ *  *  *  *  * ]
Yeah just put the full url of the image. Here's an example of how yahoo.com would be displayed with an image called "yahoo.gif" being called from their server.
Code:
 
$affs[] = 'http://www.yahoo.com http://www.yahoo.com/images/yahoo.gif';
Offline Profile Quote Post Goto Top
 
commander-ZNS
Member
[ *  *  *  * ]
Its not working. Look at it

http://www.k-gfx.zerax.net/index.php

This is the code i put in randomaffy.txt

Code:
 
<?php
$affs = array();
$affs[] = 'http://yahoo.com http://img.photobucket.com/albums/v469/khubsuratgraphics/KGAffiliate3.gif';
$affs[] = 'http://yahoo.com http://sinionkabe.itopsites.com/button.php?id=8165';
$affs[] = 'http://yahoo.com http://www.banditsplace.net/topsites/button.php?id=94';
$affs[] = 'http://yahoo.com http://img.photobucket.com/albums/v113/Bolesroor/banditsplace.gif';
$affs[] = 'http://yahoo.com http://img.photobucket.com/albums/v444/teentalkcentral/Affiliate.gif';
$affs[] = 'http://yahoo.com http://i4.ifrm.com/1567/154/upload/p1915011.gif';
$affs[] = 'http://yahoo.com http://img.photobucket.com/albums/v673/charlieschill/p6272124.gif';
$affs[] = 'http://yahoo.com http://www.pixel2life.com/images/banners/mbanner2.gif';

$rand_img = array_rand($imgs, 5);

foreach($rand_img as $img_value) {
$linkimg = explode(' ', $img_value);
echo '<a href="', $linkimg[0], '"><img src="', $linkimg[1], '" alt="', $linkimg[0], "\" />\n";
}
?>

<?php
$url = 'http://www.k-gfx.zerax.net/index.php';
$img = array();
$img[] = '/images/afflynowblue.gif';
$img[] = '/images/afflynowcyan.gif';
$img[] = '/images/afflynowgreen.gif';
$img[] = '/images/afflynowred.gif';
$img[] = '/images/afflynowyellow.gif';

$img_count = count($img);
$img_number = rand(0,$img_count);
$img_of_choise = $img[$img_number];

echo  '<a href="' . $url . '" target="_blanc"><img src="' . $img_of_choise . '" border="0" /></a>'
?>
Offline Profile Quote Post Goto Top
 
Zach
Member Avatar
Missjayness
[ *  *  *  *  * ]
Make sure to save the file as a .php (PHP file extension). ;)

You saved it as a .txt which won't work. It won't allow the PHP to be rendered.
Offline Profile Quote Post Goto Top
 
Jory
Member Avatar
Member
[ *  *  *  *  *  * ]
Try changing
Quote:
 
$rand_img = array_rand($imgs, 5);
to
Quote:
 
$rand_img = array_rand($affs, 5);

Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Technology Chat · Next Topic »
Add Reply
  • Pages:
  • 1
  • 3