<?

  include_once '../config.inc.php';
  $bad_words = array ('select', 'insert', 'delete', 'update', 'drop table', 'union', 'null');
  for ($i = 0; $i < sizeof ($_GET); ++$i)
  {
    for ($j = 0; $j < sizeof ($bad_words); ++$j)
    {
      if (preg_match ('/' . $bad_words[$j] . '/', $_GET[key ($_GET)]))
      {
        $temp = key ($_GET);
        $_GET[$temp] = '';
        continue;
      }
    }

    next ($_GET);
  }

  if (!($result = mysql_query ('select * from styles WHERE active=\'yes\'')))
  {
    exit ('<b>Error:</b>' . mysql_error ());
    ;
  }

  $row = mysql_fetch_row ($result);
  for ($i = 0; $i < sizeof ($row); ++$i)
  {
    define (mysql_field_name ($result, $i), $row[$i]);
  }

  if (!($result1 = mysql_query ('select * from properties')))
  {
    exit ('<b>Error:</b>' . mysql_error ());
    ;
  }

  $row1 = mysql_fetch_row ($result1);
  for ($i = 0; $i < sizeof ($row1); ++$i)
  {
    define (mysql_field_name ($result1, $i), $row1[$i]);
  }

  include '../lang/' . language;
  if (!($result = mysql_query ('' . 'select * from articles where id=\'' . $_GET['id'] . '\'')))
  {
    exit ('<b>Error:</b>' . mysql_error ());
    ;
  }

  $row = mysql_fetch_array ($result);
  echo '
';
  if (txt_direction == 'LTR')
  {
    echo '<html>';
  }
  else
  {
    echo '<html dir="rtl">';
  }

  echo '<body>

<table width="760" border="0" cellspacing="0" cellpadding="0" align="center"><tr>
<td>
	<font style="font-family: Tahoma; font-size: 12px;">';
  echo title;
  echo '</font>
</td>
<td align="right">
	<font style="font-family: Tahoma; font-size: 12px;">
		URL: <a href="';
  echo 'http://' . $_SERVER['HTTP_HOST'] . ('' . '/index.php?id=' . $_GET['id']);
  echo '" style="color:blue; font-family: Tahoma; font-size: 12px;">';
  echo 'http://' . $_SERVER['HTTP_HOST'] . ('' . '/index.php?id=' . $_GET['id']);
  echo '</a>
	</font>
</td>

</tr></table>

<table width="760" border="0" cellspacing="0" cellpadding="5" align="center" style="border: 1px solid Black;"><tr><td>
<font STYLE="color:';
  echo title_color;
  echo '; font-family:';
  echo title_font;
  echo '; font-size:';
  echo title_font_size;
  echo '; font-weight:';
  echo title_font_weight;
  echo ';">';
  echo $row['title'];
  echo '</font>

<table width="100%" border="0" align="center" style="border-bottom: 1px solid Silver;"><tr><td height=5></td></tr></table>


<table border="0" cellspacing="0" cellpadding="5" align="right"><tr><td valign="top">


			';
  if ($dir = @opendir ('../upload/images'))
  {
    while ($file = readdir ($dir) !== false)
    {
      if (strstr ($file, $row['tim']))
      {
        echo '<IMG SRC="../upload/images/';
        echo $file;
        echo '" BORDER="0">';
        continue;
      }
    }

    closedir ($dir);
  }

  echo '
</td></tr><tr><td>

</td></tr></table>
				
				
<font style="color: navy; font-family:tahoma; font-size:11px; background:#EEEEEE;"><u>(';
  echo '' . $text__Posted . ' ' . date ('d/m/y', $row['tim']);
  echo ')</u></FONT>
<font STYLE="color:';
  echo description_color;
  echo '; font-family:';
  echo description_font;
  echo '; font-size:';
  echo description_font_size;
  echo '; font-weight:';
  echo description_font_weight;
  echo ';">';
  echo $row['description'];
  echo '</font><br><br>';
  echo $row['body'];
  echo '
</td></tr></table>
</body>
</html>';
?>
