Esempio n. 1
0
}

function _markallread(o,type,name)
{
	//window.alert( o.href + "&redirectto=" + escape(window.location) );
	<?php 
    $options = rss_plugins_get_option(MARKALLREAD_CONFIG_OPTIONS);
    if (null == $options) {
        $options = MARKALLREAD_OPTION_CONFIIRM;
    }
    if ($options & MARKALLREAD_OPTION_CONFIIRM) {
        ?>
	if( _confirmmarkallread( type, name ) )
	<?php 
    }
    ?>
		window.location = o.href + "&redirectto=" + escape(window.location);
	return false;
}

	<?php 
    flush();
    exit;
} else {
    rss_set_hook('rss.plugins.javascript', '__markallread_js');
    rss_set_hook('rss.plugins.sidemenu.categoryunreadlabel', '__markallread_sidemenu_categoryunreadlabel');
    rss_set_hook('rss.plugins.sidemenu.folderunreadlabel', '__markallread_sidemenu_folderunreadlabel');
    rss_set_hook('rss.plugins.sidemenu.feedunreadlabel', '__markallread_sidemenu_feedunreadlabel');
    rss_set_hook('rss.plugins.items.beforeitemsimmediate', '__markallread_beforeitemsimmediate');
    rss_set_hook('rss.plugins.items.afteritems', '__markallread_afteritems');
}
Esempio n. 2
0
 * look for POST parameters prefixed with "rss_" and add them to the RSS url 
 */
function __rss_view_post2get()
{
    $ret = "";
    foreach ($_POST as $key => $val) {
        if (substr($key, 0, 4) == 'rss_') {
            $ret .= "&" . "{$key}=" . $_POST[$key];
        }
    }
    return $ret;
}
function __rss_view_footerlink($dummy)
{
    if (!defined('RSS_FILE_LOCATION')) {
        echo "<span><a href=\"" . __rss_view_url() . "\">RSS</a></span>\n";
        echo "<span><a href=\"" . __rss_view_url("atom") . "\">Atom</a></span>\n";
    }
    return $dummy;
}
function __rss_view_headerlink($dummy)
{
    if (!defined('RSS_FILE_LOCATION')) {
        echo "\t<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"" . __rss_view_url() . "\" />\n";
        echo "\t<link rel=\"alternate\" type=\"application/atom+xml\" title=\"Atom\" href=\"" . __rss_view_url("atom") . "\" />\n";
    }
    return $dummy;
}
rss_set_hook("rss.plugins.footer.span", "__rss_view_footerlink");
rss_set_hook("rss.plugins.stylesheets", '__rss_view_headerlink');
    $ret = "";
    if ($options & STICKYFLAG_ENABLE_STICKY_SHORTCUT) {
        $ret .= "function _stickyflag_sticky(id, state) {\n" . "  var sticky = " . RSS_MODE_STICKY_STATE . ";\n" . "  var img    = document.getElementById('sticky_img_'+id);\n" . "\n" . "  if(!document.states[id]) {\n" . "    document.states[id] = state;\n" . "  }\n" . "\n" . "  if(document.states[id] & sticky) {\n" . "    document.states[id] ^= sticky;\n" . "    img.src = '" . STICKYFLAG_ICON_NOSTICKY . "';\n" . "  } else {\n" . "    document.states[id] |= sticky;\n" . "    img.src = '" . STICKYFLAG_ICON_STICKY . "';\n" . "  }\n" . "\n" . "  setState(id, document.states[id]);\n" . "}\n";
    }
    if ($options & STICKYFLAG_ENABLE_FLAG_SHORTCUT) {
        $ret .= "function _stickyflag_flag(id, state) {\n" . "  var flag   = " . RSS_MODE_FLAG_STATE . ";\n" . "  var img    = document.getElementById('flag_img_'+id);\n" . "\n" . "  if(!document.states[id]) {\n" . "    document.states[id] = state;\n" . "  }\n" . "\n" . "  if(document.states[id] & flag) {\n" . "    document.states[id] ^= flag;\n" . "    img.src = '" . STICKYFLAG_ICON_NOFLAG . "';\n" . "  } else {\n" . "    document.states[id] |= flag;\n" . "    img.src = '" . __stickyflag_GetFlagIcon() . "';\n" . "  }\n" . "\n" . "  setState(id, document.states[id]);\n" . "}\n";
    }
    if (!empty($ret)) {
        print $ret;
    }
}
function __stickyflag_OnOk($ret)
{
    $options = rss_plugins_get_option(STICKYFLAG_CONFIG_OPTIONS);
    if (null == $options) {
        return;
    }
    $ret .= " ";
    if ($options & STICKYFLAG_ENABLE_STICKY_SHORTCUT) {
        $ret .= "if((sfs = document.getElementById(\\'sf_ID_s\\')) && sfs.checked) {" . "  document.getElementById(\\'sticky_img__ID_\\').src = \\'" . STICKYFLAG_ICON_STICKY . "\\';" . "} else {" . "  document.getElementById(\\'sticky_img__ID_\\').src = \\'" . STICKYFLAG_ICON_NOSTICKY . "\\';" . "}";
    }
    if ($options & STICKYFLAG_ENABLE_FLAG_SHORTCUT) {
        $ret .= "if((sff = document.getElementById(\\'sf_ID_f\\')) && sff.checked) {" . "  document.getElementById(\\'flag_img__ID_\\').src = \\'" . __stickyflag_GetFlagIcon() . "\\';" . "} else {" . "  document.getElementById(\\'flag_img__ID_\\').src = \\'" . STICKYFLAG_ICON_NOFLAG . "\\';" . "}";
    }
    return $ret;
}
rss_set_hook("rss.plugins.navelements", "__stickyflag_AddButtons");
rss_set_hook("rss.plugins.items.beforetitle", "__stickyflag_BeforeTitle");
rss_set_hook("rss.plugins.ajax.extrajs.private", "__stickyflag_js");
rss_set_hook("rss.plugins.ajax.admindlg.onok", "__stickyflag_OnOk");
Esempio n. 4
0
    if ($bfr) {
        define('DLSRX', '|<a href="/tag/([^"]+)".*>\\1</a>|U');
        if ($bfr && preg_match_all(DLSRX, $bfr, $hits, PREG_SET_ORDER)) {
            $hits = array_slice($hits, 0, MAX_TAGS_PER_ITEM);
            foreach ($hits as $hit) {
                $ret[] = $hit[1];
            }
        }
    }
    return "{$id}," . implode(" ", $ret);
}
function __delicious_edittag_js($dummy)
{
    ?>
        // get tag suggestions from del.icio.us
        newspan = document.createElement("span");
        newspan.setAttribute("id","dt" + id);
        newspan.style.margin="0 0 0 0.5em";
        newspan.innerHTML = "<?php 
    echo __('suggestions');
    ?>
: (...) ]";
        actionSpan.appendChild(newspan);
        get_from_delicious(id);
