Ошибка в functions.php: on line 144
-
Здравствуйте! Помогите пожалуйста. Видает ошибку Parse error: syntax error, unexpected ‘;’ in /var/www/dzerk_vpa/data/www/dzerkalo.kr.ua/wp-content/themes/portalthemejunkie/functions.php on line 144
Ниже привожу код файла functions.php. Помогите разобраться.<?php include("includes/theme-options.php"); // Uncomment this to test your localization, make sure to enter the right language code. // function test_localization( $locale ) { // return "ru_RU"; // } // add_filter('locale','test_localization'); load_theme_textdomain('themejunkie', TEMPLATEPATH.'/languages/'); # Sidebar if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => 'Home/Page Left', 'before_widget' => '', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="clear"></div><div class="box">', )); register_sidebar(array( 'name' => 'Home Right #Full Width', 'before_widget' => '', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="clear"></div><div class="box">', )); register_sidebar(array( 'name' => 'Home Right #Left', 'before_widget' => '', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="clear"></div><div class="box">', )); register_sidebar(array( 'name' => 'Home Right #Right', 'before_widget' => '', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="clear"></div><div class="box">', )); register_sidebar(array( 'name' => 'Page Right', 'before_widget' => '', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="clear"></div><div class="box">', )); register_sidebar(array( 'name' => 'Footer', 'before_widget' => '', 'after_widget' => '</div>', 'before_title' => '<div class="footerwidget left"><h3>', 'after_title' => '</h3>', )); } # Limit Post function tj_content_limit($max_char, $more_link_text = '', $stripteaser = 0, $more_file = '') { $content = get_the_content($more_link_text, $stripteaser, $more_file); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); $content = strip_tags($content); if (strlen($_GET['p']) > 0) { echo ""; echo $content; echo "..."; } else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) { $content = substr($content, 0, $espacio); $content = $content; echo ""; echo $content; echo "..."; } else { echo ""; echo $content; } } # Turn a category ID to a Name function cat_id_to_name($id) { foreach((array)(get_categories()) as $category) { if ($id == $category->cat_ID) { return $category->cat_name; break; } } } // Get Image Attachments function get_thumbnail($postid=0, $size='full') { if ($postid<1) $postid = get_the_ID(); $thumb = get_post_meta($postid, "thumb", TRUE); // Declare the custom field for the image if ($thumb != null or $thumb != '') { echo get_image_path($thumb); } elseif ($images = get_children(array( 'post_parent' => $postid, 'post_type' => 'attachment', 'numberposts' => '1', 'post_mime_type' => 'image', ))) foreach($images as $image) { $thumbnail=wp_get_attachment_image_src($image->ID, $size); ?> <?php echo get_image_path($thumbnail[0]); ?> <?php } else { $theme_name = strtolower(get_current_theme()); echo get_image_path('wp-content/themes/'.$theme_name.'/images/image-pending.gif'); } } function get_image_path($thumbnail='') { global $blog_id; if (isset($blog_id) && $blog_id > 0) { $imagePath = explode('/files/', $thumbnail); if (isset($imagePath[1])) { $thumbnail = '/blogs.dir/' . $blog_id . '/files/' . $imagePath[1]; } } return $thumbnail; } // Show Post Thumbnails function tj_thumbnail($width = 100, $height = 100) { ?> <a>" rel="bookmark"><img class="thumb" src="<?php bloginfo('template_directory'); ?>/includes/timthumb.php?src=<?php get_thumbnail(); ?>&h=<?php echo get_theme_mod($height); ?>&w=<?php echo get_theme_mod($width); ?>&zc=1" alt="<?php the_title(); ?>" /></a> <?php } # Breadcrumb function the_breadcrumb() { if (!is_home()) { echo ; echo '<a href="'; echo get_option('home'); echo '">'; echo "Головна"; echo " » "; if (is_category() || is_single()) { single_cat_title(); if (is_single()) { the_category(', '); echo " » "; the_title(); } } elseif (is_page()) { echo the_title(); } elseif (is_tag()) { echo 'Повідомлення Р· тегами "'; single_tag_title(); echo '"'; } elseif (is_day()) {echo "РђСЂС…С–РІРё Р·Р° "; the_time(' F jS, Y');} elseif (is_month()) {echo "РђСЂС…С–РІРё Р·Р° "; the_time(' F, Y');} elseif (is_year()) {echo "РђСЂС…С–РІРё Р·Р° "; the_time(' Y');} elseif (is_author()) {echo "РђСЂС…С–РІРё автора";} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "РђСЂС…С–РІРё блога";} elseif (is_search()) {echo "Результати пошуку";} } } #Get recent comments function tj_recent_comments($no_comments = 5, $comment_lenth = 5, $before = ' <li>', $after = '</li> ', $show_pass_post = false, $comment_style = 1, $hide_pingbacks_trackbacks = false) { global $wpdb; $most_recent_comments = wp_cache_get('most_recent_comments'); if ( false === $most_recent_comments ) { $request = "SELECT ID, comment_ID, comment_content, comment_author, comment_author_url, post_title FROM $wpdb->comments LEFT JOIN $wpdb->posts ON $wpdb->posts.ID=$wpdb->comments.comment_post_ID WHERE post_status IN ('publish','static') "; if( !$show_pass_post ) $request .= "AND post_password ='' "; if ( $hide_pingbacks_trackbacks ) $request .= "AND comment_type='' "; $request .= "AND comment_approved = '1' ORDER BY comment_ID DESC LIMIT $no_comments"; $comments = $wpdb->get_results($request); $output = ''; if ( $comments ) { $idx = 0; foreach ($comments as $comment) { $comment_author = stripslashes($comment->comment_author); if ($comment_author == "") $comment_author = "anonymous"; $comment_content = strip_tags($comment->comment_content); $comment_content = stripslashes($comment_content); $words = split(" ", $comment_content); $comment_excerpt = join(" ", array_slice($words, 0, $comment_lenth)); $permalink = get_permalink($comment->ID) . "#comment-" . $comment->comment_ID; if ( 1 == $comment_style ) { $post_title = stripslashes($comment->post_title); $post_id= stripslashes($comment->post_id); $url = $comment->comment_author_url; $idx++; if ( 1 == $idx % 2 ) $before = " <li>"; else $before = "</li> <li>"; $output .= $before . "<a href='$permalink'>$comment_author</a>" . ' on <a>ID) . '">' . $post_title . '</a>' . $after; } else { $idx++; if ( 1 == $idx % 2 ) $before = "<li class=''>"; else $before = "<li class=''>"; $output .= $before . '<strong>' . $comment_author . ':</strong> <a href="' . $permalink; $output .= '" title="View the entire comment by ' . $comment_author.'">' . $comment_excerpt.'' . $after; } } $output = convert_smilies($output); } else { $output .= $before . "None found" . $after; } $most_recent_comments = $output; wp_cache_set('most_recent_comments', $most_recent_comments); } echo $most_recent_comments; } include("includes/derwidget.php"); # Get popular posts by comments count function tj_popular_posts($no_posts = 5, $before = '</li> <li>', $after = '</li> ', $show_pass_post = false, $duration='') { 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'"; if(!$show_pass_post) $request .= " AND post_password =''"; if($duration !="") { $request .= " AND DATE_SUB(CURDATE(),INTERVAL ".$duration." DAY) < post_date "; } $request .= " GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_count DESC LIMIT $no_posts"; $posts = $wpdb->get_results($request); $output = ''; if ($posts) { foreach ($posts as $post) { $post_title = stripslashes($post->post_title); $comment_count = $post->comment_count; $permalink = get_permalink($post->ID); $output .= $before . '<a href="' . $permalink . '" title="' . $post_title.'">' . $post_title . '</a>' . $after; } } else { $output .= $before . "None found" . $after; } echo $output; } ?>
Просмотр 4 ответов — с 1 по 4 (всего 4)
Просмотр 4 ответов — с 1 по 4 (всего 4)
- Тема «Ошибка в functions.php: on line 144» закрыта для новых ответов.