function init()
 {
     register_filter("error", new filter_control_error(), NW_PFILTER_IMMEDIATE | NW_PFILTER_MORE);
     register_filter("addheader", new filter_control_addheader(), NW_PFILTER_IMMEDIATE | NW_PFILTER_MORE);
     register_filter("nocache", new filter_control_nocache(), NW_PFILTER_IMMEDIATE);
     register_filter("addservervar", new filter_control_addservervar(), NW_PFILTER_IMMEDIATE | NW_PFILTER_MORE);
     register_filter("handler", new filter_handler(), NW_PFILTER_ALL);
 }
 function init()
 {
     if (function_exists("imagecreatefromstring")) {
         register_filter("copyright", new filter_copyright(), NW_PFILTER_ALL);
         register_filter("convert", new filter_convert(), NW_PFILTER_ALL);
         register_filter("wbmp", new filter_wbmp(), NW_PFILTER_ALL);
     }
 }
 function mod_html_filters()
 {
     $this->modtype = "pfilter_registration";
     $this->modname = "HTML Filters";
     register_filter("shrink", new filter_shrink(), NW_PFILTER_ALL);
     register_filter("downcase", new filter_downcase(), NW_PFILTER_ALL);
     register_filter("wap", new filter_wap(), NW_PFILTER_ALL);
     register_filter("garbage", new filter_garbage(), NW_PFILTER_ALL);
 }
 function mod_pfilters()
 {
     $this->modtype = "core_before_response";
     $this->modname = "Filter support";
     // this one works with static, parsed and chunked:
     register_filter("null", new pfilter(false, "filter_null"), NW_PFILTER_ALL | NW_PFILTER_MORE);
     // any external program with this one:
     register_filter("pipe", new filter_pipe(false, "piping through arbitrary filter programs"), NW_PFILTER_ALL | NW_PFILTER_MORE);
     // this one makes many other filters happy:
     register_filter("unchunk", new filter_unchunk(false, "filter to resemble chunky parser content"), NW_PFILTER_CHUNKY);
 }
<?php

/**
 * Provides extensions to the admin toolbox.
 * This is intended as an example only.
 *
 * @author Stephen Billard (sbillard)
 * @version 1.0.0
 * @package plugins
 */
$plugin_description = gettext("An example of how to create extensions to the  administrative toolbox on your theme pages.");
$plugin_author = "Stephen Billard (sbillard)";
$plugin_version = '1.0.0';
$plugin_URL = "http://www.zenphoto.org/documentation/plugins/_plugins---flter-admin_toolbox.php.html";
register_filter('admin_toolbox_global', 'toolbox_global_extensions');
register_filter('admin_toolbox_gallery', 'toolbox_gallery_extensions');
/* enable these registrations if you have album, image, search, or news specific extensions.
 * 
 *
register_filter('admin_toolbox_album', 'toolbox_album_extensions');
register_filter('admin_toolbox_image', 'toolbox_image_extensions');
register_filter('admin_toolbox_search', 'toolbox_search_extensions');
register_filter('admin_toolbox_news', 'toolbox_news_extensions');
 */
function toolbox_global_extensions()
{
    if (zp_loggedin(ADMIN_RIGHTS)) {
        echo "<li>";
        printLink(WEBPATH . "/" . ZENFOLDER . '/admin-plugins.php', gettext("Plugins"), NULL, NULL, NULL);
        echo "</li>\n";
    }
    } else {
        if ($type == "type") {
            return "Linkedin";
        }
    }
}
register_filter('add_site_select', 'linkedin_add_select');
function linkedin_add_select($menu)
{
    if (isset($_POST["type"]) && $_POST["type"] == "li") {
        return $menu . "<option value='li' selected>Linkedin</option>";
    } else {
        return $menu . "<option value='li'>Linkedin</option>";
    }
}
register_filter('stats', 'linkedin_stats');
function linkedin_stats($stats)
{
    $stat = mysql_query("SELECT * FROM `linkedin`");
    $stat = mysql_num_rows($stat);
    $clicks = mysql_fetch_object(mysql_query("SELECT SUM( `exchanges` ) AS `visits` FROM `linkedin`"));
    $clicks = $clicks->visits;
    if ($clicks == "") {
        $clicks = 0;
    }
    return $stats . "<tr><td>Linkedin</td><td>{$stat}</td><td>{$clicks}</td></tr>";
}
/*register_action('initialize','facebook2');

function facebook2() {
	echo "Ich mag Facebook!";
function retweet_info($type)
{
    if ($type == "db") {
        return "retweet";
    } else {
        if ($type == "type") {
            return "Retweet";
        }
    }
}
register_filter('add_site_select', 'retweet_add_select');
function retweet_add_select($menu)
{
    if (isset($_POST["type"]) && $_POST["type"] == "rt") {
        return $menu . "<option value='rt' selected>Retweet</option>";
    } else {
        return $menu . "<option value='rt'>Retweet</option>";
    }
}
register_filter('stats', 'retweet_stats');
function retweet_stats($stats)
{
    $stat = mysql_query("SELECT * FROM `retweet`");
    $stat = mysql_num_rows($stat);
    $clicks = mysql_fetch_object(mysql_query("SELECT SUM( `exchanges` ) AS `visits` FROM `retweet`"));
    $clicks = $clicks->visits;
    if ($clicks == "") {
        $clicks = 0;
    }
    return $stats . "<tr><td>Retweet</td><td>{$stat}</td><td>{$clicks}</td></tr>";
}
<?php

/**
 * translates accented characters to unaccented ones
 * @package plugins
 */
