Location: PHPKode > scripts > Magical 8 Ball > magical8ball/answers/answers.php
<?php

/* File, where the random text/quotes are stored one per line */
$settings['text_from_file'] = '';

/*
   If you prefer you can list quotes that RanTex will choose from here.
   In this case set above variable to $settings['text_from_file'] = '';
*/
$settings['quotes'] = array(
'<b id="statement">answer - </b> I don\'t think so!',
'<b id="statement">answer - </b> Heck yeah!',
'<b id="statement">answer - </b> Very Unlikely',
'<b id="statement">answer - </b> Are you crazy?',
'<b id="statement">answer - </b> For sure!',
'<b id="statement">answer - </b> Sure...when pigs fly!',
'<b id="statement">answer - </b> Well that\'s just a silly question!',
'<b id="statement">answer - </b> There is no doubt in my mind',
'<b id="statement">answer - </b> Do bears shit in the woods?',
'<b id="statement">answer - </b> Ask again, I\'m thinking...',
'<b id="statement">answer - </b> There is just no way in hell',
'<b id="statement">answer - </b> Absolutely!',
'<b id="statement">answer - </b> Highly unlikely',
'<b id="statement">answer - </b> All signs say yes',
'<b id="statement">answer - </b> Absolutely not!',
'<b id="statement">answer - </b> YES!',
'<b id="statement">answer - </b> NO!',
'<b id="statement">answer - </b> Maybe!',
'<b id="statement">answer - </b> No. I don\'t think so',
'<b id="statement">answer - </b> When Hell freezes over!',
'<b id="statement">answer - </b> Nope. Don\'t think so',
'<b id="statement">answer - </b> Possibly...maybe',
'<b id="statement">answer - </b> No. No. No! Do yu get it?',

);

/*
   How to display the text?
   0 = raw mode: print the text as it is, when using RanTex as an include
   1 = Javascript mode: when using Javascript to display the quote
*/
$settings['display_type'] = 1;

/* Allow on-the-fly settings override? 0 = NO, 1 = YES */
$settings['allow_otf'] = 1;

/*******************************************************************************
*  DO NOT EDIT BELOW...
*
*  ...or at least make a backup before you do!
*******************************************************************************/

/* Override type? */
if ($settings['allow_otf'] && isset($_GET['type']))
{
	$type = intval($_GET['type']);
}
else
{
	$type = $settings['display_type'];
}

/* Get a list of all text options */
if ($settings['text_from_file'])
{
	$settings['quotes'] = file($settings['text_from_file']);
}

/* If we have any text choose a random one, otherwise show 'No text to choose from' */
if (count($settings['quotes']))
{
	$txt = $settings['quotes'][array_rand($settings['quotes'])];
}
else
{
	$txr = 'No text to choose from';
}

// /* Output the image according to the selected type */
// if ($type)
// {
//     /* New lines will break Javascript, remove any and replace them with <br /> */
//     $txt = nl2br(trim($txt));
//     $txt = str_replace(array("\n","\r"),'',$txt);
// 	echo 'document.write(\''.addslashes($txt).'\')';
// }
// else
{
	echo $txt;
}
?>
Return current item: Magical 8 Ball