function __mobile_truncate_content($i) { $ml = rss_theme_config_override_option('rss.output.maxlength', DEFAULT_MOBILE_OUTPUT_MAXLENGTH); if ($ml) { $i->description = html_substr($i->description, $ml); } return $i; }
<?php // load our optional overrides rss_theme_config_override_option('rss.output.frontpage.numitems', 10);
function theme_options_fill_override_array($theme, $media, $array_input, $key = null) { $ret = array(); if (!is_array($array_input)) { $array_input = explode(",", $array_input); } foreach ($array_input as $inp) { if (!is_array($inp) && isset($inp)) { $inp = array('key_' => $inp); } if (isset($inp['key_'])) { $thisret = array(); if ($key === null || $key === $inp['key_']) { $thisret = $inp; if ($inp['key_'] == 'rss.output.theme.scheme') { $schemes = loadSchemeList(true, $theme, $media); if (!isset($inp['default_'])) { $thisret['default_'] = implode(',', $schemes) . ",0"; } $thisret['type_'] = 'enum'; if (!isset($inp['desc_'])) { $thisret['desc_'] = 'The color scheme to use.'; } if (!isset($inp['export_'])) { $thisret['export_'] = ''; } $value = rss_theme_config_override_option($thisret['key_'], $thisret['default_'], $theme, $media); $value = array_pop(explode(',', $value)); $thisret['value_'] = implode(',', $schemes) . "," . $value; } else { $sql = "select * from " . getTable("config") . " where key_ like\n '" . $inp['key_'] . "'"; $res = rss_query($sql); if ($row = rss_fetch_assoc($res)) { foreach ($row as $rowkey => $rowval) { if ($rowkey !== 'value_') { if (!isset($inp[$rowkey])) { $thisret[$rowkey] = $rowval; } else { $thisret[$rowkey] = $inp[$rowkey]; } } } } $thisret['value_'] = rss_theme_config_override_option($thisret['key_'], $thisret['default_'], $theme, $media); } if ($key === null) { $ret[] = $thisret; } else { $ret = $thisret; } } } else { rss_error('rss_theme_options_configure_overrides was passed an item with no key_', RSS_ERROR_ERROR, true); } } return $ret; }
<?php // stores constants for overrides' defaults require_once 'mobileconstants.php'; // load our optional overrides rss_theme_config_override_option('rss.output.frontpage.numitems', DEFAULT_MOBILE_FRONTPAGE_NUMITEMS); rss_theme_config_override_option('rss.output.itemsinchannelview', DEFAULT_MOBILE_FRONTPAGE_ITEMSINCHANNELVIEW); // but why does it sort in reverse order unless we set this? rss_config_override('rss.output.frontpage.mixeditems', false); // force turning off of profiling $GLOBALS['rss']->profiler = null; //handle form data... if (!hidePrivate()) { foreach ($_POST as $varName => $value) { switch ($value) { case 'mobile_sticky': rss_plugins_set_item_state($varName, RSS_MODE_STICKY_STATE, true); //intentional fallthrough //intentional fallthrough case 'mobile_flag': rss_plugins_set_item_state($varName, RSS_MODE_FLAG_STATE, true); case 'mobile_read': rss_plugins_set_item_state($varName, RSS_MODE_UNREAD_STATE, false); } } }
<?php require_once 'mobile/mobileconstants.php'; rss_theme_options_configure_overrides('default', 'web', 'rss.output.theme.scheme'); rss_theme_config_override_option('rss.output.maxlength', DEFAULT_MOBILE_OUTPUT_MAXLENGTH); rss_theme_config_override_option('rss.content.strip.images', DEFAULT_MOBILE_CONTENT_STRIP_IMAGES); rss_theme_options_configure_overrides('default', 'mobile', array(array('key_' => 'rss.output.frontpage.numitems', 'default_' => DEFAULT_MOBILE_FRONTPAGE_NUMITEMS), array('key_' => 'rss.output.itemsinchannelview', 'default_' => DEFAULT_MOBILE_FRONTPAGE_ITEMSINCHANNELVIEW), array('key_' => 'rss.output.maxlength', 'default_' => DEFAULT_MOBILE_OUTPUT_MAXLENGTH, 'type_' => 'num', 'desc_' => 'Truncate long posts to this many characters. Set to 0 (default) to disable this.', 'export_' => NULL), array('key_' => 'rss.content.strip.images', 'default_' => DEFAULT_MOBILE_CONTENT_STRIP_IMAGES, 'type_' => 'boolean', 'desc_' => "When true, Gregarius won't display any image in items shown on mobile devices.", 'export_' => NULL)));