<?php 
    return null;
}
rss_set_hook('rss.plugins.javascript', '__delicious_js_register');
rss_set_hook('rss.plugins.ajax.exports', '__delicious_appendAJAXfunction');
rss_set_hook('rss.plugins.ajax.extrajs.edittag', '__delicious_edittag_js');
Esempio n. 5
0
						o.setAttribute("ondblclick","return false;");
					}
				}

				setState(id,s);
			}

		}
	}
	function __dbclickToRead_jsInit() {
		var isIE=document.all?true:false;
		var items = document.getElementsByTagName('li');
		for (var i=0; i<items.length; i++) {
			var item = items[i];
			if (item.className == "item unread") {
            	if (isIE) {
                	item.ondblclick = function() { __dblclickToRead_js_getId(this); return false;}
            	} else {
                	item.setAttribute("ondblclick","__dblclickToRead_js_getId(this); return false;");
            	}
			}
		}
	}

    <?php 
    flush();
    exit;
}
rss_set_hook('rss.plugins.javascript', '__dblclicktoread_js_register');
rss_set_hook('rss.plugins.bodyend', '__dblclickToRead_init_js');
Esempio n. 6
0
/// Name: Url filter
/// Author: Marco Bonetti
/// Description: This plugin will try to make ugly URL links look better
/// Version: 1.9
/**
 * Replaces a link in the form <a href="http://www.test.com/a/b/c.html>http://www.test.com/a/b/c.html</a>
 * with a nicer <a href="http://www.test.com/a/b/c.html">[test.com]</a>
 */
