TinyPortal

Development => Feedback => Bugs/Errors => Topic started by: deadpoeticstar on May 04, 2006, 04:05:14 PM

Title: Code Error
Post by: deadpoeticstar on May 04, 2006, 04:05:14 PM
$text[0]="Why do we park on driveways and drive on parkways?" <strong>Unknown</strong;
$text[1]="If you have webbed feet are you a duck? Or do you have to quack too?" <strong>Chris Little</strong>";
$text[2]="Do gooder than you done before. You never know when your goodest may be the bestest." <strong>Chris Little</strong>";
$text[3]="If a tree falls in the forest and no one is there to hear it - does it make a sound? Who cares, I can download it onto my ipod!!!" <strong>Chris Little</strong>";
$text[4]="Who decided that 2+2=4? Why can we not change the equations if all the numbers were made up by some guy way back when?" <strong>Chris Little</strong>";
$text[5]="If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it." <strong>W.C. Fields</strong>";
$text[6]="The real reason that we can't have the Ten Commandments in a courthouse: You cannot post "Thou shalt not steal", Thou shalt not commit adultery" and "Thou shalt not lie" in a building full of lawyers, judges and politicians. It creates a hostile work environment." <strong>George Carlin</strong>";
$text[7]="We love violence in this country, we love violence. We all have those little violent tendencies. I know you're like me, when you see someone walking down the street in a Superman tee shirt, you just want to shoot them in the chest. And when they start to bleed go, "I guess not." Don't wear the shirt. Wear a shirt that says, "I bleed if you shoot me in the chest plate" and I will not shoot you in the chest plate, Superbleeder. Haha I called him Superbleeder." <strong>Dane Cook</strong>
$text[8]="Here's an example of a women who was too optimistic with me recently. I was walking by a shoe store, and I looked in the window, and I see a pair of boots that I want in my life, OK so I walk in and I say to the women working there "Hi, excuse me. Hey, do you have these boots in a 12?" this is what she does, she looks at me very optimistically and goes "ummm let me take a peek" That's what she said by the way, "let me take a peek" I'm like "yeah while your at it, look around don't just glimpse, I want these boots..move a box if you have to" She goes into the back, when she comes out shes super optimistic and shes holding a boot she walks right up to me and says '..we have it in a 9!!' "Really? do you guys also have a bone saw anywhere near by? Tell you what, just run at me really fast and jam that sucker right on my hoof. Do you guys have a time machine to send me back to the 7th grade when those fit my feet?"
<strong>Dane Cook</strong>
$text[9]="I got a new slogan, If something happens in Vegas and I see it, I'm fucking telling everybody" <strong>Dane Cook</strong>
function show_rand_quotes($text) {
    mt_srand((double)microtime()*1000000);
    $rand=mt_rand() % sizeof($text);
    echo $text[$rand];
}


That is a script i found. i put it in a php box but then i also have this:

echo "Random quote for is: ".show_rand_quotes($text);

how do i need to get this set up so it does set up for the PHP block

and this is what the error message says:

