Skip to content

Commit e2130be

Browse files
committed
Search
1 parent a284f41 commit e2130be

File tree

5 files changed

+72
-71
lines changed

5 files changed

+72
-71
lines changed

featherbb/Controller/Search.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,14 @@ public function display($req, $res, $args)
5757
$display = $this->model->displaySearchResults($search);
5858

5959
View::setPageInfo([
60-
'display' => $display,
61-
]
62-
);
63-
64-
View::addTemplate('search/header.php', 1);
60+
'display' => $display,
61+
]);
6562

6663
if ($search['show_as'] == 'posts') {
67-
View::addTemplate('search/posts.php', 5);
64+
View::addTemplate('@forum/search/posts', 5)->display();
6865
} else {
69-
View::addTemplate('search/topics.php', 5);
66+
View::addTemplate('@forum/search/topics', 5)->display();
7067
}
71-
72-
View::addTemplate('search/footer.php', 10)->display();
7368
}
7469
}
7570
// Display the form

featherbb/View/error.html.twig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
<h2><span>{{ trans('Error') }}</span></h2>
88
<div class="box">
99
<div class="inbox">
10-
<p>{{ msg|raw }}</p>
10+
<p>
11+
{% if html is defined %}
12+
{{ msg|raw }}
13+
{% else %}
14+
{{ msg }}
15+
{% endif %}
16+
</p>
1117

1218
{% if backlink %}
1319
<p><a href="javascript: history.go(-1)">{{ trans('Go back') }}</a></p>

featherbb/View/layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
{{ fireHook('view.header.before.head.tag') }}
6969
</head>
7070

71-
<body id="feather-body">
71+
<body id="feather{{ active_page }}">
7272

7373
<header>
7474
<nav>

featherbb/View/search/topics.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</td>
2323
<td class="tc2">{{ search.forum|raw }}</td>
2424
<td class="tc3">{{ formatNumber(search.num_replies) }}</td>
25-
<td class="tcr"><a href="{{ pathFor('viewPost', {'pid': search.last_post_id}) ~'#p' ~search.last_post_id }}">{{ formatTime(search.last_post) }}</a> <span class="byuser">{{ trans('by') }} {{ search.last_poster }}</span></td>
25+
<td class="tcr"><a href="{{ pathFor('viewPost', {'id': search.tid, 'name': search.url_topic, 'pid': search.last_post_id}) ~'#p' ~search.last_post_id }}">{{ formatTime(search.last_post) }}</a> <span class="byuser">{{ trans('by') }} {{ search.last_poster }}</span></td>
2626
</tr>
2727

2828

