<?


  if (!include '../autorization.php')
  {
    echo 'Access denied!';
    exit ();
  }

  if (vscroll_category != '')
  {
    $SQL = 'SELECT * FROM articles WHERE instr(category, \'' . vscroll_category . '\') AND type!=1 AND status=1 ORDER by tim DESC LIMIT ' . vscroll_amount;
  }
  else
  {
    $SQL = 'SELECT * FROM articles WHERE type!=1 AND status=1 ORDER by tim DESC LIMIT ' . vscroll_amount;
  }

  if (!($result = mysql_query ($SQL)))
  {
    exit ('<b>Error:</b>' . mysql_error ());
    ;
  }

  echo '		
		<MARQUEE "scroll" hspace=\'0\' bgcolor="';
  echo vscroll_bg_color;
  echo '" style="border: ';
  echo vscroll_border;
  echo 'px solid ';
  echo vscroll_border_color;
  echo ';" vspace=\'0\' direction= "';
  echo vscroll_direct;
  echo '" height="';
  echo vscroll_wind_height;
  echo '" width="';
  echo vscroll_wind_width;
  echo '" scrollamount= "2" scrolldelay= "50" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>
		<table width="100%" border="0" cellspacing="0" cellpadding="5">

			';
  while ($row = mysql_fetch_array ($result))
  {
    echo '<tr><td valign="top" style="border-bottom: 1px dotted maroon;">
				<a href="javascript:" STYLE="color:';
    echo vscroll_title_color;
    echo '; font-family:';
    echo vscroll_title_font;
    echo '; font-size:';
    echo vscroll_title_font_size;
    echo '; font-weight:';
    echo vscroll_title_font_weight;
    echo ';">';
    echo $row['title'];
    echo '</a><br>';
    if (vscroll_tmb_display == 'yes')
    {
      if ($dir = @opendir ('../../upload/thumbnails/'))
      {
        while ($file = readdir ($dir) !== false)
        {
          if (strstr ($file, $row['tim']))
          {
            echo '<a href="javascript:"><IMG SRC="../../upload/thumbnails/';
            echo $file;
            echo '" vspace="3" align="';
            echo vscroll_tmb_align;
            echo '" ';
            if (vscroll_tmb_width)
            {
              echo 'width="';
              echo vscroll_tmb_width;
              echo '"';
            }

            echo ' ';
            if (vscroll_tmb_height)
            {
              echo 'height="';
              echo vscroll_tmb_height;
              echo '"';
            }

            echo ' style="border: 1px solid Black;"></a>';
            continue;
          }
        }

        closedir ($dir);
      }
    }

    echo '					
					
					<font STYLE="color:';
    echo vscroll_description_color;
    echo '; font-family:';
    echo vscroll_description_font;
    echo '; font-size:';
    echo vscroll_description_font_size;
    echo '; font-weight:';
    echo vscroll_description_font_weight;
    echo ';">&#8226;&nbsp;';
    echo $row['description'];
    echo '</font><br>
				</td></tr>
			';
  }

  echo '			</table>
			</MARQUEE>';
?>
