diabook-theme: can now set the twitter search term in theme-settings & small fixes

This commit is contained in:
tommy tomson 2012-05-05 20:01:38 +02:00
parent 8ae83201cf
commit f297751437
8 changed files with 4013 additions and 33 deletions

View File

@ -8,10 +8,9 @@
<div>$page</div> <div>$page</div>
{{ endif }} {{ endif }}
<div id="close_profiles"> <div id="close_profiles">
{{ if $comunity_profilest_title }} {{ if $comunity_profilest_title }}
<h3>$comunity_profilest_title<a id="close_comunity_profiles_icon" onClick="close_profiles()" class="icon close_box" title="close"></a></h3> <h3>$comunity_profilest_title<a id="close_comunity_profiles_icon" onClick="close_profiles()" class="icon close_box" title="$close"></a></h3>
<div id='lastusers-wrapper' class='items-wrapper'> <div id='lastusers-wrapper' class='items-wrapper'>
{{ for $comunity_profiles_items as $i }} {{ for $comunity_profiles_items as $i }}
$i $i
@ -22,7 +21,7 @@
<div id="close_helpers"> <div id="close_helpers">
{{ if $helpers }} {{ if $helpers }}
<h3>$helpers.title.1<a id="close_helpers_icon" onClick="close_helpers()" class="icon close_box" title="close"></a></h3> <h3>$helpers.title.1<a id="close_helpers_icon" onClick="close_helpers()" class="icon close_box" title="$close"></a></h3>
<a href="http://kakste.com/profile/newhere" title="@NewHere" style="margin-left: 10px; " target="blank">NewHere</a><br> <a href="http://kakste.com/profile/newhere" title="@NewHere" style="margin-left: 10px; " target="blank">NewHere</a><br>
<a href="https://helpers.pyxis.uberspace.de/profile/helpers" style="margin-left: 10px; " title="Friendica Support" target="blank">Friendica Support</a><br> <a href="https://helpers.pyxis.uberspace.de/profile/helpers" style="margin-left: 10px; " title="Friendica Support" target="blank">Friendica Support</a><br>
<a href="https://letstalk.pyxis.uberspace.de/profile/letstalk" style="margin-left: 10px; " title="Let's talk" target="blank">Let's talk</a><br> <a href="https://letstalk.pyxis.uberspace.de/profile/letstalk" style="margin-left: 10px; " title="Let's talk" target="blank">Let's talk</a><br>
@ -32,7 +31,7 @@
<div id="close_services"> <div id="close_services">
{{ if $con_services }} {{ if $con_services }}
<h3>$con_services.title.1<a id="close_services_icon" onClick="close_services()" class="icon close_box" title="close"></a></h3> <h3>$con_services.title.1<a id="close_services_icon" onClick="close_services()" class="icon close_box" title="$close"></a></h3>
<div id="right_service_icons" style="margin-left: 16px; margin-top: 5px;"> <div id="right_service_icons" style="margin-left: 16px; margin-top: 5px;">
<a href="$url/facebook"><img alt="Facebook" src="view/theme/diabook/icons/facebook.png" title="Facebook"></a> <a href="$url/facebook"><img alt="Facebook" src="view/theme/diabook/icons/facebook.png" title="Facebook"></a>
<a href="$url/settings/connectors"><img alt="StatusNet" src="view/theme/diabook/icons/StatusNet.png?" title="StatusNet"></a> <a href="$url/settings/connectors"><img alt="StatusNet" src="view/theme/diabook/icons/StatusNet.png?" title="StatusNet"></a>
@ -48,7 +47,7 @@
<div id="close_friends" style="margin-bottom:53px;"> <div id="close_friends" style="margin-bottom:53px;">
{{ if $nv }} {{ if $nv }}
<h3>$nv.title.1<a id="close_friends_icon" onClick="close_friends()" class="icon close_box" title="close"></a></h3> <h3>$nv.title.1<a id="close_friends_icon" onClick="close_friends()" class="icon close_box" title="$close"></a></h3>
<a class="$nv.directory.2" href="$nv.directory.0" style="margin-left: 10px; " title="$nv.directory.3" >$nv.directory.1</a><br> <a class="$nv.directory.2" href="$nv.directory.0" style="margin-left: 10px; " title="$nv.directory.3" >$nv.directory.1</a><br>
<a class="$nv.global_directory.2" href="$nv.global_directory.0" target="blank" style="margin-left: 10px; " title="$nv.global_directory.3" >$nv.global_directory.1</a><br> <a class="$nv.global_directory.2" href="$nv.global_directory.0" target="blank" style="margin-left: 10px; " title="$nv.global_directory.3" >$nv.global_directory.1</a><br>
<a class="$nv.match.2" href="$nv.match.0" style="margin-left: 10px; " title="$nv.match.3" >$nv.match.1</a><br> <a class="$nv.match.2" href="$nv.match.0" style="margin-left: 10px; " title="$nv.match.3" >$nv.match.1</a><br>
@ -60,7 +59,7 @@ $nv.search
<div id="close_lastusers"> <div id="close_lastusers">
{{ if $lastusers_title }} {{ if $lastusers_title }}
<h3>$lastusers_title<a id="close_lastusers_icon" onClick="close_lastusers()" class="icon close_box" title="close"></a></h3> <h3>$lastusers_title<a id="close_lastusers_icon" onClick="close_lastusers()" class="icon close_box" title="$close"></a></h3>
<div id='lastusers-wrapper' class='items-wrapper'> <div id='lastusers-wrapper' class='items-wrapper'>
{{ for $lastusers_items as $i }} {{ for $lastusers_items as $i }}
$i $i
@ -80,7 +79,7 @@ $nv.search
<div id="close_lastphotos"> <div id="close_lastphotos">
{{ if $photos_title }} {{ if $photos_title }}
<h3>$photos_title<a id="close_photos_icon" onClick="close_lastphotos()" class="icon close_box" title="close"></a></h3> <h3>$photos_title<a id="close_photos_icon" onClick="close_lastphotos()" class="icon close_box" title="$close"></a></h3>
<div id='ra-photos-wrapper' class='items-wrapper'> <div id='ra-photos-wrapper' class='items-wrapper'>
{{ for $photos_items as $i }} {{ for $photos_items as $i }}
$i $i
@ -91,7 +90,7 @@ $nv.search
<div id="close_lastlikes"> <div id="close_lastlikes">
{{ if $like_title }} {{ if $like_title }}
<h3>$like_title<a id="close_lastlikes_icon" onClick="close_lastlikes()" class="icon close_box" title="close"></a></h3> <h3>$like_title<a id="close_lastlikes_icon" onClick="close_lastlikes()" class="icon close_box" title="$close"></a></h3>
<ul id='likes'> <ul id='likes'>
{{ for $like_items as $i }} {{ for $like_items as $i }}
<li id='ra-photos-wrapper'>$i</li> <li id='ra-photos-wrapper'>$i</li>
@ -102,4 +101,18 @@ $nv.search
<div id="twitter"> <div id="twitter">
</div> </div>
<div id="close_mapquery">
{{ if $mapquery }}
<h3>$mapquery.title.1<a id="close_mapquery_icon" onClick="close_mapquery()" class="icon close_box" title="$close"></a></h3>
<div id="map" style="height:170px;width:170px;margin-top:3px;margin-bottom:1px;">
</div>
<div style="font-size:9px;">Data CC-By-SA by <a href="http://openstreetmap.org/">OpenStreetMap</a></div>
<div id="#mapcontrol" style="display:none;" class="lightbox">
hallo welt
<div id="map2" style="height:370px;width:370px;margin-top:3px;margin-bottom:1px;">
</div>
</div>
{{ endif }}
</div>
</div> </div>