function __urlfilter_filter($in)
{
    $match = '#<a[^>]+?href="(.*?)">\\1</a>#im';
    // matches non-linkified URLs
    $match2 = '#[^>"\'/=\\?](http[^\\s<$]+)[\\s$]?#im';
    $ret = preg_replace_callback($match, '__filter_callback', $in);
    $ret2 = preg_replace_callback($match2, '__filter_callback', $ret);
    return $ret2;
}
/**
 * We need a callback because for some obscure reason the /ie modifier wouldnt work 
 * in preg_replace alone. This basically formats the output
 */
function __filter_callback($matches)
{
    $ret = preg_match("/^(http:\\/\\/)?([^\\/<]+)/i", $matches[1], $outmatches);
    if ($outmatches && isset($outmatches[2])) {
        return " <a href=\"" . $matches[1] . "\">[" . $outmatches[2] . "]</a> ";
    }
    return " <a href=\"" . $matches[1] . "\">[" . $matches[1] . "]</a> ";
}
rss_set_hook('rss.plugins.import.description', '__urlfilter_filter');
Esempio n. 7
0
	}
	function __kbnav_OpenUrlNW() {
		var r = __kbnav_CurrentItemData();
		if (null != r && r.url) {
			window.open(r.url,'_blank');
		}
		return false;
	}
	function __kbnav_MarkAllRead() {
		var forms = document.getElementsByTagName('form');
		for(var i=0;i<forms.length;i++) {
			if (forms[i].className == 'markReadForm') {
				forms[i].submit();
				break;
			}
		}
		return false;
	}
	function __kbnav_EditTags() {
		var r = __kbnav_CurrentItemData();
		if (null != r && r.id && 'function' == typeof(_et)) {
			_et(r.id);
		}
	}
