<?php
function the_title_limit( $max_char, $more_link_text = "(more...)", $stripteaser = 0, $more_file = "" )
{
$title = get_the_title( $more_link_text, $stripteaser, $more_file );
$title = apply_filters( "the_title", $title );
$title = str_replace( "]]>", "]]>", $title );
if ( 0 < strlen( $_GET['span'] ) )
{
echo $title;
}
else if ( $max_char < strlen( $title ) && ( $espacio = strpos( $title, " ", $max_char ) ) )
{
$title = substr( $title, 0, $espacio );
$title = $title;
echo $title;
echo "<a href='";
the_permalink( );
echo "'></a>";
echo "<a href='";
the_permalink( );
echo "'>".$more_link_text."</a></span>";
}
else
{
echo $title;
}
}
function nok_tags( $before = lisanssız, $sep = ", ", $after = "" )
{
if ( lisanssız === $before )
{
$before = __( "Tags: " );
}
return get_the_tag_list( $before, $sep, $after );
}
function eticikler( )
{
$bla = nok_tags( "", "|", "" );
$blabla = explode( "|", $bla );
$say = count( $blabla );
if ( 1 < $say )
{
$max = "1";
}
else
{
$max = count( $blabla );
}
$i = 0;
while ( $i < $max )
{
if ( $i == 0 )
{
echo $blabla[$i];
}
else
{
echo ", ".$blabla[$i];
}
++$i;
}
}
function art_update_option( $key, $value )
{
update_option( $key, get_magic_quotes_gpc( ) ? stripslashes( $value ) : $value );
}
function art_add_admin( )
{
global $themename;
global $shortname;
global $options;
if ( $_GET['page'] == basename( __FILE__ ) && "save" == $_REQUEST['action'] )
{
foreach ( $options as $value )
{
if ( $value['type'] != "multicheck" )
{
art_update_option( $value['id'], $_REQUEST[$value['id']] );
}
else
{
foreach ( $value['options'] as $mc_key => $mc_value )
{
$up_opt = $value['id']."_".$mc_key;
art_update_option( $up_opt, $_REQUEST[$up_opt] );
}
}
}
foreach ( $options as $value )
{
if ( $value['type'] != "multicheck" )
{
if ( isset( $_REQUEST[$value['id']] ) )
{
art_update_option( $value['id'], $_REQUEST[$value['id']] );
}
else
{
delete_option( $value['id'] );
}
}
else
{
foreach ( $value['options'] as $mc_key => $mc_value )
{
$up_opt = $value['id']."_".$mc_key;
if ( isset( $_REQUEST[$up_opt] ) )
{
art_update_option( $up_opt, $_REQUEST[$up_opt] );
}
else
{
delete_option( $up_opt );
}
}
}
}
header( "Location: themes.php?page=functions.php&saved=true" );
exit( );
}
add_theme_page( "Tema Ayarları", "Tema Ayarları", "edit_themes", basename( __FILE__ ), "art_admin" );
}
function art_admin( )
{
global $themename;
global $shortname;
global $options;
if ( $_REQUEST['saved'] )
{
echo "<div id=\"message\" class=\"updated fade\"><p><strong>".$themename." Ayarlarınız Kaydedildi</strong></p></div>";
}
echo "<div class=\"wrap\">\r\n\t<h2>Wp Film Teması Ayarları</h2>\r\n\r\n\t<form method=\"post\">\r\n\r\n\t\t<table class=\"optiontable\" style=\"width:100%;\">\r\n\r\n";
foreach ( $options as $value )
{
switch ( $value['type'] )
{
case "text" :
do
{
option_wrapper_header( $value );
echo " <input style=\"width:100%;\" name=\"";
echo $value['id'];
echo "\" id=\"";
echo $value['id'];
echo "\" type=\"";
echo $value['type'];
echo "\" value=\"";
if ( !( get_settings( $value['id'] ) != "" ) )
{
break;
}
else
{
echo get_settings( $value['id'] );
}
} while ( 0 );
echo $value['std'];
echo "\" />\r\n ";
option_wrapper_footer( $value );
break;
case "select" :
option_wrapper_header( $value );
echo " ";
echo "<s";
echo "elect style=\"width:70%;\" name=\"";
echo $value['id'];
echo "\" id=\"";
echo $value['id'];
echo "\">\r\n ";
foreach ( $value['options'] as $option )
{
echo " <option";
if ( get_settings( $value['id'] ) == $option )
{
echo " selected=\"selected\"";
}
else if ( $option == $value['std'] )
{
echo " selected=\"selected\"";
}
echo ">";
echo $option;
echo "</option>\r\n ";
}
echo " </select>\r\n ";
option_wrapper_footer( $value );
break;
case "textarea" :
do
{
$ta_options = $value['options'];
option_wrapper_header( $value );
echo " <textarea name=\"";
echo $value['id'];
echo "\" id=\"";
echo $value['id'];
echo "\" style=\"width:100%;height:100px;\">";
if ( !( get_settings( $value['id'] ) !== false ) )
{
break;
}
else
{
echo get_settings( $value['id'] );
}
} while ( 0 );
echo $value['std'];
echo "</textarea>\r\n ";
option_wrapper_footer( $value );
break;
case "radio" :
option_wrapper_header( $value );
foreach ( $value['options'] as $key => $option )
{
$radio_setting = get_settings( $value['id'] );
if ( $radio_setting != "" )
{
if ( $key == get_settings( $value['id'] ) )
{
$checked = "checked=\"checked\"";
}
else
{
$checked = "";
}
}
else if ( $key == $value['std'] )
{
$checked = "checked=\"checked\"";
}
else
{
$checked = "";
}
echo " <input type=\"radio\" name=\"";
echo $value['id'];
echo "\" value=\"";
echo $key;
echo "\" ";
echo $checked;
echo " />";
echo $option;
echo "<br />\r\n ";
}
option_wrapper_footer( $value );
break;
case "checkbox" :
do
{
option_wrapper_header( $value );
if ( !get_settings( $value['id'] ) )
{
break;
}
else
{
$checked = "checked=\"checked\"";
}
} while ( 0 );
$checked = "";
echo " <input type=\"checkbox\" name=\"";
echo $value['id'];
echo "\" id=\"";
echo $value['id'];
echo "\" value=\"true\" ";
echo $checked;
echo " />\r\n ";
option_wrapper_footer( $value );
break;
case "multicheck" :
option_wrapper_header( $value );
foreach ( $value['options'] as $key => $option )
{
$pn_key = $value['id']."_".$key;
$checkbox_setting = get_settings( $pn_key );
if ( $checkbox_setting != "" )
{
do
{
if ( get_settings( $pn_key ) )
{
$checked = "checked=\"checked\"";
break;
}
else
{
$checked = "";
}
}
if ( $key == $value['std'] )
{
$checked = "checked=\"checked\"";
}
else
{
$checked = "";
}
} while ( 0 );
echo " <input type=\"checkbox\" name=\"";
echo $pn_key;
echo "\" id=\"";
echo $pn_key;
echo "\" value=\"true\" ";
echo $checked;
echo " /><label for=\"";
echo $pn_key;
echo "\">";
echo $option;
echo "</label><br />\r\n ";
}
option_wrapper_footer( $value );
break;
case "heading" :
}
echo " <tr valign=\"top\">\r\n <td colspan=\"2\" style=\"text-align: center;\"><h3>";
echo $value['name'];
echo "</h3></td>\r\n </tr>\r\n ";
break;
break;
}
echo "\r\n\t\t</table>\r\n\r\n\t\t<p class=\"submit\">\r\n\t\t\t<input name=\"save\" type=\"submit\" value=\"Kaydet\" />\r\n\t\t\t<input type=\"hidden\" name=\"action\" value=\"save\" />\r\n\t\t</p>\r\n\t</form>\r\n</div>\r\n";
}
function option_wrapper_header( $values )
{
echo " <tr valign=\"top\">\r\n <th scope=\"row\" style=\"width:1%;white-space: nowrap;\">";
echo $values['name'];
echo ":</th>\r\n <td>\r\n ";
}
function option_wrapper_footer( $values )
{
echo " </td>\r\n </tr>\r\n <tr valign=\"top\">\r\n <td> </td><td>";
echo "<s";
echo "mall>";
echo $values['desc'];
echo "</small></td>\r\n </tr>\r\n ";
}
$artThemeSettings = array(
"menu.showSubmenus" => false,
"menu.homeCaption" => "Ana Sayfa",
"menu.showHome" => true,
"menu.topItemBegin" => "<span class=\"l\"></span><span class=\"r\"></span><span class=\"t\">",
"menu.topItemEnd" => "</span>"
);
load_theme_textdomain( "kubrick" );
$themename = "WpFilm";
$shortname = "Filtema";
$default_menulinkler_content = "<a href='#'>Reklam</a>";
$default_footer_content = "[Bu Linkleri Admin Panelinden Yönetebilirsiniz.]";
$default_728reklam = "";
$default_350reklam = "";
$default_468reklam = "";
$default_160reklam = "";
$default_yenivideo = "12";
$default_reklamsure = "5";
$default_videomesaji = "Video Açılırken Lütfen Bekleyiniz..";
$default_sitemaplinki = "http://www.netdiziizle.net/sitemap.xml";
$options = array(
array(
"name" => "Ana menü Linkler",
"desc" => "header anamenü linkler ",
"id" => "art_menulinkler_content",
"std" => $default_menulinkler_content,
"type" => "textarea"
),
array(
"name" => "728*90 Header Reklam",
"desc" => "Header Reklam alanı Logonun sag kısmında görüntülenir.",
"id" => "reklam728",
"std" => $default_728reklam,
"type" => "textarea"
),
array(
"name" => "Video Öncesi",
"desc" => "Video Öncesi Gösterilecek Reklam",
"id" => "reklam350",
"std" => $default_350reklam,
"type" => "textarea"
),
array(
"name" => "Video altı",
"desc" => "Videonun altında gösterilecek reklam",
"id" => "reklam468",
"std" => $default_468reklam,
"type" => "textarea"
),
array(
"name" => "Video üstü",
"desc" => "Videonun üstünde gösterilecek reklam",
"id" => "vidust",
"std" => $default_468reklam,
"type" => "textarea"
),
array(
"name" => "Video sidebar reklam",
"desc" => "300*300 Video Sidebar Reklam alanı",
"id" => "reklam160",
"std" => $default_160reklam,
"type" => "textarea"
),
array(
"name" => "Footer Linkler",
"desc" => sprintf( __( "<strong>XHTML:</strong> Bu etiketleri kullanabilirsiniz: <code>%s</code>", "kubrick" ), "a, abbr, acronym, em, b, i, strike, strong, span" ),
"id" => "art_footer_content",
"std" => $default_footer_content,
"type" => "textarea"
),
array(
"name" => "Sitemap adresiniz",
"desc" => "Logo üstü sitemap adresiniz Örn:http://www.siteadresi.com/sitemap.xml",
"id" => "sitemaplinki",
"std" => $default_sitemaplinki,
"type" => "text"
),
array(
"name" => "Video öncesi reklam saniye",
"desc" => "Video Öncesi gösterilecek Reklamın saniyesi. örn:5",
"id" => "reklamsure",
"std" => $default_reklamsure,
"type" => "text"
),
array(
"name" => "Reklam süresince gösterilecek mesaj",
"desc" => "Video öncesi reklam açılana kadar kullanıcıya gösterilecek mesaj.",
"id" => "videomesaji",
"std" => $default_videomesaji,
"type" => "text"
)
);
add_action( "admin_menu", "art_add_admin" );
?>