Location: PHPKode > projects > Sound PHP Engine > s-p-e-0.3.0/s-p-e-0.3.0/map.php
<?php
// ===================================================== 
// 
// s-p-e - Content management system. 
// Copyright (C) 2004, 2005, 2010, 2011 Vladimir B. Tsarkov
// 
// This file is part of s-p-e. 
// 
// s-p-e is free software; you can redistribute it and/or modify 
// it under the terms of the GNU General Public License as published by 
// the Free Software Foundation, either version 3 of the License, or 
// (at your option) any later version. 
// 
// s-p-e is distributed in the hope that it will be useful, 
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
// GNU General Public License for more details. 
// 
// You should have received a copy of the GNU General Public License 
// along with s-p-e. If not, see <http://www.gnu.org/licenses/>.
//
// ------
//
//  You can contact me via e-mail: lipetsk-gnu-lug at bk period ru
//
//  map.php
//
// Abstract: Site map.
//  
// Revision History:
// 
//	1  2005-10-02  vbt
//	2  2010-06-24  vbt
//	3  2011-01-22  vbt
// 4  2011-05-14  vbt
//
// =====================================================

connect($cfg["host"], $cfg["user"], $cfg["password"], $cfg["database"], $connector);
$result = mysql_query("select num, pnid, partname 
	from ".($cfg["prefix"])."partition 
	where pnid regexp '^[0-9]{10}$' ", $connector);
if(mysql_num_rows($result) == 0)
{
	//echo "error #101-1";
} 
else 
{
   echo "<font class='s-normal' id='w-bold'>".(_("News"))."</font><br><br>";
   while($row = mysql_fetch_array($result, MYSQL_NUM))
   {
   	$result1 = mysql_query("select num, theme 
   	    from ".($cfg["prefix"])."".($row[1])." 
	    order by date desc, timer desc", $connector);

     echo "<a href='index.php?lng=$shortlng&id=".($row[0])."'>
     <font class='s-normal' id='w-normal'>".($row[2])."</font>
     </a>
     
     <ul>";
     while($row1 = mysql_fetch_array($result1, MYSQL_NUM))
     {
       echo "<p><a href='index.php?lng=$shortlng&ins=view&id=".($row[0])."&rid=".($row1[0])."' title='".(_("details"))."'>
       <font class='s-normal' id='w-normal'>
       ".($row1[1])."
       </font>
       </a>";
       echo "</p>";
     }
     mysql_free_result($result1);
     echo "</ul>";
   }
}
mysql_free_result($result);

$result = mysql_query("select num, pnid, partname 
	from ".($cfg["prefix"])."partition 
	where pnid regexp '^[0-9]{11}$'", $connector);
if(mysql_num_rows($result) == 0)
{
	//echo "error #101-2";
} 
else 
{
   echo "<p>
   <font class='s-normal' id='w-bold'>".(_("Articles"))."</font>
   </p>";
   while($row = mysql_fetch_array($result, MYSQL_NUM))
   {
     $result1 = mysql_query("select num, theme 
     	      from ".($cfg["prefix"])."".($row[1])." 
	      order by date desc, timer desc", $connector);

     echo "<font class='s-normal' id='w-normal'>
     <a href='index.php?lng=$shortlng&id=".($row[0])."'>".($row[2])."</a>
     </font>
     <ul>";
     while($row1 = mysql_fetch_array($result1, MYSQL_NUM))
     {
       echo "<p><font class='s-normal' id='w-normal'>
       <a href='index.php?lng=$shortlng&ins=view&id=".($row[0])."&rid=".($row1[0])."' title='".(_("details"))."'>".($row1[1])."</a>";
       echo "</p>";
     }
     mysql_free_result($result1);
     echo "</ul>";
   }
}
mysql_free_result($result);
mysql_close($connector);
?>
Return current item: Sound PHP Engine