'Sidebar', 'before_widget' => '
" . print_r($matches, false) . ""; if ($match) { return $matches[1]; } return false; } function modifyText ($text, $excerpt_length=20, $strip="
",$echo=1){
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
//$text = strip_tags($text);
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
//array_push($words, '[...]');
$text = implode(' ', $words);
}
if ($echo==1){
echo strip_tags($text,$strip);
}else{
return strip_tags($text,$strip);
}
}
function modifyTextPost ($excerpt_length=20, $strip="",$echo=1){
global $post;
$text = $post->post_content;
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
$text = strip_tags($text,$strip);
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
//array_push($words, '[...]');
$text = implode(' ', $words);
}
if ($echo==1){
echo $text;
}else{
return $text;
}
}
function blogname (){
$blogname = get_bloginfo("name");
$exp = explode(" ", $blogname);
$tot = count($exp);
$lastword = end($exp);
$left = implode(" ", array_slice($exp,0, count($exp)-1));
echo " " . $left . " " . $lastword;
}
function the_tab_image ($w=82, $h=57, $def = "demo.png", $key='image'){
global $post;
$image = get_post_meta($post->ID, $key, true);
if ( $image ) {
$g = blogdir . "thumb.php?src=" . $image . "&h=$h&w=$w&zc=1&q=100";
}else{
$g = blogimages . $def;
}
echo $g;
}
function the_big_image ($s='', $e=''){
global $post;
$image = get_post_meta($post->ID, 'big_image', true);
if ( $image ) {
echo $s;
echo " '.$themename.' settings saved. '.$themename.' settings reset.";
echo $e;
}
}
function the_short_title($limit=26, $title='', $echo=1){
if (empty($title)){
$title = strip_tags(the_title('','',false));
}
if (strlen($title)<=$limit){
}else{
$title = strip_tags(substr_replace(the_title('','',false),' ...',$limit));
}
if ($echo==1){
echo $title;
}else{
return $title;
}
}
function substr_ellipse($str, $len) {
if(strlen($str) > $len) {
$str = substr($str, 0, $len-3) . "...";
}
return $str;
}
function callback($buffer){
$buffer = strip_tags($buffer);
return "" . substr($buffer, 0, 140) . "... ";
}
function the_new_excerpt(){
ob_start("callback");
the_excerpt();
ob_end_flush();
}
function callback2($buffer){
$buffer = strip_tags($buffer);
return "" . substr($buffer, 0, 220) . "... ";
}
function the_new_excerpt2(){
ob_start("callback2");
the_excerpt();
ob_end_flush();
}
function most_popular_posts() {
global $wpdb;
$request = "SELECT ID, post_title, COUNT($wpdb->comments.comment_post_ID) AS 'comment_count' FROM $wpdb->posts, $wpdb->comments";
$request .= " WHERE comment_approved = '1' AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status = 'publish'";
$request .= " GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_count DESC";
$posts = $wpdb->get_results($request);
if ($posts) {
foreach ($posts as $post) {
$new_posts[] = $post->ID;
}
} else {
$new_posts[] = "0";
}
return $new_posts;
}
function recent_commented_posts() {
global $wpdb;
$request = "SELECT comment_ID, comment_post_ID FROM $wpdb->comments";
$request .= " WHERE comment_approved = '1'";
$request .= " ORDER BY comment_ID DESC";
$posts = $wpdb->get_results($request);
if ($posts) {
foreach ($posts as $post) {
$new_posts[] = $post->comment_post_ID;
}
} else {
$new_posts[] = "0";
}
return $new_posts;
}
////////////////////////////////////////////////////////////////////////////////
// THEME OPTION FOR BLOG
////////////////////////////////////////////////////////////////////////////////
$themename = blogname;
$shortname = "ti";
$wp_dropdown_rd_admin = get_categories('hide_empty=0&orderby=name');
$wp_getcat = array();
foreach ($wp_dropdown_rd_admin as $category_list) {
$wp_getcat[$category_list->cat_ID] = $category_list->cat_name;
}
$wp_listposts = array(2,4,6,8,10,12,14,16);
function mytheme_bz_admin() {
global $themename, $shortname, $options, $wp_getcat, $wp_listposts;
$theme_settings = get_option("theme_settings");
if ( $_REQUEST['saved'] ) echo '