style/themes/FeatherBB/style.css

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -827,9 +827,9 @@ footer .footer-link {
827827
}
828828
#editform .box fieldset .bblinks,
829829
#postform .box fieldset .bblinks,
830-
#punsearch .linksb .pagepost .pagelink .pages-label,
831-
#punsearch .linkst .pagepost .pagelink .pages-label,
832-
#punsearch .postlinksb .pagepost .pagelink .pages-label,
830+
#feathersearch .linksb .pagepost .pagelink .pages-label,
831+
#feathersearch .linkst .pagepost .pagelink .pages-label,
832+
#feathersearch .postlinksb .pagepost .pagelink .pages-label,
833833
#quickpost .box fieldset .bblinks,
834834
#reportform .box fieldset .bblinks {
835835
display: none
@@ -976,58 +976,58 @@ footer .footer-link {
976976
width: 100%;
977977
float: none
978978
}
979-
#punsearch .blockpost h2 {
979+
#feathersearch .blockpost h2 {
980980
color: #fff
981981
}
982-
#punsearch .linksb .pagepost,
983-
#punsearch .linkst .pagepost,
984-
#punsearch .postlinksb .pagepost {
982+
#feathersearch .linksb .pagepost,
983+
#feathersearch .linkst .pagepost,
984+
#feathersearch .postlinksb .pagepost {
985985
margin: 10px 0;
986986
padding: 10px 1px
987987
}
988-
#punsearch .linksb .pagepost .pagelink a,
989-
#punsearch .linksb .pagepost .pagelink span,
990-
#punsearch .linksb .pagepost .pagelink strong,
991-
#punsearch .linkst .pagepost .pagelink a,
992-
#punsearch .linkst .pagepost .pagelink span,
993-
#punsearch .linkst .pagepost .pagelink strong,
994-
#punsearch .postlinksb .pagepost .pagelink a,
995-
#punsearch .postlinksb .pagepost .pagelink span,
996-
#punsearch .postlinksb .pagepost .pagelink strong {
988+
#feathersearch .linksb .pagepost .pagelink a,
989+
#feathersearch .linksb .pagepost .pagelink span,
990+
#feathersearch .linksb .pagepost .pagelink strong,
991+
#feathersearch .linkst .pagepost .pagelink a,
992+
#feathersearch .linkst .pagepost .pagelink span,
993+
#feathersearch .linkst .pagepost .pagelink strong,
994+
#feathersearch .postlinksb .pagepost .pagelink a,
995+
#feathersearch .postlinksb .pagepost .pagelink span,
996+
#feathersearch .postlinksb .pagepost .pagelink strong {
997997
position: relative;
998998
float: left;
999999
margin: 0 0 0 -1px;
10001000
padding: 6px 12px;
10011001
border: 1px solid #ddd;
10021002
background-color: #fff
10031003
}
1004-
#punsearch .linksb .pagepost .pagelink a:hover,
1005-
#punsearch .linksb .pagepost .pagelink span:hover,
1006-
#punsearch .linksb .pagepost .pagelink strong:hover,
1007-
#punsearch .linkst .pagepost .pagelink a:hover,
1008-
#punsearch .linkst .pagepost .pagelink span:hover,
1009-
#punsearch .linkst .pagepost .pagelink strong:hover,
1010-
#punsearch .postlinksb .pagepost .pagelink a:hover,
1011-
#punsearch .postlinksb .pagepost .pagelink span:hover,
1012-
#punsearch .postlinksb .pagepost .pagelink strong:hover {
1004+
#feathersearch .linksb .pagepost .pagelink a:hover,
1005+
#feathersearch .linksb .pagepost .pagelink span:hover,
1006+
#feathersearch .linksb .pagepost .pagelink strong:hover,
1007+
#feathersearch .linkst .pagepost .pagelink a:hover,
1008+
#feathersearch .linkst .pagepost .pagelink span:hover,
1009+
#feathersearch .linkst .pagepost .pagelink strong:hover,
1010+
#feathersearch .postlinksb .pagepost .pagelink a:hover,
1011+
#feathersearch .postlinksb .pagepost .pagelink span:hover,
1012+
#feathersearch .postlinksb .pagepost .pagelink strong:hover {
10131013
text-decoration: none;
10141014
background-color: #fafafa
10151015
}
1016-
#punsearch .linksb .pagepost .pagelink .spacer,
1017-
#punsearch .linkst .pagepost .pagelink .spacer,
1018-
#punsearch .postlinksb .pagepost .pagelink .spacer {
1016+
#feathersearch .linksb .pagepost .pagelink .spacer,
1017+
#feathersearch .linkst .pagepost .pagelink .spacer,
1018+
#feathersearch .postlinksb .pagepost .pagelink .spacer {
10191019
background-color: #fafafa;
10201020
cursor: default;
10211021
color: #d3d3d3
10221022
}
1023-
#punsearch .linksb .pagepost .pagelink .spacer:hover,
1024-
#punsearch .linkst .pagepost .pagelink .spacer:hover,
1025-
#punsearch .postlinksb .pagepost .pagelink .spacer:hover {
1023+
#feathersearch .linksb .pagepost .pagelink .spacer:hover,
1024+
#feathersearch .linkst .pagepost .pagelink .spacer:hover,
1025+
#feathersearch .postlinksb .pagepost .pagelink .spacer:hover {
10261026
background-color: #fafafa
10271027
}
1028-
#punsearch .linksb .pagepost .pagelink strong,
1029-
#punsearch .linkst .pagepost .pagelink strong,
1030-
#punsearch .postlinksb .pagepost .pagelink strong {
1028+
#feathersearch .linksb .pagepost .pagelink strong,
1029+
#feathersearch .linkst .pagepost .pagelink strong,
1030+
#feathersearch .postlinksb .pagepost .pagelink strong {
10311031
font-weight: 400;
10321032
background-color: #fafafa;
10331033
cursor: default
@@ -1157,7 +1157,7 @@ footer .footer-link a {
11571157
display: block;
11581158
padding: 10px
11591159
}
1160-
#punuserlist .pagelink .pages-label,
1160+
#featheruserlist .pagelink .pages-label,
11611161
.blockform .box .inform fieldset .bblinks {
11621162
display: none
11631163
}
@@ -1425,45 +1425,45 @@ input[type=submit]:focus {
14251425
#regform .forminfo p {
14261426
margin: 4px 0
14271427
}
1428-
#punuserlist .blocktable {
1428+
#featheruserlist .blocktable {
14291429
margin: 0
14301430
}
1431-
#punuserlist .blocktable table thead .tc2,
1432-
#punuserlist .blocktable table thead .tc3,
1433-
#punuserlist .blocktable table thead .tcl,
1434-
#punuserlist .blocktable table thead .tcr {
1431+
#featheruserlist .blocktable table thead .tc2,
1432+
#featheruserlist .blocktable table thead .tc3,
1433+
#featheruserlist .blocktable table thead .tcl,
1434+
#featheruserlist .blocktable table thead .tcr {
14351435
width: 25%
14361436
}
1437-
#punuserlist .pagelink {
1437+
#featheruserlist .pagelink {
14381438
overflow: auto;
14391439
margin: 10px 0;
14401440
padding: 10px 0 10px 1px
14411441
}
1442-
#punuserlist .pagelink a,
1443-
#punuserlist .pagelink span,
1444-
#punuserlist .pagelink strong {
1442+
#featheruserlist .pagelink a,
1443+
#featheruserlist .pagelink span,
1444+
#featheruserlist .pagelink strong {
14451445
position: relative;
14461446
float: left;
14471447
margin: 0 0 0 -1px;
14481448
padding: 6px 12px;
14491449
border: 1px solid #ddd;
14501450
background-color: #fff
14511451
}
1452-
#punuserlist .pagelink a:hover,
1453-
#punuserlist .pagelink span:hover,
1454-
#punuserlist .pagelink strong:hover {
1452+
#featheruserlist .pagelink a:hover,
1453+
#featheruserlist .pagelink span:hover,
1454+
#featheruserlist .pagelink strong:hover {
14551455
text-decoration: none;
14561456
background-color: #fafafa
14571457
}
1458-
#punuserlist .pagelink .spacer {
1458+
#featheruserlist .pagelink .spacer {
14591459
background-color: #fafafa;
14601460
cursor: default;
14611461
color: #d3d3d3
14621462
}
1463-
#punuserlist .pagelink .spacer:hover {
1463+
#featheruserlist .pagelink .spacer:hover {
14641464
background-color: #fafafa
14651465
}
1466-
#punuserlist .pagelink strong {
1466+
#featheruserlist .pagelink strong {
14671467
font-weight: 400;
14681468
background-color: #fafafa;
14691469
cursor: default
@@ -1649,8 +1649,8 @@ img {
16491649
float: none;
16501650
width: 100%
16511651
}
1652-
#punsearch .blockpost h2 span:nth-child(2),
1653-
#punsearch .blockpost h2 span:nth-child(3),
1652+
#feathersearch .blockpost h2 span:nth-child(2),
1653+
#feathersearch .blockpost h2 span:nth-child(3),
16541654
.blockpost .box .postleft dl dd {
16551655
display: none
16561656
}
@@ -1813,29 +1813,29 @@ img {
18131813
#searchform.blockform div.box form#search div.inform fieldset div.infldset label.conl select#search_in {
18141814
margin-top: 7px;
18151815
}
1816-
body #puninstall {
1816+
body #featherinstall {
18171817
padding-bottom: 60px;
18181818
}
1819-
#puninstall .blockform .box .inform fieldset {
1819+
#featherinstall .blockform .box .inform fieldset {
18201820
margin-top: 15px;
18211821
}
1822-
#puninstall h3 {
1822+
#featherinstall h3 {
18231823
font-size: 22px;
18241824
text-align: center;
18251825
}
1826-
.forminfo p, #install p.buttons, html body div#puninstall.pun div.punwrap section.container div#brdheader.block div.box div#brdtitle.inbox {
1826+
.forminfo p, #install p.buttons, html body div#featherinstall.pun div.punwrap section.container div#brdheader.block div.box div#brdtitle.inbox {
18271827
text-align: center;
18281828
}
18291829
#install p.buttons {
18301830
font-size: 22px;
18311831
}
1832-
#puninstall .blockform .box .inform fieldset label {
1832+
#featherinstall .blockform .box .inform fieldset label {
18331833
display: block;
18341834
}
1835-
#puninstall .blockform .box .inform fieldset legend {
1835+
#featherinstall .blockform .box .inform fieldset legend {
18361836
margin-bottom: 0;
18371837
}
1838-
#puninstall.pun div.punwrap section.container div#brdmain div.blockform div.box form#install div.inform fieldset div.infldset p{
1838+
#featherinstall.pun div.punwrap section.container div#brdmain div.blockform div.box form#install div.inform fieldset div.infldset p{
18391839
margin-bottom: 12px;
18401840
}
18411841

0 commit comments

Comments
 (0)