Skip to content

Commit

Permalink
#76 更新 analytics tag
Browse files Browse the repository at this point in the history
  • Loading branch information
happyman committed Sep 30, 2023
1 parent ec201a2 commit 116629c
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 47 deletions.
10 changes: 10 additions & 0 deletions twmap3/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
$('#openwin').html('<a href="<?php echo $site_html_root; ?>" target=_top>獨立視窗</a>');
}
});

</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q1DHK68EH5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-Q1DHK68EH5');

</script>
<body><hr>
<div id="footer" title="About" name="footer">
Expand Down
11 changes: 8 additions & 3 deletions twmap3/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,6 @@ function gtag(){dataLayer.push(arguments);}
<div id="msg" style="background-color: white;">
</div>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19949015-1']);
_gaq.push(['_trackPageview']);
$(function() {
$.getScript( "js/main.js?ts=<?php echo time();?>" ).done(function() {
initialize();
Expand All @@ -325,6 +322,14 @@ function gtag(){dataLayer.push(arguments);}
});

});
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q1DHK68EH5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-Q1DHK68EH5');

</script>
</body>
Expand Down
8 changes: 8 additions & 0 deletions twmap_gen/api/poi_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@
<!--// https://datatables.net/download/ include jquery 3 -->
<link href="https://cdn.datatables.net/v/dt/jq-3.6.0/dt-1.13.4/datatables.min.css" rel="stylesheet"/>
<script src="https://cdn.datatables.net/v/dt/jq-3.6.0/dt-1.13.4/datatables.min.js"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q1DHK68EH5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-Q1DHK68EH5');

</script>
<style>
html {
font-size: 17px;
Expand Down
2 changes: 1 addition & 1 deletion twmap_gen/mapform.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

$smarty->assign("title", "產生地圖");
echo $smarty->fetch('mapform.html');

echo $smarty->fetch('analytics.html');
?>

<script type="text/javascript">
Expand Down
2 changes: 2 additions & 0 deletions twmap_gen/pages/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,5 @@
2004/4/10 v1.0 第一版可以抓出地圖, 加上座標, 需手動切圖 -- thanx to hsunwei
2004/4/2 beta 存入 sorted index, 以加速搜尋.
</pre>

{include "analytics.html"}
Empty file added twmap_gen/pages/analytics.html
Empty file.
1 change: 1 addition & 0 deletions twmap_gen/pages/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,4 @@
}
}
</script>
{include "analytics.html"}
2 changes: 1 addition & 1 deletion twmap_gen/pages/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<!-- build:js js/twmap.js -->
<script src="js/twmap.js"></script>
<!-- endbuild -->

{include "analytics.html"}

