aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon L'nu <simon.lnu@gmail.com>2012-03-06 14:51:14 -0500
committerSimon L'nu <simon.lnu@gmail.com>2012-03-06 14:51:14 -0500
commitd647dbc6af33689d0baf4bafd72031d06dcf7577 (patch)
treeafd4db159aa0b36bdb1e8f17581283843bd9bcd5
parent2a3aaca88ded68a8ce926577d3faea2f3ef0ab50 (diff)
parenta9690dfe2d9358fcbb156644df2d12099ff798c4 (diff)
downloadvolse-hubzilla-d647dbc6af33689d0baf4bafd72031d06dcf7577.tar.gz
volse-hubzilla-d647dbc6af33689d0baf4bafd72031d06dcf7577.tar.bz2
volse-hubzilla-d647dbc6af33689d0baf4bafd72031d06dcf7577.zip
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master: remove "smilie" expansion for Diaspora logo prevent duplicate likes quattro: theme settings (a bit hackish) add img fixes in diabook finalise spam storage model, begin driver changes. fixes template proc: add variable filters * master:
-rw-r--r--images/bug-x.gifbin0 -> 134 bytes
-rwxr-xr-xinclude/items.php25
-rwxr-xr-xinclude/text.php4
-rw-r--r--library/spam/b8/storage/storage_frndc.php34
-rw-r--r--view/theme/diabook/icons/bug-x.gifbin0 -> 134 bytes
-rw-r--r--view/theme/diabook/icons/community.pngbin0 -> 475 bytes
-rw-r--r--view/theme/diabook/icons/dislike.pngbin385 -> 386 bytes
-rw-r--r--[-rwxr-xr-x]view/theme/diabook/icons/globe.pngbin875 -> 1361 bytes
-rw-r--r--view/theme/diabook/icons/language.pngbin0 -> 849 bytes
-rw-r--r--view/theme/diabook/icons/like.pngbin393 -> 388 bytes
-rw-r--r--view/theme/diabook/nav.tpl29
-rw-r--r--view/theme/diabook/style.css22
-rw-r--r--view/theme/quattro/theme.php46
-rw-r--r--view/theme/quattro/theme_settings.tpl11
14 files changed, 155 insertions, 16 deletions
diff --git a/images/bug-x.gif b/images/bug-x.gif
new file mode 100644
index 000000000..10936caa7
--- /dev/null
+++ b/images/bug-x.gif
Binary files differ
diff --git a/include/items.php b/include/items.php
index 3c55fbb4f..fdff6b642 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1595,6 +1595,14 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
if((activity_match($datarray['verb'],ACTIVITY_LIKE)) || (activity_match($datarray['verb'],ACTIVITY_DISLIKE))) {
$datarray['type'] = 'activity';
$datarray['gravity'] = GRAVITY_LIKE;
+ // only one like or dislike per person
+ $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1",
+ intval($datarray['uid']),
+ intval($datarray['contact-id']),
+ dbesc($datarray['verb'])
+ );
+ if($r && count($r))
+ continue;
}
if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) {
@@ -2148,6 +2156,14 @@ function local_delivery($importer,$data) {
$datarray['type'] = 'activity';
$datarray['gravity'] = GRAVITY_LIKE;
$datarray['last-child'] = 0;
+ // only one like or dislike per person
+ $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1",
+ intval($datarray['uid']),
+ intval($datarray['contact-id']),
+ dbesc($datarray['verb'])
+ );
+ if($r && count($r))
+ continue;
}
if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) {
@@ -2297,6 +2313,15 @@ function local_delivery($importer,$data) {
if(($datarray['verb'] == ACTIVITY_LIKE) || ($datarray['verb'] == ACTIVITY_DISLIKE)) {
$datarray['type'] = 'activity';
$datarray['gravity'] = GRAVITY_LIKE;
+ // only one like or dislike per person
+ $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1",
+ intval($datarray['uid']),
+ intval($datarray['contact-id']),
+ dbesc($datarray['verb'])
+ );
+ if($r && count($r))
+ continue;
+
}
if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) {
diff --git a/include/text.php b/include/text.php
index 042ee982c..c8c03174e 100755
--- a/include/text.php
+++ b/include/text.php
@@ -737,7 +737,7 @@ function smilies($s, $sample = false) {
':headdesk',
'~friendika',
'~friendica',
- 'Diaspora*'
+// 'Diaspora*'
);
$icons = array(
@@ -778,7 +778,7 @@ function smilies($s, $sample = false) {
'<img src="' . $a->get_baseurl() . '/images/smiley-bangheaddesk.gif" alt=":headdesk" />',
'<a href="http://project.friendika.com">~friendika <img src="' . $a->get_baseurl() . '/images/friendika-16.png" alt="~friendika" /></a>',
'<a href="http://friendica.com">~friendica <img src="' . $a->get_baseurl() . '/images/friendica-16.png" alt="~friendica" /></a>',
- '<a href="http://diasporafoundation.org">Diaspora<img src="' . $a->get_baseurl() . '/images/diaspora.png" alt="Diaspora*" /></a>',
+// '<a href="http://diasporafoundation.org">Diaspora<img src="' . $a->get_baseurl() . '/images/diaspora.png" alt="Diaspora*" /></a>',
);
diff --git a/library/spam/b8/storage/storage_frndc.php b/library/spam/b8/storage/storage_frndc.php
index 7702c108b..62909d471 100644
--- a/library/spam/b8/storage/storage_frndc.php
+++ b/library/spam/b8/storage/storage_frndc.php
@@ -174,20 +174,44 @@ class b8_storage_frndc extends b8_storage_base
array_push($where, $token);
}
- $where = 'token IN ("' . implode('", "', $where) . '")';
+ $where = 'term IN ("' . implode('", "', $where) . '")';
}
else {
$token = dbesc($token);
- $where = 'token = "' . $token . '"';
+ $where = 'term = "' . $token . '"';
}
# ... and fetch the data
$result = q('
- SELECT *
- FROM ' . $this->config['table_name'] . '
- WHERE ' . $where . ' AND uid = ' . $uid );
+ SELECT * FROM spam WHERE ' . $where . ' AND uid = ' . $uid );
+
+
+ $returned_tokens = array();
+ if(count($result)) {
+ foreach($result as $rr)
+ $returned_tokens[] = $rr['term'];
+ }
+ $to_create = array();
+
+ if(count($tokens) > 0) {
+ foreach($tokens as $token)
+ if(! in_array($token,$returned_tokens))
+ $to_create[] = str_tolower($token);
+ }
+ if(count($to_create)) {
+ $sql = '';
+ foreach($to_create as $term) {
+ if(strlen($sql))
+ $sql .= ',';
+ $sql .= sprintf("(term,datetime,uid) values('%s','%s',%d)",
+ dbesc(str_tolower($term))
+ dbesc(datetime_convert()),
+ intval($uid)
+ );
+ q("insert into spam " . $sql);
+ }
return $result;
diff --git a/view/theme/diabook/icons/bug-x.gif b/view/theme/diabook/icons/bug-x.gif
new file mode 100644
index 000000000..10936caa7
--- /dev/null
+++ b/view/theme/diabook/icons/bug-x.gif
Binary files differ
diff --git a/view/theme/diabook/icons/community.png b/view/theme/diabook/icons/community.png
new file mode 100644
index 000000000..7c91e8b75
--- /dev/null
+++ b/view/theme/diabook/icons/community.png
Binary files differ
diff --git a/view/theme/diabook/icons/dislike.png b/view/theme/diabook/icons/dislike.png
index fcf340258..23de426c5 100644
--- a/view/theme/diabook/icons/dislike.png
+++ b/view/theme/diabook/icons/dislike.png
Binary files differ
diff --git a/view/theme/diabook/icons/globe.png b/view/theme/diabook/icons/globe.png
index bf27a8f3f..6bb9bc09d 100755..100644
--- a/view/theme/diabook/icons/globe.png
+++ b/view/theme/diabook/icons/globe.png
Binary files differ
diff --git a/view/theme/diabook/icons/language.png b/view/theme/diabook/icons/language.png
new file mode 100644
index 000000000..8029c0155
--- /dev/null
+++ b/view/theme/diabook/icons/language.png
Binary files differ
diff --git a/view/theme/diabook/icons/like.png b/view/theme/diabook/icons/like.png
index c9543afd5..b65edccc0 100644
--- a/view/theme/diabook/icons/like.png
+++ b/view/theme/diabook/icons/like.png
Binary files differ
diff --git a/view/theme/diabook/nav.tpl b/view/theme/diabook/nav.tpl
index 34a37ad2e..1f2f64f6a 100644
--- a/view/theme/diabook/nav.tpl
+++ b/view/theme/diabook/nav.tpl
@@ -1,6 +1,7 @@
<header>
- {# $langselector version 0.01#}
-
+
+
+
<div id="site-location">$sitelocation</div>
<div id="banner">$banner</div>
</header>
@@ -53,7 +54,15 @@
<li class="empty">$emptynotifications</li>
</ul>
</li>
- {{ endif }}
+ {{ endif }}
+
+ {{ if $nav.search}}
+ <li id="search-box">
+ <form method="get" action="$nav.search.0">
+ <input id="search-text" class="nav-menu-search" type="text" value="" name="search">
+ </form>
+ </li>
+ {{ endif }}
<li id="nav-site-linkmenu" class="nav-menu-icon"><a href="#" rel="#nav-site-menu"><span class="icon s22 gear">Site</span></a>
<ul id="nav-site-menu" class="menu-popup">
@@ -61,7 +70,13 @@
{{ if $nav.help }} <li><a class="$nav.help.2" target="friendika-help" href="$nav.help.0" title="$nav.help.3" >$nav.help.1</a></li>{{ endif }}
- <li><a class="$nav.search.2" href="$nav.search.0" title="$nav.search.3" >$nav.search.1</a></li>
+
+ <li ><a class="$nav.community.2" href="$nav.community.0" title="$nav.community.3" >$nav.community.1</a></li>
+
+
+ <li><a class="$nav.search.2" href="$nav.search.0" title="$nav.search.3" >$nav.search.1</a></li>
+
+ <li><a class="$nav.search.2" href="friendica" title="About" >About</a></li>
{{ if $nav.settings }}<li><a class="menu-sep $nav.settings.2" href="$nav.settings.0" title="$nav.settings.3">$nav.settings.1</a></li>{{ endif }}
{{ if $nav.admin }}<li><a class="$nav.admin.2" href="$nav.admin.0" title="$nav.admin.3" >$nav.admin.1</a></li>{{ endif }}
@@ -123,6 +138,12 @@
</nav>
+<div style="position: fixed; bottom: 5px; left: 25px;">$langselector</div>
+<div style="position: fixed; bottom: 7px; left: 5px;"><a href="http://pad.toktan.org/p/diabook" target="blank" ><img src="images/bug-x.gif" title="Fehlerreport für das Theme diaBook erstellen"></a></div>
+
+
+<a class="$nav.login.2" href="$nav.login.0" title="$nav.login.3" >$nav.login.1</a>
+
<ul id="nav-notifications-template" style="display:none;" rel="template">
diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css
index 06ddf6de1..ddbbc2e53 100644
--- a/view/theme/diabook/style.css
+++ b/view/theme/diabook/style.css
@@ -91,6 +91,8 @@
background-image: url("../../../view/theme/diabook/icons/notify.png");}
.icon.messages {
background-image: url("../../../view/theme/diabook/icons/messages.png");}
+.icon.community {
+ background-image: url("../../../view/theme/diabook/icons/community.png");}
.icon.drop { background-image: url("../../../view/theme/diabook/icons/drop.png");}
.icon.drophide { background-image: url("../../../view/theme/diabook/icons/drop.png");}
@@ -106,6 +108,7 @@
.icon.lock { background-image: url("../../../view/theme/diabook/icons/lock.png");}
.icon.unlock { background-image: url("../../../view/theme/diabook/icons/unlock.png");}
.icon.isstar { background-image: url("../../../view/theme/diabook/icons/isstar.png");}
+.icon.language { background-image: url("../../../view/theme/diabook/icons/language.png");}
.camera { background-image: url("../../../view/theme/diabook/icons/camera.png");
@@ -170,7 +173,7 @@
.youtube { background-position: -130px -40px;}
/*.attach { background-position: -190px -40px;}*/
-.language { background-position: -210px -40px;}
+/*.language { background-position: -210px -40px;}*/
.icon.on { background-image: url("../../../view/theme/diabook/icons/toogle_on.png"); background-repeat: no-repeat;}
@@ -526,7 +529,7 @@ header #banner a:hover {
color: #ffffff;
text-decoration: none;
outline: none;
- vertical-align: bottom;
+ vertical-align: middle;
}
header #banner #logo-img {
height: 25px;
@@ -610,12 +613,19 @@ nav #logo-text {
margin-top: 3px;
margin-right: 15px;
}
+nav .nav-menu-search {
+ position: relative;
+
+ margin: 3px 17px;
+ margin-right: 0px;
+ height: 17px;
+}
nav .nav-menu-icon {
position: relative;
height: 22px;
padding: 5px;
- margin: 0px 12px;
+ margin: 0px 7px;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-radius: 5px 5px 0 0;
border-radius: 5px 5px 0 0;
@@ -1181,6 +1191,7 @@ section {
color: #999999;
border: 1px solid #DDD;
padding: 0.3em;
+ font-size: 14px;
}
.wall-item-comment-wrapper .comment-edit-text-full {
font-size: 14px;
@@ -1329,9 +1340,9 @@ section {
margin: 0px 2em 20px 0px;
}
#profile-jot-form #profile-jot-text {
- height: 3.0em;
+ height: 2.0em;
width: 99%;
- font-size: 10px;
+ font-size: 15px;
color: #999999;
border: 1px solid #DDD;
padding: 0.3em;
@@ -1528,6 +1539,7 @@ section {
float: right;
margin-left: 10px;
margin-top: 2px;
+ font-size: 10px;
}
#profile-jot-perms{
float: right;
diff --git a/view/theme/quattro/theme.php b/view/theme/quattro/theme.php
new file mode 100644
index 000000000..7e5ab1e62
--- /dev/null
+++ b/view/theme/quattro/theme.php
@@ -0,0 +1,46 @@
+<?php
+
+$a->hooks[] = array('plugin_settings', 'view/theme/quattro/theme.php', 'quattro_settings');
+$a->hooks[] = array('plugin_settings_post', 'view/theme/quattro/theme.php', 'quattro_settings_post');
+
+
+function quattro_settings(&$a, &$o){
+ if(!local_user())
+ return;
+
+ $align = get_pconfig(local_user(), 'quattro', 'align' );
+
+ $t = file_get_contents( dirname(__file__). "/theme_settings.tpl" );
+ $o .= replace_macros($t, array(
+ '$submit' => t('Submit'),
+ '$baseurl' => $a->get_baseurl(),
+ '$title' => t("Theme settings"),
+ '$align' => array('quattro_align', t('Alignment'), $align, '', array('left'=>t('Left'), 'center'=>t('Center'))),
+ ));
+}
+
+function quattro_settings_post(&$a){
+ if(! local_user())
+ return;
+ if (isset($_POST['quattro-settings-submit'])){
+ set_pconfig(local_user(), 'quattro', 'align', $_POST['quattro_align']);
+ }
+ goaway($a->get_baseurl()."/settings/addon");
+}
+
+
+$quattro_align = get_pconfig(local_user(), 'quattro', 'align' );
+
+if(local_user() && $quattro_align=="center"){
+
+ $a->page['htmlhead'].="
+ <style>
+ html { width: 100%; margin:0px; padding:0px; }
+ body {
+ margin: 50px auto;
+ width: 900px;
+ }
+ </style>
+ ";
+
+}
diff --git a/view/theme/quattro/theme_settings.tpl b/view/theme/quattro/theme_settings.tpl
new file mode 100644
index 000000000..25af04253
--- /dev/null
+++ b/view/theme/quattro/theme_settings.tpl
@@ -0,0 +1,11 @@
+<div class="settings-block">
+ <h3 class="settings-heading">$title</h3>
+
+ {{inc field_select.tpl with $field=$align}}{{endinc}}
+
+ <div class="settings-submit-wrapper">
+ <input type="submit" value="$submit" class="settings-submit" name="quattro-settings-submit" />
+ </div>
+
+
+</div>