@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_ABORTED', 'Caching der Artikel ABGEBROCHEN.');
@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_TOTAL', ' (insgesamt %d Artikel vorhanden)...');
@define('PLUGIN_EVENT_ENTRYPROPERTIES_NL2BR', 'Automatischen Zeilenumbruch deaktivieren');
+ @define('PLUGIN_EVENT_ENTRYPROPERTIES_NO_FRONTPAGE', 'Nicht in Artikelübersicht zeigen');
break;
case 'en':
@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_ABORTED', 'Entry caching ABORTED.');
@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_TOTAL', ' (totalling %d entries)...');
@define('PLUGIN_EVENT_ENTRYPROPERTIES_NL2BR', 'Disable nl2br');
+ @define('PLUGIN_EVENT_ENTRYPROPERTIES_NO_FRONTPAGE', 'Hide from article overview / frontpage');
break;
}
}
function getSupportedProperties() {
- static $supported_properties = array('is_sticky', 'access', 'cache_body', 'cache_extended', 'no_nl2br');
+ static $supported_properties = array('is_sticky', 'access', 'cache_body', 'cache_extended', 'no_nl2br', 'no_frontpage');
return $supported_properties;
}
? 'checked="checked"'
: '';
+ $no_frontpage = (isset($eventData['properties']['ep_no_frontpage']) && serendipity_db_bool($eventData['properties']['ep_no_frontpage']))
+ || (isset($serendipity['POST']['properties']['no_frontpage']) && serendipity_db_bool($serendipity['POST']['properties']['no_frontpage']))
+ ? 'checked="checked"'
+ : '';
+
$access_values = array(
PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS_PRIVATE => 'private',
PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS_MEMBER => 'member',
<legend><?php echo PLUGIN_EVENT_ENTRYPROPERTIES_TITLE; ?></legend>
<input type="checkbox" name="serendipity[properties][is_sticky]" id="properties_is_sticky" value="true" <?php echo $is_sticky; ?> />
<label title="<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_STICKYPOSTS; ?>" for="properties_is_sticky"> <?php echo PLUGIN_EVENT_ENTRYPROPERTIES_STICKYPOSTS; ?> </label><br />
+ <input type="checkbox" name="serendipity[properties][no_frontpage]" id="properties_no_frontpage" value="true" <?php echo $no_frontpage; ?> />
+ <label title="<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_NO_FRONTPAGE; ?>" for="properties_no_frontpage"> <?php echo PLUGIN_EVENT_ENTRYPROPERTIES_NO_FRONTPAGE; ?> </label><br />
<?php if (class_exists('serendipity_event_nl2br')){ ?>
<input type="checkbox" name="serendipity[properties][no_nl2br]" id="properties_no_nl2br" value="true" <?php echo $nl2br; ?> />
<label title="<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_NL2BR; ?>" for="properties_no_nl2br"> <?php echo PLUGIN_EVENT_ENTRYPROPERTIES_NL2BR; ?> </label><br />
case 'frontend_fetchentries':
case 'frontend_fetchentry':
+ $joins = array();
$conds = array();
if ($_SESSION['serendipityAuthedUser'] === true) {
$conds[] = " (ep_access.property IS NULL OR ep_access.value = 'member' OR ep_access.value = 'public' OR (ep_access.value = 'private' AND e.authorid = " . (int)$serendipity['authorid'] . ")) ";
$conds[] = " (ep_access.property IS NULL OR ep_access.value = 'public') ";
}
+ if (!isset($serendipity['GET']['category']) && $event == 'frontend_fetchentries') {
+ $conds[] = " (ep_no_frontpage.property IS NULL OR ep_no_frontpage.value != 'true') ";
+ $joins[] = "LEFT OUTER JOIN {$serendipity['dbPrefix']}entryproperties ep_no_frontpage
+ ON (e.id = ep_no_frontpage.entryid AND ep_no_frontpage.property = 'ep_no_frontpage')";
+ }
+
if (count($conds) > 0) {
$cond = implode(' AND ', $conds);
if (empty($eventData['and'])) {
$conds[] = 'ep_cache_extended.value AS ep_cache_extended,';
$conds[] = 'ep_cache_body.value AS ep_cache_body,';
}
-
+
$cond = implode("\n", $conds);
if (empty($eventData['addkey'])) {
$eventData['addkey'] = $cond;
$eventData['orderby'] = $cond . ', ' . $eventData['orderby'];
}
- $joins = array();
if ($is_cache && (!isset($addData['noCache']) || !$addData['noCache'])) {
$joins[] = "LEFT OUTER JOIN {$serendipity['dbPrefix']}entryproperties ep_cache_extended
ON (e.id = ep_cache_extended.entryid AND ep_cache_extended.property = 'ep_cache_extended')";