$plugin_description = gettext("Filter applied to filenames to translate accented characters to unaccented ones for seo friendly URLs.");
$plugin_author = "Stephen Billard (sbillard)";
$plugin_version = '1.0.0';
$plugin_URL = "http://www.zenphoto.org/documentation/plugins/_plugins---filter-seo.php.html";
register_filter('seoFriendlyURL', 'filterAccentedCharacters');
/**
 * translates accented characters to unaccented ones
 *
 * @param string $string
 * @return string
 */
function filterAccentedCharacters($string)
{
    // strip/convert a few specific characters
    $specialchars = array("À" => "A", "Á" => "A", "Â" => "A", "Ã" => "A", "Ä" => "AE", "Å" => "A", "Ā" => "A", "Ă" => "A", "Ą" => "A", "Ǟ" => "A", "Ǡ" => "A", "Ǻ" => "A", "Ȁ" => "A", "Ȃ" => "A", "Ȧ" => "A", "Ḁ" => "A", "Ả" => "A", "Ấ" => "A", "Ầ" => "A", "Ẩ" => "A", "Ẫ" => "A", "Ậ" => "A", "Ắ" => "A", "Ằ" => "A", "Ẳ" => "A", "Ẵ" => "A", "Ặ" => "A", "Å" => "A", "Æ" => "AE", "Ǽ" => "AE", "Ǣ" => "AE", "Ḃ" => "B", "Ɓ" => "B", "Ḅ" => "B", "Ḇ" => "B", "Ƃ" => "B", "Ƅ" => "B", "Ć" => "C", "Ĉ" => "C", "Ċ" => "C", "Č" => "C", "Ƈ" => "C", "Ç" => "C", "Ḉ" => "C", "Ḋ" => "D", "Ɗ" => "D", "Ḍ" => "D", "Ḏ" => "D", "Ḑ" => "D", "Ḓ" => "D", "Ď" => "D", "Đ" => "D", "Ɖ" => "D", "È" => "E", "É" => "E", "Ê" => "E", "Ẽ" => "E", "Ē" => "E", "Ĕ" => "E", "Ė" => "E", "Ë" => "E", "Ẻ" => "E", "Ě" => "E", "Ȅ" => "E", "Ȇ" => "E", "Ẹ" => "E", "Ȩ" => "E", "Ę" => "E", "Ḙ" => "E", "Ḛ" => "E", "Ề" => "E", "Ế" => "E", "Ễ" => "E", "Ể" => "E", "Ḕ" => "E", "Ḗ" => "E", "Ệ" => "E", "Ḝ" => "E", "Ǝ" => "E", "Ɛ" => "E", "Ḟ" => "F", "Ƒ" => "F", "Ǵ" => "G", "Ĝ" => "G", "Ḡ" => "G", "Ğ" => "G", "Ġ" => "G", "Ǧ" => "G", "Ɠ" => "G", "Ģ" => "G", "Ǥ" => "G", "Ĥ" => "H", "Ḣ" => "H", "Ḧ" => "H", "Ȟ" => "H", "Ƕ" => "H", "Ḥ" => "H", "Ḩ" => "H", "Ḫ" => "H", "Ħ" => "H", "Ì" => "I", "Í" => "I", "Î" => "I", "Ĩ" => "I", "Ī" => "I", "Ĭ" => "I", "İ" => "I", "Ï" => "I", "Ỉ" => "I", "Ǐ" => "I", "Ị" => "I", "Į" => "I", "Ȋ" => "I", "Ḭ" => "I", "Ḭ" => "I", "Ɨ" => "I", "Ḯ" => "I", "IJ" => "J", "Ĵ" => "J", "Ḱ" => "K", "Ǩ" => "K", "Ḵ" => "K", "Ƙ" => "K", "Ḳ" => "K", "Ķ" => "K", "Ḻ" => "L", "Ḷ" => "L", "Ḷ" => "L", "Ļ" => "L", "Ḽ" => "L", "Ľ" => "L", "Ŀ" => "L", "Ł" => "L", "Ḹ" => "L", "Ḿ" => "M", "Ṁ" => "M", "Ṃ" => "M", "Ɯ" => "M", "Ǹ" => "N", "Ń" => "N", "Ñ" => "N", "Ṅ" => "N", "Ň" => "N", "Ŋ" => "N", "Ɲ" => "N", "Ṇ" => "N", "Ņ" => "N", "Ṋ" => "N", "Ṉ" => "N", "Ƞ" => "N", "Ö" => "OE", "Ò" => "O", "Ó" => "O", "Ô" => "O", "Õ" => "O", "Ō" => "O", "Ŏ" => "O", "Ȍ" => "O", "Ȏ" => "OE", "Ơ" => "O", "Ǫ" => "O", "Ọ" => "O", "Ɵ" => "O", "Ø" => "OE", "Ồ" => "O", "Ố" => "O", "Ỗ" => "O", "Ổ" => "O", "Ȱ" => "O", "Ȫ" => "O", "Ȭ" => "O", "Ṍ" => "O", "Ṏ" => "O", "Ṑ" => "O", "Ṓ" => "O", "Ờ" => "O", "Ớ" => "O", "Ỡ" => "O", "Ở" => "O", "Ǭ" => "O", "Ộ" => "O", "Ǿ" => "OE", "Ɔ" => "O", "Œ" => "OE", "Ṕ" => "P", "Ṗ" => "P", "Ƥ" => "P", "Ŕ" => "R", "Ṙ" => "R", "Ř" => "R", "Ȑ" => "R", "Ȓ" => "R", "Ṛ" => "R", "Ŗ" => "R", "Ṟ" => "R", "Ṝ" => "R", "Ʀ" => "R", "Ś" => "S", "Ŝ" => "S", "Ṡ" => "S", "Š" => "S", "Ṣ" => "S", "Ș" => "S", "Ş" => "S", "Ṥ" => "S", "Ṧ" => "S", "Ṩ" => "S", "Ṫ" => "T", "Ť" => "T", "Ƭ" => "T", "Ʈ" => "T", "Ṭ" => "T", "Ț" => "T", "Ţ" => "T", "Ṱ" => "T", "Ṯ" => "T", "Ŧ" => "T", "Ù" => "U", "Ú" => "U", "Û" => "U", "Ũ" => "U", "Ū" => "U", "Ŭ" => "U", "Ü" => "UE", "Ủ" => "U", "Ů" => "U", "Ű" => "U", "Ǔ" => "U", "Ȕ" => "U", "Ȗ" => "U", "Ư" => "U", "Ụ" => "U", "Ṳ" => "U", "Ų" => "U", "Ṷ" => "U", "Ṵ" => "U", "Ṹ" => "U", "Ṻ" => "U", "Ǜ" => "U", "Ǘ" => "U", "Ǖ" => "U", "Ǚ" => "U", "Ừ" => "U", "Ứ" => "U", "Ữ" => "U", "Ử" => "U", "Ự" => "U", "Ṽ" => "V", "Ṿ" => "V", "Ʋ" => "V", "Ẁ" => "W", "Ẃ" => "W", "Ŵ" => "W", "Ẇ" => "W", "Ẅ" => "W", "Ẉ" => "W", "Ẋ" => "X", "Ẍ" => "X", "Ỳ" => "Y", "Ý" => "Y", "Ŷ" => "Y", "Ỹ" => "Y", "Ȳ" => "Y", "Ẏ" => "Y", "Ÿ" => "Y", "Ỷ" => "Y", "Ƴ" => "Y", "Ỵ" => "Y", "Ź" => "Z", "Ẑ" => "Z", "Ż" => "Z", "Ž" => "Z", "Ȥ" => "Z", "Ẓ" => "Z", "Ẕ" => "Z", "Ƶ" => "Z", "à" => "a", "á" => "a", "â" => "a", "ã" => "a", "ā" => "a", "ă" => "a", "ȧ" => "a", "ä" => "ae", "ả" => "a", "å" => "a", "ǎ" => "a", "ȁ" => "a", "ȃ" => "a", "ạ" => "a", "ḁ" => "a", "ẚ" => "a", "ầ" => "a", "ấ" => "a", "ẫ" => "a", "ẩ" => "a", "ằ" => "a", "ắ" => "a", "ẵ" => "a", "ẳ" => "a", "ǡ" => "a", "ǟ" => "a", "ǻ" => "a", "ậ" => "a", "ặ" => "a", "ǽ" => "a", "ḃ" => "b", "ɓ" => "b", "ḅ" => "b", "ḇ" => "b", "ƀ" => "b", "ƃ" => "b", "ƅ" => "b", "c" => "c", "ć" => "c", "ĉ" => "c", "ċ" => "c", "č" => "c", "ƈ" => "c", "ç" => "c", "ḉ" => "c", "ḍ" => "d", "ḏ" => "d", "ḑ" => "d", "ḓ" => "d", "ď" => "d", "đ" => "d", "ƌ" => "d", "ȡ" => "d", "è" => "e", "é" => "e", "ê" => "e", "ẽ" => "e", "ē" => "e", "ĕ" => "e", "ė" => "e", "ë" => "e", "ě" => "e", "ȅ" => "e", "ȇ" => "e", "ẹ" => "e", "ȩ" => "e", "ę" => "e", "ḙ" => "e", "ề" => "e", "ế" => "e", "ễ" => "e", "ể" => "e", "ḕ" => "e", "ḗ" => "e", "ệ" => "e", "ḝ" => "e", "ǝ" => "e", "ɛ" => "e", "ḟ" => "f", "ƒ" => "f", "ǵ" => "g", "ĝ" => "g", "ḡ" => "g", "ğ" => "g", "ġ" => "g", "ǧ" => "g", "ɠ" => "g", "ģ" => "g", "ǥ" => "g", "ĥ" => "h", "ḣ" => "h", "ḧ" => "h", "ȟ" => "h", "ƕ" => "h", "ḥ" => "h", "ḩ" => "h", "ḫ" => "h", "ẖ" => "h", "ħ" => "h", "ì" => "i", "í" => "i", "î" => "i", "ĩ" => "i", "ī" => "i", "ĭ" => "i", "ı" => "i", "ï" => "i", "ỉ" => "i", "ǐ" => "i", "ị" => "i", "į" => "i", "ȉ" => "i", "ȋ" => "i", "ḭ" => "i", "ɨ" => "i", "ḯ" => "i", "ij" => "i", "ĵ" => "j", "ǰ" => "j", "ḱ" => "k", "ǩ" => "k", "ḵ" => "k", "ƙ" => "k", "ḳ" => "k", "ķ" => "k", "ĺ" => "l", "ḻ" => "l", "ḷ" => "l", "ļ" => "l", "ḽ" => "l", "ľ" => "l", "ŀ" => "l", "ł" => "l", "ƚ" => "l", "ḹ" => "l", "ȴ" => "l", "ḿ" => "m", "ṁ" => "m", "ṃ" => "m", "ɯ" => "m", "ǹ" => "n", "ń" => "n", "ñ" => "n", "ṅ" => "n", "ň" => "n", "ŋ" => "n", "ɲ" => "n", "ṇ" => "n", "ņ" => "n", "ṋ" => "n", "ṉ" => "n", "ʼn" => "n", "ƞ" => "n", "ȵ" => "n", "ò" => "o", "ó" => "o", "ô" => "o", "õ" => "o", "ō" => "o", "ŏ" => "o", "ȯ" => "o", "ö" => "oe", "ỏ" => "o", "ő" => "o", "ǒ" => "o", "ȍ" => "o", "ȏ" => "o", "ơ" => "o", "ǫ" => "o", "ọ" => "o", "ɵ" => "o", "ø" => "oe", "ồ" => "o", "ố" => "o", "ỗ" => "o", "ổ" => "o", "ȱ" => "o", "ȫ" => "o", "ȭ" => "o", "ṍ" => "o", "ṏ" => "o", "ṑ" => "o", "ṓ" => "o", "ờ" => "o", "ớ" => "o", "ỡ" => "o", "ở" => "o", "ợ" => "o", "ǭ" => "o", "ộ" => "o", "ǿ" => "o", "ɔ" => "o", "œ" => "oe", "ṕ" => "p", "ṗ" => "p", "ƥ" => "p", "ŕ" => "p", "ṙ" => "p", "ř" => "p", "ȑ" => "p", "ȓ" => "p", "ṛ" => "p", "ŗ" => "p", "ṟ" => "p", "ṝ" => "p", "ś" => "s", "ŝ" => "s", "ṡ" => "s", "š" => "s", "ṣ" => "s", "ș" => "s", "ş" => "s", "ṥ" => "s", "ṧ" => "s", "ṩ" => "s", "ß" => "ss", "ſ" => "t", "ẛ" => "t", "ṫ" => "t", "ẗ" => "t", "ť" => "t", "ƭ" => "t", "ʈ" => "t", "ƫ" => "t", "ṭ" => "t", "ț" => "t", "ţ" => "t", "ṱ" => "t", "ṯ" => "t", "ŧ" => "t", "ȶ" => "t", "ù" => "u", "ú" => "u", "û" => "u", "ũ" => "u", "ū" => "u", "ŭ" => "u", "ü" => "ue", "ủ" => "u", "ů" => "u", "ű" => "u", "ǔ" => "u", "ȕ" => "u", "ȗ" => "u", "ư" => "u", "ụ" => "u", "ṳ" => "u", "ų" => "u", "ṷ" => "u", "ṵ" => "u", "ṹ" => "u", "ṻ" => "u", "ǖ" => "u", "ǜ" => "u", "ǘ" => "u", "ǖ" => "u", "ǚ" => "u", "ừ" => "u", "ứ" => "u", "ữ" => "u", "ử" => "u", "ự" => "u", "ṽ" => "v", "ṿ" => "u", "ẁ" => "w", "ẃ" => "w", "ŵ" => "w", "ẇ" => "w", "ẅ" => "w", "ẘ" => "w", "ẉ" => "w", "ẋ" => "x", "ẍ" => "x", "ỳ" => "y", "ý" => "y", "ŷ" => "y", "ỹ" => "y", "ȳ" => "y", "ẏ" => "y", "ÿ" => "y", "ỷ" => "y", "ẙ" => "y", "ƴ" => "y", "ỵ" => "y", "ź" => "z", "ẑ" => "z", "ż" => "z", "ž" => "z", "ȥ" => "z", "ẓ" => "z", "ẕ" => "z", "ƶ" => "z", "/" => "-", "," => "-", "," => "-", ";" => "-", " " => "-");
    $string = strtr($string, $specialchars);
    $string = preg_replace("/&([a-zA-Z])(uml|acute|grave|circ|tilde|ring),/", "", $string);
    $string = preg_replace("/[^a-zA-Z0-9_.-]/", "", $string);
    $string = str_replace(array('---', '--'), '-', $string);
    return $string;
}
<?php

