| 1 |
<!-- |
| 2 |
|
| 3 |
/* |
| 4 |
* phpAiksaur - A Web Interface to the AikSaurus Thesaurus Library |
| 5 |
* Copyright (C) 2001 by Jared Davis |
| 6 |
* |
| 7 |
* This program is free software; you can redistribute it and/or modify it |
| 8 |
* under the terms of the GNU General Public License as published by the |
| 9 |
* Free Software Foundation; either version 2 of the License, or (at your |
| 10 |
* option) any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, but |
| 13 |
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 14 |
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 15 |
* for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License along |
| 18 |
* with this program; if not, write to the Free Software Foundation, Inc., |
| 19 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 20 |
*/ |
| 21 |
|
| 22 |
--> |
| 23 |
|
| 24 |
<html> |
| 25 |
<head> |
| 26 |
<title>phpAiksaur Setup</title> |
| 27 |
</head> |
| 28 |
<body bgcolor="#ffffff" text="#000000"> |
| 29 |
|
| 30 |
<h1>Welcome to <font color="#009900">phpAiksaur</font></h1> |
| 31 |
<hr size="1" noshade> |
| 32 |
<h2>Running Tests on your Installation...</h2> |
| 33 |
<p>You should see three <strong><font color="#009900">Goods</font></strong> here if your setup is correct.</p> |
| 34 |
<blockquote> |
| 35 |
<h3>Checking for PHP...</h3> |
| 36 |
<!-- detect if php is being parsed |
| 37 |
<? |
| 38 |
$ok = "ok"; |
| 39 |
?> |
| 40 |
--> |
| 41 |
<form name="testform"> |
| 42 |
<input type="hidden" name="testphp" value="<? echo $ok; ?>"></input> |
| 43 |
</form> |
| 44 |
<blockquote> |
| 45 |
<script language="JavaScript1.1"> |
| 46 |
<!-- |
| 47 |
if (document.testform.testphp.value != "ok") |
| 48 |
{ |
| 49 |
document.writeln("<p><b><font color=\"#ff0000\">ERROR:</font></b> PHP does not seem to be installed.</p>"); |
| 50 |
document.writeln("<p>Make sure that your web server is set to interpret "); |
| 51 |
document.writeln("files with .php extensions as PHP scripts.</p>"); |
| 52 |
} |
| 53 |
else |
| 54 |
{ |
| 55 |
document.writeln("<p><b><font color=\"#009900\">Good</font>:</b> PHP seems to be installed correctly.</p>"); |
| 56 |
} |
| 57 |
// --> |
| 58 |
</script> |
| 59 |
<noscript> |
| 60 |
<p><b><font color="#ff0000">ERROR:</font></b> Cannot check for PHP without JavaScript enabled.</p> |
| 61 |
<p>PHP may or may not be installed correctly.</p> |
| 62 |
</noscript> |
| 63 |
</blockquote> |
| 64 |
|
| 65 |
<h3>Checking for Correct EXEC_PATH...</h3> |
| 66 |
<blockquote> |
| 67 |
<? |
| 68 |
include("phpAiksaur.php"); |
| 69 |
if (file_exists(EXEC_PATH)) |
| 70 |
{ |
| 71 |
print "<p><b><font color=\"#009900\">Good</font>: </b> <code>" . EXEC_PATH . "</code> exists.</p>"; |
| 72 |
} |
| 73 |
else |
| 74 |
{ |
| 75 |
$dir = $DOCUMENT_ROOT . substr($PHP_SELF, 1, strlen($PHP_SELF) - 1); |
| 76 |
$dir = substr($dir, 0, strrpos($dir, "/")); |
| 77 |
|
| 78 |
print "<p><b><font color=\"#ff0000\">ERROR</font>: </b> <code>" . EXEC_PATH . "</code> does not exist.</p>"; |
| 79 |
print "<p>This indicates that either</p>"; |
| 80 |
print "<ul><li>AikSaurus Core Libraries are not installed, or</li>"; |
| 81 |
print "<li>phpAiksaur is not yet configured.</li></ul>"; |
| 82 |
print "<p>Make sure that you have installed the AikSaurus Core Library. ("; |
| 83 |
print "<a href=\"http://www.aiksaurus.com/install.php\">Instructions</a>)</p>"; |
| 84 |
print "<p>If you already installed it, edit the file:</p><blockquote><code>"; |
| 85 |
print "$dir/phpAiksuar.php</code></blockquote><p> "; |
| 86 |
print "and make sure that EXEC_PATH is correctly defined."; |
| 87 |
print " (<a href=\"http://www.aiksaurus.com/online/manual.php\">Help</a>)</p>"; |
| 88 |
} |
| 89 |
?> |
| 90 |
</blockquote> |
| 91 |
|
| 92 |
<h3>Attempting to Do A Search...</h3> |
| 93 |
<blockquote> |
| 94 |
<? |
| 95 |
$thesaurus = new phpAiksaur; |
| 96 |
|
| 97 |
if ($thesaurus->doSearch("fool")) |
| 98 |
{ |
| 99 |
print "<b><font color=\"#009900\">Good</font>: </b> Synonyms found successfully."; |
| 100 |
} |
| 101 |
else |
| 102 |
{ |
| 103 |
if (strlen($thesaurus->getError())) |
| 104 |
{ |
| 105 |
print "<p>This means that an internal error occured with the AikSaurus core.</p>"; |
| 106 |
} |
| 107 |
|
| 108 |
else |
| 109 |
{ |
| 110 |
print "<p>No synonyms were found, but no error was reported.</p>"; |
| 111 |
} |
| 112 |
|
| 113 |
print "<p><b>This should not happen</b>. Unless you were doing something that you "; |
| 114 |
print "know was strange (like messing around with thesaurus datafiles), "; |
| 115 |
print "you should probably <b>submit a bug report</b> to "; |
| 116 |
print "<a href=\"mailto:[email protected]\">[email protected]</a></p>"; |
| 117 |
} |
| 118 |
?> |
| 119 |
</blockquote> |
| 120 |
|
| 121 |
</blockquote> |
| 122 |
<hr noshade size="1"> |
| 123 |
|
| 124 |
<h2>Test Drive!</h2> |
| 125 |
|
| 126 |
<? |
| 127 |
include("phpAiksaur_popup.php"); |
| 128 |
phpAiksaur_popup(); |
| 129 |
?> |
| 130 |
|
| 131 |
|
| 132 |
<p>If the above tests passed, you can now try out your thesaurus.</p> |
| 133 |
|
| 134 |
<p>You probably want to see |
| 135 |
<a href="http://www.aiksaurus.com/online/manual.php">The Manual</a> for instructions about |
| 136 |
customization and embedding with your site. |
| 137 |
</p> |
| 138 |
|
| 139 |
<blockquote> |
| 140 |
<h3>Popup Thesaurus</h3> |
| 141 |
<blockquote> |
| 142 |
<noscript> |
| 143 |
<p><b>NOTE:</b> this will not work because you do not have javascript enabled.</p> |
| 144 |
</noscript> |
| 145 |
<p>The popup thesaurus is intended mostly for web applications like web-based |
| 146 |
email, news authoring software, etc.</p> |
| 147 |
|
| 148 |
<form name="popupThesaurus" onSubmit="javascript:launchThesaurus()"> |
| 149 |
<p><b>Test Drive Popup Thesaurus</b> <br> |
| 150 |
<input type="text" name="lookup" size="20" /> |
| 151 |
<input type="submit" value="Search"> |
| 152 |
</form> |
| 153 |
|
| 154 |
</blockquote> |
| 155 |
<br> |
| 156 |
<h3>Embedded Thesaurus</h3> |
| 157 |
<blockquote> |
| 158 |
<p>The embedded thesaurus works without javascirpt and is intended for web |
| 159 |
sites that want to provide thesuarus functionality. It <b>looks plain now</b> |
| 160 |
but can integrate into your site's look easily. |
| 161 |
</p> |
| 162 |
|
| 163 |
<form name="embeddedThesaurus" method="post" action="phpAiksaur_embedded.php"> |
| 164 |
<p><b>Test Drive Embedded Thesaurus</b> <br> |
| 165 |
<input type="text" name="lookup" size="20" /> |
| 166 |
<input type="submit" value="Search"> |
| 167 |
</form> |
| 168 |
|
| 169 |
</blockquote> |
| 170 |
|
| 171 |
</blockquote> |
| 172 |
<hr noshade size="1"> |
| 173 |
|
| 174 |
|
| 175 |
</body> |
| 176 |
</html> |