From f29775143763606a725565db941e5bfd1acbaaba Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Sat, 5 May 2012 20:01:38 +0200 Subject: diabook-theme: can now set the twitter search term in theme-settings & small fixes --- view/theme/diabook/theme.php | 87 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 67 insertions(+), 20 deletions(-) (limited to 'view/theme/diabook/theme.php') diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index f8fdeb8b1..aef74519f 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -48,7 +48,7 @@ if ($color=="pink") $color_path = "/diabook-pink/"; if ($color=="green") $color_path = "/diabook-green/"; if ($color=="dark") $color_path = "/diabook-dark/"; - + //profile_side at networkpages if ($a->argv[0] === "network" && local_user()){ @@ -80,9 +80,9 @@ if ($color=="dark") $color_path = "/diabook-dark/"; } - $ccCookie = $_COOKIE['close_pages'] + $_COOKIE['close_profiles'] + $_COOKIE['close_helpers'] + $_COOKIE['close_services'] + $_COOKIE['close_friends'] + $_COOKIE['close_twitter'] + $_COOKIE['close_lastusers'] + $_COOKIE['close_lastphotos'] + $_COOKIE['close_lastlikes']; + $ccCookie = $_COOKIE['close_pages'] + $_COOKIE['close_mapquery'] + $_COOKIE['close_profiles'] + $_COOKIE['close_helpers'] + $_COOKIE['close_services'] + $_COOKIE['close_friends'] + $_COOKIE['close_twitter'] + $_COOKIE['close_lastusers'] + $_COOKIE['close_lastphotos'] + $_COOKIE['close_lastlikes']; - if($ccCookie != "9") { + if($ccCookie != "10") { // COMMUNITY diabook_community_info(); @@ -96,7 +96,7 @@ if ($color=="dark") $color_path = "/diabook-dark/"; //right_aside at profile pages if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname']){ - if($ccCookie != "9") { + if($ccCookie != "10") { // COMMUNITY diabook_community_info(); @@ -128,29 +128,65 @@ if ($color=="dark") $color_path = "/diabook-dark/"; $a->page['htmlhead'] .= sprintf('', $twitterJS); } + //load jquery.mapquery.js + $_COOKIE['close_mapquery'] = "1"; + if($_COOKIE['close_mapquery'] != "1") { + $mapqueryJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.mapquery.core.js"; + $a->page['htmlhead'] .= sprintf('', $mapqueryJS); + $openlayersJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/OpenLayers.js"; + $a->page['htmlhead'] .= sprintf('', $openlayersJS); + $qlayersJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.mapquery.mqLayerControl.js"; + $a->page['htmlhead'] .= sprintf('', $mqlayersJS); + + } + $a->page['htmlhead'] .= ' '; - + //check if mapquerybox is active and print + $_COOKIE['close_mapquery'] = "1"; + if($_COOKIE['close_mapquery'] != "1") { + $a->page['htmlhead'] .= ' + '; + } //check if twitterbox is active and print if($_COOKIE['close_twitter'] != "1") { + $TSearchTerm=false; + $site_TSearchTerm = get_config("diabook", "TSearchTerm" ); + $TSearchTerm = get_pconfig(local_user(), "diabook", "TSearchTerm"); + if ($TSearchTerm===false) $TSearchTerm=$site_TSearchTerm; + if ($TSearchTerm===false) $TSearchTerm="friendica"; $a->page['htmlhead'] .= ' ';} //check if community_home-plugin is activated and change css @@ -579,6 +581,21 @@ if ($color=="dark") $color_path = "/diabook-dark/"; $aside['$con_services'] = $con_services; } //end connectable services + //twitter + if($_COOKIE['close_twitter'] != "1") { + $twitter = array(); + $twitter['title'] = Array("", "".t('Last Tweets')."", "", ""); + $aside['$twitter'] = $twitter; + $TSearchTerm = get_pconfig(local_user(), 'diabook', 'TSearchTerm' ); + $aside['$submit'] = t('Submit'); + $aside['$TSearchTerm'] = array('diabook_TSearchTerm', t('Set twitter search term'), $TSearchTerm, '', $TSearchTerm); + $baseurl = $a->get_baseurl(); + $aside['$baseurl'] = $baseurl; + if (isset($_POST['diabook-settings-submit'])){ + set_pconfig(local_user(), 'diabook', 'TSearchTerm', $_POST['diabook_TSearchTerm']); + } + } + //end twitter $close = t('Close'); $aside['$close'] = $close; //get_baseurl @@ -599,4 +616,5 @@ if ($color=="dark") $color_path = "/diabook-dark/"; $tpl = file_get_contents(dirname(__file__) . '/bottom.tpl'); $a->page['footer'] = $a->page['footer'].replace_macros($tpl, $bottom); } - + + -- cgit v1.2.3 From e1ab3a93cc450ca52c7651ecca8cad8334e5f1ce Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Sun, 6 May 2012 00:36:46 +0200 Subject: diabook-theme: small fix --- view/theme/diabook/theme.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/theme/diabook/theme.php') diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index afc8983db..2880df2d5 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -285,7 +285,7 @@ if ($color=="dark") $color_path = "/diabook-dark/"; if($.cookie("close_twitter") == "1") { - document.getElementById( "twitter" ).style.display = "none"; + document.getElementById( "close_twitter" ).style.display = "none"; }; if($.cookie("close_lastusers") == "1") @@ -336,7 +336,7 @@ if ($color=="dark") $color_path = "/diabook-dark/"; }; function close_twitter(){ - document.getElementById( "twitter" ).style.display = "none"; + document.getElementById( "close_twitter" ).style.display = "none"; $.cookie("close_twitter","1", { expires: 365, path: "/" }); }; -- cgit v1.2.3