Skip to content

Commit f3e9c39

Browse files
committed
Fixing posts
1 parent 7147a32 commit f3e9c39

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/models/Forum/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Forum_Post extends Forum
6363
'history' => array('hasMany', 'Forum_Post_Edit', 'foreignKey' => 'forum_post_id', 'orderBy' => array('created_at', 'desc')),
6464
'status' => array('hasOne', 'Forum_Post_Status', 'foreignKey' => 'forum_post_id'),
6565
'moderations' => array('morphMany', 'Forum_Moderation', 'name' => 'resource'),
66-
'morph' => array('morphTo', 'withTrashed'),
66+
'morph' => array('morphTo'),
6767
);
6868

6969
/********************************************************************

src/models/Forum/Reply.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Forum_Reply extends Forum
6262
'roll' => array('hasOne', 'Forum_Reply_Roll', 'foreignKey' => 'forum_reply_id'),
6363
'history' => array('hasMany', 'Forum_Reply_Edit', 'foreignKey' => 'forum_reply_id', 'orderBy' => array('created_at', 'desc')),
6464
'moderations' => array('morphMany', 'Forum_Moderation', 'name' => 'resource'),
65-
'morph' => array('morphTo', 'withTrashed'),
65+
'morph' => array('morphTo'),
6666
'quote' => array('morphTo'),
6767
);
6868

src/services/Forum/ForumPost.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,12 @@ public function setRepliesPerPage($count)
6767
public function setDefaultData()
6868
{
6969
if ($this->type == 'IMAGE') {
70-
$replyTypes= \Forum_Reply_Type::where('keyName', 'IMAGE')->get();
71-
$this->replyTypes = \CoreView::arrayToSelect($replyTypes , 'id', 'name', false);
70+
$this->replyTypes= \Forum_Reply_Type::where('keyName', 'IMAGE')->get()->toSelectArray(false);
7271
} else {
73-
$replyTypes = \Forum_Reply_Type::orderByNameAsc()->remember(60)->get();
74-
$this->replyTypes = \CoreView::arrayToSelect($replyTypes , 'id', 'name', 'Select Reply Type');
72+
$this->replyTypes = \Forum_Reply_Type::orderByNameAsc()->get()->toSelectArray('Select a Reply Type');
7573
}
7674

77-
$statuses = \Forum_Support_Status::remember(60)->get();
78-
$this->statuses = \CoreView::arrayToSelect($statuses, 'id', 'name', 'Select a Status');
75+
$this->statuses = \Forum_Support_Status::all()->toSelectArray('Select a status');
7976

8077
return $this;
8178
}

src/views/forum/post/components/postcontents.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<!-- Start Title and Details -->
22
{{ $post->icon }}
3-
<strong>{{ HTML::link('forum/post/view/'. $post->keyName .'#reply:'. $post->id, $post->name, array('name' => 'reply:'. $post->id, 'rel' => 'nofollow')) }}</strong>
3+
@if (getRootClass($post) == 'Forum_Post')
4+
<strong>{{ HTML::link('forum/post/view/'. $post->id .'/'. $details->currentPage, $post->name, array('name' => 'reply:'. $post->id, 'rel' => 'nofollow')) }}</strong>
5+
@else
6+
<strong>{{ HTML::link('forum/post/view/'. $post->post->id .'/'. $details->currentPage .'#reply:'. $post->id, $post->name, array('name' => 'reply:'. $post->id, 'rel' => 'nofollow')) }}</strong>
7+
@endif
48
@if ($post->forum_post_type_id == Forum_Post::TYPE_APPLICATION && $post->approvedFlag == 0)
59
<small class="label label-important">Unapproved</small>
610
@endif

0 commit comments

Comments
 (0)