Skip to content

Commit

Permalink
refs #1067 : modified - blog.notice (finished.)
Browse files Browse the repository at this point in the history
  • Loading branch information
inureyes committed Jan 28, 2015
1 parent 462782e commit f295dcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions library/model/blog.locative.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function getLocatives($blogid) {
//TODO Fix the parameter. Current code does not work. DBModel upgrade needed for complex queries.
return getEntries($blogid, 'id, userid, title, slogan, location', array(array('length(location)','>',1),'AND',array('category','>',-1)), 'location');
}

Expand Down
12 changes: 6 additions & 6 deletions library/model/blog.notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function getNoticesWithPaging($blogid, $search, $page, $count) {
global $database, $folderURL, $suri;
$aux = '';
$context = Model_Context::getInstance();
$pool = getDefaultDBModelOnNotice($blogid);

if (($search !== true) && $search) {
$search = escapeSearchString($search);
$aux = "AND (title LIKE '%$search%' OR content LIKE '%$search%')";
$pool->setQualifierSet(array("title","like",$search,true),"OR",array("content","like",$search,true));
}
$visibility = doesHaveOwnership() ? '' : 'AND visibility > 1';
$sql = "SELECT * FROM {$database['prefix']}Entries WHERE blogid = $blogid AND draft = 0 $visibility AND category = -2 $aux ORDER BY published DESC";
return Paging::fetch($sql, $page, $count, "$folderURL/{$suri['value']}");

return Paging::fetch($pool, $page, $count, $context->getProperty("uri.folder")."/".$context->getProperty("suri.value"));
}

function getNotice($blogid, $id) {
Expand Down

0 comments on commit f295dcb

Please sign in to comment.