</body>
</html>
2 changes: 1 addition & 1 deletion twmap_gen/pages/mapform.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@
請將此圖加上敘述
</div>
<div id="makeprogress" style="width: 100%"><span class="psLabel" style="color: black;font-weight: bold; text-shadow: 1px 1px 0 #fff; position: absolute; left: 50%;"></span>
</div>
</div>
70 changes: 29 additions & 41 deletions twmap_gen/show.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,38 +39,30 @@
$smarty->assign("site_root_url", $site_url . $site_html_root);
// $smarty->assign("ogimage", array("thumb.php?mid=$mid&size=s", "thumb.php?mid=$mid&size=m", "thumb.php?mid=$mid&size=l"));
$smarty->assign("html_head", $html_head);
if ($html_head == 1 ) {
echo $smarty->fetch("header.html");
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == 1 ) {
$smarty->assign("user_icon", 'imgs/icon_'.$_SESSION['mylogin']['type']. '.png');
$smarty->assign("user_email", $_SESSION['mylogin']['email'] );
$smarty->assign("user_nickname", $_SESSION['mylogin']['nick'] );
$smarty->assign("lastest_mid", "&mid=$mid" );
$smarty->assign("initial_tab", 3 );
$smarty->assign("browser_url", $TWMAP3URL );
$smarty->assign("loggedin", 1);
} else { // 沒有登入
// require_once('lib/fb/facebook.php');
//require_once('lib/xuite.php');
$smarty->assign("lastest_mid", "&mid=$mid" );
$smarty->assign("initial_tab", 2 );
$smarty->assign("showing", true );
$smarty->assign("browser_url", $TWMAP3URL );
$smarty->assign("loggedin", 0);
// $smarty->assign("login_xuite", $xuite->getLoginUrl());
/* $smarty->assign("login_fb",
$facebook->getLoginUrl( array(
'canvas' => 0,
'fbconnect' => 1,
'req_perms' => 'email'
if ($html_head == 1 ) {
echo $smarty->fetch("header.html");
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == 1 ) {
$smarty->assign("user_icon", 'imgs/icon_'.$_SESSION['mylogin']['type']. '.png');
$smarty->assign("user_email", $_SESSION['mylogin']['email'] );
$smarty->assign("user_nickname", $_SESSION['mylogin']['nick'] );
$smarty->assign("lastest_mid", "&mid=$mid" );
$smarty->assign("initial_tab", 3 );
$smarty->assign("browser_url", $TWMAP3URL );
$smarty->assign("loggedin", 1);
} else { // 沒有登入
// require_once('lib/fb/facebook.php');
//require_once('lib/xuite.php');
$smarty->assign("lastest_mid", "&mid=$mid" );
$smarty->assign("initial_tab", 2 );
$smarty->assign("showing", true );
$smarty->assign("browser_url", $TWMAP3URL );
$smarty->assign("loggedin", 0);

)));
*/
$smarty->assign("user_icon", "imgs/icon-map.png");
}
echo $smarty->fetch("main.html");
exit;
}
$smarty->assign("user_icon", "imgs/icon-map.png");
}
echo $smarty->fetch("main.html");
exit;
}

$smarty->assign('map',$map);
$gpx_link = $site_url . str_replace($out_root,$out_html_root,sprintf("%s%d/%s_p.gpx",$map['path'],$map['tid'],$map['md5name']));
Expand All @@ -88,8 +80,10 @@
$links['page'] = pagelink($map);
$smarty->assign('links',$links);
$smarty->display('show_track.html');
echo $smarty->fetch("analytics.html");
exit(0);
}
} // end of mid < 0

// 3. 顯示地圖
// $html_root = $out_html_root . sprintf("/%06d/%d", $map['uid'],$mid);
$html_root = $out_html_root . str_replace($out_root, "", dirname($map['filename']));
Expand Down Expand Up @@ -123,15 +117,6 @@
$smarty->assign("showing", true );
$smarty->assign("browser_url", $TWMAP3URL );
$smarty->assign("loggedin", 0);
// $smarty->assign("login_xuite", $xuite->getLoginUrl());
/* $smarty->assign("login_fb",
$facebook->getLoginUrl( array(
'canvas' => 0,
'fbconnect' => 1,
'req_perms' => 'email'
)));
*/
$smarty->assign("user_icon", "imgs/icon-map.png");
}
echo $smarty->fetch("main.html");
Expand All @@ -144,6 +129,7 @@
map_accessed($mid);
$smarty->assign('map',$map);
$smarty->display('show_deleted.html');
echo $smarty->fetch("analytics.html");
exit;
break;
case 1:
Expand All @@ -158,6 +144,7 @@
$smarty->assign('map',$map);
$smarty->assign('links',$links);
$smarty->display('show_expired.html');
echo $smarty->fetch("analytics.html");
exit;
break;
case 0:
Expand Down Expand Up @@ -237,6 +224,7 @@
$smarty->assign("map",$map);
$smarty->assign("links",$links);
$smarty->display("show_ok.html");
echo $smarty->fetch("analytics.html");
exit;
// ad();
//footer();
Expand Down

0 comments on commit 116629c

Please sign in to comment.