Jump to content

maxyme

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

maxyme's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i have solved this on my own. i had to declare the array before i wrote it... $numb=array();
  2. I have a very weird problem. On my website i have a script that takes random pages and displays them on the homepage. It works without a problem on its own but when i have it included in the homepage using include('webmaster fav.php'); i get this error: Warning: Cannot use a scalar value as an array in /mnt/w0210/d28/s25/b02a8bb2/www/webmaster fav.php on line 18 and this error: Warning: array_unique() [function.array-unique]: The argument should be an array in /mnt/w0210/d28/s25/b02a8bb2/www/webmaster fav.php on line 20 and this error: Warning: array_unique() [function.array-unique]: The argument should be an array in /mnt/w0210/d28/s25/b02a8bb2/www/webmaster fav.php on line 21 and this error: Warning: Cannot use a scalar value as an array in /mnt/w0210/d28/s25/b02a8bb2/www/webmaster fav.php on line 23 I am kindof new to php but i think its a good script and it works without errors when it isn't included on the homepage it works. what could be the problem? heres the code: <?php $directory = "/mnt/w0210/d28/s25/b02a8bb2/www/data/"; //the list of pages i want to be random on the site $directory = (!strstr($directory,"*") || $directory =="./" ) ? $directory."*" : $directory; //Checks if the wildcard operator is present, and if not it adds it by default at the end; $files = glob($directory); //Yes, it was that easy to get all the files; $size=sizeof($files); for($i=0;$i<sizeof($files) ; $i++){ //Loop through the files and adds to array; $fp = fopen($files[$i],"r"); $contents[$i]=fgets($fp,999); fclose($fp); } for($x=0;$x<15;$x++){ $numb[$x]=rand(1, sizeof($files)); } $x=count($numb)-count(array_unique($numb)); $num = array_unique ($numb); for($q=0;$x<15;$x++){ $numb[$x]=rand(1, sizeof($files)); } //$imploded = implode(" ", $contents); //get rid of spaces //$newcontent=explode("~", $imploded); // sort into chucks so i can display the data. for($i=0;$i<15; $i++){ $number=$num[$i]; if($contents[$number]==""||$contents[$number]==" "||$contents[$number]==null){ } else{ echo "<li>"; $replacedcontent=str_replace(' ', '-',$contents[$number]); echo "<br/><a href='games/$replacedcontent'>"; $newrcontent=str_replace('-', ' ',$replacedcontent); echo "<img src='$newrcontent.jpg' border='2'></img>"; echo "<br/>$newrcontent</a></li>"; } } ?> i copied and pasted it from many sites examples so thats why some comments are weird... but basically it gets all the data files. reads the title and puts them in an array, then chooses some random ones and puts them in with their image so they can be displayed on the homepage.
  3. Thanks Everyone for helping me on this script! I finally got it working.
  4. Yes i know. There is a script i use to make the boxes below the game rounded and in ie they freeze up. Though in any other browser its fine. And srry for pming u alot.
  5. Thanks for telling me about the firefox 3 problem. About the iframes, right now i'm trying to use dynamic web templates for most of the site. Once i finish that i will get rid of the iframe and just use it in the template.
  6. i found out how it works now and updated the page online but is there any where to override the hiding of the div? if possible please tell me how.
  7. ok so i used that script for the first three games on the left of this page. Click the images and titles button to go to showDiv(true) and the titles only to go to showDiv(false) Why is it so messed up? http://futuregamespc.com/all_games_new.html
  8. Thanks i'll try to fix that latter.
  9. Ok so your script will automatically find the divs that are named game_1,game_2,game_3,ect. right? I also believe in the 7th line after divIndex you meant to type style? instead of styke Could you provide me with another function to hide it i don't understand what you meant in the note above the code.
  10. I just tryed it in ie 7 i believe the problem is the rounded corners script at the bottom of the game. When they load it freezes up the whole page. Thanks i'll try to fix that
  11. What browser are you using?
  12. Do you mean the marquee? or the horizontal menu Also if anyone is using a older version of internet explorer the horizontal menu will show its vertical and won't show right. Ugh! its a old version of the css styling i use.
  13. I have a games site and i want to have a javascript code that will hide all of the game images. I will be willing to put every image in its own individual div box if its necessary. I want a script that will hide all of the div boxes. If possible i would like it if i would not have to specify all of the div boxes individually but just name them all the same and have them all hide under the same id. If you have any questions just ask me. Thanks.
  14. http://futuregamespc.com/ Hi everyone, please tell me somethings about my site that you think should be easier for the user and anything else you think about it. Thanks http://futuregamespc.com/
×
×
  • 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.