Parse error: parse error, unexpected '>' in /home/georgeli/public_html/smf/Sources/Load.php(1609) : eval()'d code(34) : eval()'d code on line 1
Title: Re: Code Error
Post by: IchBin on May 04, 2006, 04:51:56 PM
Try this:
$text[0]="Why do we park on driveways and drive on parkways? <strong>Unknown</strong>";
$text[1]="If you have webbed feet are you a duck? Or do you have to quack too? <strong>Chris Little</strong>";
$text[2]="Do gooder than you done before. You never know when your goodest may be the bestest. <strong>Chris Little</strong>";
$text[3]="If a tree falls in the forest and no one is there to hear it - does it make a sound? Who cares, I can download it onto my ipod!!! <strong>Chris Little</strong>";
$text[4]="Who decided that 2+2=4? Why can we not change the equations if all the numbers were made up by some guy way back when? <strong>Chris Little</strong>";
$text[5]="If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. <strong>W.C. Fields</strong>";
$text[6]="The real reason that we can't have the Ten Commandments in a courthouse: You cannot post \"Thou shalt not steal\", Thou shalt not commit adultery\" and \"Thou shalt not lie\" in a building full of lawyers, judges and politicians. It creates a hostile work environment. <strong>George Carlin</strong>";
$text[7]="We love violence in this country, we love violence. We all have those little violent tendencies. I know you're like me, when you see someone walking down the street in a Superman tee shirt, you just want to shoot them in the chest. And when they start to bleed go, \"I guess not.\" Don't wear the shirt. Wear a shirt that says, \"I bleed if you shoot me in the chest plate\" and I will not shoot you in the chest plate, Superbleeder. Haha I called him Superbleeder. <strong>Dane Cook</strong>";
$text[8]="Here's an example of a women who was too optimistic with me recently. I was walking by a shoe store, and I looked in the window, and I see a pair of boots that I want in my life, OK so I walk in and I say to the women working there \"Hi, excuse me. Hey, do you have these boots in a 12?\" this is what she does, she looks at me very optimistically and goes \"ummm let me take a peek\" That's what she said by the way, \"let me take a peek\" I'm like \"yeah while your at it, look around don't just glimpse, I want these boots..move a box if you have to\" She goes into the back, when she comes out shes super optimistic and shes holding a boot she walks right up to me and says '..we have it in a 9!!' \"Really? do you guys also have a bone saw anywhere near by? Tell you what, just run at me really fast and jam that sucker right on my hoof. Do you guys have a time machine to send me back to the 7th grade when those fit my feet? <strong>Dane Cook</strong>";
$text[9]="I got a new slogan, If something happens in Vegas and I see it, I'm fucking telling everybody <strong>Dane Cook</strong>";
function show_rand_quotes($text) {
    mt_srand((double)microtime()*1000000);
    $rand=mt_rand() % sizeof($text);
    echo $text[$rand];
}
Title: Re: Code Error
Post by: deadpoeticstar on May 04, 2006, 04:53:22 PM
Parse error: parse error, unexpected T_STRING in /home/georgeli/public_html/smf/Sources/Load.php(1609) : eval()'d code(34) : eval()'d code on line 7
Title: Re: Code Error
Post by: IchBin on May 04, 2006, 05:05:12 PM
Edited the text above. I forgot to escape some characters. I'm no PHP guru, but thats the way I think it should look.
Title: Re: Code Error
Post by: deadpoeticstar on May 04, 2006, 05:43:16 PM
lol the box shows but there is nothing in it now...lol
Title: Re: Code Error
Post by: bloc on May 04, 2006, 08:48:38 PM
try this one:
$text[0]='"Why do we park on driveways and drive on parkways?" <strong>Unknown</strong';
$text[1]='"If you have webbed feet are you a duck? Or do you have to quack too?" <strong>Chris Little</strong>';
$text[2]='"Do gooder than you done before. You never know when your goodest may be the bestest." <strong>Chris Little</strong>';
$text[3]='"If a tree falls in the forest and no one is there to hear it - does it make a sound? Who cares, I can download it onto my ipod!!!" <strong>Chris Little</strong>';
$text[4]='"Who decided that 2+2=4? Why can we not change the equations if all the numbers were made up by some guy way back when?" <strong>Chris Little</strong>';
$text[5]='"If at first you don\'t succeed, try again. Then quit. There\'s no use being a damn fool about it." <strong>W.C. Fields</strong>';
$text[6]='"The real reason that we can\'t have the Ten Commandments in a courthouse: You cannot post "Thou shalt not steal", Thou shalt not commit adultery" and "Thou shalt not lie" in a building full of lawyers, judges and politicians. It creates a hostile work environment." <strong>George Carlin</strong>';
$text[7]='"We love violence in this country, we love violence. We all have those little violent tendencies. I know you\'re like me, when you see someone walking down the street in a Superman tee shirt, you just want to shoot them in the chest. And when they start to bleed go, "I guess not." Don\'t wear the shirt. Wear a shirt that says, "I bleed if you shoot me in the chest plate" and I will not shoot you in the chest plate, Superbleeder. Haha I called him Superbleeder." <strong>Dane Cook</strong>';
$text[8]='"Here\'s an example of a women who was too optimistic with me recently. I was walking by a shoe store, and I looked in the window, and I see a pair of boots that I want in my life, OK so I walk in and I say to the women working there "Hi, excuse me. Hey, do you have these boots in a 12?" this is what she does, she looks at me very optimistically and goes "ummm let me take a peek" That\'s what she said by the way, "let me take a peek" I\'m like "yeah while your at it, look around don\'t just glimpse, I want these boots..move a box if you have to" She goes into the back, when she comes out shes super optimistic and shes holding a boot she walks right up to me and says \'..we have it in a 9!!\' "Really? do you guys also have a bone saw anywhere near by? Tell you what, just run at me really fast and jam that sucker right on my hoof. Do you guys have a time machine to send me back to the 7th grade when those fit my feet?"
<strong>Dane Cook</strong>';
$text[9]='"I got a new slogan, If something happens in Vegas and I see it, I\'m fucking telling everybody" <strong>Dane Cook</strong>';


    mt_srand((double)microtime()*1000000);
    $rand=mt_rand() % sizeof($text);
    echo $text[$rand];


I am more found of single than double quotes. :)

EDIT: removed the function..it can just show at once.
Title: Re: Code Error
Post by: deadpoeticstar on May 04, 2006, 08:52:32 PM
lol gave me another parsing error :P

Parse error: parse error, unexpected T_STRING in /home/georgeli/public_html/smf/Sources/Load.php(1609) : eval()'d code(34) : eval()'d code on line 6

if it helps i got the script from Here (http://www.phpfreaks.com/quickcode/Random-quotes-in-array/510.php)
Title: Re: Code Error
Post by: G6Cad on May 04, 2006, 09:01:01 PM
Why dont try this random quote script instead.

http://www.tinyportal.net/smf/index.php?topic=2547.0
Title: Re: Code Error
Post by: deadpoeticstar on May 04, 2006, 09:06:20 PM
well i tried but i couldnt get it to set up...proboably cause i had a brain fart...but ill try again
Title: Re: Code Error
Post by: IchBin on May 04, 2006, 10:36:48 PM
Make sure you delete everything, and copy/paste the exact code that Bloc posted because it works on mine mate.
Title: Re: Code Error
Post by: deadpoeticstar on May 04, 2006, 10:37:42 PM
oh i did....go check out the thread they linked me too