📄 content_-4.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
include_once( "inc/utility.php" );
include_once( "general/new_mytable/index_function.php" );
require_once( "inc/function_weather.php" );
require_once( "inc/weather.inc.php" );
ob_end_clean( );
$paraarray = getindexpara( $blockid );
$is_show_date = $paraarray['is_show_date'];
$is_show_creator = $paraarray['is_show_creator'];
$block_row = $paraarray['block_row'];
$subject_length = $paraarray['subject_length'];
$common_id = $paraarray['common_id'];
$common_str = $paraarray['common_str'];
$city = $common_str;
$sql = "SElECT * FROM weather_station WHERE station LIKE '".$city."'";
$rs = exequery( $connection, $sql );
$row = mysql_fetch_array( $rs );
$station_id = $row['station_id'];
if ( $station_id == "" )
{
$sql = "SElECT * FROM weather_station WHERE district LIKE '".$city."' ORDER BY ID DESC";
$rs = exequery( $connection, $sql );
$row = mysql_fetch_array( $rs );
$station_id = $row['station_id'];
}
$weather = new weatherrss( );
$arraydata = $weather->initrss( $station_id );
echo "<div style=\"text-align:center;\">城市 ";
echo "<s";
echo "pan style=\"color:#FF6600;font-weight:bold\">";
echo $city;
echo "</span> 天气</div>\r\n";
if ( $arraydata[0]['date'] == "" )
{
echo "没有此城市天气数据!";
exit( );
}
$i = 0;
for ( ; $i < count( $arraydata ); ++$i )
{
if ( $i == $block_row || $arraydata[$i]['date'] == "" )
{
}
else
{
$date = $arraydata[$i]['date'];
$weather = $arraydata[$i]['weather'];
$temperature_1 = $arraydata[$i]['temperature_1'];
$temperature_2 = $arraydata[$i]['temperature_2'];
unset( $argif );
if ( 0 < strpos( $weather, "转" ) )
{
$arrwea = explode( "转", $weather );
$argif[0] = $gb2gif[$arrwea[0]];
$argif[1] = $gb2gif[$arrwea[1]];
}
else
{
$argif[0] = $gb2gif[$weather];
}
echo "\t<div class='linkdiv'>\r\n\t\t<div style=\"width:40%;float:left;\">\r\n\t\t\t<div style=\"width:100%;padding:2px;\"></div>\r\n\t\t\t<div style=\"width:100%;padding:3px\">";
echo $date;
echo "</div>\r\n\t\t\t<div style=\"width:100%;padding:3px\">";
echo $weather;
echo "</div>\r\n\t\t\t<div style=\"width:100%;padding:3px\">";
echo $temperature_1;
echo "℃~";
echo $temperature_2;
echo "℃</div>\r\n\t\t</div>\r\n\t\t<div style=\"width:55%;float:left;height:100px;padding:2px;text-align:center\">\r\n\t\t";
$n = 0;
for ( ; $n < count( $argif ); ++$n )
{
echo "\t\t<img src=\"/images/index_i/weather/";
echo $argif[$n];
echo "\">\r\n\t\t";
}
echo "\t\t<br>\r\n\t\t";
echo "<s";
echo "pan style=\"color:#FF6600;font-weight:bold\">";
echo $weather;
echo "</span>\r\n\t\t</div>\r\n\t</div>\r\n";
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -