Jump to content

mikem562

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mikem562's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. perfect thank you!, how would I add more then 1 url to that so if google -or- if this -or- if this, etc
  2. I found this which I think is what I'm looking for (or something similar) if( (strpos($_SERVER['HTTP_REFERER'], get_bloginfo('home')) === false) && !$_SERVER['QUERY_STRING']) but I'm not sure how to make it, if www.sitea.com = false or siteb.com = false & your not coming from within the site itself then ... else etc
  3. Hello, This is what I'm trying to-do. I have an index.php file I would like a bit of code that says "If you got here from www.websitea.com (or a link within that site) OR www.websiteb.com" do this : else do this: I'm just not sure how to check where they're coming from. so basically if your on google.ca and you goto the site it will exicute the else part of the code but if your already on sitea or b and you click a link it will not
  4. Thank you so much! I'm following your train of thought and me & my friend are going to sit on a patio today and try to work it all out. The information you gave was exactly what I was looking for, though I do have a question. P(RJ or B5 or B9 not in first draw) = 8/14 P(RJ or B5 or B9 in first draw) = 6/14 How did you figure out the 8/14
  5. which person gets which set dosn't matter. sorry for not including all this previously. Person1 could get set 1 or 2. the one off will be delt last after each person has their set
  6. the order of the cards within the set does -NOT- matter as long as each set contains those 6 cards. The order of the sets should be as being delt to two people. 1card to set one 1card to set two continue until both sets are full
  7. I have a cards array, and I have this function which will shuffle the cards for me. How can I edit this to 'deal' 12cards (6 & 6) until all the cards are a specific 6 & 6 I pick out? function ShuffleCards(&$cardsArray, $times) { // Randomizes where to split within center (-3 to +3 from dead center) (MINIMUM 10 CARDS IN DECK) // Splits into two array. Randomizes how many cards from left and how many cards from right (between 1 and 3) // Alternates sides. Continues until both arrays are empty. $arraySize = count($cardsArray); if($arraySize<10) return; $deadCenter = $arraySize/2; for($i=0;$i<$times;$i++) { reset($cardsArray); $cutVariant = rand(-3, 3); $cutLocation = $deadCenter+$cutVariant; $firstArray = array(); $secondArray = array(); for($z=0;$z<$arraySize;$z++) { if($z<$cutLocation) array_push($firstArray, $cardsArray[$z]); else array_push($secondArray, $cardsArray[$z]); } $bottomFirst = rand(0, 1); $cardsArray = array(); while(count($firstArray) && count($secondArray)) { $leftNewCards = array(); $rightNewCards = array(); $leftVariant = rand(1, 3); if($leftVariant>count($firstArray)) $leftVariant = count($firstArray); $rightVariant = rand(1, 3); if($rightVariant>count($secondArray)) $rightVariant = count($secondArray); for($x=0;$x<$leftVariant;$x++) { array_push($leftNewCards, array_shift($firstArray)); } for($y=0;$y<$rightVariant;$y++) { array_push($rightNewCards, array_shift($secondArray)); } if($bottomFirst==0) { $newCardsArray = array_merge($leftNewCards, $rightNewCards); $bottomFirst = 1; } else { $newCardsArray = array_merge($rightNewCards, $leftNewCards); $bottomFirst = 0; } reset($newCardsArray); while(count($newCardsArray)) { array_push($cardsArray, array_shift($newCardsArray)); } } if(count($firstArray)) { while(count($firstArray)) array_push($cardsArray, array_shift($firstArray)); } if(count($secondArray)) { while(count($secondArray)) array_push($cardsArray, array_shift($secondArray)); } } }
  8. hopefully someone here can help me out. I'm trying to figure out the odd's of something happening, but my math knowledge is falling quite short. If anyone could give me a hand that would be great or even a link to something that could potentially help. If you have a deck of cards I'm trying to figure out the odds of dealing out 13cards, 2sets of 6 & 1off having them end up like this : (b=black|r=red) : set1 - b_king b_king r_jack b_5 b_a b_9 set2 - b_queen b_queen r_jack b_5 r_a b_9 1off - r_a *shrugs* any thoughts would help
  9. Hey Everyone!, I'm working on a new project and I'm wanting to take this short flv and have it play fullscreen in the background while the rest of the site does it's thing. It should resize/scale with the browser though, no controls or anything fancy like that just the video as the background fullscreened, I'm having troubles finding a suitable tutorial or code snippet to work from, If anyone has a suitable link, or example fla file it would be greatly appreciated! . Thanks in advance! -mike
  10. *bump* < i'll try one more bump. I've been playing with this all night and I just can't figure out how to get them to list by last modified :S
  11. yea I'm not quite sure how to-do that... I'm like extra stuck on this one
  12. I know I have to use the filemtime function to get the time of all the files in the array, but I'm still unsure how to sort them before it gets to this line here: $play_list .= "<image Thumb=\"$file_tmb\" Large=\"$file_img\"></image>\n";
  13. awesome!! Thank you, I'll be sure to post the final result incase anyone else should care to use it =), now just working on sorting the xml / image nodes by date so the newest is always at the top haha and then it will be set!
  14. I have the following script which generated xml for me, I need a way though so the first <image> node is the newest image, and the last node is the oldest. so instead of it doing it via filename I would like to-do it by the date it was last touched. I plan on uploading images and upon running this script I want the most recently uploaded ones at the top... <?php $dir = '../galleries/music/'; $file_ext = "img.jpg"; $play_list = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"; $play_list .= "<content>\n"; $play_list .= "<gallery>\n"; // Open directory, read contents and add to file_list if correct file_type if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if ($file != '.' && $file != '..') { $name_array = explode('_', $file); if ($name_array[1] == $file_ext) { $file_img = "$file"; $file_tmb = str_replace("_img", "_tmb", "$file"); $play_list .= "<image Thumb=\"$file_tmb\" Large=\"$file_img\"></image>\n"; } } } closedir($dh); $play_list .= "</gallery>\n"; $play_list .= "</content>\n"; $wdir = ''.$dir.'images1.xml'; $f=fopen("$wdir","w") or die("Could not open and empty the file"); fwrite($f,$play_list) or die("Could not write to the file"); fclose($f) or die ("Could not close the resource"); } } ?>
×
×
  • 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.