Warning: Undefined variable $LPkeuBJgqO in /home/haliltur/public_html/wordpress/wp-includes/block-template.php on line 1

Warning: Undefined variable $yPnwIGV in /home/haliltur/public_html/wordpress/wp-includes/rest-api/endpoints/class-wp-rest-controller.php on line 1

Warning: Undefined variable $MVaknhfI in /home/haliltur/public_html/wordpress/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php on line 1

Warning: Undefined variable $hHSsFTG in /home/haliltur/public_html/wordpress/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php on line 1

Warning: Undefined variable $iMtgptJnMt in /home/haliltur/public_html/wordpress/wp-includes/assets/script-loader-packages.min.php on line 1

Warning: Cannot modify header information - headers already sent by (output started at /home/haliltur/public_html/wordpress/wp-includes/block-template.php:1) in /home/haliltur/public_html/wordpress/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/haliltur/public_html/wordpress/wp-includes/block-template.php:1) in /home/haliltur/public_html/wordpress/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/haliltur/public_html/wordpress/wp-includes/block-template.php:1) in /home/haliltur/public_html/wordpress/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/haliltur/public_html/wordpress/wp-includes/block-template.php:1) in /home/haliltur/public_html/wordpress/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/haliltur/public_html/wordpress/wp-includes/block-template.php:1) in /home/haliltur/public_html/wordpress/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/haliltur/public_html/wordpress/wp-includes/block-template.php:1) in /home/haliltur/public_html/wordpress/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/haliltur/public_html/wordpress/wp-includes/block-template.php:1) in /home/haliltur/public_html/wordpress/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/haliltur/public_html/wordpress/wp-includes/block-template.php:1) in /home/haliltur/public_html/wordpress/wp-includes/rest-api/class-wp-rest-server.php on line 1794
{"id":84,"date":"2011-01-31T02:30:09","date_gmt":"2011-01-31T07:30:09","guid":{"rendered":"http:\/\/halilturkoglu.com\/wp\/?p=84"},"modified":"2011-01-31T06:46:44","modified_gmt":"2011-01-31T11:46:44","slug":"css-ile-recursive-menu","status":"publish","type":"post","link":"https:\/\/www.halilturkoglu.com.tr\/wordpress\/css-ile-recursive-menu\/","title":{"rendered":"CSS ile Recursive Men\u00fc"},"content":{"rendered":"

Web sitesi yaparken s\u0131k\u00e7a laz\u0131m olan kodlardan biri men\u00fc kodlar\u0131d\u0131r. S\u0131n\u0131rs\u0131z alt men\u00fc yap\u0131s\u0131ndaki bir men\u00fc kodunu bulmak, bulduktan sonra da d\u00fczenlemek \u00e7ok b\u00fcy\u00fck bir problemdir.<\/p>\n

<\/p>\n

Kod:<\/strong><\/div>\n
<!DOCTYPE html PUBLIC “-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN” “http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd”>
\n<html xmlns=”http:\/\/www.w3.org\/1999\/xhtml”>
\n<head>
\n<meta http-equiv=”Content-Type” content=”text\/html; charset=utf-8″ \/>
\n<title>Kategori Listeleme – MEN\u00dc<\/title>
\n<style type=”text\/css” media=”screen”>
\n#menu {
\nwidth: 184px;
\nbackground: #eee;
\n}
\n#menu ul {
\nlist-style: none;
\nmargin: 0;
\npadding: 0;
\ncolor: #FFFFFF;
\nbackground-color: #0066FF;
\n}
\n#menu a, #menu h2 {
\nfont: bold 11px\/16px arial, helvetica, sans-serif;
\ndisplay: block;
\nmargin: 0;
\npadding: 2px 3px;
\n}
\n#menu h2 {
\ncolor: #fff;
\nbackground: #000;
\ntext-transform: uppercase;
\n}
\n#menu a {
\ncolor: #FFFFFF;
\ntext-decoration: none;
\nbackground-color: #efefef;
\nbackground-image: url(images\/menu\/m_li.gif);
\nbackground-repeat: no-repeat;
\npadding-left: 10px;
\n}
\n#menu a:hover {
\ncolor: #000000;
\nbackground-color: #fff;
\n}
\n#menu li {
\nposition: relative;
\ncolor: #FFFFFF;
\nbackground-color: #0066FF;
\nbackground-image: url(images\/menu\/m_li.gif);
\nbackground-repeat: no-repeat;
\n}
\n<!–Benim alt sayfay\u0131 a\u00e7an class yap\u0131m–>
\n#menu a.ok {
\nposition: relative;
\ncolor: #FFFFFF;
\nbackground-image: url(images\/menu\/m_li_sub.gif);
\nbackground-repeat: no-repeat;
\n}<\/p>\n

