Location: PHPKode > projects > phpBible > phpbible/show_lex_entry.php
<?php


if(!$num)
  {
  reset ($HTTP_POST_VARS);
  while (list ($key, $val) = each ($HTTP_POST_VARS)) 
    {
    $$key=$value;
    }
  reset ($HTTP_GET_VARS);
  while (list ($key, $val) = each ($HTTP_GET_VARS)) 
    {
    $$key=$value;
    }
  }


$browser2 = getenv("HTTP_USER_AGENT");
$browser=str_replace(' ', '+', $browser);

if(stristr($browser2, 'netscape')){$browser='NS';}
if(stristr($browser2, 'mozilla')){$browser='NS';}
if(stristr($browser2, 'msie')){$browser='IE';}
if(stristr($browser2, 'opera')){$browser='OP';}

if(!$num){$num="01";}
require("./config.php");
$link = mysql_connect($host, $user, $password)
    or die("Could not connect : " . mysql_error());
mysql_select_db($db_name) or die("Could not select database");

if(strpos($num, '0')===0)
  {
  $table_name=$table_prefix;
  $table_name.='hebrew_lexicon';
  $num=substr($num, 1);
  $font="BSTHebrew, SLHebrew";
  $start='0';
  $num_start='0';
  }
else
  {
  $table_name=$table_prefix;
  $table_name.='greek_lexicon';
  $font="BSTGreek, SLGreek";
  $num_start='';
  }
function getmicrotime(){ 
    list($usec, $sec) = explode(" ",microtime()); 
    return ((float)$usec + (float)$sec); 
    } 
srand(getmicrotime());
$rn  = rand(1, 9999);

$query = "SELECT * FROM $table_name WHERE number LIKE \"$num\"";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$line = mysql_fetch_row($result); 
$word_list=explode(' ', $line[7]);
for($i=0;$i<count($word_list);$i++)
  {
  if(strstr(" $word_list[$i]", '«'))
    {
    $word_list[$i]=str_replace('«', '', $word_list[$i]);
    $word_list[$i]=str_replace('»', '', $word_list[$i]);
    $punc=ereg_replace("[0-9]", '', $word_list[$i]);
    $word_list[$i]=ereg_replace("[^0-9]", '', $word_list[$i]);
    $word_list[$i]="<a href=\"./show_lex_entry.php?num=$word_list[$i]\">$word_list[$i]</a>$punc";
    }
  }
$line[7]=implode(' ', $word_list);

if($browser!='IE')
  {
  $notie="<table width=100%
    <tr>
      <td bgcolor=\"{{DARK}}\" valign=\"top\" style=\"padding-left: 3; padding-right: 3\" height=\"20\" nowrap colspan=2>
        <table border=\"0\" width=\"100%\">
          <tr>
            <td><font color=\"#FFFFFF\" face=\"Verdana\" size=\"2\"><b>Lexicon:&nbsp;<span class=def_title onclick=\"opener.location.href='./$script_name?keyword=~$num_start$num'; window.close();\" style=\"cursor:pointer\">Strong's</span></b></font></td>
            <td><i><b><font color=\"{{MEDIUM}}\" size=\"3\">[$word]</font></b></i></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr></table>";
  }

$notie=str_replace('{{VERY DARK}}', $page_very_dark, $notie);
$notie=str_replace('{{DARK}}', $page_dark, $notie);
$notie=str_replace('{{LIGHT}}', $page_light, $notie);
$notie=str_replace('{{MEDIUM}}', $page_medium, $notie);
$notie=str_replace('{{MAIN}}', $script_name, $notie);

echo "<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"phpBible.css?$rn\"></head><body class=light onload=\"self.focus()\" topmargin=0 leftmargin=0>$notie<table width=280 cellpadding=0 cellspacing=0 border=0 class=light><tr><td valign=top nowrap><font size=3 color=#000000><b>$line[0]. </b> &nbsp;</font><br></td><td><p><font size=4 face='$font' color=#000000>$line[1]</font><font size=3 color=#000000> &nbsp;$line[3], &nbsp;<i>$line[5]</i>; &nbsp;$line[7]</font></p></td></tr></table></body></html>";

#echo "<b>$line[0]. </b> &nbsp;<font size=4 face='$font'>$line[1]</font> &nbsp;$line[3], &nbsp;<i>$line[5]</i>; &nbsp;$line[7]";
?> 
Return current item: phpBible