/**
 * Adds data to newly created images and albums.
 * @package plugins
 */
$plugin_description = gettext('Adds admin user who uploaded image to the description of the image (and to the album description if the album did not already exist.)') . ' ' . gettext('For this to work with ZIP files you must have ZZIPlib configured in your PHP.') . (function_exists('zip_open') ? '' : ' ' . gettext('<strong>You do not have ZZIPlib configured.</strong>'));
$plugin_author = "Stephen Billard (sbillard)";
$plugin_version = '1.0.0';
$plugin_URL = "http://www.zenphoto.org/documentation/plugins/_plugins---filter-new_objects.php.html";
register_filter('new_album', 'updateAlbum');
register_filter('new_image', 'updateImage');
/**
 * Adds user who caused the album to be created to the description of the album
 *
 * @param object $album
 * @return object
 */
function updateAlbum($album)
{
    global $_zp_current_admin;
    if (zp_loggedin()) {
        $bt = debug_backtrace();
        foreach ($bt as $b) {
            if (isset($b['file']) && basename($b['file']) == 'admin-upload.php') {
                $album->setDesc(gettext('Created by: ') . $_zp_current_admin['name']);
            }
        }
    }
    return $album;
}
Esempio n. 10
0
$Cbucket->addJS('amplify/amplify.request.min.js');
$Cbucket->addJS('amplify/amplify.store.min.js');
$Cbucket->addJS('amplify_requests.js');
//Assigning JS Files
Assign('jsArray', $Cbucket->JSArray);
//Assigning Module Files
Assign('module_list', $Cbucket->moduleList);
//Checking Website is closed or not
if (config('closed') && THIS_PAGE != 'ajax' && !$in_bg_cron && THIS_PAGE != 'cb_install') {
    if (!has_access("admin_access", TRUE)) {
        e($row['closed_msg'], "w");
        template("global_header.html");
        template("message.html");
        exit;
    } else {
        e(lang("ATTENTION: THIS WEBSITE IS IN OFFLINE MODE"), "w");
    }
}
//Configuring Uploader
uploaderDetails();
register_filter('photo_action_links', 'cbphoto_pm_action_link_filter');
attach_photo_pm_handlers();
if (!IN_MODULE) {
    isSectionEnabled(PARENT_PAGE, true);
}
//setting quicklist
assign('total_quicklist', $cbvid->total_quicklist());
//Adding Template functions
if ($Cbucket->template_details['php_file']) {
    include $Cbucket->template_details['php_file'];
}
Esempio n. 11
0
$usercontent->add_new_content();
$usercontent->object_group = 'comments';
$usercontent->object = 'comments';
$usercontent->get_callback = 'cb_get_user_channel_comments';
$usercontent->add_new_content();
//add_new_subscription( "video", array( lang("Video"), lang("Videos") ) );
//add_subscription_template_file("subscriptions/blocks/video.html");
//
//add_new_subscription( "photo", array( lang("Photo"), lang("Photos") ) );
//add_subscription_template_file("subscriptions/blocks/photo.html");
function add_views_column($fields)
{
    $fields[] = 'views';
    return $fields;
}
function add_subscription_seen_feature($url)
{
    $current = get_current_subscription_object();
    return $url . "&feature=subscription&ccid=" . base64_encode($current['content_id'] . ":" . $current['content_type']);
}
add_new_subscription_type("video", lang("Video"), lang("Videos"));
add_new_subscription_section("videos");
add_new_subscription_db_values("video", "videoid");
add_new_subscription_condition("video.active = 'yes' AND video.status = 'Successful' AND video.broadcast != 'unlisted' AND video.broadcast != 'private'");
register_filter('video_content_fields_unsorted', 'add_views_column');
register_filter('subscription_content_link', 'add_subscription_seen_feature');
add_new_subscription_type("photo", lang("Photo"), lang("Photos"));
add_new_subscription_callback("get_subscription_photo");
add_new_subscription_section("photos");
add_new_subscription_db_values("photos", "photo_id");
add_new_subscription_condition("photos.active = 'yes' AND photos.collection_id <> '0' ");
Esempio n. 12
0
function googleplus_info($type)
{
    if ($type == "db") {
        return "googleplus";
    } else {
        if ($type == "type") {
            return "Google Plus";
        }
    }
}
register_filter('add_site_select', 'googleplus_add_select');
function googleplus_add_select($menu)
{
    if (isset($_POST["type"]) && $_POST["type"] == "gp") {
        return $menu . "<option value='gp' selected>Google PLus</option>";
    } else {
        return $menu . "<option value='gp'>Google Plus</option>";
    }
}
register_filter('stats', 'googleplus_stats');
function googleplus_stats($stats)
{
    $stat = mysql_query("SELECT * FROM `googleplus`");
    $stat = mysql_num_rows($stat);
    $clicks = mysql_fetch_object(mysql_query("SELECT SUM( `exchanges` ) AS `visits` FROM `googleplus`"));
    $clicks = $clicks->visits;
    if ($clicks == "") {
        $clicks = 0;
    }
    return $stats . "<tr><td>Google Plus</td><td>{$stat}</td><td>{$clicks}</td></tr>";
}
Esempio n. 13
0
    } else {
        if ($type == "type") {
            return "Facebook";
        }
    }
}
register_filter('add_site_select', 'facebook_add_select');
function facebook_add_select($menu)
{
    if (isset($_POST["type"]) && $_POST["type"] == "fb") {
        return $menu . "<option value='fb' selected>Facebook</option>";
    } else {
        return $menu . "<option value='fb'>Facebook</option>";
    }
}
register_filter('stats', 'facebook_stats');
function facebook_stats($stats)
{
    $stat = mysql_query("SELECT * FROM `facebook`");
    $stat = mysql_num_rows($stat);
    $clicks = mysql_fetch_object(mysql_query("SELECT SUM( `exchanges` ) AS `visits` FROM `facebook`"));
    $clicks = $clicks->visits;
    if ($clicks == "") {
        $clicks = 0;
    }
    return $stats . "<tr><td>Facebook</td><td>{$stat}</td><td>{$clicks}</td></tr>";
}
/*register_action('initialize','facebook2');

function facebook2() {
	echo "Ich mag Facebook!";
<?php

/*
Plugin Name: Không lưu lịch sử;
Description: Bỏ qua việc lưu lại lịch sử chỉnh sửa;
Version: 1.0;
Version Number: 1;
*/
register_filter('content_create_revision', 'id_to_zero');
function id_to_zero($id)
{
    return 0;
}
Esempio n. 15
0
 function init()
 {
     register_filter("throttle", new mod_throttle(false, $this->modname), NW_PFILTER_ALL);
 }
