small cleanups
This commit is contained in:
parent
53bcc1520a
commit
091082b02a
|
@ -32,13 +32,13 @@
|
|||
|
||||
function get_entries() {
|
||||
global $serendipity;
|
||||
$andFutureCondition = !serendipity_db_bool($serendipity['showFutureEntries']) ? 'AND timestamp <= ' . serendipity_db_time() : '';
|
||||
$andFutureCondition = serendipity_db_bool($serendipity['showFutureEntries']) ? '' : 'AND timestamp <= ' . serendipity_db_time();
|
||||
$entries = [];
|
||||
foreach ($this->simple_query(
|
||||
"SELECT e.id, e.title, p.permalink, e.timestamp, LENGTH(e.body) AS size, a.realname, eplat.value AS lat, eplng.value AS lng
|
||||
FROM {$serendipity['dbPrefix']}entries e
|
||||
JOIN {$serendipity['dbPrefix']}entryproperties eplng ON (eplng.entryid = e.id AND eplng.property = 'geo_long')
|
||||
JOIN {$serendipity['dbPrefix']}entryproperties eplat ON (eplat.entryid = e.id AND eplat.property = 'geo_lat')
|
||||
JOIN {$serendipity['dbPrefix']}entryproperties eplng ON (eplng.entryid = e.id AND eplng.property = 'geo_long')
|
||||
JOIN {$serendipity['dbPrefix']}permalinks p ON (p.entry_id = e.id AND p.type = 'entry')
|
||||
JOIN {$serendipity['dbPrefix']}authors a ON a.authorid = e.authorid
|
||||
WHERE e.isdraft = 'false' $andFutureCondition
|
||||
|
|
Loading…
Reference in a new issue