$random = rand(10,13);
if($random == 1) { $logo = "xepher_logo_fredirc.gif"; }
if($random == 2) { $logo = "xepher_logo_nerdboy.png"; }
if($random == 3) { $logo = "xepher_logo_gwyn.gif"; }
if($random == 4) { $logo = "xepher_logo_icy.gif"; }
if($random == 5) { $logo = "xepher_logo_nerdboy2.png"; }
if($random == 6) { $logo = "xepher_logo_technostyle.jpg"; }
if($random == 7) { $logo = "xepher_logo_gwyn2.gif"; }
if($random == 8) { $logo = "xepher_logo_willsan.png"; }
if($random == 9) { $logo = "xepher_logo_databits.gif"; }
if($random == 11) { $logo = "XepherNet.jpg"; }
if($random == 12) { $logo = "XepherNet2.jpg"; }
if($random == 13) { $logo = "XepherNet3.jpg"; }
if($random == 10) { ?>
XEPHER.NET
Free Hosting for Free Thinkers
}else{
echo("
");
}
?>
That file is http://xepher.net/logos/randomlogo.php and is included at the top of all main xepher.net pages to rotate the logo. You'll note in the code, I'm only using logos 10 through 13, as the other logos were user-submitted years ago, and no longer fit the layout. Logo "10" is a special case, and spits out a two line text logo. Hopefully you can see how you can easily include additional code to change the hyperlink in the same way. Also note this is VERY ugly/primitive code, being that you have to add a line for each new image you add. Of course, it adds a bit of security that way, as no one can trick it into including a file I haven't specifically listed. If I had a ton of images to rotate, I'd write something that just pulls from a directory listing, but as I've yet to do that, I can't actually post code here for it.
That file is http://xepher.net/logos/randomlogo.php and is included at the top of all main xepher.net pages to rotate the logo. You'll note in the code, I'm only using logos 10 through 13, as the other logos were user-submitted years ago, and no longer fit the layout. Logo "10" is a special case, and spits out a two line text logo. Hopefully you can see how you can easily include additional code to change the hyperlink in the same way. Also note this is VERY ugly/primitive code, being that you have to add a line for each new image you add. Of course, it adds a bit of security that way, as no one can trick it into including a file I haven't specifically listed. If I had a ton of images to rotate, I'd write something that just pulls from a directory listing, but as I've yet to do that, I can't actually post code here for it.Ah yes! Thanks you! this will help when I re-vamp the site and images.
or if you wanna be more complex, ...ooh, no no, that's ok ;)
$random = rand(1,3);
if($random == 1) { $img = "comic1.gif"; $link = "http://www.comic1.net"; }
if($random == 2) { $img = "comic2.png"; $link = "http://www.comic-2.net"; }
if($random == 3) { $img = "othercomic.jpg"; $link = "http://www.comic-other.com"; }
echo("
");
?>
There's a three-way example. Just add more lines and change the "rand(1,3)" to a match the number of lines to scale it up.
if( isset( $HTTP_COOKIE_VARS['BANNER_NUMBER'] ) )
{
$banner = $HTTP_COOKIE_VARS['BANNER_NUMBER'];
$banner = ($banner + 1) % 3;
}
else
{
$banner = rand(0,2);
}
setcookie( 'BANNER_NUMBER', $banner, time()+(60) );
?>
When someone first visits the page, they get a rand() banner. Then each time they reload it after they get the next banner in series (you'd want to change the (60) in the setcookie to something longer, like (60*60*24*30)).if( isset( $HTTP_COOKIE_VARS['BANNER_ARRAY'] ) ) {
$banners = split( '#', $HTTP_COOKIE_VARS['BANNER_ARRAY'] );
}
else {
$banners = array(0,1,2);
}
if( count($banners) == 1 ) {
$banner = $banners[0];
$newbanners = '0#1#2';
}
else {
shuffle( $banners );
$uns = $banners;
$banner = array_shift($banners);
$newbanners = array_shift($banners);
while( $temp = array_shift($banners) )
{
$newbanners = $newbanners . '#' . $temp;
}
}
setcookie( 'BANNER_ARRAY', $newbanners, time()+(60*60) );
What this does, is store a list of undisplayed banners in a cookie like 1#2#3. On each load, it mixes up the list, pulls of the top one to display now and then stores the remaining choices in a cookie. So the viewer can't get the first one again until all the others have been viewed, but he won't get them in the same order every time (but you could get a repeat like this: 1,2,3,3,1,2 since after the 1,2,3 they've all been viewed and it could very well start with 3 on the next run through of the list. With a large list though, this becomes rare, and you could modify the code to exclude the last one when reloading $newbanners with the full list).$f = fopen("bannerlist.txt","r");
$banner = fgets($f);
fclose($f);
$f = fopen("bannerlist.txt","w");
$next = ($banner + 1) % 3;
fputs( $f, $next );
fclose($f);
?>
All this does is store the value of what the next banner should be in a text file and does open, read, increment, save on each load. And you could always combine #2 and #3.if($banner== 1) { ?>
A description of above site.
if($banner== 2) { ?>
A description of above site.
if($banner== 3) { ?>
A description of above site.
and where would this be placed?I've actually had plans for a while to eventually integrate images into the Site Descriptions you can set for your site, and they'd show up in the newsbox instead of just a text description. Also some code to make it so you can see different banners/text BEFORE selecting a site to go to from the dropdown. I just never got around to it.Well I was hoping to make something like that because your text version is boring :P but, alas, coding this stuff is not my forté.
Okay, on item 4... I think I know what you want now. You used more technical terms than I want to guess at. I don't speak programming, I just know what I want in plain english. :-) On that note, you want people to click the "art" button, and have it load a random art banner/text, at which point next/prev buttons would flip through only art sites. Similar situation for the other buttons. Is that right?Yes.
As for customization, as per the XN newsbox... It's doable. Though for this idea, I'm not sure you want it. If site owners can change the colors and what not, you end up with radically different looks. So one artist designs their banner to go with how they have their box laid out, but then it shows up on another site and looks totally out of place. Or someone sets it to white-on-white or something. I'd say just make it as as simple as possible, but keep it standardized.k
About embedability... that is, putting it as part of the actual page like the newsbox: That only works (via PHP) on one server, since all the boxes would get displayed by the same server, it can do that. To enable it to be done on other servers, you need iframes, javascript, or another server with a rather insecure PHP installation that allows inserting code from remote servers. Bottom line is that anyone can use an iframe, only people with pages in PHP can use a direct PHP insertion.Well I was thinking that people would just get the iframe code from me, so they would not have to worry about uploading the image sets or whatnot... and people could just iframe it to a PHP page on my account, so if I need to add a newly approved account, I could easily change it for everyone without having people bothering with the code again.

On a side note, the standard php mysql connection stuff is really a pain in the butt to use and not very friendly. I would suggest to use something like PEAR::MDB2 if Xepher would install it. It's really a kick ass setup and makes a TON of things easier, and the best part is you can change up the database back end on your site and need to make few code changes most the time.
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Xepher Free Thinkers Network
PREV
Xepher.Net Webcomics
NEXT

A dark, romantic story about a girl who, trying to save a man, follows a demon/vampire to another dimension and gets involved in a war between demons and humans. (Tambien en Espa 241ol )
I hope I've been helpful and not just random =)
echo "This string is echoed from PHP: ©Ññ®";
?>
This string is part of plain HTML: ©Ññ®
The "special string" displayed should be a copyright symbol, a capital "N" with a wiggle over it, a small "n" with a wiggle, and the circle-R (registered trademark) symbol. It should appear the same in all cases. Let me know what does and doesn't work for you, and we can figure out where the problem is.
XEPHER . NETAlso, there are a couple that have this and the "News" part in there. I would think to be valid it would need at least this (even sans the "Visitors" part), but at least the Directory Pull-Down menu.... at the very least.
Xepher.net > Art > Other > This Site
Visitors: ### DONATE!