Bladeren bron

2018-03-19

Visman 7 jaren geleden
bovenliggende
commit
743fb97694
3 gewijzigde bestanden met toevoegingen van 21 en 9 verwijderingen
  1. 19 7
      app/Models/Pages/Profile.php
  2. 2 0
      app/templates/layouts/form.forkbb.php
  3. 0 2
      app/templates/profile.forkbb.php

+ 19 - 7
app/Models/Pages/Profile.php

@@ -119,13 +119,21 @@ class Profile extends Page
                 'value'     => $isEdit ? $curUser->location : \ForkBB\cens($curUser->location),
             ];
         }
-        if ($isEdit || $curUser->url) {
+        if ($isEdit) {
             $fieldset['url'] = [
                 'id'        => 'website',
                 'type'      => 'text',
                 'maxlength' => 100,
                 'caption'   => \ForkBB\__('Website'),
-                'value'     => $isEdit ? $curUser->url : \ForkBB\cens($curUser->url),
+                'value'     => $curUser->url
+            ];
+        } elseif ($curUser->url) {
+            $fieldset['url'] = [
+                'id'      => 'website',
+                'type'    => 'link',
+                'caption' => \ForkBB\__('Website'),
+                'value'   => \ForkBB\cens($curUser->url),
+                'href'    => \ForkBB\cens($curUser->url),
             ];
         }
         if (! empty($fieldset)) {
@@ -182,18 +190,22 @@ class Profile extends Page
             'caption' => \ForkBB\__('Last post info'),
         ];
         if ($curUser->num_posts) {
-            if ('1' == $this->user->g_search && $this->user->showPostCount) {
+            if ('1' == $this->user->g_search) {
                 $fieldset['posts'] = [
                     'id'      => 'posts',
-                    'type'    => 'yield',
+                    'type'    => 'link',
                     'caption' => \ForkBB\__('Posts info'),
-                    'value'   => 'totalposts',
+                    'value'   => $this->user->showPostCount ? \ForkBB\num($curUser->num_posts) : \ForkBB\__('Show posts'),
+                    'href'    => '',
+                    'title'   => \ForkBB\__('Show posts'),
                 ];
                 $fieldset['topics'] = [
                     'id'      => 'topics',
-                    'type'    => 'yield',
+                    'type'    => 'link',
                     'caption' => \ForkBB\__('Topics info'),
-                    'value'   => 'totaltopics',
+                    'value'   => $this->user->showPostCount ? \ForkBB\num($curUser->num_topics) : \ForkBB\__('Show topics'),
+                    'href'    => '',
+                    'title'   => \ForkBB\__('Show topics'),
                 ];
             } elseif ($this->user->showPostCount) {
                 $fieldset['posts'] = [

+ 2 - 0
app/templates/layouts/form.forkbb.php

@@ -104,6 +104,8 @@
                 {!! $this->block($cur['value']) !!}
                 @elseif ('str' === $cur['type'])
                 <p class="f-ctrl" id="id-{{ $key }}">{{ $cur['value'] }}</p>
+                @elseif ('link' === $cur['type'])
+                <a class="f-link" id="id-{{ $key }}" href="{{ $cur['href'] or '' }}" title="{{ $cur['title'] or '' }}">{{ $cur['value'] or '' }}</a>
                 @endif
                 @if ($cur['info'])
                 <p class="f-child4">{!! $cur['info'] !!}</p>

+ 0 - 2
app/templates/profile.forkbb.php

@@ -13,8 +13,6 @@
 @endsection
 @section ('avatar')<img class="f-avatar-img" src="{!! $p->curUser->avatar !!}" alt="{{ $p->curUser->username }}"> @endsection
 @section ('signature'){!! $p->curUser->htmlSign !!} @endsection
-@section ('totalposts')<a href="" title="{{ __('Show posts') }}">{!! num($p->curUser->num_posts) !!}</a> @endsection
-@section ('totaltopics')<a href="" title="{{ __('Show topics') }}">{!! num($p->curUser->num_topics) !!}</a> @endsection
 @extends ('layouts/main')
     <div class="f-nav-links">
 @yield ('crumbs')