View File

@ -13,8 +13,9 @@ function theme_content(&$a){
$line_height = get_pconfig(local_user(), 'diabook', 'line_height' ); $line_height = get_pconfig(local_user(), 'diabook', 'line_height' );
$resolution = get_pconfig(local_user(), 'diabook', 'resolution' ); $resolution = get_pconfig(local_user(), 'diabook', 'resolution' );
$color = get_pconfig(local_user(), 'diabook', 'color' ); $color = get_pconfig(local_user(), 'diabook', 'color' );
$TSearchTerm = get_pconfig(local_user(), 'diabook', 'TSearchTerm' );
return diabook_form($a,$font_size, $line_height, $resolution, $color); return diabook_form($a,$font_size, $line_height, $resolution, $color, $TSearchTerm);
} }
function theme_post(&$a){ function theme_post(&$a){
@ -26,6 +27,7 @@ function theme_post(&$a){
set_pconfig(local_user(), 'diabook', 'line_height', $_POST['diabook_line_height']); set_pconfig(local_user(), 'diabook', 'line_height', $_POST['diabook_line_height']);
set_pconfig(local_user(), 'diabook', 'resolution', $_POST['diabook_resolution']); set_pconfig(local_user(), 'diabook', 'resolution', $_POST['diabook_resolution']);
set_pconfig(local_user(), 'diabook', 'color', $_POST['diabook_color']); set_pconfig(local_user(), 'diabook', 'color', $_POST['diabook_color']);
set_pconfig(local_user(), 'diabook', 'TSearchTerm', $_POST['diabook_TSearchTerm']);
} }
} }
@ -35,8 +37,9 @@ function theme_admin(&$a){
$line_height = get_config('diabook', 'line_height' ); $line_height = get_config('diabook', 'line_height' );
$resolution = get_config('diabook', 'resolution' ); $resolution = get_config('diabook', 'resolution' );
$color = get_config('diabook', 'color' ); $color = get_config('diabook', 'color' );
$TSearchTerm = get_config('diabook', 'TSearchTerm' );
return diabook_form($a,$font_size, $line_height, $resolution, $color); return diabook_form($a,$font_size, $line_height, $resolution, $color, $TSearchTerm);
} }
function theme_admin_post(&$a){ function theme_admin_post(&$a){
@ -45,11 +48,12 @@ function theme_admin_post(&$a){
set_config('diabook', 'line_height', $_POST['diabook_line_height']); set_config('diabook', 'line_height', $_POST['diabook_line_height']);
set_config('diabook', 'resolution', $_POST['diabook_resolution']); set_config('diabook', 'resolution', $_POST['diabook_resolution']);
set_config('diabook', 'color', $_POST['diabook_color']); set_config('diabook', 'color', $_POST['diabook_color']);
set_config('diabook', 'TSearchTerm', $_POST['diabook_TSearchTerm']);
} }
} }
function diabook_form(&$a, $font_size, $line_height, $resolution, $color){ function diabook_form(&$a, $font_size, $line_height, $resolution, $color, $TSearchTerm){
$line_heights = array( $line_heights = array(
"1.3"=>"1.3", "1.3"=>"1.3",
"---"=>"---", "---"=>"---",
@ -95,6 +99,7 @@ function diabook_form(&$a, $font_size, $line_height, $resolution, $color){
'$line_height' => array('diabook_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights), '$line_height' => array('diabook_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights),
'$resolution' => array('diabook_resolution', t('Set resolution for middle column'), $resolution, '', $resolutions), '$resolution' => array('diabook_resolution', t('Set resolution for middle column'), $resolution, '', $resolutions),
'$color' => array('diabook_color', t('Set color scheme'), $color, '', $colors), '$color' => array('diabook_color', t('Set color scheme'), $color, '', $colors),
'$TSearchTerm' => array('diabook_TSearchTerm', t('Set twitter search term'), $TSearchTerm, '', $TSearchTerm),
)); ));
return $o; return $o;
} }

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@
opts.title = opts.term; opts.title = opts.term;
opts.title = opts.title || ''; opts.title = opts.title || '';
text = opts.titleLink ? ('<a href="'+ opts.titleLink +'">'+ opts.title + '</a>') : ('<span>' + opts.title +'<a id="close_friends_icon" onClick="close_twitter()" class="icon close_box" title="close"></a>'+ '</span>'); text = opts.titleLink ? ('<a href="'+ opts.titleLink +'">'+ opts.title + '</a>') : ('<span>' + opts.title +'<a id="close_friends_icon" onClick="close_twitter()" class="icon close_box" title="$close"></a>'+ '</span>');
$text = $(text); $text = $(text);
if (opts.titleLink) if (opts.titleLink)
$text.css(opts.css['titleLink']); $text.css(opts.css['titleLink']);