Esempio n. 16
0
    global $usercontent;
    $user = $usercontent->get_current_user();
    $total_collections = number_format($user['total_collections']);
    return $name . " <span>{$total_collections}</span>";
}
function show_total_subscribers($name)
{
    global $usercontent;
    $user = $usercontent->get_current_user();
    return $name . " <span>" . number_format($user['subscribers']) . "</span>";
}
function show_total_subscriptions($name)
{
    global $usercontent;
    $user = $usercontent->get_current_user();
    return $name . " <span>" . number_format($user['total_subscriptions']) . "</span>";
}
function show_total_friends($name)
{
    global $usercontent, $userquery;
    $user = $usercontent->get_current_user();
    $total_contacts = $userquery->get_contacts($user['userid'], 0, 'yes', true);
    return $name . " <span>" . number_format($total_contacts) . "</span>";
}
register_filter('videos_name_filter', 'show_total_videos');
register_filter('photos_name_filter', 'show_total_photos');
register_filter('collections_name_filter', 'show_total_collections');
register_filter('subscribers_name_filter', 'show_total_subscribers');
register_filter('subscriptions_name_filter', 'show_total_subscriptions');
register_filter('friends_name_filter', 'show_total_friends');
foreach ($alloptionlist as $key => $option) {
    if ($option == 1 && strpos($key, 'filter_file_searches_') === 0) {
        $mysetoptions[] = $key;
        if (strpos($key, 'filter_file_searches_albums_') === 0) {
            $enablealbum = true;
        }
        if (strpos($key, 'filter_file_searches_images_') === 0) {
            $enableimage = true;
        }
    }
}
if ($enablealbum) {
    register_filter('album_filter', 'filterAlbums');
}
if ($enableimage) {
    register_filter('image_filter', 'filterImages');
}
/**
 * Plugin option handling class
 *
 */