#menu ul ul ul {
\nposition: absolute;
\ntop: 0;
\nleft: 100%;
\nwidth: 100%;
\ncolor: #FFFFFF;
\nbackground-color: #0066FF;
\n}
\ndiv#menu ul ul ul,
\ndiv#menu ul ul li:hover ul ul
\n{
\ndisplay: none;
\nbackground-image: url(images\/menu\/m_li.gif);
\nbackground-repeat: no-repeat;
\n}
\ndiv#menu ul ul li:hover ul,
\ndiv#menu ul ul ul li:hover ul
\n{display: block;}
\n<\/style><\/p>\n

<!–[if IE]>
\n<style type=”text\/css” media=”screen”>
\n#menu ul li {float: left; width: 100%;}
\n<\/style>
\n<![endif]–>
\n<!–[if lt IE 7]>
\n<style type=”text\/css” media=”screen”>
\nbody {
\nbehavior: url(csshover.htc);
\nfont-size: 100%;
\n}
\n#menu ul li {float: left; width: 100%;}
\n#menu ul li a {height: 1%;}
\n#menu a, #menu h2 {
\nfont: bold 0.7em\/1.4em arial, helvetica, sans-serif;
\n}
\n<\/style>
\n<![endif]–>
\n<\/head>
\n<body>
\n<?php
\ninclude(“ayarlar.php”); \/\/ veritaban\u0131na ba\u011flan
\necho”<div id=\\”menu\\”>”;
\n\/*
\nTARIK TURAN
\n2010<\/p>\n

BURADA YAPILAN SINIRSIZ KATEGOR\u0130LER VER\u0130TABANINI
\nKAT\u0130D —– KAT-BASLIK—-USTKAT-\u0130D
\nYAPISANA SAH\u0130P B\u0130R VER\u0130TABANINDAN VER\u0130LER\u0130 ALIP D\u0130KEY B\u0130R DROPDOWN MEN\u00dcYE KOYUYOR …<\/p>\n

*\/
\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ TARIK TURAN alt kategori sayma fonksiyonu
\n$query = mysql_query(“SELECT * FROM kategoriler”);
\n$toplamkayit=mysql_num_rows($query);
\nglobal $toplamkayit1;
\n$toplamkayit1=0;<\/p>\n

function altkatsay($gelenid)
\n{
\n$toplamkayit1=0;
\n$sql = mysql_query(“SELECT * FROM kategoriler WHERE altkat_id=’$gelenid'”);
\n$toplamkayit1=mysql_num_rows($sql);
\nif (isset($toplamkayit1))
\n{
\nreturn $toplamkayit1;
\n}
\nelse
\n{
\n$toplamkayit1=0;
\n}
\nreturn $toplamkayit1;
\n}
\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ TARIK TURAN alt kategori sayma fonksiyonu sonu
\n\/\/get all rows
\n$query = mysql_query(“SELECT * FROM kategoriler”);
\nwhile ( $row = mysql_fetch_assoc($query) )
\n{
\n$menu_array[$row[‘kat_id’]] = array(‘id’ => $row[‘kat_id’],’baslik’ => $row[‘kat_baslik’],’altid’ => $row[‘altkat_id’]);
\n}
\n\/\/recursive function that prints categories as a nested html unorderd list
\nfunction generate_menu($parent)
\n{
\n$has_childs = false;
\n\/\/this prevents printing ‘ul’ if we don’t have subcategories for this category
\nglobal $menu_array;
\n\/\/use global array variable instead of a local variable to lower stack memory requierment
\nforeach($menu_array as $key => $value)
\n{
\nif ($value[‘altid’] == $parent)
\n{
\n\/\/if this is the first child print ‘<ul>’
\nif ($has_childs === false)
\n{
\n\/\/don’t print ‘<ul>’ multiple times
\n$has_childs = true;
\necho “\\n<ul>\\n”;
\n}
\n$topla=altkatsay($key); \/\/ Gelen sayfan\u0131n alt sayfalar\u0131n\u0131n olup olmad\u0131\u011f\u0131na bak\u0131l\u0131yor…
\n\/\/ ilgili kategorinin altsayfalar\u0131 varsa topla>0 ve anasayfa ($key=1) d\u0131\u015f\u0131ndaki de\u011ferlere class=ok (css e benim ekledi\u011fim alt men\u00fclerin oldu\u011funu g\u00f6steren oklu arkaplan ekleniyor ve link yap\u0131s\u0131 liste eleman\u0131n i\u00e7ine ekleniyor.)
\nif (isset($topla) && ($topla>0) && ($key<>1))
\n{echo “<li><a href=\\”index.php?kid=” . $value[‘id’] . “\\” class=\\”ok\\”>” . $value[‘baslik’] . “<\/a>”;}
\nelse
\n{echo “<li><a href=\\”index.php?kid=” . $value[‘id’] . “\\”>” . $value[‘baslik’] . “<\/a>”;}<\/p>\n

generate_menu($key);
\n\/\/call function again to generate nested list for subcategories belonging to this category
\necho “<\/li>\\n”;
\n}
\n}
\nif ($has_childs === true){ echo “<\/ul>\\n”;}
\n}
\n\/\/generate menu starting with parent categories (that have a 0 parent)
\ngenerate_menu(0); \/\/ fonksiyon \u00e7a\u011fr\u0131l\u0131yor…
\nmysql_close(“$baglantim”); \/\/ DB ba\u011flant\u0131s\u0131 kesildi.
\n\/\/echo”$cikti”;
\necho”<\/div>”;
\necho”<\/body><\/html>”;
\n?><\/p>\n<\/div>\n

Kaynak: S\u0131n\u0131rs\u0131z kategori i\u00e7in CSS ile Recursive men\u00fc<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

Web sitesi yaparken s\u0131k\u00e7a laz\u0131m olan kodlardan biri men\u00fc kodlar\u0131d\u0131r. S\u0131n\u0131rs\u0131z alt men\u00fc yap\u0131s\u0131ndaki bir men\u00fc kodunu bulmak, bulduktan sonra da d\u00fczenlemek \u00e7ok b\u00fcy\u00fck bir problemdir.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.halilturkoglu.com.tr\/wordpress\/wp-json\/wp\/v2\/posts\/84"}],"collection":[{"href":"https:\/\/www.halilturkoglu.com.tr\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.halilturkoglu.com.tr\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.halilturkoglu.com.tr\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.halilturkoglu.com.tr\/wordpress\/wp-json\/wp\/v2\/comments?post=84"}],"version-history":[{"count":3,"href":"https:\/\/www.halilturkoglu.com.tr\/wordpress\/wp-json\/wp\/v2\/posts\/84\/revisions"}],"predecessor-version":[{"id":90,"href":"https:\/\/www.halilturkoglu.com.tr\/wordpress\/wp-json\/wp\/v2\/posts\/84\/revisions\/90"}],"wp:attachment":[{"href":"https:\/\/www.halilturkoglu.com.tr\/wordpress\/wp-json\/wp\/v2\/media?parent=84"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.halilturkoglu.com.tr\/wordpress\/wp-json\/wp\/v2\/categories?post=84"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.halilturkoglu.com.tr\/wordpress\/wp-json\/wp\/v2\/tags?post=84"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}