View File

@ -1,4 +1,4 @@
<a class="embed_yt" href='$embedurl' onclick='this.innerHTML=Base64.decode("$escapedhtml"); yt_iframe();javascript:$(this).parent().css("height", "370px"); return false;' style='float:left; margin: 1em; position: relative;'> <a class="embed_yt" href='$embedurl' onclick='this.innerHTML=Base64.decode("$escapedhtml"); yt_iframe();javascript:$(this).parent().css("height", "450px"); return false;' style='float:left; margin: 1em; position: relative;'>
<img width='$tw' height='$th' src='$turl' > <img width='$tw' height='$th' src='$turl' >
<div style='position: absolute; top: 0px; left: 0px; width: $twpx; height: $thpx; background: url(images/icons/48/play.png) no-repeat center center;'></div> <div style='position: absolute; top: 0px; left: 0px; width: $twpx; height: $thpx; background: url(images/icons/48/play.png) no-repeat center center;'></div>
</a> </a>

View File

@ -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 // COMMUNITY
diabook_community_info(); diabook_community_info();
@ -96,7 +96,7 @@ if ($color=="dark") $color_path = "/diabook-dark/";
//right_aside at profile pages //right_aside at profile pages
if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname']){ if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname']){
if($ccCookie != "9") { if($ccCookie != "10") {
// COMMUNITY // COMMUNITY
diabook_community_info(); diabook_community_info();
@ -128,29 +128,65 @@ if ($color=="dark") $color_path = "/diabook-dark/";
$a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $twitterJS); $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $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('<script language="JavaScript" src="%s" ></script>', $mapqueryJS);
$openlayersJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/OpenLayers.js";
$a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $openlayersJS);
$qlayersJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.mapquery.mqLayerControl.js";
$a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $mqlayersJS);
}
$a->page['htmlhead'] .= ' $a->page['htmlhead'] .= '
<script> <script>
$(function() { $(function() {
$("a.lightbox").fancybox(); // Select all links with lightbox class $("a.lightbox").fancybox(); // Select all links with lightbox class
$("div.lightbox").fancybox();
}); });
$(window).load(function() { $(window).load(function() {
var footer_top = $(document).height() - 30; var footer_top = $(document).height() - 30;
$("div#footerbox").attr("style", "border-top: 1px solid #D2D2D2; width: 70%;right: 15%;position: absolute;top:"+footer_top+"px;"); $("div#footerbox").attr("style", "border-top: 1px solid #D2D2D2; width: 70%;right: 15%;position: absolute;top:"+footer_top+"px;");
}); });
</script>'; </script>';
//check if mapquerybox is active and print
$_COOKIE['close_mapquery'] = "1";
if($_COOKIE['close_mapquery'] != "1") {
$a->page['htmlhead'] .= '
<script>
$(document).ready(function() {
$("#map").mapQuery({
layers:[{ //add layers to your map; you need to define at least one to be able to see anything on the map
type:"osm" //add a layer of the type osm (OpenStreetMap)
}]
});
$("#map2").mapQuery({
layers:[{ //add layers to your map; you need to define at least one to be able to see anything on the map
type:"osm" //add a layer of the type osm (OpenStreetMap)
}]
});
});
</script>';
}
//check if twitterbox is active and print //check if twitterbox is active and print
if($_COOKIE['close_twitter'] != "1") { 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'] .= ' $a->page['htmlhead'] .= '
<script> <script>
$(function() { $(function() {
$("#twitter").twitterSearch({ $("#twitter").twitterSearch({
term: "friendica", term: "'.$TSearchTerm.'",
animInSpeed: 250, animInSpeed: 250,
bird: false, bird: false,
avatar: false, avatar: false,
@ -187,6 +223,7 @@ if ($color=="dark") $color_path = "/diabook-dark/";
<script> <script>
function restore_boxes(){ function restore_boxes(){
$.cookie("close_pages","2", { expires: 365, path: "/" }); $.cookie("close_pages","2", { expires: 365, path: "/" });
$.cookie("close_mapquery","2", { expires: 365, path: "/" });
$.cookie("close_helpers","2", { expires: 365, path: "/" }); $.cookie("close_helpers","2", { expires: 365, path: "/" });
$.cookie("close_profiles","2", { expires: 365, path: "/" }); $.cookie("close_profiles","2", { expires: 365, path: "/" });
$.cookie("close_services","2", { expires: 365, path: "/" }); $.cookie("close_services","2", { expires: 365, path: "/" });
@ -219,6 +256,11 @@ if ($color=="dark") $color_path = "/diabook-dark/";
document.getElementById( "close_pages" ).style.display = "none"; document.getElementById( "close_pages" ).style.display = "none";
}; };
if($.cookie("close_mapquery") == "1")
{
document.getElementById( "close_mapquery" ).style.display = "none";
};
if($.cookie("close_profiles") == "1") if($.cookie("close_profiles") == "1")
{ {
document.getElementById( "close_profiles" ).style.display = "none"; document.getElementById( "close_profiles" ).style.display = "none";
@ -266,6 +308,11 @@ if ($color=="dark") $color_path = "/diabook-dark/";
$.cookie("close_pages","1", { expires: 365, path: "/" }); $.cookie("close_pages","1", { expires: 365, path: "/" });
}; };
function close_mapquery(){
document.getElementById( "close_mapquery" ).style.display = "none";
$.cookie("close_mapquery","1", { expires: 365, path: "/" });
};
function close_profiles(){ function close_profiles(){
document.getElementById( "close_profiles" ).style.display = "none"; document.getElementById( "close_profiles" ).style.display = "none";
$.cookie("close_profiles","1", { expires: 365, path: "/" }); $.cookie("close_profiles","1", { expires: 365, path: "/" });
@ -509,6 +556,15 @@ if ($color=="dark") $color_path = "/diabook-dark/";
}} }}
//END Community Page //END Community Page
//mapquery
$_COOKIE['close_mapquery'] = "1";
if($_COOKIE['close_mapquery'] != "1") {
$mapquery = array();
$mapquery['title'] = Array("", t('Earth View'), "", "");
$aside['$mapquery'] = $mapquery;
}
//end mapquery
//helpers //helpers
if($_COOKIE['close_helpers'] != "1") { if($_COOKIE['close_helpers'] != "1") {
$helpers = array(); $helpers = array();
@ -523,6 +579,8 @@ if ($color=="dark") $color_path = "/diabook-dark/";
$aside['$con_services'] = $con_services; $aside['$con_services'] = $con_services;
} }
//end connectable services //end connectable services
$close = t('Close');
$aside['$close'] = $close;
//get_baseurl //get_baseurl
$url = $a->get_baseurl($ssl_state); $url = $a->get_baseurl($ssl_state);
$aside['$url'] = $url; $aside['$url'] = $url;
@ -542,14 +600,3 @@ if ($color=="dark") $color_path = "/diabook-dark/";
$a->page['footer'] = $a->page['footer'].replace_macros($tpl, $bottom); $a->page['footer'] = $a->page['footer'].replace_macros($tpl, $bottom);
} }

View File

@ -6,6 +6,8 @@
{{inc field_select.tpl with $field=$resolution}}{{endinc}} {{inc field_select.tpl with $field=$resolution}}{{endinc}}
{{inc field_input.tpl with $field=$TSearchTerm}}{{endinc}}
<div class="field select"> <div class="field select">
<a onClick="restore_boxes()" title="Restore right-hand column" style="cursor: pointer;">Restore right-hand column</a> <a onClick="restore_boxes()" title="Restore right-hand column" style="cursor: pointer;">Restore right-hand column</a>
</div> </div>