session_start();
// Register all the neccessary session variables in this index page
include '../configuration/session_variables.php';
// Include the configuration variables
include '../configuration/config.php';
// Create a database connection to kit database
include '../configuration/connect_db.php';
//if ($display_year=='')
// $display_year=date('Y');
$fishing_diary_id = $_GET['fishing_diary_id'];
$display_year= $_GET['display_year'];
// Include the tracking
if ($fishing_diary_id!='')
$track_page_name='DIARY - Fishing index page -'.$fishing_diary_id;
else
$track_page_name='FISHING DIARY YEAR '.$display_year;
include '../tracking/track.inc';
if (strstr($_SERVER['HTTP_REFERER'],'uwants')){ // Forward unwanted outside refers to a declearation page
header ("location: ../fishing/refer.php?refer=uwant_forum");
}
else if(strstr($_SERVER['HTTP_REFERER'],'discuss')){
header ("location: ../fishing/refer.php?refer=discuss");
}else if ((strstr($ip_addr,'147.8.') || strstr($ip_addr,'158.132.')) && $_SESSION["user"]["user_id"]!=1 && $ip_addr!='147.8.177.159')
header ("location:../about_kit/index.php");
else if (!($_COOKIE["fishing_watch"]=='Y' || $_COOKIE["fishing_watch"]=='N') && $_SESSION["user"]["user_id"]!="1" && $_SESSION["user"]["user_id"]!="2"){
// Ask if display hunting
header ("location:declare.php");
}
$with_hunting=$_COOKIE["fishing_watch"];
$display_range[0]=0;
$display_range[1]=99999;
if (($fishing_diary_id<$display_range[0] || $fishing_diary_id>$display_range[1]) && $_SESSION["user"]["user_id"]!="1" && $_SESSION["user"]["user_id"]!="2" && $fishing_diary_id!='')
header ("location:index.php");
function place_path($input,$db_link,$server_path)
{
global $place_path_output;
$query = "select * from `fishing_db_place` where place_id='".$input."'";
$result = mysql_query($query,$db_link)
or die("Query failed: Failed to select from fishing_db_fish");
while ($line=mysql_fetch_array($result, MYSQL_ASSOC)){
if ($line['ref_place_id']!='0')
$return_flag=place_path($line['ref_place_id'],$db_link,$server_path);
if ($return_flag==1)
$place_path_output.= " > ";
if ($line['public']==0 && $_SESSION["user"]["user_id"]!="1" && $_SESSION["user"]["user_id"]!="2")
$place_path_output.= "秘位
";
else{
if ($line['x']!=''){
$place_path_output.= "".$line['name']."
";
}else
$place_path_output.= "".$line['name']."";
}
if ($line['public']==1 && $fly_to_upper_location==0){
global $fly_to_upper_location;
$fly_to_upper_location=1;
global $google_map_x;
$google_map_x=$line['x'];
global $google_map_y;
$google_map_y=$line['y'];
global $google_map_zoom;
$google_map_zoom=$line['zoom'];
global $google_map_point_x;
$google_map_point_x=$line['point_x'];
global $google_map_point_y;
$google_map_point_y=$line['point_y'];
}
}
mysql_free_result($result);
return 1;
}
$query = "select * from fishing_db_diary_asoc_place a, fishing_db_place b where a.place_id=b.place_id and a.fishing_diary_id='".$fishing_diary_id."'";
$result = mysql_query($query,$db_link)
or die("Query failed : Failed to select the fishing diary place info from database");
while ($line=mysql_fetch_array($result, MYSQL_ASSOC))
$search_result[count($search_result)]=$line;
mysql_free_result($result);
$query2 = "select start_x,start_y,zoom from `fishing_diary` where fishing_diary_id='".$fishing_diary_id."' ";
$result2 = mysql_query($query2,$db_link)
or die("Query failed : Failed to select the startup map x,y,zoom from database");
while ($line2=mysql_fetch_array($result2, MYSQL_ASSOC))
$start_up=$line2;
mysql_free_result($result2);
// Google Map
?>
// Inlclude the neccessary modules
$_PAGE['title'] = 'Fishing & Scuba Diving Diary 傑仔的釣魚和浮潛日記 ';
$_PAGE['meta_keywords']
= '釣魚 船釣 艇釣 釣點 沉船位 青班 石班 西貢 艇家 魚餌 魚獲圖片 釣魚短片 釣魚電影 魚絲 魚鉤 呔魚 排口 大蝦 八爪 三們仔 塔門';
$page_marquee='
This page is written in Chinese language. Fishing, Diving, lots of fun ! 放生BB魚,保護大自然,大家齊響應!
Protect the natural environment.';
$_page_top_banner='top_banner.jpg';
$site_helper='5.gif';
echo $_USER['browser'];
//$_page_activate_moving_menu=1;
$_page_is_fishing=1;
$_page_fish_uncle='left';
$_page_selected_diary='left';
$_page_fish_search='left';
$_page_place_search='left';
$_page_fish_uncle_boat='left';
$_page_fish_chattabox='left';
include '../modules/default.inc';
$_SESSION["message"]='';
$_SESSION["user"]["site_helper"]='';
if ($fishing_diary_id!="")
echo "";
else
echo "";
// Include the page banner
$page_banner_no_bgcolor=0;
$page_banner='diving.jpg';
include '../modules/page_banner.inc';
if ($_SESSION["user"]["user_id"]!="1" && $_SESSION["user"]["user_id"]!="2"){
if ($with_hunting=='Y'){
if (trim($display_year)=='')
$query = "select display_content,day,month,year,place,image_source,time,title,get,fishing_diary_id,title_image,have_photo,have_movie from `fishing_diary` where display='Y' and diary_type='kit' order by priority desc limit ".$_fishing_diary_display_no_of_entry;
else
$query = "select display_content,day,month,year,place,image_source,time,title,get,fishing_diary_id,title_image,have_photo,have_movie from `fishing_diary` where fishing_diary_id>='".$display_range[0]."' and fishing_diary_id<='".$display_range[1]."' and display='Y' and year='".$display_year."' and diary_type='kit' order by priority desc";
}else{
if (trim($display_year)=='')
$query = "select display_content,day,month,year,place,image_source,time,title,get,fishing_diary_id,title_image,have_photo,have_movie from `fishing_diary` where display='Y' and with_hunting='".$with_hunting."' and diary_type='kit' order by priority desc limit ".$_fishing_diary_display_no_of_entry;
else
$query = "select display_content,day,month,year,place,image_source,time,title,get,fishing_diary_id,title_image,have_photo,have_movie from `fishing_diary` where fishing_diary_id>='".$display_range[0]."' and fishing_diary_id<='".$display_range[1]."' and display='Y' and with_hunting='".$with_hunting."' and year='".$display_year."' and diary_type='kit' order by priority desc";
}
}else{
if (trim($display_year)=='')
$query = "select display_content,day,month,year,place,image_source,time,title,get,fishing_diary_id,title_image,have_photo,have_movie from `fishing_diary` where diary_type='kit' order by priority desc limit ".$_fishing_diary_display_no_of_entry;
else
$query = "select display_content,day,month,year,place,image_source,time,title,get,fishing_diary_id,title_image,have_photo,have_movie from `fishing_diary` where year='".$display_year."' and diary_type='kit' order by priority desc";
}
$result = mysql_query($query,$db_link)
or die("Query failed : Failed to select the fishing diary from database");
while ($line=mysql_fetch_array($result, MYSQL_ASSOC))
$fishing[count($fishing)]=$line;
mysql_free_result($result);
if ($fishing_diary_id!=""){
if ($_SESSION["user"]["user_id"]!="1" && $_SESSION["user"]["user_id"]!="2"){
if ($with_hunting=='Y')
$query = "select * from `fishing_diary` where fishing_diary_id='".$fishing_diary_id."' and display='Y' and diary_type='kit' ";
else
$query = "select * from `fishing_diary` where fishing_diary_id='".$fishing_diary_id."' and display='Y' and with_hunting='".$with_hunting."' and diary_type='kit' ";
}else
$query = "select * from `fishing_diary` where fishing_diary_id='".$fishing_diary_id."' and diary_type='kit' ";
$result = mysql_query($query,$db_link)
or die("Query failed : Failed to select the fishing diary from database");
while ($line=mysql_fetch_array($result, MYSQL_ASSOC))
$fishing_message=$line;
mysql_free_result($result);
}
include $server_path.'/fishing/index_introduction_module.inc';
//helper ("Fishing, Diving, lots of fun !
放生BB魚,保護大自然
","",5);
/*
echo "\n";
echo " | Hello 各位好 ! 又有一件事希望大家幫幫忙了 , 我們有2張$4,000 勝景旅遊 S.K.Y. Travel 的Coupons. 可以用來訂機票,book酒店,旅行團等一切消費, 可惜傑仔和家人未能抽出時間去旅行 ...Coupons不能使用了 ... 使用Coupons的最後期限是31-3-2007, 不過都可以用來book之後的機票. , 真的不想浪費喔.... 如果您有興趣, 我們可以以平價出讓給您 , 請send email 去 kit[dot]fishing[at]gmail[dot]com 聯絡吧! Thank you  |
";
echo "
\n";
*/
// Declare if ok to watch Spearfishing content
$color_flag=1;
title_line("釣魚和潛水歷險旅程 ".$display_year,"Fishing Diary");
echo "\n";
echo " 顯示";
for ($i=(int)date('Y') ; $i>=2004 ; $i--){
if ($display_year==$i)
echo "".$i." ";
else
echo "".$i." ";
}
echo "年的美好回憶 . | ";
echo "";
if ($with_hunting=='Y')
echo "顯示 / 不顯示 內容包含獵魚活動的日記. |
";
else
echo "顯示 / 不顯示 內容包含獵魚活動的日記.";
echo "
\n";
echo "\n";
echo "時間 | 地點 | 主題 | 收穫 | 詳情 |
\n";
echo "
";
for ($i=0 ; $i\n";
echo "";
if ($fishing_diary_id==$fishing[$i]["fishing_diary_id"])
echo " |
\n";
}
if ($fishing_message['fishing_diary_id']!=""){
title_line($fishing_message["day"]."-".$fishing_message["month"]."-".$fishing_message["year"]." ".strip_tags($fishing_message["title"]),"Fishing_Diary_Detail");
echo "\n";
//Declaration
if ($fishing_message["with_hunting"]=='Y')
echo "注意: 這遍日記中紀錄了獵魚的活動. 不顯示內容包含獵魚活動的日記 |
";
echo "Time | ".$fishing_message["time"]." |
";
echo "Place | ";
echo "";
for ($j=0 ;$j";
}
echo " | ";
echo "
";
echo "";
echo "";
echo " |
";
echo "Result | ".$fishing_message["get"]." |
";
if ($fishing_message["description"]!=''){
if ($fishing_message["fishing_diary_id"]>=22){
$fishing_message["description"]=str_replace('[IMG_SOURCE]',$fishing_message["image_source"],$fishing_message["description"]);
$fishing_message["description"]=str_replace('[VIDEO_SOURCE]',$fishing_message["video_source"],$fishing_message["description"]);
//if ($fishing_message["fishing_diary_id"]>=44)
// imagecopymerge ( resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct).
}
$fishing_message["description"]=str_replace('[EMOTION_SOURCE]',$server_path.'/pics/emotics/',$fishing_message["description"]);
//$fishing_message["description"] = preg_replace("/img src/", "table height=100 background", $fishing_message["description"]);
while(1==1){
$extract_part = strstr($fishing_message["description"], '[POSITION(');
if ($extract_part==FALSE){
break;
}else{
$extract_bracket = strpos($extract_part,')');
$retrieve_place_id=substr($extract_part,10,$extract_bracket-10);
$place_path_output='';
place_path((int)$retrieve_place_id,$db_link,$server_path);
$fishing_message["description"] = preg_replace('/\[POSITION\('.$retrieve_place_id.'\)\]/', '傑仔的釣點/潛點資料庫 : '.$place_path_output,$fishing_message["description"]);
}
}
//$fishing_message["description"] = preg_replace('/\[POSITION\([0-9]*\)\]/', 'REPLACED', $fishing_message["description"]);
echo "Detail | ";
if ($_SESSION["user"]["user_id"]=="1" || $_SESSION["user"]["user_id"]=="2")
echo $fishing_message["description"];
else
echo preg_replace("/(a*|w*|[[:print:]]|[[:alpha:]]|[[:digit:]]|[[:graph:]]|\n)*<\/private>/", "", $fishing_message["description"]);
echo " |
";
}
if (($_SESSION["user"]["user_id"]=="1" || $_SESSION["user"]["user_id"]=="2") && $fishing_message["private_description"]!=''){ // User ID 1 is Kit, 2 is kwait
$fishing_message["private_description"]=str_replace('[IMG_SOURCE]',$fishing_message["image_source"],$fishing_message["private_description"]);
$fishing_message["private_description"]=str_replace('[VIDEO_SOURCE]',$fishing_message["video_source"],$fishing_message["private_description"]);
$fishing_message["private_description"]=str_replace('[EMOTION_SOURCE]',$server_path.'/pics/emotics/',$fishing_message["private_description"]);
echo "Private | ";
echo $fishing_message["private_description"];
echo " |
";
}
echo "
";
}
$_PAGE['keywords_search_list_no_of_words']=4000;
$_PAGE['keywords_search_list_range_low']='START_OF_FISHING';
$_PAGE['keywords_search_list_range_high']='END_OF_FISHING';
// Inlclude the neccessary close module
include '../modules/default_close.inc';
?>