Jump to content

aldeasim

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://aldeasim.com

Profile Information

  • Gender
    Not Telling
  • Location
    Chile

aldeasim's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hmmm. Proofing I realized that the code is good, but Wordpress has something that blocks the right behaviour of the script . I think this is not the right place to solve WP problems, so thanks a lot for all your efforts!! — Aldeasim.
  2. It's the same, hcdarkmage. The new random.php you send hasn't now the little errors it had, but I had solved them all before proofing it. Now it doesn't show anything (before it showed a name, a wrong one, but a name anyway). I'm observing other thing now. I have a javascript in <head></head> (that's header.php file) but the code isn't executing in footer.php. The problem is similar. I don't want to seek here solutions for this js problem, but I only wanted to point it out. For the record. — Aldeasim.
  3. Well, it works for the header.php file. The problem is that footer.php doesn't return any value to $hdinfo. Now, include(random.php) in footer.php only makes the script execute twice, and the random number not corresponding with the header.php one. — Aldeasim.
  4. The problem remains, hcdarkmage. (Sorry by my code syntax )
  5. Hmm. Actually, pyrodude, it didn't It appears I'm doing something bad, but the code looks just fine... — Aldeasim. PS: The code now is: <?php $hd = rand(1, 4); // header function GetRandImages() { global $hd, $hdn, $hdinfo; switch($hd) { case 1: ($hdn = "1"); ($hdperma = "http://www.sxc.hu/profile/hawkida"); ($hdname = "Hawkida"); break; case 2: ($hdn = "2"); ($hdperma = "http://www.sxc.hu/profile/reuben4eva"); ($hdname = "Audrey Johnson"); break; case 3: ($hdn = "3"); ($hdperma = "http://www.imageafter.com/"); ($hdname = "ImageAfter"); break; case 4: ($hdn = "4"); ($hdperma = "http://www.sxc.hu/profile/dsiis"); ($hdname = "Israel Jiménez"); break; } $hdinfo = "<a href=\"" . $hdperma . "\" target=\"_blank\">" . $hdname . "</a>" ; } ?>
  6. Drewbee, it doesn't. — Aldeasim. PS: With the code I've sent, I neither get $hdn, nor $hdinfo, so I have a blank header and no link to any author.
  7. Now I feel really dumb. <?php $hd = rand(1, 4); // header function GetRandImages() { global $hd; switch($hd) { case 1: ($hdn = "1"); ($hdperma = "http://www.sxc.hu/profile/hawkida"); ($hdname = "Hawkida"); break; case 2: ($hdn = "2"); ($hdperma = "http://www.sxc.hu/profile/reuben4eva"); ($hdname = "Audrey Johnson"); break; case 3: ($hdn = "3"); ($hdperma = "http://www.imageafter.com/"); ($hdname = "ImageAfter"); break; case 4: ($hdn = "4"); ($hdperma = "http://www.sxc.hu/profile/dsiis"); ($hdname = "Israel Jiménez"); break; } $hdinfo = "<a href=\"" . $hdperma . "\" target=\"_blank\">" . $hdname . "</a>" ; } ?> That's my random.php file. In my header.php file I have this: <?php include_once (TEMPLATEPATH . '/random.php'); ?> <style> #top {background: url(recursos/superior_bg<?php GetRandImages(); echo $hdn; ?>.jpg) center repeat-x; } </style> And in my footer.php I have: <?php GetRandImages(); ?> header image by <?php echo $hdinfo; ?> Any idea? The best result I've reached is having two different random numbers, but the header and footer were looking correctly (but with wrong data). Thanks a lot in advance! — Aldeasim.
  8. Thanks drewbee, but I have done that. I save this random value to $hd, and the name of the author of the picture and a link to his page and saved it to $hdinfo, but it still doesn't work in footer.php. As a proof, I called $hdinfo from the header.php file, and it displays the result. Maybe with "save the name value to a variable" you mean something I can catch... ??? — Aldeasim.
  9. Hi there. I'm new here and have got a big problem, and I'll tell you the whole situation. I've got a blog powered by Wordpress, with header photos I randomly use that other people have taken. Due to the Wordpress file system, I've got the header.php archive, where I call (with include( )) a random.php file (which has the function rand( ) in it). I have no problem to insert a random file name, so different header images are displayed every time page is refreshed. The problem is that I need to put the credits of the images (this Creative Commons thing...) in the footer.php file. What can I do to use the same randomly generated number in these two different files and include( ) them both in the index.php file that Wordpress require? I've tried to include( ) random.php in header.php as in footer.php, but it generates two different random numbers, so image doesn't correspond with credits of that image. Any help will be greatly appreciated. Thanks in advance! — Aldeasim.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.