]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #2102 from annando/1511-unseen-forums
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Fri, 27 Nov 2015 21:17:17 +0000 (22:17 +0100)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Fri, 27 Nov 2015 21:17:17 +0000 (22:17 +0100)
Bugfix: Now the unseen counter for forums work

15 files changed:
include/identity.php
include/user.php
view/templates/profile_vcard.tpl
view/theme/duepuntozero/style.css
view/theme/duepuntozero/templates/profile_vcard.tpl
view/theme/frost-mobile/style.css
view/theme/frost-mobile/templates/profile_vcard.tpl
view/theme/frost/style.css
view/theme/frost/templates/profile_vcard.tpl
view/theme/quattro/dark/style.css
view/theme/quattro/green/style.css
view/theme/quattro/lilac/style.css
view/theme/quattro/quattro.less
view/theme/quattro/templates/profile_vcard.tpl
view/theme/vier/templates/profile_vcard.tpl

index 3ab65d9e64e8711cd0f6412311cf671f96a06e75..a785ce981dc8074873c9fb354b2e72a4e31f310d 100644 (file)
@@ -62,7 +62,7 @@ if(! function_exists('profile_load')) {
 
                if($profile) {
                        $profile_int = intval($profile);
-                       $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
+                       $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `contact`.`addr` AS faddr, `user`.* FROM `profile`
                                        INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
                                        WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d AND `contact`.`self` = 1 LIMIT 1",
                                        dbesc($nickname),
@@ -70,7 +70,7 @@ if(! function_exists('profile_load')) {
                        );
                }
                if((!$r) && (!count($r))) {
-                       $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
+                       $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `contact`.`addr` AS faddr, `user`.* FROM `profile`
                                        INNER JOIN `contact` ON `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
                                        WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 AND `contact`.`self` = 1 LIMIT 1",
                                        dbesc($nickname)
index d989664acd72999f16ec1432765124cd23c39f01..3997a8a61f12584da6469808d767fb93c53c2db6 100644 (file)
@@ -48,7 +48,7 @@ function create_user($arr) {
                        $result['message'] .= t('An invitation is required.') . EOL;
                        return $result;
                }
-               $r = q("select * from register where `hash` = '%s' limit 1", dbesc($invite_id));
+               $r = q("SELECT * FROM `register` WHERE `hash` = '%s' LIMIT 1", dbesc($invite_id));
                if(! results($r)) {
                        $result['message'] .= t('Invitation could not be verified.') . EOL;
                        return $result;
@@ -66,7 +66,7 @@ function create_user($arr) {
                        require_once('library/openid.php');
                        $openid = new LightOpenID;
                        $openid->identity = $openid_url;
-                       $openid->returnUrl = $a->get_baseurl() . '/openid';
+                       $openid->returnUrl = z_root() . '/openid';
                        $openid->required = array('namePerson/friendly', 'contact/email', 'namePerson');
                        $openid->optional = array('namePerson/first','media/image/aspect11','media/image/default');
                        try {
@@ -138,9 +138,10 @@ function create_user($arr) {
 
        if(! preg_match("/^[a-z0-9][a-z0-9\_]*$/",$nickname))
                $result['message'] .= t('Your "nickname" can only contain "a-z", "0-9" and "_".') . EOL;
+
        $r = q("SELECT `uid` FROM `user`
-                       WHERE `nickname` = '%s' LIMIT 1",
-                       dbesc($nickname)
+               WHERE `nickname` = '%s' LIMIT 1",
+               dbesc($nickname)
        );
        if(count($r))
                $result['message'] .= t('Nickname is already registered. Please choose another.') . EOL;
@@ -149,8 +150,8 @@ function create_user($arr) {
        // but could be a security issue for federated platforms.
 
        $r = q("SELECT * FROM `userd`
-                       WHERE `username` = '%s' LIMIT 1",
-                       dbesc($nickname)
+               WHERE `username` = '%s' LIMIT 1",
+               dbesc($nickname)
        );
        if(count($r))
                $result['message'] .= t('Nickname was once registered here and may not be re-used. Please choose another.') . EOL;
@@ -237,8 +238,8 @@ function create_user($arr) {
         */
 
        $r = q("SELECT `uid` FROM `user`
-                       WHERE `nickname` = '%s' ",
-                       dbesc($nickname)
+               WHERE `nickname` = '%s' ",
+               dbesc($nickname)
        );
        if((count($r) > 1) && $newuid) {
                $result['message'] .= t('Nickname is already registered. Please choose another.') . EOL;
@@ -255,8 +256,8 @@ function create_user($arr) {
                        t('default'),
                        1,
                        dbesc($username),
-                       dbesc($a->get_baseurl() . "/photo/profile/{$newuid}.jpg"),
-                       dbesc($a->get_baseurl() . "/photo/avatar/{$newuid}.jpg"),
+                       dbesc(z_root() . "/photo/profile/{$newuid}.jpg"),
+                       dbesc(z_root() . "/photo/avatar/{$newuid}.jpg"),
                        intval($publish),
                        intval($netpublish)
 
@@ -269,22 +270,23 @@ function create_user($arr) {
                        return $result;
                }
                $r = q("INSERT INTO `contact` ( `uid`, `created`, `self`, `name`, `nick`, `photo`, `thumb`, `micro`, `blocked`, `pending`, `url`, `nurl`,
-                       `request`, `notify`, `poll`, `confirm`, `poco`, `name-date`, `uri-date`, `avatar-date`, `closeness` )
-                       VALUES ( %d, '%s', 1, '%s', '%s', '%s', '%s', '%s', 0, 0, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 0 ) ",
+                       `addr`, `request`, `notify`, `poll`, `confirm`, `poco`, `name-date`, `uri-date`, `avatar-date`, `closeness` )
+                       VALUES ( %d, '%s', 1, '%s', '%s', '%s', '%s', '%s', 0, 0, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 0 ) ",
                        intval($newuid),
                        datetime_convert(),
                        dbesc($username),
                        dbesc($nickname),
-                       dbesc($a->get_baseurl() . "/photo/profile/{$newuid}.jpg"),
-                       dbesc($a->get_baseurl() . "/photo/avatar/{$newuid}.jpg"),
-                       dbesc($a->get_baseurl() . "/photo/micro/{$newuid}.jpg"),
-                       dbesc($a->get_baseurl() . "/profile/$nickname"),
-                       dbesc(normalise_link($a->get_baseurl() . "/profile/$nickname")),
-                       dbesc($a->get_baseurl() . "/dfrn_request/$nickname"),
-                       dbesc($a->get_baseurl() . "/dfrn_notify/$nickname"),
-                       dbesc($a->get_baseurl() . "/dfrn_poll/$nickname"),
-                       dbesc($a->get_baseurl() . "/dfrn_confirm/$nickname"),
-                       dbesc($a->get_baseurl() . "/poco/$nickname"),
+                       dbesc(z_root() . "/photo/profile/{$newuid}.jpg"),
+                       dbesc(z_root() . "/photo/avatar/{$newuid}.jpg"),
+                       dbesc(z_root() . "/photo/micro/{$newuid}.jpg"),
+                       dbesc(z_root() . "/profile/$nickname"),
+                       dbesc(normalise_link(z_root() . "/profile/$nickname")),
+                       dbesc($nickname . '@' . substr(z_root(), strpos(z_root(),'://') + 3 )),
+                       dbesc(z_root() . "/dfrn_request/$nickname"),
+                       dbesc(z_root() . "/dfrn_notify/$nickname"),
+                       dbesc(z_root() . "/dfrn_poll/$nickname"),
+                       dbesc(z_root() . "/dfrn_confirm/$nickname"),
+                       dbesc(z_root() . "/poco/$nickname"),
                        dbesc(datetime_convert()),
                        dbesc(datetime_convert()),
                        dbesc(datetime_convert())
@@ -296,23 +298,23 @@ function create_user($arr) {
                require_once('include/group.php');
                group_add($newuid, t('Friends'));
 
-               $r = q("SELECT id FROM `group` WHERE uid = %d AND name = '%s'",
+               $r = q("SELECT `id` FROM `group` WHERE `uid` = %d AND `name` = '%s'",
                        intval($newuid),
                        dbesc(t('Friends'))
                );
                if($r && count($r)) {
                        $def_gid = $r[0]['id'];
 
-                       q("UPDATE user SET def_gid = %d WHERE uid = %d",
+                       q("UPDATE `user` SET `def_gid` = %d WHERE `uid` = %d",
                                intval($r[0]['id']),
                                intval($newuid)
                        );
                }
 
                if(get_config('system', 'newuser_private') && $def_gid) {
-                       q("UPDATE user SET allow_gid = '%s' WHERE uid = %d",
-                          dbesc("<" . $def_gid . ">"),
-                          intval($newuid)
+                       q("UPDATE `user` SET `allow_gid` = '%s' WHERE `uid` = %d",
+                               dbesc("<" . $def_gid . ">"),
+                               intval($newuid)
                        );
                }
 
index fe5762973fbb0113c8d3b7b5283d85f2a1576d3b..05e44432fd2d33635edd787841f3d7eace0f2079 100644 (file)
@@ -3,7 +3,7 @@
 
        <div class="fn label p-name">{{$profile.name}}</div>
        
-                               
+       {{if $profile.faddr}}<div class="p-faddr">{{$profile.faddr}}</div>{{/if}}
        
        {{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}}
 
index 3e9bed33b3ab0ec6c1a916ab225b2ed00ff83068..255a1d089ab606e56eb37e63e08b713c0cbac2f0 100644 (file)
@@ -2511,7 +2511,8 @@ aside input[type='text'] {
        font-weight: bold;
 }
 
-.vcard .title {
+.vcard .title,
+.vcard .p-faddr {
        margin-bottom: 5px;
        margin-left: 12px;
 }
index 9a34605732d223c8af688dfa16c743ca64e80840..bf2eb27349815370e1ff6fe0f488569d6b9bb187 100644 (file)
@@ -3,7 +3,7 @@
 
        <div class="fn label">{{$profile.name}}</div>
        
-                               
+       {{if $profile.faddr}}<div class="p-faddr">{{$profile.faddr}}</div>{{/if}}
        
        {{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}}
        <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="{{$profile.photo}}?rev={{$profile.picdate}}" alt="{{$profile.name}}"></div>
        <div id="profile-extra-links">
                <ul>
                        {{if $connect}}
-                                {{if $remoteconnect}}
-                                        <li><a id="dfrn-request-link" href="{{$remoteconnect}}">{{$connect}}</a></li>
-                                {{else}}
-                                        <li><a id="dfrn-request-link" href="dfrn_request/{{$profile.nickname}}">{{$connect}}</a></li>
-                                {{/if}}
-                        {{/if}}
+                               {{if $remoteconnect}}
+                                       <li><a id="dfrn-request-link" href="{{$remoteconnect}}">{{$connect}}</a></li>
+                               {{else}}
+                                       <li><a id="dfrn-request-link" href="dfrn_request/{{$profile.nickname}}">{{$connect}}</a></li>
+                               {{/if}}
+                       {{/if}}
                        {{if $wallmessage}}
                                <li><a id="wallmessage-link" href="wallmessage/{{$profile.nickname}}">{{$wallmessage}}</a></li>
                        {{/if}}
index f8b49df7c508d05a379cebf6cc75ccd6fc72cf6a..4485c056ffedea5c70dc09acf25bdfb19799d38e 100644 (file)
@@ -3105,7 +3105,8 @@ aside input[type='text'] {
        font-weight: bold;\r
 }\r
 \r
-.vcard .title {\r
+.vcard .title,\r
+.vcard .p-faddr {\r
        margin-bottom: 5px;\r
        margin-left: 12px;\r
 }\r
index 6e097c62bf07f8d978c091b86a2a0b87363c7499..515740871385e0951b5100fa77e4b9cbb51b5e94 100644 (file)
@@ -3,7 +3,7 @@
 
        <div class="fn label">{{$profile.name}}</div>
        
-                               
+       {{if $profile.faddr}}<div class="p-faddr">{{$profile.faddr}}</div>{{/if}}
        
        {{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}}
        <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="{{$profile.photo}}?rev={{$profile.picdate}}" alt="{{$profile.name}}"></div>
index 5909df23553226028fd6c5702d1eb4fe6acbdbd8..24fe47559a47acb804cc53eea92fc39fb884ffa6 100644 (file)
@@ -2890,7 +2890,8 @@ aside input[type='text'] {
        font-weight: bold;
 }
 
-.vcard .title {
+.vcard .title,
+.vcard .p-faddr {
        margin-bottom: 5px;
        margin-left: 12px;
 }
index 6e097c62bf07f8d978c091b86a2a0b87363c7499..515740871385e0951b5100fa77e4b9cbb51b5e94 100644 (file)
@@ -3,7 +3,7 @@
 
        <div class="fn label">{{$profile.name}}</div>
        
-                               
+       {{if $profile.faddr}}<div class="p-faddr">{{$profile.faddr}}</div>{{/if}}
        
        {{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}}
        <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="{{$profile.photo}}?rev={{$profile.picdate}}" alt="{{$profile.name}}"></div>
index 93ee1ccd58feefcf6014b4675c01bd77bae850eb..25102ba31d900ef499670e440f49d268123a920d 100644 (file)
@@ -463,7 +463,7 @@ a:hover {
   text-decoration: underline;
 }
 blockquote {
-  background: #FFFFFF;
+  background: #ffffff;
   padding: 1em;
   margin-left: 1em;
   border-left: 1em solid #e6e6e6;
@@ -810,6 +810,9 @@ aside .vcard .fn {
 aside .vcard .title {
   margin-bottom: 5px;
 }
+aside .vcard .p-faddr {
+  margin-bottom: 5px;
+}
 aside .vcard dl {
   height: auto;
   overflow: auto;
index ab50d93ae1b0ed8a72b0d41dd0c0b5cf38de9a69..78de88654292add54764fa4d1c2de792de74cf80 100644 (file)
@@ -463,7 +463,7 @@ a:hover {
   text-decoration: underline;
 }
 blockquote {
-  background: #FFFFFF;
+  background: #ffffff;
   padding: 1em;
   margin-left: 1em;
   border-left: 1em solid #e6e6e6;
@@ -810,6 +810,9 @@ aside .vcard .fn {
 aside .vcard .title {
   margin-bottom: 5px;
 }
+aside .vcard .p-faddr {
+  margin-bottom: 5px;
+}
 aside .vcard dl {
   height: auto;
   overflow: auto;
index 510b2f7c8c6539548eebc63db6e65d483b16dcd4..1ca27b895c058a3b527ee732039270b5bb4bd2fc 100644 (file)
 body {
   font-family: Liberation Sans, helvetica, arial, clean, sans-serif;
   font-size: 11px;
-  background-color: #F6ECF9;
+  background-color: #f6ecf9;
   color: #2d2d2d;
   margin: 50px 0px 0px 0px;
   display: table;
@@ -463,7 +463,7 @@ a:hover {
   text-decoration: underline;
 }
 blockquote {
-  background: #FFFFFF;
+  background: #ffffff;
   padding: 1em;
   margin-left: 1em;
   border-left: 1em solid #e6e6e6;
@@ -810,6 +810,9 @@ aside .vcard .fn {
 aside .vcard .title {
   margin-bottom: 5px;
 }
+aside .vcard .p-faddr {
+  margin-bottom: 5px;
+}
 aside .vcard dl {
   height: auto;
   overflow: auto;
@@ -1704,7 +1707,7 @@ span[id^="showmore-wrap"] {
   height: 20px;
   width: 500px;
   font-weight: bold;
-  border: 1px solid #F6ECF9;
+  border: 1px solid #f6ecf9;
 }
 #jot #jot-title:-webkit-input-placeholder {
   font-weight: normal;
@@ -1731,7 +1734,7 @@ span[id^="showmore-wrap"] {
   margin: 0px;
   height: 20px;
   width: 200px;
-  border: 1px solid #F6ECF9;
+  border: 1px solid #f6ecf9;
 }
 #jot #jot-category:hover {
   border: 1px solid #999999;
index 2faa7966f06c38a875ec02aaa8c04ca08d530fc4..db1f42d769b12690943dabde461562ab558a5f1a 100644 (file)
@@ -317,6 +317,7 @@ aside {
        .vcard {
                .fn { font-size: 16px; font-weight: bold; margin-bottom: 5px; }
                .title { margin-bottom: 5px; }
+               .p-faddr{ margin-bottom: 5px; }
                dl { height: auto; overflow: auto; }
                dt {float: left; margin-left: 0px; width: 35%; text-align: right; color: @VCardLabelColor; }
                dd {float: left; margin-left: 4px; width: 60%;}
index d57169dcc1781728d075bcd89e2023a37d217a38..dfa6d0445d6d0b625009914882ab1e5a5b81834b 100644 (file)
@@ -6,17 +6,17 @@
                        <div class="action">
                        <a class="icon s16 edit ttright" href="#" rel="#profiles-menu" title="{{$profile.edit.3}}"><span>{{$profile.edit.1}}</span></a>
                        <ul id="profiles-menu" class="menu-popup">
-                           {{if $profile.menu.entries}}
-                               {{foreach $profile.menu.entries as $e}}
-                               <li>
-                                       <a href="profiles/{{$e.id}}"><img src='{{$e.photo}}'>{{$e.profile_name}}</a>
-                               </li>
-                               {{/foreach}}
-                       {{else}}
-                               <li>
-                                       <a href="{{$profile.edit.0}}">{{$profile.edit.1}}</a>
-                               </li>
-                       {{/if}}
+                       {{if $profile.menu.entries}}
+                               {{foreach $profile.menu.entries as $e}}
+                               <li>
+                                       <a href="profiles/{{$e.id}}"><img src='{{$e.photo}}'>{{$e.profile_name}}</a>
+                               </li>
+                               {{/foreach}}
+                       {{else}}
+                               <li>
+                                       <a href="{{$profile.edit.0}}">{{$profile.edit.1}}</a>
+                               </li>
+                       {{/if}}
                                <li><a href="profile_photo" >{{$profile.menu.chg_photo}}</a></li>
                                {{if $profile.menu.cr_new }}
                                <li><a href="profiles/new" id="profile-listing-new-link">{{$profile.menu.cr_new}}</a></li>
@@ -26,6 +26,7 @@
                {{/if}}
        </div>
 
+       {{if $profile.faddr}}<div class="p-faddr">{{$profile.faddr}}</div>{{/if}}
 
        {{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}}
        <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="{{$profile.photo}}?rev={{$profile.picdate}}" alt="{{$profile.name}}" /></div>
 
        {{if $marital}}<dl class="marital"><dt class="marital-label"><span class="heart">&hearts;</span>{{$marital}}</dt><dd class="marital-text">{{$profile.marital}}</dd></dl>{{/if}}
 
-       {{if $homepage}}<dl class="homepage"><dt
-        class="homepage-label">{{$homepage}}</dt><dd class="homepage-url"><a
-        href="{{$profile.homepage}}" target="external-link">{{$profile.homepage}}</a></dd></dl>{{/if}}
+       {{if $homepage}}
+       <dl class="homepage"><dt class="homepage-label">{{$homepage}}</dt>
+               <dd class="homepage-url"><a href="{{$profile.homepage}}" target="external-link">{{$profile.homepage}}</a></dd>
+       </dl>
+       {{/if}}
 
        {{include file="diaspora_vcard.tpl"}}
        
        <div id="profile-extra-links">
                <ul>
                        {{if $connect}}
-                                {{if $remoteconnect}}
-                                        <li><a id="dfrn-request-link" href="{{$remoteconnect}}">{{$connect}}</a></li>
-                                {{else}}
-                                        <li><a id="dfrn-request-link" href="dfrn_request/{{$profile.nickname}}">{{$connect}}</a></li>
-                                {{/if}}
-                        {{/if}}
+                               {{if $remoteconnect}}
+                                       <li><a id="dfrn-request-link" href="{{$remoteconnect}}">{{$connect}}</a></li>
+                               {{else}}
+                                       <li><a id="dfrn-request-link" href="dfrn_request/{{$profile.nickname}}">{{$connect}}</a></li>
+                               {{/if}}
+                       {{/if}}
                        {{if $wallmessage}}
                                <li><a id="wallmessage-link" href="wallmessage/{{$profile.nickname}}">{{$wallmessage}}</a></li>
                        {{/if}}
index 3317d668ce69df45fb42e3891c3f0998de757844..c5a51ccbafe9ebae73e67815868e37cec4918830 100644 (file)
@@ -13,6 +13,8 @@
                {{/if}}
        </div>
 
+       {{if $profile.faddr}}<div class="p-faddr">{{$profile.faddr}}</div>{{/if}}
+
        {{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}}
 
        {{if $profile.picdate}}
@@ -20,6 +22,7 @@
        {{else}}
                <div id="profile-photo-wrapper"><a href="{{$profile.url}}"><img class="photo u-photo" src="{{$profile.photo}}" alt="{{$profile.name}}"></a></div>
        {{/if}}
+       
        {{if $profile.network_name}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$profile.network_name}}</dd></dl>{{/if}}
        {{if $location}}
                <dl class="location"><dt class="location-label">{{$location}}</dt>