Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yama committed Mar 1, 2018
1 parent 484e7cf commit 0ba3c33
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions nucleus/libs/BLOG.php
Expand Up @@ -562,14 +562,14 @@ function getSqlSearch($query, $amountMonths = 0, &$highlight, $mode = '')
$query = 'SELECT COUNT(*) as result ';
}

$query .= ' FROM '.sql_table('item').' as i, '.sql_table('member').' as m, '.sql_table('category').' as c'
$query .= parseQuery(' FROM <%prefix%>item as i, <%prefix%>member as m, <%prefix%>category as c')
. ' WHERE i.iauthor=m.mnumber'
. ' and i.icat=c.catid'
. ' and i.idraft=0' // exclude drafts
. ' AND i.icat=c.catid'
. ' AND i.idraft=0' // exclude drafts
. $selectblogs
// don't show future items
. ' and i.itime<=' . mysqldate($this->getCorrectTime())
. ' and '.$where;
. ' AND i.itime<=' . mysqldate($this->getCorrectTime())
. ' AND '.$where;

// take into account amount of months to search
if ($amountMonths > 0)
Expand Down Expand Up @@ -607,7 +607,7 @@ function getSqlBlog($extraQuery, $mode = '')
else
$query = 'SELECT COUNT(*) as result ';

$query .= ' FROM '.sql_table('item').' as i, '.sql_table('member').' as m, '.sql_table('category').' as c'
$query .= parseQuery(' FROM <%prefix%>item as i, <%prefix%>member as m, <%prefix%>category as c')
. ' WHERE i.iblog='.$this->blogid
. ' and i.iauthor=m.mnumber'
. ' and i.icat=c.catid'
Expand Down Expand Up @@ -1517,10 +1517,7 @@ function getSqlItemList($itemarray,$showDrafts = 0,$showFuture = 0)
. ' i.icat as catid,'
. ' i.iclosed as closed';

$query .= ' FROM '
. '<%prefix%>item as i, '
. '<%prefix%>member as m, '
. '<%prefix%>category as c'
$query .= ' FROM <%prefix%>item as i, <%prefix%>member as m, <%prefix%>category as c'
. ' WHERE'
. ' i.iblog='.$this->blogid
. ' and i.iauthor=m.mnumber'
Expand Down

0 comments on commit 0ba3c33

Please sign in to comment.