include('include.php');
## dragec
## hardcoded !!!
$get = 1;
// get a tuple if required
$got = 0; // flag no record
if( is_numeric($get) && $get > 0 )
{
if( $res = mysql_query("select * from maps where id=$get") )
$tuple = mysql_fetch_array($res);
else
fatal("Error: " . mysql_error());
if( empty($cat) ) $cat = $tuple[catroot];
$got = 1; // flag we got the tuple
if( strlen($tuple['lang']) && isset($ezLangs[$tuple['lang']]) )
$ezMap['lang'] = $tuple['lang']; // use this map's lang encoding
}
getLang(0);
doHTML();
?>
\n";
/*
$top = $row[top];
$left = $row[xleft];
echo "
\n";
*/
echo "
\n";
// Build tooltip div
//$myTips = doTip($row,$left,$top); // create tooltip
//echo $myTips;
echo "
\n";
// Build tooltip div
$top += 10;
$left += 10;
$myTips .= doTip($row,$left,$top); // create tooltip
}
//print_r($Locations);
// update view counter for this map
mysql_query("update maps set viewed = viewed + 1 where id = $tuple[id]");
// output the tooltips
echo $myTips;
?>
## under map div
//print "
";
print "
";
## most popular - start
$MostPopular = $City->MostPopular();
//kill most popular at the beginning of work
if(0 && $MostPopular)
{
//print_r($MostPopular);
print "
Most popular
\n";
print "
\n";
//print "Name | Location | Country |
\n";
foreach( $MostPopular as $RowNo => $CityRow)
{
$CityData = $City->GetCityData($CityRow['id']);
if(!empty($CityRow['name']) && (!empty($CityData['info'][1]) || !empty($CityData['info'][2]) || !empty($CityData['info'][3]) || !empty($CityData['info'][4]) || !empty($CityData['info'][5]) || !empty($CityData['info'][6])))
{
$cityLink = SITE_URL.'/cities_'.$CityRow['id'].'_'.urlize($CityRow['name']).'.html';
/*
$cityLink = ''.$CityRow['name']."
\n";
*/
print "".$CityRow['name'].", ".$CityRow['recorded'].", ".$CityRow['city'].", ".$CityRow['country']." |
\n";
/*
print "".$CityRow['name'].", ".$CityRow['recorded'].", ".$CityRow['city'].", ".$CityRow['country']." |
\n";
*/
}
}
print "
\n";
}
## most popular - end
## print location list
if(is_array($Locations) && count($Locations) > 0)
{
//print_r($Locations);
print "
All videos
\n";
print "
\n";
//print "Name | Location | Country |
\n";
foreach( $Locations as $RowNo => $CityRow)
{
if(!empty($CityRow['city']) && !empty($CityRow['name']) && (!empty($CityRow['info'][1][0]['description']) || !empty($CityRow['info'][2][0]['description']) || !empty($CityRow['info'][3][0]['description']) || !empty($CityRow['info'][4][0]['description']) || !empty($CityRow['info'][5][0]['description']) || !empty($CityRow['info'][6][0]['description'])))
{
$cityLink = SITE_URL.'/cities_'.$CityRow['id'].'_'.urlize($CityRow['name']).'.html';
/*
$cityLink = ''.$CityRow['name']."
\n";
print "".$cityLink." | ".$CityRow['city']." | ".$CityRow['country']." |
\n";
*/
//print_r($CityRow['info']);
print "".$CityRow['name']." |
\n";//, ".$CityRow['record_date'].", ".$CityRow['city'].", ".$CityRow['country']."
}
}
print "
\n";
}
print "
"; ## under map div
} // query
else
fatal("Error: " . mysql_error());
} // get is set
else
{
// display generic list
// header file if any...
if( is_file("header.html") )
include("header.html");
// first get all maps
$Q = "select M.*,C.title as CT from maps M, cats C where M.catroot=C.id ";
echo "Query: $Q\n";
// by default only show active ones
if( !isset($showAll) || empty($showAll) )
$Q .= "and M.active = 1 ";
// show from a certain category
if( isset($cat) && is_numeric($cat) && $cat > 0 )
$Q .= "and M.catroot = $cat ";
$Q .= "order by CT, M.title";
//echo "\n";
if( $res = mysql_query($Q) )
{
$i = 0; $j = 0;
$oldCat = 0;
echo "
\n";
// prepare category divider
if( is_numeric($ezMap['cats_in_row']) && $ezMap['cats_in_row'] > 0 )
$myMod = $ezMap['cats_in_row'];
else
$myMod = 4; // default num just in case
// outer table
echo "\n";
echo "\n";
while( $row = mysql_fetch_array($res) )
{
if( $oldCat != $row['catroot'] )
{
// print cat box
if( $oldCat )
{
echo "\n";
printf($L['idx_cat_viewed'],catViewed($oldCat));
echo "\n
\n";
echo " \n
\n
\n
\n"; // close last table
echo "\n \n";
// see if we need to close the row and open a new one
echo "\n";
if( !($j % $myMod) )
echo "\n\n";
}
echo " \n\n";
// category table
echo "\n";
echo "\n";
$tmp = sprintf($L['idx_maps_in'],$row['CT']);
echo " $tmp | \n";
echo " \n";
echo "\n";
echo " \n";
echo " \n";
echo " | \n";
echo " \n";
echo "\n";
echo " \n";
$oldCat = $row['catroot'];
$j++; // count categories
}
echo " $row[title] \n";
$i++;
}
// summarize last category
echo "\n";
printf($L['idx_cat_viewed'],number_format(catViewed($oldCat)));
echo "\n \n";
echo " | \n \n \n";
// close outer table
echo "\n | \n
\n\n\n";
// summary data
echo "\n";
printf($L['records'],$i);
echo "
\n";
if( is_file("footer.html") )
include("footer.html");
echo "\n";
echo $L['powered'];
echo "
\n";
}
} // get is not set
?>
Copyright 2006-2012 Cosic Development
Cities compare distance