"; return $html; } /** * Sort a multidimensional array on a array kay (found on http://php.net/manual/en/function.sort.php) * @array array the array * @key str the field to use as key to sort * @order str sort method: "ASC", "DESC" */ function alo_em_msort ($array, $key, $order = "ASC") { $tmp = array(); foreach($array as $akey => $array2) { $tmp[$akey] = $array2[$key]; } if ($order == "DESC") { arsort($tmp , SORT_NUMERIC ); } else { asort($tmp , SORT_NUMERIC ); } $tmp2 = array(); foreach($tmp as $key => $value) { $tmp2[$key] = $array[$key]; } return $tmp2; } /** * Remove HTML tags, including invisible text such as style and * script code, and embedded objects. Add line breaks around * block-level tags to prevent word joining after tag removal. * (based on http://nadeausoftware.com/articles/2007/09/php_tip_how_strip_html_tags_web_page ) */ function alo_em_html2plain ( $text ) { // transform in utf-8 if not yet //$text = utf8_encode($text); if ( function_exists( 'mb_detect_encoding' ) && mb_detect_encoding($text, "UTF-8") != "UTF-8" ) $text = utf8_encode($text); $text = preg_replace( array( // Remove invisible content '@]*?>.*?@siu', '@]*?>.*?@siu', '@]*?.*?@siu', '@]*?.*?@siu', '@]*?.*?@siu', '@]*?.*?@siu', '@]*?.*?@siu', '@]*?.*?@siu', '@]*?.*?@siu', // Add line breaks before and after blocks '@link' to 'link (url)' $text = preg_replace('/(.*)<\/a>/', "$0 ($2)", $text ); // from
to \n - do this after rewriting links, so that links with
in them are still recognized by the regex $text = preg_replace('//i', "\n", $text ); $text = strip_tags( $text ); // remove excessive spaces and tabs $text = preg_replace("/[ \t]+/", " ", $text); // replace quotes by their plain-text variants $text = preg_replace("/“/", "\"", $text); $text = preg_replace("/”/", "\"", $text); // replace dashes by = $text = preg_replace("/–/", "=", $text); $text = preg_replace("/—/", "=", $text); // strip blank lines (blank, with tabs or spaces) $text = preg_replace("/[\r\n]+[\s\t]*[\r\n]+/", "\n\n", $text ); return $text; } /** * Show credit and banners *@param bol only donate (false) or all banners (true) */ function alo_em_show_credit_banners ( $all=false ) { if ( get_option('alo_em_show_credit_banners') == "no" ) return; ?>
  • . .
    www.eventualo.net

    :


  • Original WP Themes by ThemeFuse

    If you are interested in buying original WP themes I would recommend ThemeFuse.

  • Original WP by ThemeFuse

    Do you need SMTP?
    SMTP2GO provides a complete outgoing email infrastructure allowing you to send your emails through a professional SMTP service.

0 ) ? number_format ( ( $number * 100 / $total ), $float ) : 0; } /** * Get IP address: useful if you like to filter it */ function alo_em_ip_address() { $ip_address = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] ); return apply_filters ( 'alo_easymail_ip_address', $ip_address ); } /** * Get a checkbox list of WP roles, useful in options * * @param str name field * @param arr the caps to search in roles * @param str more attributes * @return html * * echo alo_em_role_checkboxes( 'roles', 'publish_posts' ); */ function alo_em_role_checkboxes ( $name='roles', $search_caps=array(), $attrs='' ) { settype( $search_caps, 'array' ); if ( empty($search_caps[0]) ) return ''; $get_editable_roles = get_editable_roles(); $html = ''; foreach ($get_editable_roles as $role => $val ) { // Search the req caps in role caps $has_caps = array_intersect( array_keys($val['capabilities']), $search_caps ); // Compare the reordered arrays: must be identical sort( $search_caps ); sort( $has_caps ); $checked = ( $search_caps == $has_caps )? 'checked="checked"' : ''; // Admin always checked $disabled = ( $role == 'administrator' ) ? 'disabled="disabled"' : ''; $html .= ' '; $html .= '
'; } return $html; } /* EOF */