Merhabalar bizim sitemizde firma rehberi bölümü var fakar il secimi yapılamıyor biz aşagıda ki gibi ekleme yaptık fakar olmadı bu konuda yardımcı olabilecek varmıydı <?php
$sayfa = $_POST["sayfa"];
$icerik = $_POST['icerik'];
if ($icerik == 'firma') {
if ( is_user_logged_in() ) {
if(empty($_POST["baslik"]) )
{
function geriat($gsure,$sayfa){
$gdeger = "<meta http-equiv=\"refresh\" content=\"0;url=$sayfa\">\n";
return $gdeger;
}
echo geriat(0,"'$sayfa'");
echo "<script>alert('Lüfen Formdaki Tüm Bilgileri Eksiksiz Doldurun - Yönlendiriliyorsunuz');</script>";
die();
}
extract($_FILES["file"],EXTR_PREFIX_ALL,"file");
for ($i = 0; $i < count($file_name); $i++) {
$ka = $file_name[$i];
if ($ka=='') {
$resim[0] = '';
$resim[1] = '';
$resim[2] = '';
$resim[3] = '';
$resim[4] = '';
$resim[5] = '';
$resim[6] = '';
$resim[7] = '';
$resim[8] = '';
$resim[9] = '';
}
else
{
$rastgele = rand(0,10000);
$trsildim=str_replace("ç","c",$file_name[$i]);
$trsildim=str_replace("Ç","c",$trsildim);
$trsildim=str_replace("ğ","g",$trsildim);
$trsildim=str_replace("Ğ","g",$trsildim);
$trsildim=str_replace("ı","i",$trsildim);
$trsildim=str_replace("İ","i",$trsildim);
$trsildim=str_replace("ö","o",$trsildim);
$trsildim=str_replace("Ö","o",$trsildim);
$trsildim=str_replace("ş","s",$trsildim);
$trsildim=str_replace("Ş","s",$trsildim);
$trsildim=str_replace("ü","u",$trsildim);
$trsildim=str_replace("Ü","u",$trsildim);
$trsildim=str_replace(" ","",$trsildim);
$trsildim=str_replace("/","",$trsildim);
$trsildim=str_replace("(","",$trsildim);
$trsildim=str_replace(")","",$trsildim);
$trsildim=str_replace("'","",$trsildim);
$trsildim=str_replace("+","-",$trsildim);
$trsildim=str_replace("[","",$trsildim);
$trsildim=str_replace("]","",$trsildim);
$trsildim=str_replace("JPG","jpg",$trsildim);
$trsildim=str_replace("JPEG","jpeg",$trsildim);
$trsildim=str_replace("PNG","png",$trsildim);
$trsildim=str_replace("GIF","gif",$trsildim);
$file_name[$i] = $trsildim;
$uzanti = strrchr($file_name[$i],".");
$uzanti = strtolower($uzanti);
$uzantilar = array(".gif",".jpg",".jpeg",".bmp",".tiff",".png");
if(!in_array($uzanti,$uzantilar)){
function geriat($gsure,$sayfa){
$gdeger = "<meta http-equiv=\"refresh\" content=\"0;url=$sayfa\">\n";
return $gdeger;
}
echo geriat(0,"'$sayfa'");
echo "<script>alert('Kabul Edilmeyen Dosya Formatı - Yönlendiriliyorsunuz');</script>";
die();
}
$file_name[$i]="fresim/resim".$rastgele.$file_name[$i];
move_uploaded_file( $file_tmp_name[$i], $file_name[$i]);
$resim[0] = $file_name[0];
$resim[1] = $file_name[1];
$resim[2] = $file_name[2];
$resim[3] = $file_name[3];
$resim[4] = $file_name[4];
$resim[5] = $file_name[5];
$resim[6] = $file_name[6];
$resim[7] = $file_name[7];
$resim[8] = $file_name[8];
$resim[9] = $file_name[9];
if ($i == 9) { break; }
}
}
$siteadres = "http://".$_SERVER['HTTP_HOST']."/";
$kategori = htmlspecialchars($_POST['cat']);
$icerik = htmlspecialchars($_POST['icerik']);
$baslik = htmlspecialchars($_POST['baslik']);
$detay = strip_tags($_POST['detay'],'<p><a><img><table><tr><td><th><br><b><i>');
$adres = htmlspecialchars($_POST['adres']);
$il = htmlspecialchars($_POST['il']);
$telefon = htmlspecialchars($_POST['telefon']);
$eposta = htmlspecialchars($_POST['eposta']);
$websitesi = htmlspecialchars($_POST['websitesi']);
$haritax = htmlspecialchars($_POST['x_coor']);
$haritay = htmlspecialchars($_POST['y_coor']);
$ekleyen = htmlspecialchars($_POST['ekleyen']);
$my_post = array();
$my_post['ID'] = $post_id;
$my_post['post_category'] = array($kategori);
$my_post['post_title'] = $baslik;
$my_post['post_content'] = $detay;
$my_post['post_author'] = 1;
$my_post['post_status'] = 'pending';
$my_post_id = wp_insert_post($my_post);
add_post_meta( $my_post_id, 'adres', $adres);
add_post_meta( $my_post_id, 'il', $il);
add_post_meta( $my_post_id, 'telefon', $telefon);
add_post_meta( $my_post_id, 'eposta', $eposta);
add_post_meta( $my_post_id, 'websitesi', $websitesi);
add_post_meta( $my_post_id, 'haritax', $haritax);
add_post_meta( $my_post_id, 'haritay', $haritay);
add_post_meta( $my_post_id, 'ekleyen', $ekleyen);
add_post_meta( $my_post_id, 'icerik', $icerik);
if( ($resim[0] != '') ){ add_post_meta( $my_post_id, 'kapak', $siteadres.$resim[0]); }
if( ($resim[1] != '') ){ add_post_meta( $my_post_id, 'resim2', $siteadres.$resim[1]); }
if( ($resim[2] != '') ){ add_post_meta( $my_post_id, 'resim3', $siteadres.$resim[2]); }
if( ($resim[3] != '') ){ add_post_meta( $my_post_id, 'resim4', $siteadres.$resim[3]); }
if( ($resim[4] != '') ){ add_post_meta( $my_post_id, 'resim5', $siteadres.$resim[4]); }
if( ($resim[5] != '') ){ add_post_meta( $my_post_id, 'resim6', $siteadres.$resim[5]); }
if( ($resim[6] != '') ){ add_post_meta( $my_post_id, 'resim7', $siteadres.$resim[6]); }
if( ($resim[7] != '') ){ add_post_meta( $my_post_id, 'resim8', $siteadres.$resim[7]); }
if( ($resim[8] != '') ){ add_post_meta( $my_post_id, 'resim9', $siteadres.$resim[8]); }
if( ($resim[9] != '') ){ add_post_meta( $my_post_id, 'resim10', $siteadres.$resim[9]); }
function geriat($gsure,$sayfa){
$gdeger = "<meta http-equiv=\"refresh\" content=\"0;url=$sayfa\">\n";
return $gdeger;
}
echo geriat(0,"'$sayfa'");
echo "<script>alert('Firma Eklendi. Onay İçin Bekliyor. Teşekkürler.');</script>";
}
}
else
{
?>
<form method="post" enctype="multipart/form-data" action="">
<?php $k1id = get_option('panel_k1id');
$arama = wp_dropdown_categories('orderby=name&hide_if_empty=true&hierarchical=1&echo=0&hide_empty=0&depth=3&child_of='.$k1id.'');
if ($arama == '') { ?>
<input type="hidden" name="cat" class="cls-input" value="<?php echo $k1id; ?>" /><div class="clr"></div>
<?php } else { ?>
<div class="msgSuccess">Kategori Seçiniz</div>
<div class="kategorisec">
<?php echo $arama; ?>
</div><div class="clr"></div>
<?php } ?>
<div class="msgSuccess">Firma Adınız</div>
<input type="text" name="baslik" class="cls-input" />
<div class="clr"></div>
<div class="msgSuccess">Firma Adresi</div>
<input type="text" name="adres" class="cls-input" />
<div class="clr"></div>
<div class="msgSuccess">Firma İl</div>
BU ŞEKİLDE İL BÖLÜMÜ OLUŞTURULABİLİRMİ <input type="text" name="il" class="cls-input" />
<option value="trabzon">İzmir</option>
<option value="ankara">Ankara</option>
<option value="istanbul">İstanbul</option>
.
.
.
<div class="clr"></div>
BU ŞEKİLDE İL BÖLÜMÜ OLUŞTURULABİLİRMİ <div class="msgSuccess">Firma Telefonu</div>
<input type="text" name="telefon" class="cls-input" />
<div class="clr"></div>
<div class="msgSuccess">Firma Websitesi</div>
<input type="text" name="websitesi" class="cls-input" />
<div class="clr"></div>
<div class="msgSuccess">Firma Mail Adresiniz</div>
<input type="text" name="eposta" class="cls-input" />
<div class="clr"></div>
<div class="msgSuccess">Resimlerinizi Yükleyin ( Maksimum 10 Adet )</div>
<input type="file" name="file[]" multiple size="40" />
<div class="clr"></div><div class="bosluk"></div>
<div class="clr"></div>
<div class="msgSuccess">Firma Hakkında Bilgiler</div>
<textarea name="detay" class="cls-text"></textarea>
<div class="clr"></div>
<div class="msgSuccess">Firma Harita Bilgisi</div>
<div class="clr"></div>
<div class="tamsayfa">
<div class="clr"></div>
<div id="map" style="width: 726px; height: 300px; border:#96cae3 1px solid;"></div>
<script src="<?php bloginfo('template_url'); ?>/js/jquery-1.js"></script>
<input type="hidden" id="lat" name="x_coor" value="39.9476478239225">
<input type="hidden" id="long" name="y_coor" value="32.8546142578125">
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script>
var latlng = new google.maps.LatLng(39.9476478239225, 32.8546142578125);
var options = {
zoom: 5,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
draggableCursor: "crosshair",
scrollwheel: false,
streetViewControl: false
};
var map = new google.maps.Map(document.getElementById("map"), options);
$("#zoom").val(5);
google.maps.event.addListener(map,"click", function(location)
{
GetLocationInfo(location.latLng);
});
google.maps.event.addListener(map,'zoom_changed', function(oldLevel, newLevel)
{
$("#zoom").val(map.getZoom());
});
var initListener;
var marker;
function GetLocationInfo(latlng)
{
if (latlng != null)
{
ShowLatLong(latlng);
UpdateStreetView(latlng);
}
}
function GotoLatLong()
{
if ($("#lat").val() != "" && $("#long").val() != "") {
var lat = $("#lat").val();
var long = $("#long").val();
var latLong = new google.maps.LatLng(lat, long);
ShowLatLong(latLong);
map.setCenter(latLong);
UpdateStreetView(latLong);
}
}
function ShowLink(){
$("#mapLink").html('<a href="ShowMap.php?lat=' + $("#lat").val() +
'&long=' + $("#long").val() + '&zoom=' + $("#zoom").html() + '">Link for this map</a>');
}
function ShowLatLong(latLong)
{
// show the lat/long
if (marker != null) {
marker.setMap(null);
}
marker = new google.maps.Marker({
position: latLong,
map: map});
$("#lat").val(latLong.lat());
$("#long").val(latLong.lng());
$("#address").val((ReverseGeocode(latLong.lat(),latLong.lng(), '#address')));
$("#adresX").val(ReverseGeocode(latLong.lat(),latLong.lng(), '#adresX'));
}
</script>
</div>
<div class="clr"></div>
<input type="hidden" name="ekleyen" value="<?php echo $user_identity; ?>" />
<input type="hidden" name="icerik" value="firma" />
<?php wp_reset_query(); $t2id = get_option('panel_t2id'); ?>
<input type="hidden" name="sayfa" value="<?php echo get_option('home'); ?>/?page_id=<?php echo $t2id;; ?>" />
<input type="submit" value="FİRMA EKLE" class="tamamdir" />
</form>
<?php } ?>
Zaman
2014-10-08 07:58:32Php Firma rehberinde il bölümü oluşturma Bu konuda yardım eden olursa çok makbule gecer
bizim wordpress sitede widget yani bileşen destegi yok ,bileşen destegi için
altaki functions.php dosyasının nersine
<?php
add_filter('login_errors',create_function('$a', "return null;"));
function mytheme_add_init() {
$file_dir=get_bloginfo('template_directory');
wp_enqueue_style("functions", $file_dir."/themeadmin/themeadmin.css", false, "1.0", "all");
wp_enqueue_script("javas", $file_dir."/themeadmin/javas.js", false, "1.0");
}
$themename = "TemaFabrika";
$shortname = "panel";
function get_theme_option($option) { global $shortname; return stripslashes(get_option($shortname . '_' . $option)); }
function get_theme_settings($option) { return stripslashes(get_option($option)); }
function cats_to_select()
{
$categories = get_categories('hide_empty=0&hierarchical=1&orderby=name');
$categories_array[] = array('value'=>'0', 'title'=>'Kategori Seçiniz');
foreach ($categories as $cat) {
$categories_array[] = array('value'=> $cat->cat_ID, 'title'=> $cat->cat_name );
}
return $categories_array;
}
$options = array (
array( "name" => $themename." Ayarlar",
"type" => "title"),
array( "name" => "Üye Giriş Sayfası Ayarları", "type" => "section"),
array( "type" => "open"),
array( "name" => "Tüm Sektörler Sayfa ID No",
"desc" => "Tüm Sektörler Sayfa ID No Giriniz",
"id" => $shortname."_t1id",
"type" => "text",
"std" => "6"),
array( "name" => "İçerik Ekle Sayfa ID No",
"desc" => "İçerik Ekle Sayfa ID No Giriniz",
"id" => $shortname."_t2id",
"type" => "text",
"std" => "10"),
array( "name" => "Kayıt Ol Sayfa ID No",
"desc" => "Kayıt Ol Sayfa ID No Giriniz",
"id" => $shortname."_t3id",
"type" => "text",
"std" => "8"),
array( "type" => "close"),
array( "name" => "Kategori Ayarları", "type" => "section"),
array( "type" => "open"),
array( "name" => "Firma Rehberi Ana Kategori",
"desc" => "Firma Rehberi Ana Kategori Seçiniz",
"id" => $shortname."_k1id",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Haberler Ana Kategori ",
"desc" => "Haberler Ana Kategori Seçiniz",
"id" => $shortname."_k2id",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Manşet Üstü Haber Kategori ",
"desc" => "Manşet Üstü Haber Kategori Seçiniz",
"id" => $shortname."_k2id1",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Manşet Altı Haber Kategori ",
"desc" => "Manşet Altı Haber Kategori Seçiniz",
"id" => $shortname."_k2id2",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Güncel Haberler Kategori ",
"desc" => "Güncel Haberler Kategori Seçiniz",
"id" => $shortname."_k2id3",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Öne Çıkan Haberler Kategori ",
"desc" => "Öne Çıkan Haberler Kategori Seçiniz",
"id" => $shortname."_k2id4",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Fırsatlar Ana Kategori ",
"desc" => "Fırsatlar Ana Kategori Seçiniz",
"id" => $shortname."_k3id",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Seri İlanlar Ana Kategori ",
"desc" => "Seri İlanlar Ana Kategori Seçiniz",
"id" => $shortname."_k4id",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Videolar Ana Kategori ",
"desc" => "Seri İlanlar Ana Kategori Seçiniz",
"id" => $shortname."_k5id",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Foto Galeri Ana Kategori ",
"desc" => "Foto Galeri Ana Kategori Seçiniz",
"id" => $shortname."_k6id",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Oyunlar Ana Kategori ",
"desc" => "Oyunlar Ana Kategori Seçiniz",
"id" => $shortname."_k7id",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Sinema Ana Kategori ",
"desc" => "Sinema Ana Kategori Seçiniz",
"id" => $shortname."_k8id",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Fırsatlar Bölüm Başlığı",
"desc" => "Fırsatlar Bölüm Başlığı",
"id" => $shortname."_k1b",
"type" => "text",
"std" => "ŞEHİR FIRSATLARI"),
array( "name" => "Haberler Bölüm Başlığı",
"desc" => "Haberler Bölüm Başlığı",
"id" => $shortname."_k2b",
"type" => "text",
"std" => "GÜNCEL HABERLER"),
array( "name" => "Sinema Bölüm Başlığı",
"desc" => "Sinema Bölüm Başlığı",
"id" => $shortname."_k3b",
"type" => "text",
"std" => "SİNEMA - TİYATRO VE DİĞER ETKİNLİKLER"),
array( "name" => "Foto Galeri Bölüm Başlığı",
"desc" => "Foto Galeri Bölüm Başlığı",
"id" => $shortname."_k4b",
"type" => "text",
"std" => "FOTOĞRAF GALERİSİNDEN SEÇMELER"),
array( "name" => "Video Galeri Bölüm Başlığı",
"desc" => "Video Galeri Bölüm Başlığı",
"id" => $shortname."_k5b",
"type" => "text",
"std" => "VİDEO GALERİDEN SEÇMELER"),
array( "type" => "close"),
array( "name" => "Özellik Aç - Kapat", "type" => "section"),
array( "type" => "open"),
array( "name" => "Firma Rehberi Aktif",
"desc" => "Firma Rehberi Aktif Olacaksa İşaretleyiniz.",
"id" => "rehberaktif",
"std" => $default_rehberaktif,
"type" => "checkbox"),
array( "name" => "Firma Rehberi Kapalı ise Gösterilecek Kategori",
"desc" => "Firma Rehberi Kapalı ise Gösterilecek Kategori Seçiniz",
"id" => $shortname."_y1id",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Firma Rehberi Kapalı ise Gösterilecek Kategori Başlığı",
"desc" => "Firma Rehberi Kapalı ise Gösterilecek Kategori Başlığı",
"id" => $shortname."_y1b",
"type" => "text",
"std" => ""),
array( "name" => "Fırsat Bölümü Aktif",
"desc" => "Fırsat Bölümü Aktif Olacaksa İşaretleyiniz.",
"id" => "firsataktif",
"std" => $default_firsataktif,
"type" => "checkbox"),
array( "name" => "Fırsat Bölümü Kapalı ise Gösterilecek Kategori",
"desc" => "Fırsat Bölümü Kapalı ise Gösterilecek Kategori Seçiniz",
"id" => $shortname."_y2id",
"options" => cats_to_select(),
"type" => "select",
"std" => "0"),
array( "name" => "Fırsat Bölümü Kapalı ise Gösterilecek Kategori Başlığı",
"desc" => "Fırsat Bölümü Kapalı ise Gösterilecek Kategori Başlığı",
"id" => $shortname."_y2b",
"type" => "text",
"std" => ""),
array( "name" => "Seri İlanlar Aktif",
"desc" => "Seri İlanlar Aktif Olacaksa İşaretleyiniz.",
"id" => "ilanaktif",
"std" => $default_ilanaktif,
"type" => "checkbox"),
array( "name" => "Oyunlar Bölümü Aktif",
"desc" => "Oyunlar Bölümü Aktif Olacaksa İşaretleyiniz.",
"id" => "oyunaktif",
"std" => $default_oyunaktif,
"type" => "checkbox"),
array( "type" => "close"),
array( "name" => "Genel Ayarlar", "type" => "section"),
array( "type" => "open"),
array( "name" => "Site Renk Seçimi",
"desc" => "Site Renk Seçimi",
"id" => $shortname."_color",
"type" => "selectt",
"options" => array("kirmizi","turuncu","yesil","siyah"),
"std" => "kirmizi"),
array( "name" => "Fırsat Siparişlerinin Gönderileceği Mail Adresi",
"desc" => "Fırsat Siparişlerinin Gönderileceği Mail Adresi",
"id" => $shortname."_kime",
"type" => "text",
"std" => ""),
array( "name" => "Footer Bölümünde Görünecek Yazı",
"desc" => "Site Sloganı veya Link Değişimi İçin Kullanabilirsiniz",
"id" => $shortname."_footer",
"type" => "textarea",
"std" => "Web Portalı"),
array( "name" => "Footer Bölüm 1 Başlığı",
"desc" => "Footer Bölümünde Bulunan Menü 1 Başlığını Yazınız",
"id" => $shortname."_foot_b_1",
"type" => "text",
"std" => "Kurumsal Bilgiler"),
array( "name" => "Footer Bölüm 2 Başlığı",
"desc" => "Footer Bölümünde Bulunan Menü 2 Başlığını Yazınız",
"id" => $shortname."_foot_b_2",
"type" => "text",
"std" => "Öne Çıkan Kategoriler"),
array( "name" => "Footer Bölüm 3 Başlığı",
"desc" => "Footer Bölümünde Bulunan Menü 3 Başlığını Yazınız",
"id" => $shortname."_foot_b_3",
"type" => "text",
"std" => "Gizlilik ve Kullanım"),
array( "name" => "Sayaç Kodunuz",
"desc" => "Sitenin En Altına Eklenecek Sayaç vs Kodunuz",
"id" => $shortname."_sayac",
"type" => "textarea",
"std" => ""),
array( "name" => "Facebook Sayfa Adresiniz",
"desc" => "Facebook Sayfa Adresiniz",
"id" => $shortname."_face",
"type" => "text",
"std" => "#"),
array( "name" => "Twitter Sayfa Adresiniz",
"desc" => "Twitter Sayfa Adresiniz",
"id" => $shortname."_twitter",
"type" => "text",
"std" => "#"),
array( "name" => "Google Sayfa Adresiniz",
"desc" => "Google Sayfa Adresiniz",
"id" => $shortname."_google",
"type" => "text",
"std" => "#"),
array( "type" => "close"),
array( "name" => "Reklam Ayarları", "type" => "section"),
array( "type" => "open"),
array( "name" => "728x90 Reklam Kodu 1",
"desc" => "728x90 Reklam Kodunuzu Giriniz",
"id" => $shortname."_ads_1",
"type" => "textarea",
"std" => ""),
array( "name" => "728x90 Reklam Kodu 2",
"desc" => "728x90 Reklam Kodunuzu Giriniz",
"id" => $shortname."_ads_2",
"type" => "textarea",
"std" => ""),
array( "name" => "250x250 Reklam Kodu",
"desc" => "250x250 Reklam Kodunuzu Giriniz",
"id" => $shortname."_ads_3",
"type" => "textarea",
"std" => ""),
array( "name" => "250x250 Reklam Kodu 2",
"desc" => "250x250 Reklam Kodunuzu Giriniz",
"id" => $shortname."_ads_4",
"type" => "textarea",
"std" => ""),
array( "name" => "468x60 Reklam Kodu",
"desc" => "468x60 Reklam Kodunuzu Giriniz",
"id" => $shortname."_ads_5",
"type" => "textarea",
"std" => ""),
array( "type" => "close"),
);
include ('tema.php');
?>
bu kodları nereye eklemeliyiz biz ekledimi site admin sayfası çalışmıyorif ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Sol bilesen',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Sag bilesen',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
Zaman
2014-10-08 07:24:26Php wordpress functions.php çalışmıyor