<?php 
    flush();
    exit;
}
rss_set_hook('rss.plugins.javascript', '__kbnav_js_register');
rss_set_hook('rss.plugins.bodyend', '__kbnav_init_js');
{
    $url = getPath() . RSS_PLUGINS_DIR . "/roundedcorners.php?rc-css";
    return "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\" />\n";
}
if (isset($_GET['rc-css'])) {
    $css = "\n/* bad bad bad */\n.frame,.item,h3.collapsed,table,div.content img,\nul.navlist li,a.bookmarklet, fieldset, div#pbholder, div.ief,\ndiv.ief p a, #loginfo, input[type=\"submit\"] { -moz-border-radius: 5px; -webkit-border-radius:5px }\n#sidemenu li {\n\t-moz-border-radius-top-left:5px;\n\t-moz-border-radius-top-right:5px;\n\t-webkit-border-top-left-radius:5px;\n\t-webkit-border-top-right-radius:5px;\n}\n";
    require_once '../core.php';
    rss_bootstrap(false, '$Revision$' . $css, 24);
    header('Content-Type: text/css');
    echo $css;
    exit;
}
/* Turn off rounded corners on the big frames because of a gecko
rendering bug */
function __roundedCornersCheckjs($dummy)
{
    ?>
      <script type="text/javascript">
      <!--
      	var theMainDivsOfItems = document.getElementById("items");	
		if (theMainDivsOfItems && (theMainDivsOfItems.offsetHeight > 29000)) {
			theMainDivsOfItems.style.MozBorderRadius = 0;
		}
	   -->
      </script>
<?php 
    return $dummy;
}
rss_set_hook("rss.plugins.stylesheets", '__rc_CSS');
rss_set_hook('rss.plugins.bodyend', '__roundedCornersCheckjs');
Esempio n. 9
0
    return $dummy;
}
if (isset($_REQUEST['nwjs'])) {
    require_once '../core.php';
    rss_bootstrap(false, '$Revision$', 24);
    require_once '../init.php';
    ?>
	function __new_window() {
    if (document.getElementsByTagName) {
        var items = document.getElementById("items");
        if (items) {
            var anchors = items.getElementsByTagName("a");
            for (var i=0; i<anchors.length; i++) {
                var anchor = anchors[i];
                if (anchor.href && (anchor.href.indexOf('<?php 
    echo $_SERVER['HTTP_HOST'];
    ?>
') < 0)) {
                    anchor.target = '_blank';
                }
            }
        }
    }
	}
<?php 
    flush();
    exit;
}
rss_set_hook('rss.plugins.javascript', '__new_window_js_register');
rss_set_hook('rss.plugins.bodyend', '__new_window_init_js');
Esempio n. 10
0
    $i->description = kses($i->description, $allowed);
    return $i;
}
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;
}
if (rss_theme_config_override_option('rss.content.strip.images', DEFAULT_MOBILE_CONTENT_STRIP_IMAGES)) {
    rss_set_hook('rss.plugins.items.beforerender', '__mobile_strip_images');
}
if (rss_theme_config_override_option('rss.output.maxlength', DEFAULT_MOBILE_OUTPUT_MAXLENGTH) > 0) {
    rss_set_hook('rss.plugins.items.beforerender', '__mobile_truncate_content');
}
function mobileLoginForm()
{
    ?>
<html><head><title>Login</title></head>
<body>
<form method="post" action="<?php 
    echo getPath();
    ?>
">
<p><input type="hidden" name="media" value="mobile" />
<label for="username">Username:</label>
<input type="text" id="username" name="username" value="" /></p>
<p><label for="password">Password:</label>
<input type="password" name="password" id="password"  value="" /></p>
Esempio n. 11
0
    } else {
        return $wrk . " /";
    }
}
function __escape_ampersands($in)
{
    return str_replace('& ', '&amp; ', $in);
}
function __sanitize($in)
{
    $output = __escape_ampersands($in);
    //<br />
    $output = preg_replace('/<br\\s?\\/?>/i', '<br />', $output);
    //<img>
    $output = preg_replace("/<img([^>]*)alt=([^>]*)>/im", "<img\$1`alt=\$2>", $output);
    $output = preg_replace("/<img([^`|>]*)>/im", "<img alt=\"\"\$1>", $output);
    $output = preg_replace("/<img([^>]*)`alt=([^>]*)>/im", "<img\$1alt=\$2>", $output);
    $output = preg_replace('/<img([^>]+)>/eim', "'<img '.__endslash('\\1').'>'", $output);
    //lowercase tags
    // Removed: Fix for #111.
    //$output = preg_replace('/<([^\s]+)/eim',"'<'.strtolower('\\1')",$output);
    //blockquotes
    $output = str_replace('<blockquote><p>', '<blockquote>', $output);
    $output = str_replace('</p></blockquote>', '</blockquote>', $output);
    $output = str_replace('<blockquote>', '<blockquote><p>', $output);
    $output = str_replace('</blockquote>', '</p></blockquote>', $output);
    return stripslashes($output);
}
rss_set_hook('rss.plugins.import.description', '__sanitize');
//$in = "<img src=\"http://ok\" alt=\"alt\" /><BR><img src=\"http://nok\">";
//echo __sanitize($in) . "\n";
Esempio n. 12
0
 function HTTPServerPushUpdate($cid)
 {
     parent::Update($doPopulate = true, $updatePrivateAlso = false, $cid);
     $GLOBALS['rss']->header->appendHeader("Connection: close");
     $GLOBALS['rss']->header->appendHeader("Content-type: multipart/x-mixed-replace;boundary=\"" . PUSH_BOUNDARY . "\"");
     $GLOBALS['rss']->header->options |= HDR_NO_OUPUTBUFFERING;
     rss_set_hook('rss.plugins.bodystart', "pushHeaderCallBack");
     rss_set_hook('rss.plugins.bodyend', "pushFooterCallBack");
     ob_implicit_flush();
 }
Esempio n. 13
0
<?php

/// Name: FireStats plugin for Gregarius
/// Author: Omry Yadan
/// Description: Enables FireStats to monitor access to Gregarius
/// Version: 1.0
/// Configuration: __firestats_config
// register the hooks
rss_set_hook('rss.plugins.bodystart', '__firestats_hit');
rss_set_hook("rss.plugins.navelements", "__firestats_nav_button");
function __firestats_installed_in_gregarius()
{
    $path = dirname(__FILE__);
    return file_exists($path . '/php/db-hit.php');
}
function __get_firestats_path()
{
    if (!__firestats_installed_in_gregarius()) {
        $path = rss_plugins_get_option('firestats.path');
        if ($path == null || $path == '') {
            echo 'You need to configure the FireStats plugin in the plugins screen<br/>';
            return false;
        } else {
            if (!file_exists($path . '/php/db-hit.php')) {
                echo "FireStats was not detected at <b>{$path}</b>.<br/>";
                return false;
            } else {
                return $path;
            }
        }
    } else {