class filter_file_searches_options
{
    function filter_file_searches_options()
    {
    }
    function getOptionsSupported()
    {
        global $_zp_supported_images, $_zp_extra_filetypes, $mysetoptions;
        $albums = $this->loadAlbumNames(getAlbumFolder());
        $albums = array_unique($albums);
Esempio n. 18
0
$args = array('label' => 'SEO', 'key' => 'hm_seo_main_setting', 'function' => 'hm_seo_main_setting', 'function_input' => array(), 'child_of' => FALSE);
register_admin_setting_page($args);
function hm_seo_main_setting()
{
    if (isset($_POST['save_seo_setting'])) {
        foreach ($_POST as $key => $value) {
            $args = array('section' => 'hm_seo', 'key' => $key, 'value' => $value);
            set_option($args);
        }
    }
    hm_include(BASEPATH . '/' . HM_PLUGIN_DIR . '/hm_seo/layout/main_setting.php');
}
/* 
Hook action để hiển thị title, meta_description & meta_keywords
*/
register_filter('hm_title', 'hm_seo_display_title');
function hm_seo_display_title($title)
{
    global $hmcontent;
    global $hmtaxonomy;
    $request = get_current_uri();
    $request_data = get_uri_data(array('uri' => $request));
    if ($request == '') {
        $home_title = get_option(array('section' => 'hm_seo', 'key' => 'home_title'));
        if ($home_title != '') {
            return '<title>' . $home_title . '</title>' . "\n\r";
        } else {
            return $title;
        }
    } else {
        if ($request_data != FALSE) {
Esempio n. 19
0
    } else {
        if ($type == "type") {
            return "Stumbleupon";
        }
    }
}
register_filter('add_site_select', 'stumbleupon_add_select');
function stumbleupon_add_select($menu)
{
    if (isset($_POST["type"]) && $_POST["type"] == "su") {
        return $menu . "<option value='su' selected>Stumbleupon</option>";
    } else {
        return $menu . "<option value='su'>Stumbleupon</option>";
    }
}
register_filter('stats', 'stumbleupon_stats');
function stumbleupon_stats($stats)
{
    $stat = mysql_query("SELECT * FROM `stumbleupon`");
    $stat = mysql_num_rows($stat);
    $clicks = mysql_fetch_object(mysql_query("SELECT SUM( `exchanges` ) AS `visits` FROM `stumbleupon`"));
    $clicks = $clicks->visits;
    if ($clicks == "") {
        $clicks = 0;
    }
    return $stats . "<tr><td>Stumbleupon</td><td>{$stat}</td><td>{$clicks}</td></tr>";
}
/*register_action('initialize','facebook2');

function facebook2() {
	echo "Ich mag Facebook!";
Esempio n. 20
0
    } else {
        if ($type == "type") {
            return "Digg";
        }
    }
}
register_filter('add_site_select', 'digg_add_select');
function digg_add_select($menu)
{
    if (isset($_POST["type"]) && $_POST["type"] == "dg") {
        return $menu . "<option value='dg' selected>Digg</option>";
    } else {
        return $menu . "<option value='dg'>Digg</option>";
    }
}
register_filter('stats', 'digg_stats');
function digg_stats($stats)
{
    $stat = mysql_query("SELECT * FROM `digg`");
    $stat = mysql_num_rows($stat);
    $clicks = mysql_fetch_object(mysql_query("SELECT SUM( `exchanges` ) AS `visits` FROM `digg`"));
    $clicks = $clicks->visits;
    if ($clicks == "") {
        $clicks = 0;
    }
    return $stats . "<tr><td>Digg</td><td>{$stat}</td><td>{$clicks}</td></tr>";
}
/*register_action('initialize','facebook2');

function facebook2() {
	echo "Ich mag Facebook!";
Esempio n. 21
0
function youtube_info($type)
{
    if ($type == "db") {
        return "youtube";
    } else {
        if ($type == "type") {
            return "Youtube";
        }
    }
}
register_filter('add_site_select', 'youtube_add_select');
function youtube_add_select($menu)
{
    if (isset($_POST["type"]) && $_POST["type"] == "yt") {
        return $menu . "<option value='yt' selected>Youtube</option>";
    } else {
        return $menu . "<option value='yt'>Youtube</option>";
    }
}
register_filter('stats', 'youtube_stats');
function youtube_stats($stats)
{
    $stat = mysql_query("SELECT * FROM `youtube`");
    $stat = mysql_num_rows($stat);
    $clicks = mysql_fetch_object(mysql_query("SELECT SUM( `exchanges` ) AS `visits` FROM `youtube`"));
    $clicks = $clicks->visits;
    if ($clicks == "") {
        $clicks = 0;
    }
    return $stats . "<tr><td>Youtube</td><td>{$stat}</td><td>{$clicks}</td></tr>";
}
Esempio n. 22
0
 function init()
 {
     register_filter("gzip", $this, NW_PFILTER_ALL);
 }
Esempio n. 23
0
                    $new_output .= "</url>";
                }
                $query = "select * from " . prefix . "_eshop_products where active = 1 order by id desc";
                foreach ($mysql->select($query) as $rec) {
                    $link = checkLinkAvailable('eshop', 'show') ? generateLink('eshop', 'show', array('alt' => $rec['url'])) : generateLink('core', 'plugin', array('plugin' => 'eshop', 'handler' => 'show'), array('alt' => $rec['url']));
                    $new_output .= "<url>";
                    $new_output .= "<loc>" . home . $link . "</loc>";
                    $new_output .= "<priority>" . floatval(pluginGetVariable('gsmg', 'news_pr')) . "</priority>";
                    $new_output .= "<lastmod>" . strftime("%Y-%m-%d", max($rec['editdate'], $rec['date'])) . "</lastmod>";
                    $new_output .= "<changefreq>daily</changefreq>";
                    $new_output .= "</url>";
                }
                $output = $output . $new_output;
            }
        }
    }
    register_filter('gsmg', 'eshop', new gShopFilter());
}
function IsCatFeatures($category_id, $feature_id, $array)
{
    if (is_array($array)) {
        foreach ($array as $row) {
            if ($category_id == $row['category_id'] && $feature_id == $row['feature_id']) {
                return true;
            }
        }
        return false;
    } else {
        return false;
    }
}
<?php

/*
Plugin Name: CKEditor;
Description: Thay thế bộ soạn thảo thành CKEditor;
Version: 1.0;
Version Number: 1;
*/
/** dùng hook filter thay class của ckeditor vào textarea */
register_filter('input_editor_input', 'change_ckeditor_class');
function change_ckeditor_class($field_array)
{
    $field_array = json_decode($field_array, TRUE);
    $field_array['addClass'] = 'ckeditor';
    return $field_array;
}
/** dùng hook action thêm js vào đầu trang admin cp */
register_action('hm_admin_head', 'add_tinymce_js');
function add_tinymce_js()
{
    ?>
	<!-- CKEditor Plugin -->
	<script type="text/javascript" src="<?php 
    echo PLUGIN_URI;
    ?>
hm_ckeditor/ckeditor/ckeditor.js"></script>
	<script>
	$(document).ready(function(){
		$(document).on('click', '.use_media_file_insert', function(){
			var file_id = $('#file_id').val();
			var file_src = $('#file_src').val();
<?php

/*
Plugin Name: Tiny MCE;
Description: Thay thế bộ soạn thảo thành Tiny MCE (Tiếng Việt);
Version: 1.0;
Version Number: 1;
*/
/** dùng hook filter thay class của tinymce vào textarea */
register_filter('input_editor_input', 'change_tinymce_class');
function change_tinymce_class($field_array)
{
    $field_array = json_decode($field_array, TRUE);
    $field_array['addClass'] = 'tinymce';
    return $field_array;
}
/** dùng hook action thêm js vào đầu trang admin cp */
register_action('hm_admin_head', 'add_tinymce_js');
function add_tinymce_js()
{
    ?>
	<!-- Tiny MCE Plugin -->
	<script type="text/javascript" src="<?php 
    echo PLUGIN_URI;
    ?>
hm_tinymce/tinymce/tinymce.min.js"></script>
	<script>
	tinymce.init({
		convert_urls : false,
		selector: "textarea.tinymce",
		theme: "modern",
Esempio n. 26
0
function surf_info($type)
{
    if ($type == "db") {
        return "surf";
    } else {
        if ($type == "type") {
            return "Surf";
        }
    }
}
register_filter('add_site_select', 'surf_add_select');
function surf_add_select($menu)
{
    if (isset($_POST["type"]) && $_POST["type"] == "surf") {
        return $menu . "<option value='surf' selected>Surf</option>";
    } else {
        return $menu . "<option value='surf'>Surf</option>";
    }
}
register_filter('stats', 'surf_stats');
function surf_stats($stats)
{
    $stat = mysql_query("SELECT * FROM `surf`");
    $stat = mysql_num_rows($stat);
    $clicks = mysql_fetch_object(mysql_query("SELECT SUM( `exchanges` ) AS `visits` FROM `surf`"));
    $clicks = $clicks->visits;
    if ($clicks == "") {
        $clicks = 0;
    }
    return $stats . "<tr><td>Surf</td><td>{$stat}</td><td>{$clicks}</td></tr>";
}
 function init()
 {
     register_filter("emailprotect", $this, NW_PFILTER_ALL);
 }
Esempio n. 28
0
    } else {
        if ($type == "type") {
            return "Twitter";
        }
    }
}
register_filter('add_site_select', 'twitter_add_select');
function twitter_add_select($menu)
{
    if (isset($_POST["type"]) && $_POST["type"] == "tw") {
        return $menu . "<option value='tw' selected>Twitter</option>";
    } else {
        return $menu . "<option value='tw'>Twitter</option>";
    }
}
register_filter('stats', 'twitter_stats');
function twitter_stats($stats)
{
    $stat = mysql_query("SELECT * FROM `twitter`");
    $stat = mysql_num_rows($stat);
    $clicks = mysql_fetch_object(mysql_query("SELECT SUM( `exchanges` ) AS `visits` FROM `twitter`"));
    $clicks = $clicks->visits;
    if ($clicks == "") {
        $clicks = 0;
    }
    return $stats . "<tr><td>Twitter</td><td>{$stat}</td><td>{$clicks}</td></tr>";
}
/*register_action('initialize','facebook2');

function facebook2() {
	echo "Ich mag Facebook!";