Advertisement
Guest User

Untitled

a guest
Sep 19th, 2013
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.87 KB | None | 0 0
  1. <?php
  2. function lisans_yap() {
  3. $site_adresi = get_bloginfo("url");
  4. $lisans_kodu_cek = og_ayar("oz_lisans");
  5. $lisans_kod = trim($lisans_kodu_cek);
  6.  
  7. if($lisans_kod) {
  8. if (md5(md5(strtoupper(md5(sha1($site_adresi))))) != $lisans_kod) {
  9. die( '<div class="ortala" style="width:444px;"><div class="kutu error ">HATA! Girilen lisans anahtar&#305; hatal&#305; yada eksik! <br/><br/>L&#252;tfen size verilen lisans anahtar&#305;n&#305;n do&#287;ru oldu&#287;una emin olunuz! E&#287;er lisans anahtar&#305;n&#305;z yok ise, temay&#305; kullanabilmek i&#231;in lisans sat&#305;n alman&#305;z gerekir. <br/><br/>Sat&#305;n almak i&#231;in <strong>oz-press@hotmail.com</strong> adresinden ileti&#351;ime ge&#231;iniz.</div></div>' );
  10. }
  11. } else {
  12. die( '<div class="ortala" style="width:444px;"><div class="kutu error "> HATA! Lisanss&#305;z kullan&#305;m. <br/><br/>L&#252;tfen sat&#305;n ald&#305;&#287;&#305;n&#305;z lisans anahtar&#305;n&#305; tema ayarlar&#305; sayfas&#305;ndan ilgili alana giriniz. E&#287;er lisans anahtar&#305;n&#305;z yok ise, temay&#305; kullanabilmek i&#231;in lisans sat&#305;n alman&#305;z gerekir. <br/><br/>Sat&#305;n almak i&#231;in <strong>oz-press@hotmail.com</strong> adresinden ileti&#351;ime ge&#231;iniz.</div></div>' );
  13. }
  14.  
  15. }
  16. add_action("wp_head","lisans_yap");
  17.  
  18.  
  19. update_option('users_can_register', 1);
  20. include_once("lib/panel.php");
  21. include(TEMPLATEPATH . '/lib/category_widget.php');
  22. include(TEMPLATEPATH . '/lib/comment_widget.php');
  23. include(TEMPLATEPATH . '/lib/fb_widget.php');
  24. include(TEMPLATEPATH . '/lib/random_widget.php');
  25.  
  26. function disableAutoSave(){
  27. wp_deregister_script('autosave');
  28. }
  29. add_action( 'wp_print_scripts', 'disableAutoSave' );
  30. remove_filter('term_description','wpautop');
  31.  
  32. function unregister_default_wp_widgets(){
  33. unregister_widget( "WP_Widget_Calendar" );
  34. unregister_widget( "WP_Widget_Links" );
  35. unregister_widget( "WP_Widget_Meta" );
  36. unregister_widget( "WP_Widget_Search" );
  37. unregister_widget( "WP_Widget_Recent_Comments" );
  38. unregister_widget( "WP_Widget_RSS" );
  39. }
  40.  
  41. add_action( "widgets_init", "unregister_default_wp_widgets", 1 );
  42. remove_action( "wp_head", "wlwmanifest_link" );
  43. remove_action( "wp_head", "wp_generator" );
  44. remove_action( "wp_head", "rsd_link" );
  45. remove_action( "wp_head", "start_post_rel_link" );
  46. remove_action( "wp_head", "index_rel_link" );
  47. remove_action( "wp_head", "adjacent_posts_rel_link" );
  48. function _remove_script_version( $src ){
  49. $parts = explode( '?', $src );
  50. return $parts[0];
  51. }
  52. add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
  53. add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
  54. /*------------------------------------------------------------
  55. OZMovie &#214;zel Alan
  56. -------------------------------------------------------------
  57. */
  58. $isim = og_ayar('isim_alan');
  59. $imdb = og_ayar('imdb_alan');
  60. $oyuncu = og_ayar('oyuncular_alan');
  61. $yil = og_ayar('yapim_alan');
  62. $yonetmen = og_ayar('yonetmen_alan');
  63. $ozet = og_ayar('ozet_alan');
  64. $fragman = og_ayar('fragman_alan');
  65.  
  66. function alanlar( $metalar ) {
  67. global $post;
  68. if ($metalar == 'isim'){
  69. echo $isim;
  70. }
  71. if($metalar == 'yil') {
  72. echo $yil;
  73. }
  74. if($metalar == 'oyuncular') {
  75. echo $oyuncu;
  76. }
  77. if($metalar == 'imdb') {
  78. echo $imdb;
  79. }
  80. if($metalar == 'yonetmen') {
  81. echo $yonetmen;
  82. }
  83. if($metalar == 'ozet') {
  84. echo $ozet;
  85. }
  86. }
  87. /*------------------------------------------------------------
  88. OZMovie Part
  89. -------------------------------------------------------------
  90. */
  91. function ozmovie_part( $args = "" )
  92. {
  93. $defaults = array(
  94. "before" => "".__( "".$bilgi."" ),
  95. "after" => "",
  96. "link_before" => "<span>",
  97. "link_after" => "</span>",
  98. "echo" => 1 );
  99.  
  100. $r = wp_parse_args( $args, $defaults );
  101. extract( $r, EXTR_SKIP );
  102. global $page;
  103. global $numpages;
  104. global $multipage;
  105. global $more;
  106. global $pagenow;
  107. global $pages;
  108. $part_bir = get_option( "ozmovie_ilk" );
  109. $output = "";
  110. if ( $multipage )
  111. {
  112. $output .= $before;
  113. $i = 1;
  114. while ( $i < $numpages + 1 )
  115. {
  116. $part_content = $pages[$i - 1];
  117. $has_part_title = strpos( $part_content, "<!--baslik:" );
  118. if ( 0 === $has_part_title )
  119. {
  120. $end = strpos( $part_content, "-->" );
  121. $title = trim( str_replace( "<!--baslik:", "", substr( $part_content, 0, $end ) ) );
  122. }
  123. $output .= " ";
  124. if ( $i != $page || !$more && $page == 1 )
  125. {
  126. $output .= _wp_link_page( $i );
  127. }
  128.  
  129. $output .= $link_before.$title.$link_after;
  130. if ( $i != $page || !$more && $page == 1 )
  131. {
  132. $output .= "</a>";
  133. }
  134. $i = $i + 1;
  135. }
  136. $output .= $after;
  137. }
  138. if ( $echo )
  139. {
  140. echo $output;
  141. }
  142. return $output;
  143. }
  144. /*------------------------------------------------------------
  145. OZMovie &#304;zlenme
  146. -------------------------------------------------------------
  147. */
  148. function getPostViews($postID){
  149. $count_key = 'views';
  150. $count = get_post_meta($postID, $count_key, true);
  151. if($count==''){
  152. delete_post_meta($postID, $count_key);
  153. add_post_meta($postID, $count_key, '0');
  154. return "0";
  155. }
  156. return $count.'';
  157. }
  158. function setPostViews($postID) {
  159. $count_key = 'views';
  160. $count = get_post_meta($postID, $count_key, true);
  161. if($count==''){
  162. $count = 0;
  163. delete_post_meta($postID, $count_key);
  164. add_post_meta($postID, $count_key, '0');
  165. }else{
  166. $count++;
  167. update_post_meta($postID, $count_key, $count);
  168. }
  169. }
  170. /*------------------------------------------------------------
  171. OZMovie Custom Write Panel Buttons
  172. -------------------------------------------------------------
  173. */
  174. if( !function_exists('_add_my_quicktags') ){
  175. function _add_my_quicktags()
  176. { ?>
  177. <script type="text/javascript">
  178. QTags.addButton( 'php', 'Sonraki Part', '<!--nextpage-->' );
  179. QTags.addButton( 'isim', 'Part ismi','<!--baslik:', '-->');
  180. </script>
  181. <?php }
  182. add_action('admin_print_footer_scripts', '_add_my_quicktags');
  183. }
  184.  
  185. /*------------------------------------------------------------
  186. OZMovie Custom Taxonomies
  187. -------------------------------------------------------------
  188. */
  189. function add_custom_taxonomies() {
  190. register_taxonomy('imdb', 'post', array('hierarchical' => false,'labels' => array(
  191. 'name' => _x( 'IMDB', 'taxonomy general name' ),
  192. 'singular_name' => _x( 'IMDB Puan&#305;', 'taxonomy singular name' ),
  193. 'search_items' => __( 'IMDB Puan&#305; ara' ),
  194. 'all_items' => __( 'T&#252;m IMDB Puanlar&#305;' ),
  195. 'edit_item' => __( 'IMDB Puan&#305; d&#252;zenle' ),
  196. 'update_item' => __( 'IMDB Puan&#305; g&#252;ncelle' ),
  197. 'add_new_item' => __( 'Yeni IMDB Puan&#305; ekle' ),
  198. 'new_item_name' => __( 'Yeni IMDB Puan&#305;' ),
  199. 'menu_name' => __( 'IMDB Puanlar&#305;' ),
  200. ),
  201. 'rewrite' => array(
  202. 'slug' => 'imdb', // This controls the base slug that will display before each term
  203. 'with_front' => false, // Don't display the category base before "/locations/"
  204. 'hierarchical' => false // This will allow URL's like "/locations/boston/cambridge/"
  205. ),
  206. ));
  207. register_taxonomy('oyuncu', 'post', array('hierarchical' => false,'labels' => array(
  208. 'name' => _x( 'Oyuncu', 'taxonomy general name' ),
  209. 'singular_name' => _x( 'Oyuncu', 'taxonomy singular name' ),
  210. 'search_items' => __( 'Oyuncu ara' ),
  211. 'all_items' => __( 'T&#252;m oyuncular' ),
  212. 'edit_item' => __( 'Oyuncu d&#252;zenle' ),
  213. 'update_item' => __( 'Oyuncu g&#252;ncelle' ),
  214. 'add_new_item' => __( 'Yeni oyuncu ekle' ),
  215. 'new_item_name' => __( 'Yeni oyuncu ad&#305;' ),
  216. 'menu_name' => __( 'Oyuncular' ),
  217. ),
  218. 'rewrite' => array(
  219. 'slug' => 'oyuncu', // This controls the base slug that will display before each term
  220. 'with_front' => false, // Don't display the category base before "/locations/"
  221. 'hierarchical' => false // This will allow URL's like "/locations/boston/cambridge/"
  222. ),
  223. ));
  224. register_taxonomy('yapim', 'post', array('hierarchical' => false,'labels' => array(
  225. 'name' => _x( 'Yap&#305;m Y&#305;l&#305;', 'taxonomy general name' ),
  226. 'singular_name' => _x( 'Yap&#305;m Y&#305;l&#305;', 'taxonomy singular name' ),
  227. 'search_items' => __( 'Yap&#305;m Y&#305;l&#305; ara' ),
  228. 'all_items' => __( 'T&#252;m y&#305;llar' ),
  229. 'edit_item' => __( 'Yap&#305;m Y&#305;l&#305; d&#252;zenle' ),
  230. 'update_item' => __( 'Yap&#305;m Y&#305;l&#305; g&#252;ncelle' ),
  231. 'add_new_item' => __( 'Yeni Yap&#305;m Y&#305;l&#305; ekle' ),
  232. 'new_item_name' => __( 'Yeni Yap&#305;m Y&#305;l&#305;' ),
  233. 'menu_name' => __( 'Yap&#305;m Y&#305;l&#305;' ),
  234. ),
  235. 'rewrite' => array(
  236. 'slug' => 'yapim', // This controls the base slug that will display before each term
  237. 'with_front' => false, // Don't display the category base before "/locations/"
  238. 'hierarchical' => false // This will allow URL's like "/locations/boston/cambridge/"
  239. ),
  240. ));
  241. register_taxonomy('yonetmen', 'post', array('hierarchical' => false,'labels' => array(
  242. 'name' => _x( 'Y&#246;netmen', 'taxonomy general name' ),
  243. 'singular_name' => _x( 'Y&#246;netmen', 'taxonomy singular name' ),
  244. 'search_items' => __( 'Y&#246;netmen ara' ),
  245. 'all_items' => __( 'T&#252;m y&#246;netmenler' ),
  246. 'edit_item' => __( 'Y&#246;netmen d&#252;zenle' ),
  247. 'update_item' => __( 'Y&#246;netmen g&#252;ncelle' ),
  248. 'add_new_item' => __( 'Yeni y&#246;netmen ekle' ),
  249. 'new_item_name' => __( 'Yeni y&#246;netmen ad&#305;' ),
  250. 'menu_name' => __( 'Y&#246;netmenler' ),
  251. ),
  252. 'rewrite' => array(
  253. 'slug' => 'yonetmen', // This controls the base slug that will display before each term
  254. 'with_front' => false, // Don't display the category base before "/locations/"
  255. 'hierarchical' => false // This will allow URL's like "/locations/boston/cambridge/"
  256. ),
  257. ));
  258. }
  259. add_action( 'init', 'add_custom_taxonomies', 0 );
  260. /*------------------------------------------------------------
  261. OZMovie Custom Write Panel
  262. -------------------------------------------------------------
  263. */
  264. $prefix = 'dbt_';
  265. $orisim = og_ayar('isim_alan');
  266. $pfragman = og_ayar('fragman_alan');
  267. $pozet = og_ayar('ozet_alan');
  268.  
  269. $meta_box = array(
  270. 'id' => 'my-meta-box',
  271. 'title' => 'Film Bilgileri',
  272. 'page' => 'post',
  273. 'context' => 'normal',
  274. 'priority' => 'high',
  275. 'fields' => array(
  276. array(
  277. 'name' => 'Orjinal &#304;sim',
  278. 'desc' => 'Filmin orjinal ismini girin.',
  279. 'id' => 'orjinal_isim' ,
  280. 'type' => 'text',
  281. 'std' => ''
  282. ),
  283. array(
  284. 'name' => 'Film hakk&#305;nda',
  285. 'desc' => 'Film hakk&#305;nda k&#305;sa bir yaz&#305; girin.',
  286. 'id' => 'dbt_film_hakkinda' ,
  287. 'type' => 'editor',
  288. 'std' => ''
  289. ),
  290. array(
  291. 'name' => 'SEO Title',
  292. 'desc' => 'Filme ait &#246;zel bir ba&#351;l&#305;k girebilirsiniz',
  293. 'id' => '_aioseop_title' ,
  294. 'type' => 'text',
  295. 'std' => ''
  296. ),
  297. array(
  298. 'name' => 'SEO Description',
  299. 'desc' => 'Filme ait &#246;zel bir a&#231;&#305;klama girebilirsiniz. (MAX. 160 KARAKTER)',
  300. 'id' => '_aioseop_description' ,
  301. 'type' => 'textarea',
  302. 'std' => ''
  303. ),
  304. array(
  305. 'name' => 'SEO Keywords',
  306. 'desc' => 'Filme ait &#246;zel bir anahtar kelimeler girebilirsiniz. Aralar&#305;na virg&#252;l koymay&#305; unutmay&#305;n.',
  307. 'id' => '_aioseop_keywords' ,
  308. 'type' => 'text',
  309. 'std' => ''
  310. )
  311. )
  312. );
  313.  
  314. add_action('admin_menu', 'mytheme_add_box');
  315. add_filter( wp_editor, 'the_content');
  316.  
  317. // Add meta box
  318. function mytheme_add_box() {
  319. global $meta_box;
  320.  
  321. add_meta_box($meta_box['id'], $meta_box['title'], 'mytheme_show_box', $meta_box['page'], $meta_box['context'], $meta_box['priority']);
  322. }
  323. // Callback function to show fields in meta box
  324. function mytheme_show_box() {
  325. global $meta_box, $post;
  326.  
  327. // Use nonce for verification
  328. echo '<input type="hidden" name="mytheme_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
  329.  
  330. echo '<table class="form-table">';
  331.  
  332. foreach ($meta_box['fields'] as $field) {
  333. // get current post meta data
  334. $meta = get_post_meta($post->ID, $field['id'], true);
  335. $editor_settings = apply_filters('rwmb_wysiwyg_settings', array( 'wpautop' => TRUE, 'media_buttons' => FALSE, 'editor_class' => 'rwmb-wysiwyg', ), 10, 1 );
  336.  
  337. echo '<tr>',
  338. '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
  339. '<td>';
  340. switch ($field['type']) {
  341. case 'text':
  342. echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />',
  343. '<br />', $field['desc'];
  344. break;
  345. case 'editor':
  346. $editin = wp_editor( $meta, $field['id'], $editor_settings );
  347. echo apply_filters( 'the_content', $editin );
  348. echo '<br />', $field['desc'];
  349. break;
  350. case 'textarea':
  351. echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>',
  352. '<br />', $field['desc'];
  353. break;
  354. case 'select':
  355. echo '<select name="', $field['id'], '" id="', $field['id'], '">';
  356. foreach ($field['options'] as $option) {
  357. echo '<option', $meta == $option ? ' selected="selected"' : '', '>', $option, '</option>';
  358. }
  359. echo '</select>';
  360. break;
  361. case 'radio':
  362. foreach ($field['options'] as $option) {
  363. echo '<input type="radio" name="', $field['id'], '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' />', $option['name'];
  364. }
  365. break;
  366. case 'checkbox':
  367. echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';
  368. break;
  369. }
  370. echo '<td>',
  371. '</tr>';
  372. }
  373.  
  374. echo '</table>';
  375. }
  376.  
  377. add_action('save_post', 'mytheme_save_data');
  378.  
  379. // Save data from meta box
  380. function mytheme_save_data($post_id) {
  381. global $meta_box;
  382.  
  383. // verify nonce
  384. if (!wp_verify_nonce($_POST['mytheme_meta_box_nonce'], basename(__FILE__))) {
  385. return $post_id;
  386. }
  387.  
  388. // check autosave
  389. if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
  390. return $post_id;
  391. }
  392.  
  393. // check permissions
  394. if ('page' == $_POST['post_type']) {
  395. if (!current_user_can('edit_page', $post_id)) {
  396. return $post_id;
  397. }
  398. } elseif (!current_user_can('edit_post', $post_id)) {
  399. return $post_id;
  400. }
  401.  
  402. foreach ($meta_box['fields'] as $field) {
  403. $old = get_post_meta($post_id, $field['id'], true);
  404. $new = $_POST[$field['id']];
  405.  
  406. if ($new && $new != $old) {
  407. update_post_meta($post_id, $field['id'], $new);
  408. } elseif ('' == $new && $old) {
  409. delete_post_meta($post_id, $field['id'], $old);
  410. }
  411. }
  412. }
  413.  
  414. /*------------------------------------------------------------
  415. OZMovie Cache Sistemi
  416. -------------------------------------------------------------
  417. */
  418.  
  419. function filmtimi_cachesil(){
  420. delete_transient( 'cacheHEADER' );
  421. delete_transient( 'cacheUST' );
  422. delete_transient( 'cacheRAST' );
  423. delete_transient( 'cacheLOOP' );
  424. delete_transient( 'cacheSOSYAL' );
  425. delete_transient( 'cacheREKLAM' );
  426. delete_transient( 'cacheYORUM' );
  427. delete_transient( 'cacheAD' );
  428. delete_transient( 'cacheMANSET' );
  429. delete_transient( 'cacheTAVSIYE' );
  430. delete_transient( 'cacheRASTGELE' );
  431. delete_transient( 'cacheFOOTER' );
  432. }
  433. add_action('publish_post', 'filmtimi_cachesil');
  434. add_action('update_post', 'filmtimi_cachesil');
  435. add_action('delete_post', 'filmtimi_cachesil');
  436. add_action('edit_post', 'filmtimi_cachesil');
  437. add_action('ogpanel_ayarlar', 'filmtimi_cachesil');
  438.  
  439.  
  440.  
  441. /*------------------------------------------------------------
  442. OZMovie &#214;ne &#199;&#305;kar&#305;lm&#305;&#351; G&#246;rsel
  443. -------------------------------------------------------------
  444. */
  445. add_theme_support( 'post-thumbnails' );
  446. add_image_size( 'midi', 164, 235, true);
  447. add_image_size( 'tavsiye', 110, 164, true);
  448. add_image_size( 'mini', 45, 64, true);
  449. add_filter('post_thumbnail_html', 'remove_feat_img_title');
  450. function remove_feat_img_title($img) {
  451. $img = preg_replace('/title="(.*?)"/','',$img);
  452. return $img;
  453. }
  454. /*------------------------------------------------------------
  455. OZMovie Men&#252;ler
  456. -------------------------------------------------------------
  457. */
  458. add_action( 'init', 'theme_menus' );
  459. function theme_menus() {
  460. register_nav_menus(
  461. array(
  462. 'menu-1' => __( 'Anamenu' ),
  463. 'menu-2' => __( 'FooterMenu' ),
  464. )
  465. );
  466. }
  467. /*------------------------------------------------------------
  468. OZMovie Yorumlar
  469. -------------------------------------------------------------
  470. */
  471. function mytheme_comment($comment, $args, $depth) {
  472. $GLOBALS['comment'] = $comment; ?>
  473. <li id="yorum-<?php comment_ID() ?>">
  474. <div class="avatarKapsul">
  475. <?php $authID = get_the_author_meta('ID');if($authID == $comment->user_id){?>
  476. <a href="<?php echo site_url(); ?>/?author=<?php the_author_ID(); ?>"><?php echo get_avatar( $comment->comment_author_email, 58 ); ?></a></div><!--avatar biti&#351;-->
  477. <div class="yorumKapsul">
  478. <h4><a href="<?php echo site_url(); ?>/?author=<?php the_author_ID(); ?>"><?php printf(__('<strong>%s</strong>'), get_comment_author_link()) ?></a></h4>
  479. <span><?php echo human_time_diff( get_comment_time('U'), current_time('timestamp') ) . ' &#246;nce'; ?></span>
  480. <div class="clear"></div>
  481. <div class="yorumMetin">
  482. <?php comment_text() ?>
  483. <?php if ($comment->comment_approved == '0') : ?>
  484. <em><?php _e('Your comment is awaiting moderation.') ?></em>
  485. <?php endif; ?>
  486. </div><!--yorumMetin biti&#351;-->
  487. </div><!--yorumKapsul biti&#351;-->
  488. <?php } else {?>
  489. <?php echo get_avatar( $comment->comment_author_email, 58 ); ?></div><!--avatar biti&#351;-->
  490. <div class="yorumKapsul">
  491. <h4><?php printf(__('<strong>%s</strong>'), get_comment_author_link()) ?></h4>
  492. <span><?php echo human_time_diff( get_comment_time('U'), current_time('timestamp') ) . ' &#246;nce'; ?></span>
  493. <div class="clear"></div>
  494. <div class="yorumMetin">
  495. <?php comment_text() ?>
  496. <?php if ($comment->comment_approved == '0') : ?>
  497. <em><?php _e('Your comment is awaiting moderation.') ?></em>
  498. <?php endif; ?>
  499. </div><!--yorumMetin biti&#351;-->
  500. </div><!--yorumKapsul biti&#351;-->
  501. <?php } ?>
  502. </li>
  503. <?php
  504. }
  505. add_filter('next_posts_link_attributes', 'posts_link_attributes_1');
  506. add_filter('previous_posts_link_attributes', 'posts_link_attributes_2');
  507.  
  508. function posts_link_attributes_1() {
  509. return 'id="prev-post"';
  510. }
  511. function posts_link_attributes_2() {
  512. return 'id="next-post"';
  513. }
  514. /*------------------------------------------------------------
  515. OZMovie Sidebar
  516. -------------------------------------------------------------
  517. */
  518. if ( function_exists('register_sidebar') )
  519. register_sidebar(array('name'=>'Sidebar',
  520. 'before_title' => '<div class="sideBas"><h2>',
  521. 'after_title' => '</h2></div><!--sideBas biti&#351;-->',
  522. 'before_widget' => '<div class="sideitem" id="%1$s">',
  523. 'after_widget' => '</div>',
  524. ));
  525. /*------------------------------------------------------------
  526. OZMovie Exclude pages from search results
  527. -------------------------------------------------------------
  528. */
  529. function remove_pages_from_search($query) {
  530. if ($query->is_search) {
  531. $query->set('post_type', 'post');
  532. }
  533. return $query;
  534. }
  535. add_filter('pre_get_posts','remove_pages_from_search');
  536. //
  537. function my_custom_login_logo() {
  538. echo '<style type="text/css">
  539. h1 a { background-image:url('.get_bloginfo('template_directory').'/img/logo.png) !important; background-size:286px 90px!important; height:90px!important; }
  540. </style>';
  541. }
  542.  
  543. add_action('login_head', 'my_custom_login_logo');
  544. ?>
  545. <?php
  546. /*------------------------------------------------------------
  547. OZMovie Custom User Profile
  548. -------------------------------------------------------------
  549. */
  550. add_action( 'show_user_profile', 'extra_user_profile_fields' );
  551. add_action( 'edit_user_profile', 'extra_user_profile_fields' );
  552.  
  553. function extra_user_profile_fields( $user ) { ?>
  554. <h3><?php _e("Ekstra bilgiler", "blank"); ?></h3>
  555.  
  556. <table class="form-table">
  557. <tr>
  558. <th><label for="fb"><?php _e("Facebook adresiniz"); ?></label></th>
  559. <td>
  560. <input type="text" name="fb" id="fb" value="<?php echo esc_attr( get_the_author_meta( 'fb', $user->ID ) ); ?>" class="regular-text" /><br />
  561. <span class="description"><?php _e("Facebook adresinizi girin."); ?></span>
  562. </td>
  563. </tr>
  564. <tr>
  565. <th><label for="tw"><?php _e("Twitter adresiniz"); ?></label></th>
  566. <td>
  567. <input type="text" name="tw" id="tw" value="<?php echo esc_attr( get_the_author_meta( 'tw', $user->ID ) ); ?>" class="regular-text" /><br />
  568. <span class="description"><?php _e("Twitter adresinizi girin."); ?></span>
  569. </td>
  570. </tr>
  571. <tr>
  572. <th><label for="user_select"><?php _e("Cinsiyetiniz"); ?></label></th>
  573. <td><?php $selected = get_the_author_meta( 'user_select', $user->ID ); ?>
  574. <select name="user_select" id="user_select" style="width: 318px;">
  575. <option value="Erkek" <?php echo ($selected == "Erkek")? 'selected="selected"' : '' ?>>Erkek</option>
  576. <option value="Kad&#305;n" <?php echo ($selected == "Kad&#305;n")? 'selected="selected"' : '' ?>>Kad&#305;n</option>
  577. </select>
  578. <span class="description"><?php _e("Cinsiyetinizi se&#231;in."); ?></span>
  579. </td>
  580. </tr>
  581. </table>
  582. <?php }
  583.  
  584. add_action( 'personal_options_update', 'save_extra_user_profile_fields' );
  585. add_action( 'edit_user_profile_update', 'save_extra_user_profile_fields' );
  586.  
  587. function save_extra_user_profile_fields( $user_id ) {
  588. if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }
  589. update_usermeta( $user_id, 'user_select', $_POST['user_select'] );
  590. update_usermeta( $user_id, 'tw', $_POST['tw'] );
  591. update_usermeta( $user_id, 'fb', $_POST['fb'] );
  592. }
  593. /*------------------------------------------------------------
  594. OZMovie Custom User Avatar
  595. -------------------------------------------------------------
  596. */
  597. if (!function_exists('oz_avatar')) { function oz_avatar($avatar_defaults) { $new_default_icon = get_bloginfo('template_directory') .'/img/avatar.png';
  598. $avatar_defaults[$new_default_icon] = 'Avatar';
  599. return $avatar_defaults;
  600. }
  601. add_filter( 'avatar_defaults' , 'oz_avatar' ); }
  602. remove_action('wp_head', 'wlwmanifest_link');
  603. remove_action('wp_head', 'rsd_link');
  604.  
  605.  
  606. /*------------------------------------------------------------
  607. OZMovie Page Create
  608. -------------------------------------------------------------
  609. */
  610.  
  611. $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'en-cok-izlenenler';");
  612.  
  613. if (!$page_id) {
  614.  
  615. $my_page = array(
  616. 'post_status' => 'publish',
  617. 'post_type' => 'page',
  618. 'post_author' => 1,
  619. 'post_name' => 'en-cok-izlenenler',
  620. 'post_title' => 'En &#199;ok &#304;zlenenler'
  621. );
  622. $page_id = wp_insert_post($my_page);
  623.  
  624. update_post_meta($page_id, '_wp_page_template', 'en-cok-izlenenler.php');
  625.  
  626. } else {
  627. update_post_meta($page_id, '_wp_page_template', 'en-cok-izlenenler.php');
  628. }
  629. $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'en-cok-yorumlananlar';");
  630.  
  631. if (!$page_id) {
  632.  
  633. $my_page = array(
  634. 'post_status' => 'publish',
  635. 'post_type' => 'page',
  636. 'post_author' => 1,
  637. 'post_name' => 'en-cok-yorumlananlar',
  638. 'post_title' => 'En &#199;ok Yorumlananlar'
  639. );
  640. $page_id = wp_insert_post($my_page);
  641.  
  642. update_post_meta($page_id, '_wp_page_template', 'en-cok-yorumlananlar.php');
  643.  
  644. } else {
  645. update_post_meta($page_id, '_wp_page_template', 'en-cok-yorumlananlar.php');
  646. }
  647. $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'favoriler';");
  648.  
  649. if (!$page_id) {
  650.  
  651. $my_page = array(
  652. 'post_status' => 'publish',
  653. 'post_type' => 'page',
  654. 'post_author' => 1,
  655. 'post_content' => '{{wp-favorite-posts}}',
  656. 'post_name' => 'favoriler',
  657. 'post_title' => 'Favoriler'
  658. );
  659. $page_id = wp_insert_post($my_page);
  660.  
  661. update_post_meta($page_id, '_wp_page_template', 'favoriler.php');
  662.  
  663. } else {
  664. update_post_meta($page_id, '_wp_page_template', 'favoriler.php');
  665. }
  666. $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'giris';");
  667.  
  668. if (!$page_id) {
  669.  
  670. $my_page = array(
  671. 'post_status' => 'publish',
  672. 'post_type' => 'page',
  673. 'post_author' => 1,
  674. 'post_name' => 'giris',
  675. 'post_title' => 'Giri&#351;'
  676. );
  677. $page_id = wp_insert_post($my_page);
  678.  
  679. update_post_meta($page_id, '_wp_page_template', 'page-login.php');
  680.  
  681. } else {
  682. update_post_meta($page_id, '_wp_page_template', 'page-login.php');
  683. }
  684. $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'kayit';");
  685.  
  686. if (!$page_id) {
  687.  
  688. $my_page = array(
  689. 'post_status' => 'publish',
  690. 'post_type' => 'page',
  691. 'post_author' => 1,
  692. 'post_name' => 'kayit',
  693. 'post_title' => 'Kay&#305;t'
  694. );
  695. $page_id = wp_insert_post($my_page);
  696.  
  697. update_post_meta($page_id, '_wp_page_template', 'page-register.php');
  698.  
  699. } else {
  700. update_post_meta($page_id, '_wp_page_template', 'page-register.php');
  701. }
  702. $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'profil';");
  703.  
  704. if (!$page_id) {
  705.  
  706. $my_page = array(
  707. 'post_status' => 'publish',
  708. 'post_type' => 'page',
  709. 'post_author' => 1,
  710. 'post_name' => 'profil',
  711. 'post_title' => 'Profil'
  712. );
  713. $page_id = wp_insert_post($my_page);
  714.  
  715. update_post_meta($page_id, '_wp_page_template', 'page-profil.php');
  716.  
  717. } else {
  718. update_post_meta($page_id, '_wp_page_template', 'page-profil.php');
  719. }
  720. $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'sifre';");
  721.  
  722. if (!$page_id) {
  723.  
  724. $my_page = array(
  725. 'post_status' => 'publish',
  726. 'post_type' => 'page',
  727. 'post_author' => 1,
  728. 'post_name' => 'sifre',
  729. 'post_title' => '&#350;ifre'
  730. );
  731. $page_id = wp_insert_post($my_page);
  732.  
  733. update_post_meta($page_id, '_wp_page_template', 'page-sifre.php');
  734.  
  735. } else {
  736. update_post_meta($page_id, '_wp_page_template', 'page-sifre.php');
  737. }
  738. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement