<?php
function create_my_taxonomies( )
{
register_taxonomy( "tur", "post", array( "hierarchical" => false, "label" => "Filmin Türü", "query_var" => true, "rewrite" => true ) );
register_taxonomy( "tarih", "post", array( "hierarchical" => false, "label" => "Vizyon Tarihi", "query_var" => true, "rewrite" => true ) );
register_taxonomy( "oyuncular", "post", array( "hierarchical" => false, "label" => "Filmin Oyuncuları", "query_var" => true, "rewrite" => true ) );
register_taxonomy( "isim", "post", array( "hierarchical" => false, "label" => "Filmin Türkçe İsmi", "query_var" => true, "rewrite" => true ) );
register_taxonomy( "kalite", "post", array( "hierarchical" => false, "label" => "Filmin Görüntü Kalitesi", "query_var" => true, "rewrite" => true ) );
register_taxonomy( "imdb", "post", array( "hierarchical" => false, "label" => "Filmin İmdb Puanı", "query_var" => true, "rewrite" => true ) );
}
function fs_theme_footer( )
{
echo "\n".fs_get_option( "fs_tracking" )."\n";
}
function fs_get_option( $key )
{
global $fs_options;
$fs_options = get_option( "fs_options" );
$fs_defaults = array( "fs_logo" => get_bloginfo( "template_url" )."/images/logo.png" );
foreach ( $fs_defaults as $k => $v )
{
if ( !$fs_options[$k] )
{
$fs_options[$k] = $fs_defaults[$k];
}
}
return $fs_options[$key];
}
function fs_excerpt( $devami = "", $devami2 = "" )
{
global $post;
if ( function_exists( $devami ) )
{
add_filter( "excerpt_length", $devami );
}
if ( function_exists( $devami2 ) )
{
add_filter( "excerpt_more", $devami2 );
}
$output = get_the_excerpt( );
$output = apply_filters( "wptexturize", $output );
$output = apply_filters( "convert_chars", $output );
$output = "".$output."";
echo $output;
}
function fs_kisa_yazi2( $length )
{
return 35;
}
function fs_kisa_yazi1( $length )
{
return 19;
}
function fs_kisalt( $more )
{
return "...";
}
function k_baslik( )
{
$k_baslik = get_the_title( );
if ( 20 < strlen( $k_baslik ) )
{
$k_baslik = mb_substr( $k_baslik, 0, 20 )."...";
}
echo $k_baslik;
}
function k_baslik2( )
{
$k_baslik2 = get_the_title( );
if ( 43 < strlen( $k_baslik2 ) )
{
$k_baslik2 = mb_substr( $k_baslik2, 0, 43 )."...";
}
echo $k_baslik2;
}
function fs_yorumlar( $comment, $args, $depth )
{
$GLOBALS['comment'] = $comment;
echo "<li>\r\n<div class=\"yorum-ortala\">\r\n<div class=\"yorum-avatar\"></div>\r\n<div class=\"yorum-sag\">\r\n<div class=\"yorum-ad\">";
comment_author( );
echo "</div>\r\n<p>";
comment_text( );
echo "</p>\r\n</div>\r\n<div class=\"mis\"></div>\r\n<div class=\"cevapla\">";
comment_reply_link( array_merge( $args, array( "depth" => $depth, "max_depth" => $args['max_depth'] ) ) );
echo "</div>\r\n</div>\r\n</li>\r\n";
}
function tj_create_meta_box( )
{
add_meta_box( "post-meta-boxes", __( "Film Ekleme Paneli", "baymovie" ), "post_meta_boxes", "post", "normal", "high" );
add_meta_box( "page-meta-boxes", __( "Custom Fields Panel", "baymovie" ), "page_meta_boxes", "page", "normal", "high" );
}
function tj_post_meta_boxes( )
{
$meta_boxes = array( "resim" => array( "name" => "resim", "title" => __( "Resim Adresi:", "baymovie" ), "type" => "text", "desc" => "Buraya resimlerin url adresi yazilir." ), "konu" => array( "name" => "konu", "title" => __( "Konu:", "baymovie" ), "type" => "textarea", "desc" => "Buraya filmin konusunu yazabilirsiniz." ), "dil" => array( "name" => "dil", "title" => __( "Kuşak:", "baymovie" ), "type" => "text", "desc" => "Buraya film resimlerinin üstünde çıkan kuşağı girebilirsiniz." ), "tur" => array( "name" => "tur", "title" => __( "Türü:", "baymovie" ), "type" => "text", "desc" => "Buraya filmin türünü yazabilirsiniz." ), "tarih" => array( "name" => "tarih", "title" => __( "Vizyon Tarihi:", "baymovie" ), "type" => "text", "desc" => "Buraya filmin yapim yilini girebilirsiniz." ), "oyuncular" => array( "name" => "oyuncular", "title" => __( "Oyuncular:", "baymovie" ), "type" => "text", "desc" => "Buraya filmin oyuncularını yazabilirsiniz." ), "isim" => array( "name" => "isim", "title" => __( "Türkçe İsim:", "baymovie" ), "type" => "text", "desc" => "Filmin türkçe ismi varsa buraya yazabilirsiniz." ), "kalite" => array( "name" => "kalite", "title" => __( "Görüntü Kalitesi:", "baymovie" ), "type" => "text", "desc" => "Buraya filmin görüntü kalitesini girebilirsiniz. Örneğin: 720p" ), "imdb" => array( "name" => "imdb", "title" => __( "IMDB Puanı:", "baymovie" ), "type" => "text", "desc" => "Buraya imdb puanı girebilirsiniz. Örneğin: 6.7/10" ), "part1" => array( "name" => "part1", "title" => __( "Part 1:", "baymovie" ), "type" => "textarea", "desc" => "Buraya filmin 1. partını girebilirsiniz." ), "part2" => array( "name" => "part2", "title" => __( "Part 2:", "baymovie" ), "type" => "textarea", "desc" => "Buraya filmin 2. partını girebilirsiniz." ), "part3" => array( "name" => "part3", "title" => __( "Part 3:", "baymovie" ), "type" => "textarea", "desc" => "Buraya filmin 3. partını girebilirsiniz." ), "part4" => array( "name" => "part4", "title" => __( "Part 4:", "baymovie" ), "type" => "textarea", "desc" => "Buraya filmin 4. partını girebilirsiniz." ), "part5" => array( "name" => "part5", "title" => __( "Part 5:", "baymovie" ), "type" => "textarea", "desc" => "Buraya filmin 5. partını girebilirsiniz." ), "part6" => array( "name" => "part6", "title" => __( "Part 6:", "baymovie" ), "type" => "textarea", "desc" => "Buraya filmin 6. partını girebilirsiniz." ), "part7" => array( "name" => "part7", "title" => __( "Part 7:", "baymovie" ), "type" => "textarea", "desc" => "Buraya filmin 7. partını girebilirsiniz." ), "part8" => array( "name" => "part8", "title" => __( "Part 8:", "baymovie" ), "type" => "textarea", "desc" => "Buraya filmin 8. partını girebilirsiniz." ), "part9" => array( "name" => "part9", "title" => __( "Part 9:", "baymovie" ), "type" => "textarea", "desc" => "Buraya filmin 9. partını girebilirsiniz." ), "part10" => array( "name" => "part10", "title" => __( "Part 10:", "baymovie" ), "type" => "textarea", "desc" => "Buraya filmin 10. partını girebilirsiniz." ), "tekpart" => array( "name" => "tekpart", "title" => __( "Tek Part:", "baymovie" ), "type" => "textarea", "desc" => "Buraya filmin tek part linkini girebilirsiniz." ), "1ozel" => array( "name" => "1ozel", "title" => __( "Ek Part İsmi - 1:", "baymovie" ), "type" => "text", "desc" => "Buraya sıralı partlardan farklı bir isim girebilirsiniz.Örneğin: Vk" ), "1ozellink" => array( "name" => "1ozellink", "title" => __( "Ek Part Linki - 1:", "baymovie" ), "type" => "textarea", "desc" => "Buraya ek part 1 in linkini girebilirsiniz." ), "2ozel" => array( "name" => "2ozel", "title" => __( "Ek Part İsmi - 2:", "baymovie" ), "type" => "text", "desc" => "Buraya sıralı partlardan farklı bir isim girebilirsiniz.Örneğin: Vk" ), "2ozellink" => array( "name" => "2ozellink", "title" => __( "Ek Part Linki - 2:", "baymovie" ), "type" => "textarea", "desc" => "Buraya ek part 2 nin linkini girebilirsiniz." ), "3ozel" => array( "name" => "3ozel", "title" => __( "Ek Part İsmi - 3:", "baymovie" ), "type" => "text", "desc" => "Buraya sıralı partlardan farklı bir isim girebilirsiniz.Örneğin: Vk" ), "3ozellink" => array( "name" => "3ozellink", "title" => __( "Ek Part Linki - 3:", "baymovie" ), "type" => "textarea", "desc" => "Buraya ek part 3 ün linkini girebilirsiniz." ) );
return apply_filters( "tj_post_meta_boxes", $meta_boxes );
}
function tj_page_meta_boxes( )
{
$meta_boxes = array( "teaser_text" => array( "name" => "teaser_text", "title" => __( "Teaser", "baymovie" ), "type" => "text", "desc" => "Here you can enter some short text for header teaser on a page." ) );
return apply_filters( "tj_page_meta_boxes", $meta_boxes );
}
function post_meta_boxes( )
{
global $post;
$meta_boxes = tj_post_meta_boxes( );
echo "\t<table class=\"form-table\">\r\n\t";
foreach ( $meta_boxes as $meta )
{
$value = get_post_meta( $post->ID, $meta['name'], true );
if ( $meta['type'] == "text" )
{
get_meta_text_input( $meta, $value );
}
else if ( $meta['type'] == "textarea" )
{
get_meta_textarea( $meta, $value );
}
else if ( $meta['type'] == "select" )
{
get_meta_select( $meta, $value );
}
}
echo "\t</table>\r\n";
}
function page_meta_boxes( )
{
global $post;
$meta_boxes = tj_page_meta_boxes( );
echo "\t<table class=\"form-table\">\r\n\t";
foreach ( $meta_boxes as $meta )
{
$value = stripslashes( get_post_meta( $post->ID, $meta['name'], true ) );
if ( $meta['type'] == "text" )
{
get_meta_text_input( $meta, $value );
}
else if ( $meta['type'] == "textarea" )
{
get_meta_textarea( $meta, $value );
}
else if ( $meta['type'] == "select" )
{
get_meta_select( $meta, $value );
}
}
echo "\t</table>\r\n";
}
function get_meta_text_input( $args = array( ), $value = false )
{
extract( $args );
echo "\t<tr>\r\n\t\t<th style=\"width:20%;\">\r\n\t\t\t<label for=\"";
echo $name;
echo "\">";
echo $title;
echo "</label>\r\n\t\t</th>\r\n\t\t<td>\r\n\t\t\t<input type=\"text\" name=\"";
echo $name;
echo "\" id=\"";
echo $name;
echo "\" value=\"";
echo wp_specialchars( $value, 1 );
echo "\" size=\"30\" tabindex=\"30\" style=\"width: 97%;margin-top:-3px;\" />\r\n\t\t\t<input type=\"hidden\" name=\"";
echo $name;
echo "_noncename\" id=\"";
echo $name;
echo "_noncename\" value=\"";
echo wp_create_nonce( plugin_basename( __FILE__ ) );
echo "\" />\r\n\t\t\t<br />\r\n\t\t\t<p class=\"description\">";
echo $desc;
echo "</p>\r\n\t\t</td>\r\n\t</tr>\r\n\t";
}
function get_meta_select( $args = array( ), $value = false )
{
extract( $args );
echo "\t<tr>\r\n\t\t<th style=\"width:20%;\">\r\n\t\t\t<label for=\"";
echo $name;
echo "\">";
echo $title;
echo "</label>\r\n\t\t</th>\r\n\t\t<td>\r\n\t\t\t";
echo "<s";
echo "elect name=\"";
echo $name;
echo "\" id=\"";
echo $name;
echo "\">\r\n\t\t\t";
foreach ( $options as $option )
{
echo "\t\t\t\t<option ";
if ( htmlentities( $value, ENT_QUOTES ) == $option )
{
echo " selected=\"selected\"";
}
echo ">\r\n\t\t\t\t\t";
echo $option;
echo "\t\t\t\t</option>\r\n\t\t\t";
}
echo "\t\t\t</select>\r\n\t\t\t<input type=\"hidden\" name=\"";
echo $name;
echo "_noncename\" id=\"";
echo $name;
echo "_noncename\" value=\"";
echo wp_create_nonce( plugin_basename( __FILE__ ) );
echo "\" />\r\n\t\t</td>\r\n\t</tr>\r\n\t";
}
function get_meta_textarea( $args = array( ), $value = false )
{
extract( $args );
echo "\t<tr>\r\n\t\t<th style=\"width:20%;\">\r\n\t\t\t<label for=\"";
echo $name;
echo "\">";
echo $title;
echo "</label>\r\n\t\t</th>\r\n\t\t<td>\r\n\t\t\t<textarea name=\"";
echo $name;
echo "\" id=\"";
echo $name;
echo "\" cols=\"60\" rows=\"4\" tabindex=\"30\" style=\"width: 97%;margin-top:-3px;\">";
echo wp_specialchars( $value, 1 );
echo "</textarea>\r\n\t\t\t<input type=\"hidden\" name=\"";
echo $name;
echo "_noncename\" id=\"";
echo $name;
echo "_noncename\" value=\"";
echo wp_create_nonce( plugin_basename( __FILE__ ) );
echo "\" />\r\n\t\t</td>\r\n\t</tr>\r\n\t";
}
function tj_save_meta_data( $post_id )
{
global $post;
if ( "page" == $_POST['post_type'] )
{
$meta_boxes = array_merge( tj_page_meta_boxes( ) );
}
else
{
$meta_boxes = array_merge( tj_post_meta_boxes( ) );
}
foreach ( $meta_boxes as $meta_box )
{
if ( !wp_verify_nonce( $_POST[$meta_box['name']."_noncename"], plugin_basename( __FILE__ ) ) )
{
return $post_id;
}
if ( "page" == $_POST['post_type'] && !current_user_can( "edit_page", $post_id ) )
{
return $post_id;
}
if ( "post" == $_POST['post_type'] && !current_user_can( "edit_post", $post_id ) )
{
return $post_id;
}
$data = stripslashes( $_POST[$meta_box['name']] );
if ( get_post_meta( $post_id, $meta_box['name'] ) == "" )
{
add_post_meta( $post_id, $meta_box['name'], $data, true );
}
else if ( $data != get_post_meta( $post_id, $meta_box['name'], true ) )
{
update_post_meta( $post_id, $meta_box['name'], $data );
}
else if ( $data == "" )
{
delete_post_meta( $post_id, $meta_box['name'], get_post_meta( $post_id, $meta_box['name'], true ) );
}
}
}
$tema = "".get_bloginfo( "template_url" )."/";
$ana = "".get_bloginfo( "home" )."/";
$isim = "".get_bloginfo( "blogname" )."";
remove_filter( "term_description", "wpautop" );
remove_action( "wp_head", "pagenavi_css" );
remove_action( "wp_print_styles", "pagenavi_stylesheets" );
add_image_size( "res1", 129, 191, true );
add_image_size( "res2", 129, 191, true );
add_image_size( "res3", 129, 191, true );
add_action( "init", "create_my_taxonomies", 0 );
if ( STYLESHEETPATH == TEMPLATEPATH )
{
define( "OF_FILEPATH", TEMPLATEPATH );
define( "OF_DIRECTORY", get_template_directory_uri( ) );
}
else
{
define( "OF_FILEPATH", STYLESHEETPATH );
define( "OF_DIRECTORY", get_template_directory_uri( ) );
}
require_once( OF_FILEPATH."/admin/admin-functions.php" );
require_once( OF_FILEPATH."/admin/admin-interface.php" );
require_once( OF_FILEPATH."/admin/theme-options.php" );
require_once( OF_FILEPATH."/admin/theme-functions.php" );
require_once( OF_FILEPATH."/serial.php" );
if ( function_exists( "register_sidebar" ) )
{
register_sidebar( array( "name" => "Footer Sol", "before_widget" => "<div class=\"ftlinkl\">", "after_widget" => "</div>", "before_title" => "<h4>", "after_title" => "</h4>" ) );
}
register_sidebar( array( "name" => "Footer Orta", "before_widget" => "<div class=\"ftlink\">", "after_widget" => "</div>", "before_title" => "<h4>", "after_title" => "</h4>" ) );
register_sidebar( array( "name" => "Footer Sağ", "before_widget" => "<div class=\"ftlinkr\">", "after_widget" => "</div>", "before_title" => "<h4>", "after_title" => "</h4>" ) );
register_sidebar( array( "name" => "Sol Kısım", "before_widget" => "<div class=\"solust\">", "after_widget" => "</div>\r\n</div>", "before_title" => "<h1>", "after_title" => "</h1></div>\r\n<div class=\"solorta2\">\r\n\t<div class=\"sevilenler2\">" ) );
add_action( "wp_footer", "fs_theme_footer" );
$kod['site'] = getenv( "HTTP_HOST" );
if ( substr( $kod['site'], 0, 4 ) == "www." )
{
$kod['site'] = substr( $kod['site'], 4 );
}
$ygt = "baymovieherhakkisaklidir";
$kod['hash'] = wordwrap( strtoupper( md5( sha1( str_rot13( substr( $kod['site'].$ygt, 0, 0 - 1 ) ) ) ) ), 4, "-", true );
if ( $kod['hash'] !== $kod_anahtar )
{
exit( "Lisans anahtariniz bu site icin gecerli degil" );
}
else
{
unset( $kod );
}
register_nav_menus( array( "siteanamenu" => __( "Ana Menü", "fs_menu" ) ) );
add_action( "admin_menu", "tj_create_meta_box" );
add_action( "save_post", "tj_save_meta_data" );
?>