Plugin Directory

Changeset 3638928


Ignore:
Timestamp:
08/08/2026 07:40:52 PM (3 months ago)
Author:
wpstorecomtr
Message:

Release version 2.0.0

Location:
nobetci-eczaneler
Files:
6 added
18 edited
11 copied

Legend:

Unmodified
Added
Removed
  • nobetci-eczaneler/tags/2.0.0/assets/css/style.css

    r3585474 r3638928  
    151151}
    152152
    153 /* Widget Styles */
    154 .nbetec-widget-wrapper {
    155     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    156     border-radius: 8px;
    157     overflow: hidden;
    158     background: #fff;
    159     box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    160     border: 1px solid #e2e8f0;
    161 }
    162 
    163 .nbetec-widget-header-red {
    164     background: #b91c1c;
    165     color: #fff;
    166     padding: 12px 15px;
    167     font-size: 16px;
    168     text-transform: uppercase;
    169     font-weight: bold;
    170     display: flex;
    171     align-items: center;
    172 }
    173 
    174 .nbetec-widget-subheader-dark {
    175     background: #2d3748;
    176     color: #fff;
    177     padding: 8px 15px;
    178     font-size: 13px;
    179     text-align: center;
    180     font-weight: 500;
    181 }
    182 
    183 .nbetec-widget-list {
    184     list-style: none;
    185     margin: 0;
    186     padding: 0;
    187 }
    188 
    189 .nbetec-widget-item {
    190     border-bottom: 3px solid #cbd5e0;
    191 }
    192 
    193 .nbetec-widget-item:last-child {
    194     border-bottom: none;
    195 }
    196 
    197 .nbetec-w-name {
    198     font-size: 15px;
    199     color: #1a202c;
    200     padding: 10px 15px;
    201     background: #fff;
    202     border-bottom: 1px solid #edf2f7;
    203     display: flex;
    204     align-items: center;
    205 }
    206 
    207 .nbetec-w-e-icon-img {
    208     width: 24px;
    209     height: 24px;
    210     margin-right: 8px;
    211     object-fit: contain;
    212 }
    213 
    214 .nbetec-w-ilce {
    215     color: #718096;
    216     font-size: 13px;
    217     margin-left: 5px;
    218     font-weight: normal;
    219 }
    220 
    221 .nbetec-w-phone, .nbetec-w-address, .nbetec-w-direction {
    222     font-size: 14px;
    223     color: #4a5568;
    224     padding: 10px 15px;
    225     background: #f7fafc;
    226     border-bottom: 1px solid #edf2f7;
    227     display: flex;
    228     align-items: center;
    229 }
    230 
    231 .nbetec-w-address {
    232     background: #fff;
    233     align-items: flex-start;
    234 }
    235 
    236 .nbetec-w-direction {
    237     background: #fdf2f8;
    238     color: #b91c1c;
    239     font-style: italic;
    240 }
    241 
    242 .nbetec-w-phone a, .nbetec-w-address a {
    243     color: #2d3748;
    244     text-decoration: none;
    245 }
    246 
    247 .nbetec-w-phone .dashicons, .nbetec-w-address .dashicons {
    248     font-size: 18px;
    249     width: 18px;
    250     height: 18px;
    251     margin-right: 8px;
    252     color: #4a5568;
    253 }
    254 
    255 .nbetec-w-more {
    256     text-align: center;
    257     padding: 12px;
    258     background: #f7fafc;
    259     border-top: 1px solid #edf2f7;
    260 }
    261 
    262 .nbetec-w-more a {
    263     color: #3182ce;
    264     text-decoration: none;
    265     font-weight: bold;
    266     font-size: 13px;
    267 }
     153
    268154
    269155/* Koyu Tema (Dark) */
    270156.nbetec-theme-dark {
    271     background: #1a202c;
     157    background: #000000;
    272158    border-color: #2d3748;
    273159    color: #e2e8f0;
    274160}
    275 .nbetec-theme-dark .nbetec-widget-item { border-color: #2d3748; }
    276 .nbetec-theme-dark .nbetec-w-name { color: #f7fafc; }
    277 .nbetec-theme-dark .nbetec-w-phone, .nbetec-theme-dark .nbetec-w-address { color: #cbd5e0; }
    278 .nbetec-theme-dark .nbetec-w-more { background: #2d3748; border-color: #4a5568; }
    279 
    280161/* --- Inline Styles Moved Here --- */
    281162.nbetec-breadcrumb { font-size: 14px; margin-bottom: 20px; display: flex; align-items: center; flex-wrap: wrap; }
    … …  
    335216.nbetec-city-card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.08); border-color: #e53e3e; color: #e53e3e; }
    336217.nbetec-city-card:hover .nbetec-city-plate { color: #c53030; }
     218
     219/* Anasayfa İl Seçimi Koyu Tema */
     220.nbetec-theme-dark .nbetec-header .nbetec-title { color: #ffffff; }
     221.nbetec-theme-dark .nbetec-desc, .nbetec-theme-dark .nbetec-header p { color: #ffffff; }
     222.nbetec-theme-dark #nbetec-city-search {
     223    background: #2d3748;
     224    border-color: #4a5568;
     225    color: #f7fafc;
     226}
     227.nbetec-theme-dark #nbetec-city-search::placeholder { color: #a0aec0; }
     228.nbetec-theme-dark .nbetec-search-icon { stroke: #a0aec0; }
     229
     230.nbetec-theme-dark .nbetec-city-card {
     231    background: #2d3748;
     232    border-color: #4a5568;
     233}
     234.nbetec-theme-dark .nbetec-city-card:hover {
     235    background: #1a202c;
     236    border-color: #fc8181;
     237    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
     238}
     239.nbetec-theme-dark .nbetec-city-plate { color: #fc8181; }
     240.nbetec-theme-dark .nbetec-city-name { color: #e2e8f0; }
     241.nbetec-theme-dark .nbetec-city-card:hover .nbetec-city-name { color: #f7fafc; }
     242
     243/* Shortcode / Eczane Listesi Koyu Tema */
     244.nbetec-theme-dark .nbetec-card {
     245    background: #1a202c;
     246    border-color: #2d3748;
     247    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
     248}
     249.nbetec-theme-dark .nbetec-card:hover { border-color: #fc8181; box-shadow: 0 10px 20px rgba(0,0,0,0.7); }
     250.nbetec-theme-dark .nbetec-name { color: #f7fafc; }
     251.nbetec-theme-dark .nbetec-ilce { background: #000000; color: #90cdf4; }
     252.nbetec-theme-dark .nbetec-address, .nbetec-theme-dark .nbetec-phone { background: #000000; }
     253.nbetec-theme-dark .nbetec-address a, .nbetec-theme-dark .nbetec-phone a { color: #e2e8f0; }
     254.nbetec-theme-dark .nbetec-address a:hover, .nbetec-theme-dark .nbetec-phone a:hover { color: #fc8181; }
     255.nbetec-theme-dark .nbetec-address svg, .nbetec-theme-dark .nbetec-phone svg { color: #a0aec0; }
     256.nbetec-theme-dark .nbetec-direction { background: #000000 !important; color: #ffffff !important; border-left-color: #b91c1c !important; }
     257.nbetec-theme-dark .nbetec-direction * { color: #ffffff !important; }
     258/* Dropdown Seçiciler Koyu Tema */
     259.nbetec-theme-dark .nbetec-selector-header, .nbetec-theme-dark .nbetec-selector-dropdown {
     260    background: #1a202c !important;
     261    border-color: #2d3748 !important;
     262    color: #f7fafc !important;
     263}
     264.nbetec-theme-dark .nbetec-selector-header span, .nbetec-theme-dark .nbetec-selector-header strong { color: #f7fafc !important; }
     265.nbetec-theme-dark .nbetec-city-list li a { border-color: #2d3748 !important; color: #e2e8f0 !important; }
     266.nbetec-theme-dark .nbetec-city-list li a:hover { background: #000000 !important; }
     267.nbetec-theme-dark .nbetec-city-list .nbetec-plate { background: #000000 !important; color: #e2e8f0 !important; }
     268.nbetec-theme-dark .nbetec-selector-dropdown > div { background: #1a202c !important; border-color: #2d3748 !important; }
     269.nbetec-theme-dark .nbetec-search-input {
     270    background: #1a202c !important;
     271    border-color: #2d3748 !important;
     272    color: #f7fafc !important;
     273}
     274
     275/* Paylaş Alanı Koyu Tema */
     276.nbetec-theme-dark .nbetec-share-actions { background: #1a202c !important; border-color: #2d3748 !important; color: #e2e8f0 !important; }
     277.nbetec-theme-dark .nbetec-share-label { color: #f7fafc !important; }
     278.nbetec-theme-dark .nbetec-x-icon, .nbetec-theme-dark .nbetec-print-btn { color: #f7fafc !important; }
     279
     280/* Kontrol Satırı (Şehir, İlçe, Paylaş) Düzeni */
     281.nbetec-controls-row {
     282    display: flex;
     283    flex-direction: column;
     284    gap: 15px;
     285    margin-bottom: 20px;
     286}
     287.nbetec-share-actions {
     288    justify-content: center !important;
     289}
     290
     291@media (min-width: 768px) {
     292    .nbetec-controls-row {
     293        flex-direction: row;
     294        align-items: center;
     295    }
     296    .nbetec-city-selector, .nbetec-district-selector, .nbetec-share-actions {
     297        flex: 1;
     298        margin-bottom: 0 !important;
     299    }
     300}
     301
     302/* ========================================= */
     303/* YENI WIDGET TASARIMI (THEME INDEPENDENT)  */
     304/* ========================================= */
     305.nbetec-nw-container {
     306    all: initial !important; /* Reset everything */
     307    display: block !important;
     308    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     309    border-radius: 4px !important;
     310    overflow: hidden !important;
     311    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
     312    background: #fff !important;
     313    border: 1px solid #e2e8f0 !important;
     314}
     315
     316/* Header */
     317.nbetec-nw-theme-red_list .nbetec-nw-header {
     318    background: #b91c1c !important;
     319    padding: 15px !important;
     320    display: flex !important;
     321    align-items: center !important;
     322    gap: 12px !important;
     323}
     324.nbetec-nw-logo-box {
     325    border: 2px solid #ffffff !important;
     326    color: #ffffff !important;
     327    font-size: 24px !important;
     328    font-weight: bold !important;
     329    width: 38px !important;
     330    height: 38px !important;
     331    display: flex !important;
     332    align-items: center !important;
     333    justify-content: center !important;
     334    flex-shrink: 0 !important;
     335    line-height: 1 !important;
     336}
     337.nbetec-nw-title-box {
     338    display: flex !important;
     339    flex-direction: column !important;
     340}
     341.nbetec-nw-title {
     342    color: #ffffff !important;
     343    font-weight: 900 !important;
     344    font-size: 16px !important;
     345    line-height: 1.2 !important;
     346    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     347}
     348.nbetec-nw-city {
     349    color: #ffffff !important;
     350    font-weight: bold !important;
     351    font-size: 14px !important;
     352    margin-top: 2px !important;
     353    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     354}
     355
     356/* Dates */
     357.nbetec-nw-theme-red_list .nbetec-nw-dates {
     358    background: #2d3748 !important;
     359    padding: 12px 15px !important;
     360    display: flex !important;
     361    flex-direction: column !important;
     362    gap: 8px !important;
     363}
     364.nbetec-nw-date-row {
     365    display: flex !important;
     366    align-items: center !important;
     367    gap: 8px !important;
     368}
     369.nbetec-nw-calendar-icon {
     370    width: 16px !important;
     371    height: 16px !important;
     372    color: #cbd5e0 !important;
     373    flex-shrink: 0 !important;
     374}
     375.nbetec-nw-date-row span {
     376    color: #ffffff !important;
     377    box-shadow: none !important;
     378}
     379.nbetec-filter-btn:hover { border-color: #cbd5e0; background: #f7fafc; color: #4a5568; text-decoration: none; }
     380.nbetec-filter-btn.active { border-color: #3182ce; color: #3182ce; background: #ebf8ff; font-weight: 700; }
     381.nbetec-filter-icon { margin-right: 6px; font-size: 12px; font-weight: bold; }
     382
     383.nbetec-shortcode { max-width: 1000px; margin: 0 auto; font-family: inherit; }
     384.nbetec-shortcode .nbetec-header .nbetec-title {
     385    background: linear-gradient(135deg, #e53e3e, #c53030);
     386    -webkit-background-clip: text;
     387    -webkit-text-fill-color: transparent;
     388    display: inline-block;
     389}
     390.nbetec-search-wrapper { position: relative; max-width: 600px; margin: 0 auto 30px auto; }
     391.nbetec-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); pointer-events: none; transition: stroke 0.3s ease; }
     392#nbetec-city-search {
     393    width: 100%; padding: 16px 20px 16px 45px; font-size: 16px; border: 2px solid #e2e8f0;
     394    border-radius: 30px; outline: none; background: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.02); transition: all 0.3s ease;
     395}
     396#nbetec-city-search:focus { border-color: #e53e3e; box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.15); }
     397#nbetec-city-search:focus + .nbetec-search-icon, #nbetec-city-search:focus ~ .nbetec-search-icon { stroke: #e53e3e; }
     398.nbetec-city-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px; }
     399@media (max-width: 992px) { .nbetec-city-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }
     400@media (max-width: 480px) {
     401    .nbetec-city-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
     402    .nbetec-city-card { padding: 10px 4px; }
     403    .nbetec-city-plate { font-size: 18px; margin-bottom: 4px; }
     404    .nbetec-city-name { font-size: 11px; word-break: break-word; line-height: 1.2; }
     405}
     406.nbetec-city-card {
     407    display: flex; flex-direction: column; align-items: center; justify-content: center;
     408    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px 10px;
     409    text-decoration: none; color: #2d3748; transition: all 0.2s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.02);
     410}
     411.nbetec-city-card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.08); border-color: #e53e3e; color: #e53e3e; }
     412.nbetec-city-card:hover .nbetec-city-plate { color: #c53030; }
     413
     414/* Anasayfa İl Seçimi Koyu Tema */
     415.nbetec-theme-dark .nbetec-header .nbetec-title { color: #ffffff; }
     416.nbetec-theme-dark .nbetec-desc, .nbetec-theme-dark .nbetec-header p { color: #ffffff; }
     417.nbetec-theme-dark #nbetec-city-search {
     418    background: #2d3748;
     419    border-color: #4a5568;
     420    color: #f7fafc;
     421}
     422.nbetec-theme-dark #nbetec-city-search::placeholder { color: #a0aec0; }
     423.nbetec-theme-dark .nbetec-search-icon { stroke: #a0aec0; }
     424
     425.nbetec-theme-dark .nbetec-city-card {
     426    background: #2d3748;
     427    border-color: #4a5568;
     428}
     429.nbetec-theme-dark .nbetec-city-card:hover {
     430    background: #1a202c;
     431    border-color: #fc8181;
     432    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
     433}
     434.nbetec-theme-dark .nbetec-city-plate { color: #fc8181; }
     435.nbetec-theme-dark .nbetec-city-name { color: #e2e8f0; }
     436.nbetec-theme-dark .nbetec-city-card:hover .nbetec-city-name { color: #f7fafc; }
     437
     438/* Shortcode / Eczane Listesi Koyu Tema */
     439.nbetec-theme-dark .nbetec-card {
     440    background: #1a202c;
     441    border-color: #2d3748;
     442    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
     443}
     444.nbetec-theme-dark .nbetec-card:hover { border-color: #fc8181; box-shadow: 0 10px 20px rgba(0,0,0,0.7); }
     445.nbetec-theme-dark .nbetec-name { color: #f7fafc; }
     446.nbetec-theme-dark .nbetec-ilce { background: #000000; color: #90cdf4; }
     447.nbetec-theme-dark .nbetec-address, .nbetec-theme-dark .nbetec-phone { background: #000000; }
     448.nbetec-theme-dark .nbetec-address a, .nbetec-theme-dark .nbetec-phone a { color: #e2e8f0; }
     449.nbetec-theme-dark .nbetec-address a:hover, .nbetec-theme-dark .nbetec-phone a:hover { color: #fc8181; }
     450.nbetec-theme-dark .nbetec-address svg, .nbetec-theme-dark .nbetec-phone svg { color: #a0aec0; }
     451.nbetec-theme-dark .nbetec-direction { background: #000000 !important; color: #ffffff !important; border-left-color: #b91c1c !important; }
     452.nbetec-theme-dark .nbetec-direction * { color: #ffffff !important; }
     453/* Dropdown Seçiciler Koyu Tema */
     454.nbetec-theme-dark .nbetec-selector-header, .nbetec-theme-dark .nbetec-selector-dropdown {
     455    background: #1a202c !important;
     456    border-color: #2d3748 !important;
     457    color: #f7fafc !important;
     458}
     459.nbetec-theme-dark .nbetec-selector-header span, .nbetec-theme-dark .nbetec-selector-header strong { color: #f7fafc !important; }
     460.nbetec-theme-dark .nbetec-city-list li a { border-color: #2d3748 !important; color: #e2e8f0 !important; }
     461.nbetec-theme-dark .nbetec-city-list li a:hover { background: #000000 !important; }
     462.nbetec-theme-dark .nbetec-city-list .nbetec-plate { background: #000000 !important; color: #e2e8f0 !important; }
     463.nbetec-theme-dark .nbetec-selector-dropdown > div { background: #1a202c !important; border-color: #2d3748 !important; }
     464.nbetec-theme-dark .nbetec-search-input {
     465    background: #1a202c !important;
     466    border-color: #2d3748 !important;
     467    color: #f7fafc !important;
     468}
     469
     470/* Paylaş Alanı Koyu Tema */
     471.nbetec-theme-dark .nbetec-share-actions { background: #1a202c !important; border-color: #2d3748 !important; color: #e2e8f0 !important; }
     472.nbetec-theme-dark .nbetec-share-label { color: #f7fafc !important; }
     473.nbetec-theme-dark .nbetec-x-icon, .nbetec-theme-dark .nbetec-print-btn { color: #f7fafc !important; }
     474
     475/* Kontrol Satırı (Şehir, İlçe, Paylaş) Düzeni */
     476.nbetec-controls-row {
     477    display: flex;
     478    flex-direction: column;
     479    gap: 15px;
     480    margin-bottom: 20px;
     481}
     482.nbetec-share-actions {
     483    justify-content: center !important;
     484}
     485
     486@media (min-width: 768px) {
     487    .nbetec-controls-row {
     488        flex-direction: row;
     489        align-items: center;
     490    }
     491    .nbetec-city-selector, .nbetec-district-selector, .nbetec-share-actions {
     492        flex: 1;
     493        margin-bottom: 0 !important;
     494    }
     495}
     496
     497/* ========================================= */
     498/* YENI WIDGET TASARIMI (THEME INDEPENDENT)  */
     499/* ========================================= */
     500.nbetec-nw-container {
     501    all: initial !important; /* Reset everything */
     502    display: block !important;
     503    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     504    border-radius: 4px !important;
     505    overflow: hidden !important;
     506    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
     507    background: #fff !important;
     508    border: 1px solid #e2e8f0 !important;
     509}
     510
     511/* Header */
     512.nbetec-nw-theme-red_list .nbetec-nw-header {
     513    background: #b91c1c !important;
     514    padding: 15px !important;
     515    display: flex !important;
     516    align-items: center !important;
     517    gap: 12px !important;
     518}
     519.nbetec-nw-logo-box {
     520    border: 2px solid #ffffff !important;
     521    color: #ffffff !important;
     522    font-size: 24px !important;
     523    font-weight: bold !important;
     524    width: 38px !important;
     525    height: 38px !important;
     526    display: flex !important;
     527    align-items: center !important;
     528    justify-content: center !important;
     529    flex-shrink: 0 !important;
     530    line-height: 1 !important;
     531}
     532.nbetec-nw-title-box {
     533    display: flex !important;
     534    flex-direction: column !important;
     535}
     536.nbetec-nw-title {
     537    color: #ffffff !important;
     538    font-weight: 900 !important;
     539    font-size: 16px !important;
     540    line-height: 1.2 !important;
     541    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     542}
     543.nbetec-nw-city {
     544    color: #ffffff !important;
     545    font-weight: bold !important;
     546    font-size: 14px !important;
     547    margin-top: 2px !important;
     548    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     549}
     550
     551/* Dates */
     552.nbetec-nw-theme-red_list .nbetec-nw-dates {
     553    background: #2d3748 !important;
     554    padding: 12px 15px !important;
     555    display: flex !important;
     556    flex-direction: column !important;
     557    gap: 8px !important;
     558}
     559.nbetec-nw-date-row {
     560    display: flex !important;
     561    align-items: center !important;
     562    gap: 8px !important;
     563}
     564.nbetec-nw-calendar-icon {
     565    width: 16px !important;
     566    height: 16px !important;
     567    color: #cbd5e0 !important;
     568    flex-shrink: 0 !important;
     569}
     570.nbetec-nw-date-row span {
     571    color: #ffffff !important;
     572    font-size: 13px !important;
     573    font-weight: 600 !important;
     574    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     575}
     576
     577/* List */
     578.nbetec-nw-list {
     579    list-style: none !important;
     580    margin: 0 !important;
     581    padding: 0 !important;
     582    max-height: 320px !important;
     583    overflow-y: auto !important;
     584    background: #ffffff !important;
     585}
     586.nbetec-nw-theme-red_list .nbetec-nw-list {
     587    scrollbar-width: auto !important;
     588    scrollbar-color: #ffffff #b91c1c !important;
     589}
     590.nbetec-nw-theme-red_list .nbetec-nw-list::-webkit-scrollbar-track {
     591    background: #b91c1c !important;
     592}
     593.nbetec-nw-theme-red_list .nbetec-nw-list::-webkit-scrollbar-thumb {
     594    background: #ffffff !important;
     595    border-radius: 3px !important;
     596}
     597.nbetec-nw-theme-red_list .nbetec-nw-list::-webkit-scrollbar-thumb:hover {
     598    background: #f7fafc !important;
     599}
     600.nbetec-nw-list li::before, .nbetec-nw-list li::after {
     601    display: none !important;
     602    content: none !important;
     603}
     604.nbetec-nw-item {
     605    list-style: none !important;
     606    margin: 0 !important;
     607    padding: 12px 15px !important;
     608    border-bottom: 1px solid #edf2f7 !important;
     609}
     610.nbetec-nw-theme-red_list .nbetec-nw-item {
     611    background: #b91c1c !important;
     612    border-bottom: 1px solid #9b2c2c !important;
     613}
     614.nbetec-nw-item:last-child {
     615    border-bottom: none !important;
     616}
     617
     618.nbetec-nw-item-header {
     619    display: flex !important;
     620    align-items: center !important;
     621    gap: 10px !important;
     622    margin-bottom: 10px !important;
     623}
     624
     625.nbetec-nw-item-logo {
     626    background: #b91c1c !important;
     627    color: #ffffff !important;
     628    width: 26px !important;
     629    height: 26px !important;
     630    display: flex !important;
     631    align-items: center !important;
     632    justify-content: center !important;
     633    font-weight: bold !important;
     634    font-size: 16px !important;
     635    border-radius: 4px !important;
     636    flex-shrink: 0 !important;
     637}
     638.nbetec-nw-theme-red_list .nbetec-nw-item-logo {
     639    background: #ffffff !important;
     640    color: #b91c1c !important;
     641}
     642
     643.nbetec-nw-item-name-box {
     644    display: flex !important;
     645    flex-direction: column !important;
     646}
     647
     648.nbetec-nw-item-name {
     649    font-weight: bold !important;
     650    font-size: 15px !important;
     651    color: #1a202c !important;
     652    line-height: 1.2 !important;
     653    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     654}
     655.nbetec-nw-theme-red_list .nbetec-nw-item-name {
     656    color: #ffffff !important;
     657}
     658
     659.nbetec-nw-item-district {
     660    font-size: 13px !important;
     661    color: #718096 !important;
     662    margin-top: 2px !important;
     663    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     664}
     665.nbetec-nw-theme-red_list .nbetec-nw-item-district {
     666    color: #fed7d7 !important;
     667}
     668
     669.nbetec-nw-item-details {
     670    display: flex !important;
     671    flex-direction: column !important;
     672    gap: 6px !important;
     673}
     674
     675.nbetec-nw-phone, .nbetec-nw-address {
     676    display: flex !important;
     677    align-items: flex-start !important;
     678    gap: 6px !important;
     679    color: #4a5568 !important;
     680    text-decoration: none !important;
     681    font-size: 13px !important;
     682    line-height: 1.4 !important;
     683    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     684}
     685.nbetec-nw-theme-red_list .nbetec-nw-phone,
     686.nbetec-nw-theme-red_list .nbetec-nw-address {
     687    color: #ffffff !important;
     688}
     689.nbetec-nw-phone:hover, .nbetec-nw-address:hover {
     690    color: #b91c1c !important;
     691}
     692.nbetec-nw-theme-red_list .nbetec-nw-phone:hover,
     693.nbetec-nw-theme-red_list .nbetec-nw-address:hover {
     694    color: #fed7d7 !important;
     695}
     696.nbetec-nw-phone svg, .nbetec-nw-address svg {
     697    width: 14px !important;
     698    height: 14px !important;
     699    flex-shrink: 0 !important;
     700    margin-top: 2px !important;
     701    color: #a0aec0 !important;
     702}
     703.nbetec-nw-theme-red_list .nbetec-nw-phone svg,
     704.nbetec-nw-theme-red_list .nbetec-nw-address svg {
     705    color: #fed7d7 !important;
     706}
     707
     708.nbetec-nw-directions {
     709    font-size: 12px !important;
     710    color: #b91c1c !important;
     711    background: #fef2f2 !important;
     712    padding: 6px 10px !important;
     713    border-radius: 4px !important;
     714    margin-top: 4px !important;
     715    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     716}
     717.nbetec-nw-theme-red_list .nbetec-nw-directions {
     718    color: #ffffff !important;
     719    background: #9b2c2c !important;
     720}
     721
     722.nbetec-nw-more-link {
     723    background: #f7fafc !important;
     724    padding: 12px !important;
     725    text-align: center !important;
     726    border-top: 1px solid #edf2f7 !important;
     727}
     728.nbetec-nw-theme-red_list .nbetec-nw-more-link {
     729    background: #b91c1c !important;
     730    border-top: 1px solid #9b2c2c !important;
     731}
     732.nbetec-nw-more-link a {
     733    color: #3182ce !important;
     734    text-decoration: none !important;
     735    font-weight: bold !important;
     736    font-size: 14px !important;
     737    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     738}
     739.nbetec-nw-theme-red_list .nbetec-nw-more-link a {
     740    color: #ffffff !important;
     741}
     742.nbetec-nw-more-link a:hover {
     743    text-decoration: underline !important;
     744}
     745.nbetec-nw-theme-red_list .nbetec-nw-more-link a:hover {
     746    color: #fed7d7 !important;
     747}
     748
     749/* ========================================= */
     750/* LIGHT THEME OVERRIDES (AÇIK MOD)          */
     751/* ========================================= */
     752
     753.nbetec-nw-theme-light .nbetec-nw-header {
     754    background: #ffffff !important;
     755    padding: 15px !important;
     756    display: flex !important;
     757    align-items: center !important;
     758    gap: 12px !important;
     759    border-bottom: 1px solid #edf2f7 !important;
     760}
     761.nbetec-nw-theme-light .nbetec-nw-logo-box {
     762    border: 2px solid #b91c1c !important;
     763    color: #ffffff !important;
     764    background: #b91c1c !important;
     765}
     766.nbetec-nw-theme-light .nbetec-nw-title {
     767    color: #1a202c !important;
     768}
     769.nbetec-nw-theme-light .nbetec-nw-city {
     770    color: #e53e3e !important;
     771}
     772
     773.nbetec-nw-theme-light .nbetec-nw-dates {
     774    background: #f7fafc !important;
     775    padding: 12px 15px !important;
     776    display: flex !important;
     777    flex-direction: column !important;
     778    gap: 8px !important;
     779    border-bottom: 1px solid #edf2f7 !important;
     780}
     781.nbetec-nw-theme-light .nbetec-nw-date-row span {
     782    color: #4a5568 !important;
     783}
     784.nbetec-nw-theme-light .nbetec-nw-calendar-icon {
     785    color: #a0aec0 !important;
     786}
     787
     788.nbetec-nw-alert {
     789    padding: 15px !important;
     790    color: #c53030 !important;
     791    background: #fff5f5 !important;
     792    font-size: 14px !important;
     793    text-align: center !important;
     794    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     795}
     796
     797/* ========================================= */
     798/* DARK THEME OVERRIDES (KARANLIK MOD)       */
     799/* ========================================= */
     800.nbetec-nw-theme-dark {
     801    background: #1a202c !important;
     802    border-color: #2d3748 !important;
     803}
     804.nbetec-nw-theme-dark .nbetec-nw-header {
     805    background: #1a202c !important;
     806    border-bottom: 1px solid #2d3748 !important;
     807    padding: 15px !important;
     808    display: flex !important;
     809    align-items: center !important;
     810    gap: 12px !important;
     811}
     812.nbetec-nw-theme-dark .nbetec-nw-logo-box {
     813    border-color: #e53e3e !important;
     814    color: #e53e3e !important;
     815    background: transparent !important;
     816}
     817.nbetec-nw-theme-dark .nbetec-nw-title {
     818    color: #f7fafc !important;
     819}
     820.nbetec-nw-theme-dark .nbetec-nw-city {
     821    color: #fc8181 !important;
     822}
     823
     824.nbetec-nw-theme-dark .nbetec-nw-dates {
     825    background: #2d3748 !important;
     826    border-bottom: 1px solid #4a5568 !important;
     827    padding: 12px 15px !important;
     828    display: flex !important;
     829    flex-direction: column !important;
     830    gap: 8px !important;
     831}
     832.nbetec-nw-theme-dark .nbetec-nw-date-row span {
     833    color: #e2e8f0 !important;
     834}
     835.nbetec-nw-theme-dark .nbetec-nw-calendar-icon {
     836    color: #a0aec0 !important;
     837}
     838
     839.nbetec-nw-theme-dark .nbetec-nw-list {
     840    background: #1a202c !important;
     841    scrollbar-color: #4a5568 #1a202c !important;
     842}
     843.nbetec-nw-theme-dark .nbetec-nw-list::-webkit-scrollbar-track {
     844    background: #1a202c !important;
     845}
     846.nbetec-nw-theme-dark .nbetec-nw-list::-webkit-scrollbar-thumb {
     847    background: #4a5568 !important;
     848}
     849.nbetec-nw-theme-dark .nbetec-nw-list::-webkit-scrollbar-thumb:hover {
     850    background: #718096 !important;
     851}
     852
     853.nbetec-nw-theme-dark .nbetec-nw-item {
     854    border-bottom: 1px solid #2d3748 !important;
     855}
     856.nbetec-nw-theme-dark .nbetec-nw-item-logo {
     857    background: #2d3748 !important;
     858    color: #fc8181 !important;
     859}
     860.nbetec-nw-theme-dark .nbetec-nw-item-name {
     861    color: #e2e8f0 !important;
     862}
     863.nbetec-nw-theme-dark .nbetec-nw-item-district {
     864    color: #a0aec0 !important;
     865}
     866.nbetec-nw-theme-dark .nbetec-nw-phone,
     867.nbetec-nw-theme-dark .nbetec-nw-address {
     868    color: #a0aec0 !important;
     869}
     870.nbetec-nw-theme-dark .nbetec-nw-phone:hover,
     871.nbetec-nw-theme-dark .nbetec-nw-address:hover {
     872    color: #fc8181 !important;
     873}
     874.nbetec-nw-theme-dark .nbetec-nw-phone svg,
     875.nbetec-nw-theme-dark .nbetec-nw-address svg {
     876    color: #718096 !important;
     877}
     878.nbetec-nw-theme-dark .nbetec-nw-phone:hover svg,
     879.nbetec-nw-theme-dark .nbetec-nw-address:hover svg {
     880    color: #fc8181 !important;
     881}
     882
     883.nbetec-nw-theme-dark .nbetec-nw-directions {
     884    background: #2d3748 !important;
     885    color: #cbd5e0 !important;
     886}
     887
     888.nbetec-nw-theme-dark .nbetec-nw-more-link {
     889    background: #1a202c !important;
     890    border-top: 1px solid #2d3748 !important;
     891}
     892.nbetec-nw-theme-dark .nbetec-nw-more-link a {
     893    color: #63b3ed !important;
     894}
     895.nbetec-nw-theme-dark .nbetec-nw-more-link a:hover {
     896    color: #90cdf4 !important;
     897}
  • nobetci-eczaneler/tags/2.0.0/assets/js/admin.js

    r3585474 r3638928  
    1313       
    1414        if (il) {
     15            $('#nbetec-page-builder-section').slideDown();
    1516            sc += ' il="' + il + '"';
    16             var urlPath = il;
    1717           
    18             if (ilce && ilce !== '') {
    19                 sc += ' ilce="' + ilce + '"';
    20                 urlPath += '-' + ilce;
     18            if (nbetecAdminVars.permalinkStructure) {
     19                var urlPath = il;
     20                if (ilce && ilce !== '') {
     21                    sc += ' ilce="' + ilce + '"';
     22                    urlPath += '-' + ilce;
     23                }
     24                urlPath += '-nobetci-eczaneleri';
     25                url = siteUrl + '/' + urlPath;
     26            } else {
     27                url = siteUrl + '/?nobetci_il=' + il;
     28                if (ilce && ilce !== '') {
     29                    sc += ' ilce="' + ilce + '"';
     30                    url += '&nobetci_ilce=' + ilce;
     31                }
    2132            }
    22             urlPath += '-nobetci-eczaneleri';
    23             url = siteUrl + '/' + urlPath;
     33        } else {
     34            $('#nbetec-page-builder-section').slideUp();
    2435        }
    2536        sc += ']';
    … …  
    6677   
    6778    $('#builder-ilce').on('change', updateBuilder);
     79   
     80    // Bulk Page Builder Logic
     81    $('#nbetec-create-pages-btn').on('click', function() {
     82        var il = $('#builder-il').val();
     83        var ilName = $('#builder-il option:selected').text();
     84        var createDistricts = $('#nbetec-create-district-pages').is(':checked') ? 1 : 0;
     85       
     86        if (!il) return;
     87       
     88        if (!confirm(nbetecAdminVars.i18n.confirmCreate)) {
     89            return;
     90        }
     91       
     92        var btn = $(this);
     93        var btnText = $('#nbetec-create-pages-btn-text');
     94        var originalText = btnText.text();
     95        var statusDiv = $('#nbetec-page-builder-status');
     96       
     97        btn.prop('disabled', true);
     98        btnText.text(nbetecAdminVars.i18n.creating);
     99        statusDiv.hide();
     100       
     101        $.post(ajaxurl, {
     102            action: 'nbetec_create_city_pages',
     103            nonce: nonce,
     104            il_slug: il,
     105            il_name: ilName,
     106            create_districts: createDistricts
     107        }, function(response) {
     108            btn.prop('disabled', false);
     109            btnText.text(originalText);
     110           
     111            if (response.success) {
     112                statusDiv.html('✅ ' + response.data.message).show();
     113            } else {
     114                statusDiv.html('❌ Hata: ' + response.data).show();
     115            }
     116        }).fail(function() {
     117            btn.prop('disabled', false);
     118            btnText.text(originalText);
     119            statusDiv.html('❌ ' + nbetecAdminVars.i18n.error).show();
     120        });
     121    });
    68122});
    69123
    … …  
    86140    });
    87141}
     142
     143// Tab Switching Logic
     144jQuery(document).ready(function($) {
     145    $('.nbetec-admin-tab').on('click', function(e) {
     146        e.preventDefault();
     147       
     148        // Remove active class from all tabs and panes
     149        $('.nbetec-admin-tab').removeClass('active');
     150        $('.nbetec-tab-pane').removeClass('active');
     151       
     152        // Add active class to clicked tab
     153        $(this).addClass('active');
     154       
     155        // Show target pane
     156        var targetId = $(this).data('target');
     157        $('#' + targetId).addClass('active');
     158       
     159        // Save current tab to localStorage
     160        localStorage.setItem('nbetec_active_admin_tab', targetId);
     161    });
     162   
     163    // Restore active tab on load
     164    var savedTab = localStorage.getItem('nbetec_active_admin_tab');
     165    if (savedTab && $('#' + savedTab).length) {
     166        $('.nbetec-admin-tab[data-target="' + savedTab + '"]').click();
     167    }
     168});
  • nobetci-eczaneler/tags/2.0.0/assets/js/frontend.js

    r3605267 r3638928  
    1313
    1414    // Dropdown Logic
    15     const header = document.querySelector('.nbetec-selector-header');
    16     const dropdown = document.querySelector('.nbetec-selector-dropdown');
    17     const search = document.querySelector('.nbetec-search-input');
    18     const items = document.querySelectorAll('.nbetec-city-list li');
     15    const dropdownContainers = document.querySelectorAll('.nbetec-city-selector, .nbetec-district-selector');
     16   
     17    dropdownContainers.forEach(container => {
     18        const header = container.querySelector('.nbetec-selector-header');
     19        const dropdown = container.querySelector('.nbetec-selector-dropdown');
     20        const search = container.querySelector('.nbetec-search-input');
     21        const items = container.querySelectorAll('.nbetec-city-list li');
     22       
     23        if (header && dropdown) {
     24            header.addEventListener('click', function(e) {
     25                e.stopPropagation();
     26                // Hide other dropdowns
     27                document.querySelectorAll('.nbetec-selector-dropdown').forEach(d => {
     28                    if (d !== dropdown) d.style.display = 'none';
     29                });
     30               
     31                const isShowing = dropdown.style.display === 'block';
     32                dropdown.style.display = isShowing ? 'none' : 'block';
     33                if(!isShowing && search) {
     34                    search.focus();
     35                    search.value = '';
     36                    items.forEach(item => item.style.display = '');
     37                }
     38            });
    1939
    20     if (header && dropdown && search) {
    21         header.addEventListener('click', function(e) {
    22             e.stopPropagation();
    23             const isShowing = dropdown.style.display === 'block';
    24             dropdown.style.display = isShowing ? 'none' : 'block';
    25             if(!isShowing) {
    26                 search.focus();
    27                 search.value = '';
    28                 items.forEach(item => item.style.display = '');
     40            dropdown.addEventListener('click', function(e) {
     41                e.stopPropagation();
     42            });
     43
     44            if (search) {
     45                search.addEventListener('input', function(e) {
     46                    const term = trToLower(e.target.value).trim();
     47                    const normalizedTerm = normalizeTr(term);
     48
     49                    items.forEach(item => {
     50                        const text = trToLower(item.textContent);
     51                        const normalizedText = normalizeTr(text);
     52                        item.style.display = text.includes(term) || normalizedText.includes(normalizedTerm) ? '' : 'none';
     53                    });
     54                });
    2955            }
     56        }
     57    });
     58
     59    document.addEventListener('click', function() {
     60        document.querySelectorAll('.nbetec-selector-dropdown').forEach(d => {
     61            d.style.display = 'none';
    3062        });
    31 
    32         document.addEventListener('click', function() {
    33             dropdown.style.display = 'none';
    34         });
    35 
    36         dropdown.addEventListener('click', function(e) {
    37             e.stopPropagation();
    38         });
    39 
    40         search.addEventListener('input', function(e) {
    41             const term = trToLower(e.target.value).trim();
    42             const normalizedTerm = normalizeTr(term);
    43 
    44             items.forEach(item => {
    45                 const text = trToLower(item.textContent);
    46                 const normalizedText = normalizeTr(text);
    47                
    48                 item.style.display = text.includes(term) || normalizedText.includes(normalizedTerm) ? '' : 'none';
    49             });
    50         });
    51     }
     63    });
    5264
    5365    // Home Search Logic
  • nobetci-eczaneler/tags/2.0.0/includes/class-admin.php

    r3585474 r3638928  
    1313        // AJAX endpoint for fetching districts
    1414        add_action('wp_ajax_nbetec_get_districts', array($this, 'ajax_get_districts'));
     15        add_action('wp_ajax_nbetec_create_city_pages', array($this, 'ajax_create_city_pages'));
    1516    }
    1617
    … …  
    2021        }
    2122       
     23        wp_enqueue_style('nbetec-admin-style', plugin_dir_url(dirname(__FILE__)) . 'assets/css/admin.css', array(), '1.0.0');
    2224        wp_enqueue_script('nbetec-admin-script', plugin_dir_url(dirname(__FILE__)) . 'assets/js/admin.js', array('jquery'), '1.0.0', true);
    2325       
    … …  
    2527            'nonce' => wp_create_nonce('nbetec_admin_nonce'),
    2628            'siteUrl' => rtrim(site_url(), '/'),
     29            'permalinkStructure' => get_option('permalink_structure'),
    2730            'i18n' => array(
    2831                'selectFirst' => __('Önce il seçiniz...', 'nobetci-eczaneler'),
    … …  
    3134                'notFound' => __('İlçe bulunamadı veya hata oluştu.', 'nobetci-eczaneler'),
    3235                'error' => __('Bağlantı hatası.', 'nobetci-eczaneler'),
    33                 'copyFail' => __('Kopyalama başarısız oldu. Lütfen manuel seçip kopyalayın.', 'nobetci-eczaneler')
     36                'copyFail' => __('Kopyalama başarısız oldu. Lütfen manuel seçip kopyalayın.', 'nobetci-eczaneler'),
     37                'confirmCreate' => __('Bu il için otomatik sayfa oluşturmak istediğinize emin misiniz? (Eğer sayfalar zaten varsa yeniden oluşturulmaz)', 'nobetci-eczaneler'),
     38                'creating' => __('Sayfalar oluşturuluyor, lütfen bekleyin...', 'nobetci-eczaneler')
    3439            )
    3540        ));
    … …  
    6065        sort($districts);
    6166        wp_send_json_success($districts);
     67    }
     68   
     69    public function ajax_create_city_pages() {
     70        check_ajax_referer('nbetec_admin_nonce', 'nonce');
     71       
     72        if (!current_user_can('manage_options') && !current_user_can('publish_pages')) {
     73            wp_send_json_error(__('Yetkiniz yok.', 'nobetci-eczaneler'));
     74        }
     75       
     76        $il_slug = isset($_POST['il_slug']) ? sanitize_title(wp_unslash($_POST['il_slug'])) : '';
     77        $il_name = isset($_POST['il_name']) ? sanitize_text_field(wp_unslash($_POST['il_name'])) : '';
     78        $create_districts = isset($_POST['create_districts']) ? intval($_POST['create_districts']) : 0;
     79       
     80        if (empty($il_slug) || empty($il_name)) {
     81            wp_send_json_error(__('Geçersiz il bilgisi.', 'nobetci-eczaneler'));
     82        }
     83       
     84        $created = 0;
     85        $existed = 0;
     86       
     87        // Create Parent City Page
     88        $parent_slug = $il_slug . '-nobetci-eczaneleri';
     89        $parent_title = $il_name . ' Nöbetçi Eczaneleri';
     90        $parent_content = '[nobetci-eczane il="' . $il_slug . '"]';
     91       
     92        $parent_id = 0;
     93        $page_check = get_page_by_path($parent_slug);
     94       
     95        if ($page_check) {
     96            $parent_id = $page_check->ID;
     97            $existed++;
     98        } else {
     99            $parent_id = wp_insert_post(array(
     100                'post_title'    => $parent_title,
     101                'post_name'     => $parent_slug,
     102                'post_content'  => $parent_content,
     103                'post_status'   => 'publish',
     104                'post_type'     => 'page',
     105            ));
     106           
     107            if ($parent_id && !is_wp_error($parent_id)) {
     108                $created++;
     109            } else {
     110                wp_send_json_error(__('Ana il sayfası oluşturulamadı.', 'nobetci-eczaneler'));
     111            }
     112        }
     113       
     114        // Create District Pages if requested
     115        if ($create_districts && $parent_id && !is_wp_error($parent_id)) {
     116            $api = new NBETEC_API();
     117            $data = $api->get_eczane_data($il_slug);
     118           
     119            if ($data && !empty($data['data'][0])) {
     120                $districts = array();
     121                foreach ($data['data'][0] as $eczane) {
     122                    if (!empty($eczane['ilce']) && !in_array($eczane['ilce'], $districts)) {
     123                        $districts[] = $eczane['ilce'];
     124                    }
     125                }
     126               
     127                foreach ($districts as $ilce) {
     128                    $ilce_slug = sanitize_title($ilce);
     129                    $child_slug = $il_slug . '-' . $ilce_slug . '-nobetci-eczaneleri';
     130                    $child_title = $il_name . ' ' . $ilce . ' Nöbetçi Eczaneleri';
     131                    $child_content = '[nobetci-eczane il="' . $il_slug . '" ilce="' . $ilce_slug . '"]';
     132                   
     133                    // Check if child page exists under this parent
     134                    $child_page_check = get_page_by_path($parent_slug . '/' . $child_slug);
     135                    if ($child_page_check) {
     136                        $existed++;
     137                    } else {
     138                        // Fallback check by direct slug (if path is different)
     139                        $direct_check = get_posts(array(
     140                            'name'        => $child_slug,
     141                            'post_type'   => 'page',
     142                            'post_status' => 'publish',
     143                            'post_parent' => $parent_id,
     144                            'numberposts' => 1
     145                        ));
     146                       
     147                        if ($direct_check) {
     148                            $existed++;
     149                        } else {
     150                            $child_id = wp_insert_post(array(
     151                                'post_title'    => $child_title,
     152                                'post_name'     => $child_slug,
     153                                'post_content'  => $child_content,
     154                                'post_status'   => 'publish',
     155                                'post_type'     => 'page',
     156                                'post_parent'   => $parent_id,
     157                            ));
     158                            if ($child_id && !is_wp_error($child_id)) {
     159                                $created++;
     160                            }
     161                        }
     162                    }
     163                }
     164            }
     165        }
     166       
     167        $msg = '';
     168        if ($created > 0) {
     169            $msg .= sprintf(__('%d yeni sayfa oluşturuldu. ', 'nobetci-eczaneler'), $created);
     170        }
     171        if ($existed > 0) {
     172            $msg .= sprintf(__('%d sayfa zaten mevcuttu. ', 'nobetci-eczaneler'), $existed);
     173        }
     174        if ($created == 0 && $existed == 0) {
     175            $msg = __('Hiçbir sayfa oluşturulmadı.', 'nobetci-eczaneler');
     176        }
     177       
     178        wp_send_json_success(array(
     179            'message' => $msg,
     180            'created' => $created,
     181            'existed' => $existed
     182        ));
    62183    }
    63184
    … …  
    77198        $admin_notice = '';
    78199
    79         // Update Ad Settings
    80         if (isset($_POST['nbetec_save_ads']) && check_admin_referer('nbetec_save_ads_action', 'nbetec_save_ads_nonce')) {
     200        // Handle settings save
     201        if (isset($_POST['nbetec_save_settings']) && check_admin_referer('nbetec_save_settings_action', 'nbetec_save_settings_nonce')) {
    81202            if (isset($_POST['nbetec_ad_code'])) {
    82203                if (current_user_can('unfiltered_html')) {
    83                     // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    84204                    update_option('nbetec_ad_code', wp_unslash($_POST['nbetec_ad_code']));
    85205                } else {
    … …  
    87207                }
    88208            }
     209           
    89210            if (isset($_POST['nbetec_ad_frequency'])) {
    90211                update_option('nbetec_ad_frequency', intval($_POST['nbetec_ad_frequency']));
    91212            }
    92             $admin_notice .= '<div style="background: #fff; border-left: 4px solid #00a32a; padding: 12px 15px; margin: 20px 0; box-shadow: 0 1px 1px rgba(0,0,0,.04);"><p style="margin: 0; font-size: 14px;">✅ ' . esc_html__('Reklam ayarları başarıyla kaydedildi!', 'nobetci-eczaneler') . '</p></div>';
     213           
     214            if (isset($_POST['nbetec_global_theme'])) {
     215                update_option('nbetec_global_theme', sanitize_text_field($_POST['nbetec_global_theme']));
     216            }
     217
     218            if (isset($_POST['nbetec_enable_seo'])) {
     219                update_option('nbetec_enable_seo', 'on');
     220            } else {
     221                update_option('nbetec_enable_seo', 'off'); // Checkbox was unchecked
     222            }
     223           
     224            $admin_notice .= '<div style="background: #fff; border-left: 4px solid #00a32a; padding: 12px 15px; margin: 20px 0; box-shadow: 0 1px 1px rgba(0,0,0,.04);"><p style="margin: 0; font-size: 14px;">✅ ' . esc_html__('Ayarlar başarıyla kaydedildi!', 'nobetci-eczaneler') . '</p></div>';
    93225        }
    94226
    … …  
    127259
    128260        ?>
    129         <div class="wrap">
    130             <h1><?php esc_html_e('Nöbetçi Eczaneler Ayarları', 'nobetci-eczaneler'); ?></h1>
    131             <?php echo wp_kses_post($admin_notice); ?>
    132            
    133             <div class="card" style="max-width: 600px; padding: 20px; margin-top: 20px;">
     261        <div class="nbetec-admin-wrap">
     262            <div class="nbetec-admin-header">
     263                <div class="nbetec-admin-logo">N</div>
     264                <ul class="nbetec-admin-tabs">
     265                    <li><a class="nbetec-admin-tab active" data-target="tab-hosgeldiniz"><?php esc_html_e('Hoşgeldiniz', 'nobetci-eczaneler'); ?></a></li>
     266                    <li><a class="nbetec-admin-tab" data-target="tab-tema"><?php esc_html_e('Genel Ayarlar', 'nobetci-eczaneler'); ?></a></li>
     267                    <li><a class="nbetec-admin-tab" data-target="tab-reklam"><?php esc_html_e('Reklam Ayarları', 'nobetci-eczaneler'); ?></a></li>
     268                    <li><a class="nbetec-admin-tab" data-target="tab-araclar"><?php esc_html_e('Sistem Araçları', 'nobetci-eczaneler'); ?></a></li>
     269                </ul>
     270            </div>
     271           
     272            <div class="nbetec-admin-content">
     273                <?php echo wp_kses_post($admin_notice); ?>
     274               
     275                <div id="tab-hosgeldiniz" class="nbetec-tab-pane active">
     276                    <div class="nbetec-admin-card">
    134277                <h2><?php esc_html_e('Nasıl Kullanılır?', 'nobetci-eczaneler'); ?></h2>
    135278                <p><?php esc_html_e("Bu eklenti SEO uyumlu sayfa yapılandırmasıyla çalışır. Eklenti aktif olduğu sürece fiziksel bir sayfa oluşturmanıza gerek yoktur. Desteklenen tüm iller ve ilçeler URL üzerinden otomatik olarak taranır ve API'den getirilir. Yapmanız gereken sadece", 'nobetci-eczaneler'); ?> <code>[nobetci-eczane]</code> <?php esc_html_e('kodunu oluşturacağınız Nöbetçi Eczaneler sayfasına eklemek.', 'nobetci-eczaneler'); ?></p>
    … …  
    139282                    <p style="margin-bottom: 0;"><?php esc_html_e('Hazırda sayfanız yoksa otomatik oluşturalım.', 'nobetci-eczaneler'); ?> <button type="submit" style="background: none; border: none; padding: 0; margin: 0; font: inherit; color: #2271b1; text-decoration: underline; cursor: pointer;"><?php esc_html_e('Buraya tıklayın.', 'nobetci-eczaneler'); ?></button></p>
    140283                </form>
    141             </div>
    142            
    143             <div class="card" style="max-width: 600px; padding: 20px; margin-top: 20px;">
    144                 <h2><?php esc_html_e('Kısa Kod (Shortcode) Oluşturucu', 'nobetci-eczaneler'); ?></h2>
     284                    </div>
     285                   
     286                    <div class="nbetec-admin-card">
     287                <h2><?php esc_html_e('Kısa Kod (Shortcode) ve Sayfa Oluşturucu', 'nobetci-eczaneler'); ?></h2>
    145288                <p><?php esc_html_e('Eczaneleri istediğiniz sayfada veya yazıda göstermek için aşağıdaki aracı kullanarak kolayca kısa kod oluşturabilirsiniz.', 'nobetci-eczaneler'); ?></p>
    146289               
    … …  
    201344                    <span id="url-copy-status" style="color: green; font-weight: bold; display: none;"><?php esc_html_e('Kopyalandı! ✔️', 'nobetci-eczaneler'); ?></span>
    202345                </div>
    203             </div>
    204 
    205 
    206            
    207             <div class="card" style="max-width: 600px; padding: 20px; margin-top: 20px;">
     346               
     347                <div id="nbetec-page-builder-section" style="display: none; margin-top: 30px; padding-top: 20px; border-top: 1px solid #e2e8f0;">
     348                    <h3 style="margin-top: 0;"><?php esc_html_e('Otomatik Sayfa Oluşturucu', 'nobetci-eczaneler'); ?></h3>
     349                    <p><?php esc_html_e('Seçtiğiniz il için fiziksel bir WordPress sayfası oluşturabilirsiniz. İsterseniz altındaki tüm ilçeler için de ayrı ayrı sayfalar oluşturabilirsiniz.', 'nobetci-eczaneler'); ?></p>
     350                   
     351                    <div style="display: flex; align-items: center; gap: 15px; margin-bottom: 10px;">
     352                        <button type="button" id="nbetec-create-pages-btn" class="button nbetec-admin-btn-primary" style="padding: 0 20px;">
     353                            <span class="dashicons dashicons-admin-page" style="margin-top: 4px; margin-right: 4px;"></span>
     354                            <span id="nbetec-create-pages-btn-text"><?php esc_html_e('Sayfaları Oluştur', 'nobetci-eczaneler'); ?></span>
     355                        </button>
     356                        <label style="display: flex; align-items: center; gap: 5px; cursor: pointer;">
     357                            <input type="checkbox" id="nbetec-create-district-pages">
     358                            <?php esc_html_e('Tüm ilçeler için de ayrı alt sayfalar oluştur', 'nobetci-eczaneler'); ?>
     359                        </label>
     360                    </div>
     361                    <div id="nbetec-page-builder-status" style="display: none; padding: 10px 15px; border-left: 4px solid #00a32a; background: #f2fbf6; color: #1e4620; font-weight: 500; margin-top: 15px;"></div>
     362                </div>
     363                    </div>
     364                </div> <!-- End tab-hosgeldiniz -->
     365               
     366                <div id="tab-reklam" class="nbetec-tab-pane">
     367                    <div class="nbetec-admin-card">
    208368                <h2><?php esc_html_e('Reklam Ayarları (AdSense vb.)', 'nobetci-eczaneler'); ?></h2>
    209369                <p><?php esc_html_e('Eczane listesinin arasına otomatik olarak reklam kodunuzu yerleştirebilirsiniz.', 'nobetci-eczaneler'); ?></p>
    … …  
    232392                    </p>
    233393                </form>
    234             </div>
    235 
    236             <div class="card" style="max-width: 600px; padding: 20px; margin-top: 20px;">
     394                    </div>
     395                </div> <!-- End tab-reklam -->
     396
     397                <div id="tab-tema" class="nbetec-tab-pane">
     398                    <div class="nbetec-admin-card">
     399                <h2><?php esc_html_e('Genel Ayarlar', 'nobetci-eczaneler'); ?></h2>
     400                <p><?php esc_html_e('Eklentinin tema ve SEO gibi genel ayarlarını buradan yapılandırabilirsiniz.', 'nobetci-eczaneler'); ?></p>
     401                <form method="post" action="">
     402                    <?php wp_nonce_field('nbetec_save_settings_action', 'nbetec_save_settings_nonce'); ?>
     403                    <input type="hidden" name="nbetec_save_settings" value="1">
     404                   
     405                    <table class="form-table">
     406                        <tr>
     407                            <th scope="row"><label for="nbetec_global_theme"><?php esc_html_e('Tema Rengi', 'nobetci-eczaneler'); ?></label></th>
     408                            <td>
     409                                <select id="nbetec_global_theme" name="nbetec_global_theme" style="width: 200px;">
     410                                    <option value="light" <?php selected(get_option('nbetec_global_theme', 'light'), 'light'); ?>><?php esc_html_e('Aydınlık Mod', 'nobetci-eczaneler'); ?></option>
     411                                    <option value="dark" <?php selected(get_option('nbetec_global_theme', 'light'), 'dark'); ?>><?php esc_html_e('Karanlık Mod', 'nobetci-eczaneler'); ?></option>
     412                                </select>
     413                                <p class="description"><?php esc_html_e('Tüm eczane sayfaları seçtiğiniz temaya bürünecektir.', 'nobetci-eczaneler'); ?></p>
     414                            </td>
     415                        </tr>
     416                        <tr>
     417                            <th scope="row"><label for="nbetec_enable_seo"><?php esc_html_e('Otomatik SEO Etiketleri', 'nobetci-eczaneler'); ?></label></th>
     418                            <td>
     419                                <label>
     420                                    <input type="checkbox" id="nbetec_enable_seo" name="nbetec_enable_seo" value="on" <?php checked(get_option('nbetec_enable_seo', 'on'), 'on'); ?>>
     421                                    <?php esc_html_e('Açık (Önerilen)', 'nobetci-eczaneler'); ?>
     422                                </label>
     423                                <p class="description"><?php esc_html_e('İl ve ilçe sayfaları için dinamik meta title, meta description ve meta keywords otomatik oluşturulur.', 'nobetci-eczaneler'); ?></p>
     424                            </td>
     425                        </tr>
     426                    </table>
     427                    <p class="submit">
     428                        <input type="submit" class="button nbetec-admin-btn-primary" value="<?php esc_attr_e('Ayarları Kaydet', 'nobetci-eczaneler'); ?>">
     429                    </p>
     430                </form>
     431                    </div>
     432                </div> <!-- End tab-tema -->
     433
     434                <div id="tab-araclar" class="nbetec-tab-pane">
     435                    <div class="nbetec-admin-card">
    237436                <h2><?php esc_html_e('Hızlı İşlemler', 'nobetci-eczaneler'); ?></h2>
    238437                <p><?php esc_html_e('Nöbetçi eczaneler her 1 saatte bir API\'den çekilir ve sitenizi hızlandırmak için önbelleğe alınır. Acil bir durum varsa manuel olarak silebilirsiniz.', 'nobetci-eczaneler'); ?></p>
    … …  
    249448                    <input type="submit" name="nbetec_flush_rules" class="button button-primary" value="<?php esc_attr_e('SEO Bağlantılarını Yenile (Flush Rewrite Rules)', 'nobetci-eczaneler'); ?>">
    250449                </form>
    251             </div>
    252            
    253             <div class="card" style="max-width: 600px; padding: 20px; margin-top: 20px; background-color: #f2fbf6; border: 1px solid #d5ecd8; border-radius: 6px; box-shadow: none;">
    254                 <h3 style="margin-top: 0; font-size: 13px; font-weight: 700; color: #2c3e50; text-transform: uppercase; border-bottom: 1px solid #e3f2e7; padding-bottom: 10px; margin-bottom: 15px; letter-spacing: 0.5px;"><?php esc_html_e('VERİ KAYNAĞI', 'nobetci-eczaneler'); ?></h3>
    255                 <p style="margin: 0; font-size: 14px; color: #5a6b7c;"><?php
    256                     echo sprintf(
    257                         wp_kses(
    258                             /* translators: %s: URL to wpstore.com.tr */
    259                             __('Veriler <a href="%s" target="_blank" style="text-decoration: underline; color: #2271b1;">wpstore.com.tr</a> üzerinden resmi REST API aracılığıyla çekilmektedir.', 'nobetci-eczaneler'),
    260                             array('a' => array('href' => true, 'target' => true, 'style' => true))
    261                         ),
    262                         esc_url('https://wpstore.com.tr')
    263                     );
    264                 ?></p>
    265             </div>
    266            
    267         </div>
     450                    </div>
     451
     452                    <div class="nbetec-admin-card" style="background-color: #f2fbf6; border: 1px solid #d5ecd8; box-shadow: none;">
     453                        <h3 style="margin-top: 0; font-size: 13px; font-weight: 700; color: #2c3e50; text-transform: uppercase; border-bottom: 1px solid #e3f2e7; padding-bottom: 10px; margin-bottom: 15px; letter-spacing: 0.5px;"><?php esc_html_e('VERİ KAYNAĞI', 'nobetci-eczaneler'); ?></h3>
     454                        <p style="margin: 0; font-size: 14px; color: #5a6b7c;"><?php
     455                            echo sprintf(
     456                                wp_kses(
     457                                    /* translators: %s: URL to wpstore.com.tr */
     458                                    __('Veriler <a href="%s" target="_blank" style="text-decoration: underline; color: #2271b1;">wpstore.com.tr</a> üzerinden resmi REST API aracılığıyla çekilmektedir.', 'nobetci-eczaneler'),
     459                                    array('a' => array('href' => true, 'target' => true, 'style' => true))
     460                                ),
     461                                esc_url('https://wpstore.com.tr')
     462                            );
     463                        ?></p>
     464                    </div>
     465                </div> <!-- End tab-araclar -->
     466
     467            </div> <!-- End nbetec-admin-content -->
     468        </div> <!-- End nbetec-admin-wrap -->
    268469        <?php
    269470    }
  • nobetci-eczaneler/tags/2.0.0/includes/class-api.php

    r3585474 r3638928  
    4343        }
    4444       
    45         // API isteği
     45        // API isteği - Siteyi yavaşlatmaması için timeout 3 saniyeye düşürüldü
    4646        $url = $this->api_base_url . '?city=' . $il_slug;
    47         $response = wp_remote_get($url, array('timeout' => 15));
     47        $response = wp_remote_get($url, array('timeout' => 3));
    4848       
    4949        if (is_wp_error($response)) {
  • nobetci-eczaneler/tags/2.0.0/includes/class-frontend.php

    r3585474 r3638928  
    3030            $il_slug = sanitize_title($atts['il']);
    3131            $ilce_slug = !empty($atts['ilce']) ? sanitize_title($atts['ilce']) : '';
     32            $nbetec_il_slug = $il_slug;
     33            $nbetec_ilce_slug = $ilce_slug;
    3234            include NBETEC_DIR . 'templates/shortcode-eczane.php';
    3335        } else {
    … …  
    4244        wp_register_script('nbetec-frontend-script', NBETEC_URL . 'assets/js/frontend.js', array(), NBETEC_VERSION, true);
    4345
     46        // Her yerde (Elementor, Sidebar widget vb.) stillerin yüklendiğinden emin olmak için:
     47        wp_enqueue_style('nbetec-style');
     48
     49        // Sadece özel rota (sayfa) için JS'i yükle
    4450        if (get_query_var('nobetci_il')) {
    45             wp_enqueue_style('nbetec-style');
    4651            wp_enqueue_script('nbetec-frontend-script');
    4752        }
  • nobetci-eczaneler/tags/2.0.0/includes/class-widget.php

    r3605267 r3638928  
    1010            'nbetec_widget',
    1111            'Nöbetçi Eczaneler',
    12             array('description' => 'Sitenizin herhangi bir alanında nöbetçi eczaneleri veya şehir arama kutusunu gösterir.')
     12            array('description' => 'Sitenizin herhangi bir alanında nöbetçi eczaneleri gösterir.')
    1313        );
    1414    }
    … …  
    1818        $il = !empty($instance['il']) ? sanitize_title($instance['il']) : 'istanbul';
    1919        $ilce = !empty($instance['ilce']) ? sanitize_title($instance['ilce']) : '';
    20         $theme = !empty($instance['theme']) ? $instance['theme'] : 'light';
     20        $theme = !empty($instance['theme']) ? $instance['theme'] : 'red_list'; // Default to red theme
    2121
    2222        echo wp_kses_post($args['before_widget']);
    … …  
    2626        }
    2727
    28         echo '<div class="nbetec-widget-wrapper nbetec-theme-' . esc_attr($theme) . '">';
    29 
    30         // Liste Modu
     28        // Tarih Hesaplama
     29        try {
     30            $tz = new DateTimeZone('Europe/Istanbul');
     31            $date_today = new DateTime('now', $tz);
     32            $date_tomorrow = new DateTime('tomorrow', $tz);
     33        } catch (Exception $e) {
     34            $date_today = new DateTime();
     35            $date_tomorrow = new DateTime('+1 day');
     36        }
     37
     38        $tr_months = array('01' => 'Ocak', '02' => 'Şubat', '03' => 'Mart', '04' => 'Nisan', '05' => 'Mayıs', '06' => 'Haziran', '07' => 'Temmuz', '08' => 'Ağustos', '09' => 'Eylül', '10' => 'Ekim', '11' => 'Kasım', '12' => 'Aralık');
     39        $tr_days = array('Monday' => 'Pazartesi', 'Tuesday' => 'Salı', 'Wednesday' => 'Çarşamba', 'Thursday' => 'Perşembe', 'Friday' => 'Cuma', 'Saturday' => 'Cumartesi', 'Sunday' => 'Pazar');
     40
     41        $str_today = $date_today->format('j') . ' ' . $tr_months[$date_today->format('m')] . ' ' . $tr_days[$date_today->format('l')];
     42        $str_tomorrow = $date_tomorrow->format('j') . ' ' . $tr_months[$date_tomorrow->format('m')] . ' ' . $tr_days[$date_tomorrow->format('l')] . ' sabahı';
     43
    3144        $api = new NBETEC_API();
    3245        $eczane_data = $api->get_eczane_data($il);
     46       
     47        // Şehir adı formatlama
     48        $nbetec_all_cities = array(
     49            'adana' => 'Adana', 'adiyaman' => 'Adıyaman', 'afyonkarahisar' => 'Afyonkarahisar', 'agri' => 'Ağrı',
     50            'amasya' => 'Amasya', 'ankara' => 'Ankara', 'antalya' => 'Antalya', 'artvin' => 'Artvin',
     51            'aydin' => 'Aydın', 'balikesir' => 'Balıkesir', 'bilecik' => 'Bilecik', 'bingol' => 'Bingöl',
     52            'bitlis' => 'Bitlis', 'bolu' => 'Bolu', 'burdur' => 'Burdur', 'bursa' => 'Bursa',
     53            'canakkale' => 'Çanakkale', 'cankiri' => 'Çankırı', 'corum' => 'Çorum', 'denizli' => 'Denizli',
     54            'diyarbakir' => 'Diyarbakır', 'edirne' => 'Edirne', 'elazig' => 'Elazığ', 'erzincan' => 'Erzincan',
     55            'erzurum' => 'Erzurum', 'eskisehir' => 'Eskişehir', 'gaziantep' => 'Gaziantep', 'giresun' => 'Giresun',
     56            'gumushane' => 'Gümüşhane', 'hakkari' => 'Hakkari', 'hatay' => 'Hatay', 'isparta' => 'Isparta',
     57            'mersin' => 'Mersin', 'istanbul' => 'İstanbul', 'izmir' => 'İzmir', 'kars' => 'Kars',
     58            'kastamonu' => 'Kastamonu', 'kayseri' => 'Kayseri', 'kirklareli' => 'Kırklareli', 'kirsehir' => 'Kırşehir',
     59            'kocaeli' => 'Kocaeli', 'konya' => 'Konya', 'kutahya' => 'Kütahya', 'malatya' => 'Malatya',
     60            'manisa' => 'Manisa', 'kahramanmaras' => 'Kahramanmaraş', 'mardin' => 'Mardin', 'mugla' => 'Muğla',
     61            'mus' => 'Muş', 'nevsehir' => 'Nevşehir', 'nigde' => 'Niğde', 'ordu' => 'Ordu',
     62            'rize' => 'Rize', 'sakarya' => 'Sakarya', 'samsun' => 'Samsun', 'siirt' => 'Siirt',
     63            'sinop' => 'Sinop', 'sivas' => 'Sivas', 'tekirdag' => 'Tekirdağ', 'tokat' => 'Tokat',
     64            'trabzon' => 'Trabzon', 'tunceli' => 'Tunceli', 'sanliurfa' => 'Şanlıurfa', 'usak' => 'Uşak',
     65            'van' => 'Van', 'yozgat' => 'Yozgat', 'zonguldak' => 'Zonguldak', 'aksaray' => 'Aksaray',
     66            'bayburt' => 'Bayburt', 'karaman' => 'Karaman', 'kirikkale' => 'Kırıkkale', 'batman' => 'Batman',
     67            'sirnak' => 'Şırnak', 'bartin' => 'Bartın', 'ardahan' => 'Ardahan', 'igdir' => 'Iğdır',
     68            'yalova' => 'Yalova', 'karabuk' => 'Karabük', 'kilis' => 'Kilis', 'osmaniye' => 'Osmaniye',
     69            'duzce' => 'Düzce', 'kibris' => 'Kıbrıs'
     70        );
     71        $il_name = isset($nbetec_all_cities[$il]) ? $nbetec_all_cities[$il] : ucfirst($il);
     72        if (!empty($eczane_data) && !empty($eczane_data['detay']['city_name']) && mb_strtolower($eczane_data['detay']['city_name'], 'UTF-8') !== mb_strtolower($il_name, 'UTF-8')) {
     73            $il_name = $eczane_data['detay']['city_name'];
     74        }
     75
     76        echo '<div class="nbetec-nw-container nbetec-nw-theme-' . esc_attr($theme) . '">';
     77
     78        // Kırmızı Tema Başlığı
     79        if ($theme === 'red_list' || true) { // İleride diğer temalar eklenirken burası güncellenir.
     80            echo '<div class="nbetec-nw-header">';
     81            echo '<div class="nbetec-nw-logo-box">E</div>';
     82            echo '<div class="nbetec-nw-title-box">';
     83            echo '<div class="nbetec-nw-title">NÖBETÇİ ECZANELER</div>';
     84            echo '<div class="nbetec-nw-city">' . esc_html(mb_convert_case($il_name, MB_CASE_TITLE, "UTF-8")) . '</div>';
     85            echo '</div>';
     86            echo '</div>';
     87
     88            echo '<div class="nbetec-nw-dates">';
     89            echo '<div class="nbetec-nw-date-row">';
     90            echo '<svg class="nbetec-nw-calendar-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>';
     91            echo '<span>' . esc_html($str_today) . '</span>';
     92            echo '</div>';
     93            echo '<div class="nbetec-nw-date-row">';
     94            echo '<svg class="nbetec-nw-calendar-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>';
     95            echo '<span>' . esc_html($str_tomorrow) . '</span>';
     96            echo '</div>';
     97            echo '</div>';
     98        }
     99
     100        if (empty($eczane_data) || empty($eczane_data['data'][0])) {
     101            echo '<div class="nbetec-nw-alert">Bu bölge için nöbetçi eczane bulunamadı.</div>';
     102        } else {
     103            $eczaneler = $eczane_data['data'][0];
    33104           
    34             $il_name = ucfirst($il);
    35             $date_desc = !empty($eczane_data['detay']['description']) ? $eczane_data['detay']['description'] : gmdate('d.m.Y') . ' Nöbetçi Eczaneleri';
    36 
    37             if ($theme === 'red_list') {
    38                 echo '<div class="nbetec-widget-header-red">';
    39                 echo '<strong><span style="font-size: 1.2em; border: 1px solid #fff; padding: 0 4px; margin-right: 5px;">E</span> NÖBETÇİ ECZANELER</strong>';
    40                 echo '</div>';
    41                 echo '<div class="nbetec-widget-subheader-dark">';
    42                 echo esc_html($date_desc);
     105            if ($ilce) {
     106                $filtered = array();
     107                foreach ($eczaneler as $ecz) {
     108                    if (sanitize_title($ecz['ilce']) === $ilce) {
     109                        $filtered[] = $ecz;
     110                    }
     111                }
     112                $eczaneler = $filtered;
     113            }
     114           
     115            if (empty($eczaneler)) {
     116                echo '<div class="nbetec-nw-alert">Bu ilçe için nöbetçi eczane bulunamadı.</div>';
     117            } else {
     118                echo '<ul class="nbetec-nw-list">';
     119                foreach ($eczaneler as $eczane) {
     120                    echo '<li class="nbetec-nw-item">';
     121                    echo '<div class="nbetec-nw-item-header">';
     122                    echo '<div class="nbetec-nw-item-logo">E</div>';
     123                    echo '<div class="nbetec-nw-item-name-box">';
     124                    echo '<div class="nbetec-nw-item-name">' . esc_html($eczane['eczane_adi']) . '</div>';
     125                    echo '<div class="nbetec-nw-item-district">(' . esc_html($eczane['ilce']) . ')</div>';
     126                    echo '</div>';
     127                    echo '</div>';
     128
     129                    echo '<div class="nbetec-nw-item-details">';
     130                    echo '<a href="tel:' . esc_attr(preg_replace('/[^0-9+]/', '', $eczane['telefon'])) . '" class="nbetec-nw-phone">';
     131                    echo '<svg viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>';
     132                    echo '<span>' . esc_html($eczane['telefon']) . '</span>';
     133                    echo '</a>';
     134                   
     135                    $map_query = (!empty($eczane['latitude']) && !empty($eczane['longitude'])) ? $eczane['latitude'] . ',' . $eczane['longitude'] : $eczane['eczane_adi'] . ' ' . $eczane['adres'];
     136                    echo '<a href="https://maps.google.com/?q=' . urlencode($map_query) . '" target="_blank" rel="noopener noreferrer" class="nbetec-nw-address">';
     137                    echo '<svg viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>';
     138                    echo '<span>' . esc_html($eczane['adres']) . '</span>';
     139                    echo '</a>';
     140
     141                    if (!empty($eczane['adres_tarifi'])) {
     142                        echo '<div class="nbetec-nw-directions">';
     143                        echo wp_kses_post($eczane['adres_tarifi']);
     144                        echo '</div>';
     145                    }
     146                    echo '</div>';
     147                    echo '</li>';
     148                }
     149                echo '</ul>';
     150               
     151                $more_url = nbetec_get_url($il, $ilce);
     152                echo '<div class="nbetec-nw-more-link">';
     153                echo '<a href="' . esc_url($more_url) . '">Tüm Eczaneleri Gör &raquo;</a>';
    43154                echo '</div>';
    44155            }
    45 
    46             if (empty($eczane_data) || empty($eczane_data['data'][0])) {
    47                 echo '<p>Bu bölge için nöbetçi eczane bulunamadı.</p>';
    48             } else {
    49                 $eczaneler = $eczane_data['data'][0];
    50                
    51                 if ($ilce) {
    52                     $filtered = array();
    53                     foreach ($eczaneler as $ecz) {
    54                         if (sanitize_title($ecz['ilce']) === $ilce) {
    55                             $filtered[] = $ecz;
    56                         }
    57                     }
    58                     $eczaneler = $filtered;
    59                 }
    60                
    61                 if (empty($eczaneler)) {
    62                     echo '<p>Bu ilçe için nöbetçi eczane bulunamadı.</p>';
    63                 } else {
    64                     $count = 0;
    65                     echo '<ul class="nbetec-widget-list" style="max-height: 280px; overflow-y: auto;">';
    66                     foreach ($eczaneler as $eczane) {
    67                         ?>
    68                         <li class="nbetec-widget-item">
    69                             <div class="nbetec-w-name">
    70                                 <img src="<?php echo esc_url(NBETEC_URL . 'assets/images/eczane-logo.webp'); ?>" alt="E" class="nbetec-w-e-icon-img">
    71                                 <div style="display: flex; flex-direction: column;">
    72                                     <strong><?php echo esc_html($eczane['eczane_adi']); ?></strong>
    73                                     <span class="nbetec-w-ilce" style="margin-left: 0; margin-top: 2px;">(<?php echo esc_html($eczane['ilce']); ?>)</span>
    74                                 </div>
    75                             </div>
    76                             <div class="nbetec-w-phone">
    77                                 <span class="dashicons dashicons-phone"></span>
    78                                 <a href="tel:<?php echo esc_attr(preg_replace('/[^0-9+]/', '', $eczane['telefon'])); ?>"><?php echo esc_html($eczane['telefon']); ?></a>
    79                             </div>
    80                             <div class="nbetec-w-address">
    81                                 <?php
    82                                 $widget_map_query = (!empty($eczane['latitude']) && !empty($eczane['longitude']))
    83                                     ? $eczane['latitude'] . ',' . $eczane['longitude']
    84                                     : $eczane['eczane_adi'] . ' ' . $eczane['adres'];
    85                                 ?>
    86                                 <a href="https://maps.google.com/?q=<?php echo urlencode($widget_map_query); ?>" target="_blank" rel="noopener noreferrer">
    87                                     <span class="dashicons dashicons-location"></span>
    88                                     <?php echo esc_html($eczane['adres']); ?>
    89                                 </a>
    90                             </div>
    91                             <?php if(!empty($eczane['adres_tarifi'])): ?>
    92                             <div class="nbetec-w-direction">
    93                                 <?php echo esc_html($eczane['adres_tarifi']); ?>
    94                             </div>
    95                             <?php endif; ?>
    96                         </li>
    97                         <?php
    98                     }
    99                     echo '</ul>';
    100                    
    101                     // Tümünü gör linki
    102                     $more_url = home_url('/' . $il . (!empty($ilce) ? '-' . $ilce : '') . '-nobetci-eczaneleri');
    103                     echo '<div class="nbetec-w-more"><a href="' . esc_url($more_url) . '">Tüm Eczaneleri Gör &raquo;</a></div>';
    104                 }
    105             }
     156        }
    106157
    107158        echo '</div>';
     159
    108160        echo wp_kses_post($args['after_widget']);
    109161    }
    … …  
    113165        $il = !empty($instance['il']) ? $instance['il'] : 'istanbul';
    114166        $ilce = !empty($instance['ilce']) ? $instance['ilce'] : '';
    115         $theme = !empty($instance['theme']) ? $instance['theme'] : 'light';
     167        $theme = !empty($instance['theme']) ? $instance['theme'] : 'red_list';
     168
     169        $nbetec_all_cities = array(
     170            'adana' => 'Adana', 'adiyaman' => 'Adıyaman', 'afyonkarahisar' => 'Afyonkarahisar', 'agri' => 'Ağrı',
     171            'amasya' => 'Amasya', 'ankara' => 'Ankara', 'antalya' => 'Antalya', 'artvin' => 'Artvin',
     172            'aydin' => 'Aydın', 'balikesir' => 'Balıkesir', 'bilecik' => 'Bilecik', 'bingol' => 'Bingöl',
     173            'bitlis' => 'Bitlis', 'bolu' => 'Bolu', 'burdur' => 'Burdur', 'bursa' => 'Bursa',
     174            'canakkale' => 'Çanakkale', 'cankiri' => 'Çankırı', 'corum' => 'Çorum', 'denizli' => 'Denizli',
     175            'diyarbakir' => 'Diyarbakır', 'edirne' => 'Edirne', 'elazig' => 'Elazığ', 'erzincan' => 'Erzincan',
     176            'erzurum' => 'Erzurum', 'eskisehir' => 'Eskişehir', 'gaziantep' => 'Gaziantep', 'giresun' => 'Giresun',
     177            'gumushane' => 'Gümüşhane', 'hakkari' => 'Hakkari', 'hatay' => 'Hatay', 'isparta' => 'Isparta',
     178            'mersin' => 'Mersin', 'istanbul' => 'İstanbul', 'izmir' => 'İzmir', 'kars' => 'Kars',
     179            'kastamonu' => 'Kastamonu', 'kayseri' => 'Kayseri', 'kirklareli' => 'Kırklareli', 'kirsehir' => 'Kırşehir',
     180            'kocaeli' => 'Kocaeli', 'konya' => 'Konya', 'kutahya' => 'Kütahya', 'malatya' => 'Malatya',
     181            'manisa' => 'Manisa', 'kahramanmaras' => 'Kahramanmaraş', 'mardin' => 'Mardin', 'mugla' => 'Muğla',
     182            'mus' => 'Muş', 'nevsehir' => 'Nevşehir', 'nigde' => 'Niğde', 'ordu' => 'Ordu',
     183            'rize' => 'Rize', 'sakarya' => 'Sakarya', 'samsun' => 'Samsun', 'siirt' => 'Siirt',
     184            'sinop' => 'Sinop', 'sivas' => 'Sivas', 'tekirdag' => 'Tekirdağ', 'tokat' => 'Tokat',
     185            'trabzon' => 'Trabzon', 'tunceli' => 'Tunceli', 'sanliurfa' => 'Şanlıurfa', 'usak' => 'Uşak',
     186            'van' => 'Van', 'yozgat' => 'Yozgat', 'zonguldak' => 'Zonguldak', 'aksaray' => 'Aksaray',
     187            'bayburt' => 'Bayburt', 'karaman' => 'Karaman', 'kirikkale' => 'Kırıkkale', 'batman' => 'Batman',
     188            'sirnak' => 'Şırnak', 'bartin' => 'Bartın', 'ardahan' => 'Ardahan', 'igdir' => 'Iğdır',
     189            'yalova' => 'Yalova', 'karabuk' => 'Karabük', 'kilis' => 'Kilis', 'osmaniye' => 'Osmaniye',
     190            'duzce' => 'Düzce', 'kibris' => 'Kıbrıs'
     191        );
     192
     193        $ilceler = array();
     194        if (!empty($il)) {
     195            $api = new NBETEC_API();
     196            $eczane_data = $api->get_eczane_data($il);
     197            if (!empty($eczane_data) && !empty($eczane_data['data'][0])) {
     198                foreach ($eczane_data['data'][0] as $ecz) {
     199                    $ilce_slug = sanitize_title($ecz['ilce']);
     200                    $ilceler[$ilce_slug] = trim($ecz['ilce']);
     201                }
     202            }
     203        }
     204        asort($ilceler);
    116205        ?>
    117206        <p>
    … …  
    121210        <p>
    122211            <label for="<?php echo esc_attr($this->get_field_id('il')); ?>">Gösterilecek İl:</label>
    123             <input class="widefat" id="<?php echo esc_attr($this->get_field_id('il')); ?>" name="<?php echo esc_attr($this->get_field_name('il')); ?>" type="text" value="<?php echo esc_attr($il); ?>" placeholder="Örn: adana">
     212            <select class="widefat" id="<?php echo esc_attr($this->get_field_id('il')); ?>" name="<?php echo esc_attr($this->get_field_name('il')); ?>">
     213                <?php foreach ($nbetec_all_cities as $city_slug => $city_name): ?>
     214                    <option value="<?php echo esc_attr($city_slug); ?>" <?php selected($il, $city_slug); ?>><?php echo esc_html($city_name); ?></option>
     215                <?php endforeach; ?>
     216            </select>
    124217        </p>
    125218        <p>
    126219            <label for="<?php echo esc_attr($this->get_field_id('ilce')); ?>">Gösterilecek İlçe (Opsiyonel):</label>
    127             <input class="widefat" id="<?php echo esc_attr($this->get_field_id('ilce')); ?>" name="<?php echo esc_attr($this->get_field_name('ilce')); ?>" type="text" value="<?php echo esc_attr($ilce); ?>" placeholder="Örn: kozan">
     220            <select class="widefat" id="<?php echo esc_attr($this->get_field_id('ilce')); ?>" name="<?php echo esc_attr($this->get_field_name('ilce')); ?>">
     221                <option value="">-- Tüm İlçeler --</option>
     222                <?php foreach ($ilceler as $ilce_slug => $ilce_name): ?>
     223                    <option value="<?php echo esc_attr($ilce_slug); ?>" <?php selected($ilce, $ilce_slug); ?>><?php echo esc_html($ilce_name); ?></option>
     224                <?php endforeach; ?>
     225            </select>
     226            <br><small><em>Not: İli değiştirdiğinizde yeni ilin ilçelerinin gelmesi için önce "Kaydet" butonuna basınız.</em></small>
    128227        </p>
    129228        <p>
    130229            <label for="<?php echo esc_attr($this->get_field_id('theme')); ?>">Tema Rengi:</label>
    131230            <select class="widefat" id="<?php echo esc_attr($this->get_field_id('theme')); ?>" name="<?php echo esc_attr($this->get_field_name('theme')); ?>">
    132                 <option value="light" <?php selected($theme, 'light'); ?>>Açık Tema</option>
     231                <option value="light" <?php selected($theme, 'light'); ?>>Aydınlık</option>
    133232                <option value="red_list" <?php selected($theme, 'red_list'); ?>>Kırmızı Tema</option>
     233                <option value="dark" <?php selected($theme, 'dark'); ?>>Karanlık Mod</option>
    134234            </select>
    135235        </p>
    … …  
    142242        $instance['il'] = (!empty($new_instance['il'])) ? sanitize_text_field($new_instance['il']) : '';
    143243        $instance['ilce'] = (!empty($new_instance['ilce'])) ? sanitize_text_field($new_instance['ilce']) : '';
    144         $instance['theme'] = (!empty($new_instance['theme'])) ? sanitize_text_field($new_instance['theme']) : 'light';
     244        $instance['theme'] = (!empty($new_instance['theme'])) ? sanitize_text_field($new_instance['theme']) : 'red_list';
    145245        return $instance;
    146246    }
  • nobetci-eczaneler/tags/2.0.0/nobetci-eczaneler.php

    r3605267 r3638928  
    44 * Plugin URI: https://wpstore.com.tr/nobetci-eczane-eklentisi
    55 * Description: Türkiye'nin 81 İl ve İlçesi dahil olmak üzere Kuzey Kıbrıs Türk Cumhuriyeti'nin Nöbetçi Eczanelerini günlük olarak yayınlar.
    6  * Version: 1.1.0
     6 * Version: 2.0.0
    77 * Requires at least: 5.8
    88 * Requires PHP: 7.4
    … …  
    1818}
    1919
    20 define('NBETEC_VERSION', '1.1.0');
     20define('NBETEC_VERSION', '2.0.0');
    2121define('NBETEC_DIR', plugin_dir_path(__FILE__));
    2222define('NBETEC_URL', plugin_dir_url(__FILE__));
    … …  
    2727require_once NBETEC_DIR . 'includes/class-admin.php';
    2828require_once NBETEC_DIR . 'includes/class-widget.php';
     29require_once NBETEC_DIR . 'includes/class-seo.php';
     30
     31/**
     32 * Kalıcı bağlantı (permalink) yapısına göre URL üretir
     33 */
     34function nbetec_get_url($il_slug, $ilce_slug = '') {
     35    if (get_option('permalink_structure')) {
     36        // Özel Kalıcı Bağlantılar (Yazı Adı vb.)
     37        if (!empty($ilce_slug)) {
     38            return home_url('/' . $il_slug . '-' . $ilce_slug . '-nobetci-eczaneleri');
     39        } else {
     40            return home_url('/' . $il_slug . '-nobetci-eczaneleri');
     41        }
     42    } else {
     43        // Düz (Plain) Kalıcı Bağlantılar
     44        $url = home_url('/');
     45        $url = add_query_arg('nobetci_il', $il_slug, $url);
     46        if (!empty($ilce_slug)) {
     47            $url = add_query_arg('nobetci_ilce', $ilce_slug, $url);
     48        }
     49        return $url;
     50    }
     51}
    2952
    3053// Widget Kaydı
    … …  
    4467        new NBETEC_API();
    4568        new NBETEC_Frontend();
     69        new NBETEC_SEO();
    4670        if (is_admin()) {
    4771            new NBETEC_Admin();
  • nobetci-eczaneler/tags/2.0.0/readme.txt

    r3605267 r3638928  
    55Tested up to: 7.0
    66Requires PHP: 7.4
    7 Stable tag: 1.1.0
     7Stable tag: 2.0.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    8484== Changelog ==
    8585
     86= 2.0.0 =
     87* **[YENİ] Sayfalar İçin Karanlık Mod:** Nöbetçi Eczane sayfalarının (il, ilçe listelemeleri ve ana ekran) görünümü için modern bir **Karanlık Mod (Dark Mode)** eklendi.
     88* **[YENİ] Bileşen (Widget) Temaları:** Bileşen tasarımları zenginleştirildi; mevcut klasik Kırmızı temanın yanına **Aydınlık (Light)** ve **Karanlık (Dark)** olmak üzere 2 yeni tema daha eklendi. Böylelikle bileşenlerde (widget) toplam 3 farklı tema seçeneğine ulaşıldı.
     89* **[YENİ] Dinamik SEO Modülü:** İl ve ilçe eczane sayfaları için otomatik Meta Title, Meta Description ve Keywords oluşturma altyapısı eklendi.
     90* **[YENİ] Güncel Tarihli SEO Etiketleri:** Arama motoru tıklama oranlarını (CTR) artırmak amacıyla SEO başlık ve açıklamalarına her gün otomatik değişen "O Günün Tarihi" (Örn: 8 Ağustos) eklendi.
     91* **[YENİ] Tam SEO Uyumluluğu:** Yeni SEO altyapısının Yoast SEO, Rank Math ve All In One SEO eklentileriyle tam entegre (kanca sistemiyle) ve uyumlu çalışması sağlandı.
     92* **[YENİ] Yönetim Paneli - SEO Kontrolü:** "Genel Ayarlar" sekmesine Otomatik SEO etiketlerini açıp kapatabileceğiniz kontrol butonu eklendi.
     93* **[Geliştirme] Akıllı Sayfa Oluşturucu:** Admin panelinden oluşturulan ilçe sayfalarının başlıklarına SEO için otomatik olarak "İl Adı" eklendi (Örn: Sadece "Merkez" yerine "Bitlis Merkez Nöbetçi Eczaneleri").
     94* **[Geliştirme] SEO Uyumlu URL:** Otomatik oluşturulan ilçe sayfalarının kalıcı bağlantıları (slug) daha SEO dostu olacak şekilde `il-ilce-nobetci-eczaneleri` (Örn: `bitlis-merkez-nobetci-eczaneleri`) formatına güncellendi.
     95* **[Geliştirme] Tasarım Tutarlılığı:** Kısa kod (shortcode) çıktıları ile ana sayfadaki eczane kartı tasarımları birebir eşitlendi.
     96* **[Geliştirme] Breadcrumb (Navigasyon):** İl ve ilçe sayfalarındaki karmaşayı önlemek amacıyla Breadcrumb (Ekmek kırıntısı) menüsünden gereksiz "Anasayfa" bağlantısı kaldırıldı.
     97* **[Düzeltme] Tema Çakışmaları:** Kullanılan WordPress temasının, eczane ve il seçim kartlarındaki linklerin altına otomatik çizgi (underline) atması sorunu çözüldü.
     98* **[Düzeltme] Metin Kesilmesi:** İlçe sayfalarının en altındaki SEO/bilgilendirme metinlerinde yaşanan cümlenin yarıda kesilme hatası giderildi.
     99* **[Düzeltme] Harf Standartları:** Kısa kod ekranında yazdırılan ilçe isimlerinin tasarımla tam uyumlu olması için otomatik "BÜYÜK HARF" filtresi uygulandı.
     100
     101
    86102= 1.1.0 =
    87103* Nöbet gününün bazen yanlış yazımı düzeltildi.
  • nobetci-eczaneler/tags/2.0.0/templates/eczane-page.php

    r3605267 r3638928  
    163163
    164164$post = new WP_Post($nbetec_dummy_post);
     165wp_cache_add( -99, $post, 'posts' );
    165166$wp_query->post = $post;
    166167$wp_query->posts = array($post);
    167168$wp_query->queried_object = $post;
    168 $wp_query->queried_object_id = $post->ID;
     169$wp_query->queried_object_id = 0;
    169170$wp_query->is_singular = true;
    170171$wp_query->is_single = false;
    … …  
    172173
    173174get_header();
     175
     176$nbetec_global_theme = get_option('nbetec_global_theme', 'light');
     177$nbetec_theme_class = ($nbetec_global_theme === 'dark') ? ' nbetec-theme-dark' : '';
    174178?>
    175 <div class="nbetec-container">
     179<div class="nbetec-container<?php echo esc_attr($nbetec_theme_class); ?>">
    176180    <div class="nbetec-header">
    177181
    … …  
    190194            }
    191195            ?>
    192             <a href="<?php echo esc_url(home_url()); ?>" aria-label="<?php esc_attr_e('Anasayfa', 'nobetci-eczaneler'); ?>">
    193                 <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 5px;"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
    194                 <?php esc_html_e('Anasayfa', 'nobetci-eczaneler'); ?>
    195             </a>
    196             <span class="nbetec-sep">/</span>
     196
    197197            <a href="<?php echo esc_url($nbetec_home_page_url); ?>"><?php echo esc_html($nbetec_home_page_title); ?></a>
    198198            <span class="nbetec-sep">/</span>
    199199            <?php if ($nbetec_ilce_name): ?>
    200                 <a href="<?php echo esc_url(home_url('/' . sanitize_title($nbetec_il_name) . '-nobetci-eczaneleri')); ?>"><?php echo esc_html($nbetec_il_name); ?></a>
     200                <a href="<?php echo esc_url(nbetec_get_url(sanitize_title($nbetec_il_name))); ?>"><?php echo esc_html($nbetec_il_name); ?></a>
    201201                <span class="nbetec-sep">/</span>
    202202                <span class="nbetec-current"><?php echo esc_html($nbetec_ilce_name); ?></span>
    203203            <?php else: ?>
    204                 <a href="<?php echo esc_url(home_url('/' . sanitize_title($nbetec_il_slug) . '-nobetci-eczaneleri')); ?>" class="nbetec-current"><?php echo esc_html($nbetec_il_name); ?></a>
     204                <a href="<?php echo esc_url(nbetec_get_url($nbetec_il_slug)); ?>" class="nbetec-current"><?php echo esc_html($nbetec_il_name); ?></a>
    205205            <?php endif; ?>
    206206        </div>
    … …  
    266266    }
    267267    if(empty($nbetec_current_city_name)) $nbetec_current_city_name = $nbetec_il_name;
     268   
     269    // Eczaneleri topla (data içindeki ilk array grubunda bulunuyor)
     270    $nbetec_eczaneler = isset($nbetec_eczane_data['data'][0]) ? $nbetec_eczane_data['data'][0] : array();
     271   
     272    // Benzersiz ilçeleri bul
     273    $nbetec_ilceler = array();
     274    foreach ($nbetec_eczaneler as $nbetec_ecz) {
     275        $nbetec_ilce_adi = trim($nbetec_ecz['ilce']);
     276        if (!empty($nbetec_ilce_adi) && !in_array($nbetec_ilce_adi, $nbetec_ilceler)) {
     277            $nbetec_ilceler[] = $nbetec_ilce_adi;
     278        }
     279    }
     280    sort($nbetec_ilceler);
     281   
     282    // İlçe filtresi uygula
     283    if ($nbetec_ilce_slug) {
     284        $nbetec_filtered = array();
     285        foreach ($nbetec_eczaneler as $nbetec_ecz) {
     286            $nbetec_ecz_ilce_slug = sanitize_title($nbetec_ecz['ilce']);
     287            if ($nbetec_ecz_ilce_slug === $nbetec_ilce_slug) {
     288                $nbetec_filtered[] = $nbetec_ecz;
     289            }
     290        }
     291        $nbetec_eczaneler = $nbetec_filtered;
     292    }
     293   
     294    $current_url = urlencode(get_permalink());
     295    $page_title = urlencode($nbetec_page_title . " - Güncel Nöbetçi Eczaneler");
    268296    ?>
    269     <div class="nbetec-city-selector" style="position: relative; margin-bottom: 20px; width: 100%; max-width: 400px; font-family: sans-serif;">
    270         <div class="nbetec-selector-header" style="background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #2d3748; font-weight: 500;">
    271             <span><?php esc_html_e('Şehir Seçin:', 'nobetci-eczaneler'); ?> <strong><?php echo esc_html(nbetec_tr_strtoupper($nbetec_current_city_name)); ?></strong></span>
    272             <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
     297    <div class="nbetec-controls-row">
     298        <div class="nbetec-city-selector" style="position: relative; font-family: sans-serif;">
     299            <div class="nbetec-selector-header" style="background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #2d3748; font-weight: 500;">
     300                <span><?php esc_html_e('Şehir Seçin:', 'nobetci-eczaneler'); ?> <strong><?php echo esc_html(nbetec_tr_strtoupper($nbetec_current_city_name)); ?></strong></span>
     301                <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
     302            </div>
     303            <div class="nbetec-selector-dropdown nbetec-city-dropdown" style="display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 100; margin-top: 5px; overflow: hidden;">
     304                <div style="padding: 10px; border-bottom: 1px solid #e2e8f0; background: #f7fafc;">
     305                    <input type="text" class="nbetec-search-input" placeholder="<?php esc_attr_e('şehir adı veya plaka kodu yazın...', 'nobetci-eczaneler'); ?>" style="width: 100%; border: 1px solid #cbd5e0; border-radius: 4px; padding: 8px 12px; outline: none; font-size: 14px; box-sizing: border-box;">
     306                </div>
     307                <ul class="nbetec-city-list" style="max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0;">
     308                    <?php foreach($nbetec_all_cities as $nbetec_plate => $nbetec_city): ?>
     309                        <li>
     310                            <a href="<?php echo esc_url(nbetec_get_url($nbetec_city['slug'])); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7;">
     311                                <?php if($nbetec_plate !== 'kibris'): ?>
     312                                    <span class="nbetec-plate" style="display: inline-block; background: #edf2f7; color: #4a5568; padding: 2px 6px; border-radius: 4px; margin-right: 8px; font-size: 12px; font-weight: bold;"><?php echo esc_html($nbetec_plate); ?></span>
     313                                <?php else: ?>
     314                                    <span class="nbetec-plate" style="display: inline-block; background: #fff; border: 1px solid #e2e8f0; padding: 2px 6px; border-radius: 4px; margin-right: 8px;"><img src="<?php echo esc_url(NBETEC_URL . 'assets/images/kktc.svg'); ?>" alt="KKTC" width="18" height="12" style="vertical-align: middle;"></span>
     315                                <?php endif; ?>
     316                                <span class="nbetec-city-name" style="font-weight: 600; font-size: 15px;"><?php echo esc_html(nbetec_tr_strtoupper($nbetec_city['name'])); ?></span>
     317                            </a>
     318                        </li>
     319                    <?php endforeach; ?>
     320                </ul>
     321            </div>
    273322        </div>
    274         <div class="nbetec-selector-dropdown" style="display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 100; margin-top: 5px; overflow: hidden;">
    275             <div style="padding: 10px; border-bottom: 1px solid #e2e8f0; background: #f7fafc;">
    276                 <input type="text" class="nbetec-search-input" placeholder="<?php esc_attr_e('şehir adı veya plaka kodu yazın...', 'nobetci-eczaneler'); ?>" style="width: 100%; border: 1px solid #cbd5e0; border-radius: 4px; padding: 8px 12px; outline: none; font-size: 14px; box-sizing: border-box;">
     323
     324        <?php if (!empty($nbetec_ilceler)): ?>
     325        <div class="nbetec-district-selector" style="position: relative; font-family: sans-serif;">
     326            <div class="nbetec-selector-header nbetec-district-header" style="background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #2d3748; font-weight: 500;">
     327                <span><?php esc_html_e('İlçe Seçin:', 'nobetci-eczaneler'); ?> <strong><?php echo $nbetec_ilce_name ? esc_html(nbetec_tr_strtoupper($nbetec_ilce_name)) : 'TÜMÜ'; ?></strong></span>
     328                <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
    277329            </div>
    278             <ul class="nbetec-city-list" style="max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0;">
    279                 <?php foreach($nbetec_all_cities as $nbetec_plate => $nbetec_city): ?>
     330            <div class="nbetec-selector-dropdown nbetec-district-dropdown" style="display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 100; margin-top: 5px; overflow: hidden;">
     331                <ul class="nbetec-city-list" style="max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0;">
    280332                    <li>
    281                         <a href="<?php echo esc_url(home_url(sprintf('/%s-nobetci-eczaneleri', $nbetec_city['slug']))); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7;">
    282                             <?php if($nbetec_plate !== 'kibris'): ?>
    283                                 <span class="nbetec-plate" style="display: inline-block; background: #edf2f7; color: #4a5568; padding: 2px 6px; border-radius: 4px; margin-right: 8px; font-size: 12px; font-weight: bold;"><?php echo esc_html($nbetec_plate); ?></span>
    284                             <?php else: ?>
    285                                 <span class="nbetec-plate" style="display: inline-block; background: #fff; border: 1px solid #e2e8f0; color: #e53e3e; padding: 2px 6px; border-radius: 4px; margin-right: 8px; font-size: 12px; font-weight: bold;">&#10084;&#65039;</span>
    286                             <?php endif; ?>
    287                             <span class="nbetec-city-name" style="font-weight: 600; font-size: 15px;"><?php echo esc_html(nbetec_tr_strtoupper($nbetec_city['name'])); ?></span>
     333                        <a href="<?php echo esc_url(nbetec_get_url($nbetec_il_slug)); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7; font-weight: 600;">
     334                            TÜMÜ
    288335                        </a>
    289336                    </li>
    290                 <?php endforeach; ?>
    291             </ul>
     337                    <?php foreach($nbetec_ilceler as $ilce_adi): ?>
     338                        <li>
     339                            <a href="<?php echo esc_url(nbetec_get_url($nbetec_il_slug, sanitize_title($ilce_adi))); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7; font-weight: 600;">
     340                                <?php echo esc_html(nbetec_tr_strtoupper($ilce_adi)); ?>
     341                            </a>
     342                        </li>
     343                    <?php endforeach; ?>
     344                </ul>
     345            </div>
     346        </div>
     347        <?php endif; ?>
     348
     349        <div class="nbetec-share-actions" style="display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 10px 15px;">
     350            <span class="nbetec-share-label" style="font-weight: 600; color: #2d3748; margin-right: 5px;">Paylaş:</span>
     351            <a href="https://api.whatsapp.com/send?text=<?php echo $page_title; ?>%20<?php echo $current_url; ?>" target="_blank" style="color: #25D366;" title="WhatsApp ile Paylaş"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51a12.8 12.8 0 0 0-.57-.01c-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z"/></svg></a>
     352            <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $current_url; ?>" target="_blank" style="color: #1877F2;" title="Facebook ile Paylaş"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.469h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.469h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg></a>
     353            <a href="https://twitter.com/intent/tweet?url=<?php echo $current_url; ?>&text=<?php echo $page_title; ?>" target="_blank" style="color: #000;" class="nbetec-x-icon" title="X ile Paylaş"><svg width="22" height="22" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>
     354            <a href="https://t.me/share/url?url=<?php echo $current_url; ?>&text=<?php echo $page_title; ?>" target="_blank" style="color: #0088cc;" title="Telegram ile Paylaş"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12zM5.397 11.516l12.186-4.69c.563-.207 1.05.132.85 1.077l-2.077 9.774c-.183.82-.67.1023-.93.834l-2.571-1.896-1.243 1.197c-.138.138-.254.255-.522.255l.184-2.613 4.757-4.296c.207-.184-.045-.286-.32-.102l-5.88 3.7-2.535-.79c-.551-.173-.563-.55.115-.815z"/></svg></a>
     355            <div style="width: 1px; height: 24px; background: #e2e8f0; margin: 0 5px;"></div>
     356            <button onclick="window.print()" class="nbetec-print-btn" style="background: none; border: none; cursor: pointer; color: #4a5568; display: flex; align-items: center; padding: 0;" title="Sayfayı Yazdır"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 6 2 18 2 18 9"></polyline><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path><rect x="6" y="14" width="12" height="8"></rect></svg></button>
    292357        </div>
    293358    </div>
    … …  
    302367           
    303368            <?php
    304             // Eczaneleri topla (data içindeki ilk array grubunda bulunuyor)
    305             $nbetec_eczaneler = isset($nbetec_eczane_data['data'][0]) ? $nbetec_eczane_data['data'][0] : array();
    306            
    307             // Benzersiz ilçeleri bul
    308             $nbetec_ilceler = array();
    309             foreach ($nbetec_eczaneler as $nbetec_ecz) {
    310                 $nbetec_ilce_adi = trim($nbetec_ecz['ilce']);
    311                 if (!empty($nbetec_ilce_adi) && !in_array($nbetec_ilce_adi, $nbetec_ilceler)) {
    312                     $nbetec_ilceler[] = $nbetec_ilce_adi;
    313                 }
    314             }
    315             sort($nbetec_ilceler);
    316            
    317             // İlçe filtresi uygula
    318             if ($nbetec_ilce_slug) {
    319                 // İlçe slug'ını Türkçe karakter dönüştürerek veya küçük harf eşleştirerek filtrelememiz lazım.
    320                 $nbetec_filtered = array();
    321                 foreach ($nbetec_eczaneler as $nbetec_ecz) {
    322                     $nbetec_ecz_ilce_slug = sanitize_title($nbetec_ecz['ilce']);
    323                     if ($nbetec_ecz_ilce_slug === $nbetec_ilce_slug) {
    324                         $nbetec_filtered[] = $nbetec_ecz;
    325                     }
    326                 }
    327                 $nbetec_eczaneler = $nbetec_filtered;
    328             }
     369            // İlçe hesaplamaları ve filtrelemeleri yukarı taşındı.
    329370            ?>
    330            
    331             <?php if (!empty($nbetec_ilceler)): ?>
    332 
    333             <div class="nbetec-filters">
    334                 <a href="<?php echo esc_url(home_url(sprintf('/%s-nobetci-eczaneleri', $nbetec_il_slug))); ?>"
    335                    class="nbetec-filter-btn <?php echo empty($nbetec_ilce_slug) ? 'active' : ''; ?>">
    336                     <?php if(empty($nbetec_ilce_slug)): ?><span class="nbetec-filter-icon">&#10003;</span><?php endif; ?><?php esc_html_e('TÜMÜ', 'nobetci-eczaneler'); ?>
    337                 </a>
    338                 <?php foreach ($nbetec_ilceler as $nbetec_ilce_adi):
    339                     $nbetec_current_ilce_slug = sanitize_title($nbetec_ilce_adi);
    340                     $nbetec_is_active = ($nbetec_current_ilce_slug === $nbetec_ilce_slug);
    341                 ?>
    342                     <a href="<?php echo esc_url(home_url(sprintf('/%s-%s-nobetci-eczaneleri', $nbetec_il_slug, $nbetec_current_ilce_slug))); ?>"
    343                        class="nbetec-filter-btn <?php echo $nbetec_is_active ? 'active' : ''; ?>">
    344                         <?php if($nbetec_is_active): ?><span class="nbetec-filter-icon">&#10003;</span><?php endif; ?><?php echo esc_html(nbetec_tr_strtoupper($nbetec_ilce_adi)); ?>
    345                     </a>
    346                 <?php endforeach; ?>
    347             </div>
    348             <?php endif; ?>
    349371           
    350372            <?php if (empty($nbetec_eczaneler)): ?>
  • nobetci-eczaneler/tags/2.0.0/templates/shortcode-eczane.php

    r3605267 r3638928  
    123123$nbetec_page_title = $nbetec_ilce_name ? "{$nbetec_il_name} {$nbetec_ilce_name} Nöbetçi Eczaneleri" : "{$nbetec_il_name} Nöbetçi Eczaneleri";
    124124
     125$nbetec_global_theme = get_option('nbetec_global_theme', 'light');
     126$nbetec_theme_class = ($nbetec_global_theme === 'dark') ? ' nbetec-theme-dark' : '';
     127
     128// Eczaneleri topla (data içindeki ilk array grubunda bulunuyor)
     129$nbetec_eczaneler = (isset($nbetec_eczane_data) && isset($nbetec_eczane_data['data'][0])) ? $nbetec_eczane_data['data'][0] : array();
     130
     131// Benzersiz ilçeleri bul
     132$nbetec_ilceler = array();
     133foreach ($nbetec_eczaneler as $nbetec_ecz) {
     134    $nbetec_ilce_adi = trim($nbetec_ecz['ilce']);
     135    if (!empty($nbetec_ilce_adi) && !in_array($nbetec_ilce_adi, $nbetec_ilceler)) {
     136        $nbetec_ilceler[] = $nbetec_ilce_adi;
     137    }
     138}
     139sort($nbetec_ilceler);
     140
     141// İlçe filtresi uygula
     142if ($nbetec_ilce_slug) {
     143    $nbetec_filtered = array();
     144    foreach ($nbetec_eczaneler as $nbetec_ecz) {
     145        $nbetec_ecz_ilce_slug = sanitize_title($nbetec_ecz['ilce']);
     146        if ($nbetec_ecz_ilce_slug === $nbetec_ilce_slug) {
     147            $nbetec_filtered[] = $nbetec_ecz;
     148        }
     149    }
     150    $nbetec_eczaneler = $nbetec_filtered;
     151}
     152
     153$nbetec_current_city_name = '';
     154foreach($nbetec_all_cities as $nbetec_plate => $nbetec_city) {
     155    if($nbetec_city['slug'] === $nbetec_il_slug) {
     156        $nbetec_current_city_name = $nbetec_city['name'];
     157        break;
     158    }
     159}
     160if(empty($nbetec_current_city_name)) $nbetec_current_city_name = $nbetec_il_name;
    125161?>
    126 <div class="nbetec-container">
    127     <div class="nbetec-header">
    128         <h1 class="nbetec-title"><?php echo esc_html($nbetec_page_title); ?></h1>
    129         <?php if ($nbetec_eczane_data && !empty($nbetec_eczane_data['detay']['description'])): ?>
    130             <p class="nbetec-desc"><?php echo esc_html($nbetec_eczane_data['detay']['description']); ?></p>
    131         <?php endif; ?>
     162<div class="nbetec-container<?php echo esc_attr($nbetec_theme_class); ?>">
     163    <div class="nbetec-header" style="text-align: left; margin-bottom: 40px;">
     164        <h1 class="nbetec-title" style="margin-bottom: 15px;"><?php echo esc_html($nbetec_page_title); ?></h1>
     165        <?php
     166        // Tarihleri Türkçe oluştur
     167        $nbetec_tr_months = array('', 'Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık');
     168        $nbetec_tr_days = array('Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi');
     169       
     170        // Nöbet tarihi hesaplaması
     171        $current_time = time();
     172        $current_hour = (int)wp_date('G');
     173       
     174        $shift_ts = ($current_hour < 8) ? strtotime('-1 day', $current_time) : $current_time;
     175        $shift_ts = mktime(12, 0, 0, (int)wp_date('n', $shift_ts), (int)wp_date('j', $shift_ts), (int)wp_date('Y', $shift_ts));
     176
     177        $nbetec_current_ts = $shift_ts;
     178
     179        if (isset($nbetec_eczane_data['updated']) && !empty($nbetec_eczane_data['updated'])) {
     180            $nbetec_date_parts = explode('-', $nbetec_eczane_data['updated']);
     181            if (count($nbetec_date_parts) === 3) {
     182                $api_ts = mktime(12, 0, 0, (int)$nbetec_date_parts[1], (int)$nbetec_date_parts[2], (int)$nbetec_date_parts[0]);
     183                if ($api_ts < $shift_ts) {
     184                    $nbetec_current_ts = $api_ts;
     185                }
     186            }
     187        }
     188       
     189        $nbetec_today_m = (int)wp_date('n', $nbetec_current_ts);
     190        $nbetec_today_w = (int)wp_date('w', $nbetec_current_ts);
     191        $nbetec_short_date = wp_date('j', $nbetec_current_ts) . ' ' . $nbetec_tr_months[$nbetec_today_m] . ' ' . $nbetec_tr_days[$nbetec_today_w];
     192        $nbetec_long_date = wp_date('j', $nbetec_current_ts) . ' ' . $nbetec_tr_months[$nbetec_today_m] . ' ' . wp_date('Y', $nbetec_current_ts) . ' ' . $nbetec_tr_days[$nbetec_today_w];
     193       
     194        $nbetec_tomorrow_ts = strtotime('+1 day', $nbetec_current_ts);
     195        $nbetec_tom_m = (int)wp_date('n', $nbetec_tomorrow_ts);
     196        $nbetec_tom_w = (int)wp_date('w', $nbetec_tomorrow_ts);
     197        $nbetec_tom_long_date = wp_date('j', $nbetec_tomorrow_ts) . ' ' . $nbetec_tr_months[$nbetec_tom_m] . ' ' . wp_date('Y', $nbetec_tomorrow_ts) . ' ' . $nbetec_tr_days[$nbetec_tom_w];
     198       
     199        $nbetec_loc_text = $nbetec_il_name;
     200        if (!empty($nbetec_ilce_name)) {
     201            $nbetec_loc_text .= ' ' . $nbetec_ilce_name;
     202        }
     203
     204        $nbetec_mesai_text = in_array($nbetec_today_w, array(0, 6)) ? 'gününden' : 'mesai bitiminden';
     205        ?>
     206        <div class="nbetec-desc" style="font-size: 15px; line-height: 1.6; text-align: justify; margin: 0;">
     207            <p style="margin-top: 0; margin-bottom: 10px;"><strong><?php echo esc_html($nbetec_short_date); ?></strong> <?php echo esc_html($nbetec_loc_text); ?> Nöbetçi Eczanelerine sayfamızdan ulaşabilirsiniz.</p>
     208            <p style="margin-bottom: 0;">Bu sayfada <strong><?php echo esc_html($nbetec_long_date); ?></strong> <?php echo esc_html($nbetec_mesai_text); ?>, <strong><?php echo esc_html($nbetec_tom_long_date); ?></strong> sabaha kadar açık olan <strong><?php echo esc_html($nbetec_loc_text); ?></strong> nöbetçi eczanelerinin listesini bulabilirsiniz. Bazı eczaneler, gece boyu nöbet tutmuyor olabilir; bazıları ise icap nöbeti tutuyor veya mücbir bir sebeple nöbet başında bulunamıyor olabilir. Bu nedenle eczaneye gitmeden önce telefonla açık olduğunu teyit etmeniz tavsiye olunur. Geçmiş olsun dileklerimizle.</p>
     209        </div>
    132210    </div>
    133211   
    134     <?php
    135     $nbetec_current_city_name = '';
    136     foreach($nbetec_all_cities as $nbetec_plate => $nbetec_city) {
    137         if($nbetec_city['slug'] === $nbetec_il_slug) {
    138             $nbetec_current_city_name = $nbetec_city['name'];
    139             break;
    140         }
    141     }
    142     if(empty($nbetec_current_city_name)) $nbetec_current_city_name = $nbetec_il_name;
    143     ?>
    144     <div class="nbetec-city-selector" style="position: relative; margin-bottom: 20px; width: 100%; max-width: 400px; font-family: sans-serif;">
    145         <div class="nbetec-selector-header" style="background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #2d3748; font-weight: 500;">
    146             <span><?php esc_html_e('Şehir Seçin:', 'nobetci-eczaneler'); ?> <strong><?php echo esc_html($nbetec_current_city_name); ?></strong></span>
    147             <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
     212    <div class="nbetec-controls-row">
     213        <div class="nbetec-city-selector" style="position: relative; font-family: sans-serif;">
     214            <div class="nbetec-selector-header" style="background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #2d3748; font-weight: 500;">
     215                <span><?php esc_html_e('Şehir Seçin:', 'nobetci-eczaneler'); ?> <strong><?php echo esc_html(mb_strtoupper(str_replace(array('i', 'ı', 'ğ', 'ü', 'ş', 'ö', 'ç'), array('İ', 'I', 'Ğ', 'Ü', 'Ş', 'Ö', 'Ç'), $nbetec_current_city_name), 'UTF-8')); ?></strong></span>
     216                <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
     217            </div>
     218            <div class="nbetec-selector-dropdown nbetec-city-dropdown" style="display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 100; margin-top: 5px; overflow: hidden;">
     219                <div style="padding: 10px; border-bottom: 1px solid #e2e8f0; background: #f7fafc;">
     220                    <input type="text" class="nbetec-search-input" placeholder="<?php esc_attr_e('şehir adı veya plaka kodu yazın...', 'nobetci-eczaneler'); ?>" style="width: 100%; border: 1px solid #cbd5e0; border-radius: 4px; padding: 8px 12px; outline: none; font-size: 14px; box-sizing: border-box;">
     221                </div>
     222                <ul class="nbetec-city-list" style="max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0;">
     223                    <?php foreach($nbetec_all_cities as $nbetec_plate => $nbetec_city): ?>
     224                        <li>
     225                            <a href="<?php echo esc_url(nbetec_get_url($nbetec_city['slug'])); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7;">
     226                                <?php if($nbetec_plate !== 'kibris'): ?>
     227                                    <span class="nbetec-plate" style="display: inline-block; background: #edf2f7; color: #4a5568; padding: 2px 6px; border-radius: 4px; margin-right: 8px; font-size: 12px; font-weight: bold;"><?php echo esc_html($nbetec_plate); ?></span>
     228                                <?php else: ?>
     229                                    <span class="nbetec-plate" style="display: inline-block; background: #fff; border: 1px solid #e2e8f0; padding: 2px 6px; border-radius: 4px; margin-right: 8px;"><img src="<?php echo esc_url(NBETEC_URL . 'assets/images/kktc.svg'); ?>" alt="KKTC" width="18" height="12" style="vertical-align: middle;"></span>
     230                                <?php endif; ?>
     231                                <span class="nbetec-city-name" style="font-weight: 600; font-size: 15px;"><?php echo esc_html(mb_strtoupper(str_replace(array('i', 'ı', 'ğ', 'ü', 'ş', 'ö', 'ç'), array('İ', 'I', 'Ğ', 'Ü', 'Ş', 'Ö', 'Ç'), $nbetec_city['name']), 'UTF-8')); ?></span>
     232                            </a>
     233                        </li>
     234                    <?php endforeach; ?>
     235                </ul>
     236            </div>
    148237        </div>
    149         <div class="nbetec-selector-dropdown" style="display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 100; margin-top: 5px; overflow: hidden;">
    150             <div style="padding: 10px; border-bottom: 1px solid #e2e8f0; background: #f7fafc;">
    151                 <input type="text" class="nbetec-search-input" placeholder="<?php esc_attr_e('şehir adı veya plaka kodu yazın...', 'nobetci-eczaneler'); ?>" style="width: 100%; border: 1px solid #cbd5e0; border-radius: 4px; padding: 8px 12px; outline: none; font-size: 14px; box-sizing: border-box;">
     238
     239        <?php if (!empty($nbetec_ilceler)): ?>
     240        <div class="nbetec-district-selector" style="position: relative; font-family: sans-serif;">
     241            <div class="nbetec-selector-header nbetec-district-header" style="background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #2d3748; font-weight: 500;">
     242                <span><?php esc_html_e('İlçe Seçin:', 'nobetci-eczaneler'); ?> <strong><?php echo $nbetec_ilce_name ? esc_html(mb_strtoupper(str_replace(array('i', 'ı', 'ğ', 'ü', 'ş', 'ö', 'ç'), array('İ', 'I', 'Ğ', 'Ü', 'Ş', 'Ö', 'Ç'), $nbetec_ilce_name), 'UTF-8')) : 'TÜMÜ'; ?></strong></span>
     243                <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
    152244            </div>
    153             <ul class="nbetec-city-list" style="max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0;">
    154                 <?php foreach($nbetec_all_cities as $nbetec_plate => $nbetec_city): ?>
     245            <div class="nbetec-selector-dropdown nbetec-district-dropdown" style="display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 100; margin-top: 5px; overflow: hidden;">
     246                <ul class="nbetec-city-list" style="max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0;">
    155247                    <li>
    156                         <a href="<?php echo esc_url(home_url(sprintf('/%s-nobetci-eczaneleri', $nbetec_city['slug']))); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7;">
    157                             <?php if($nbetec_plate !== 'kibris'): ?>
    158                                 <span class="nbetec-plate" style="display: inline-block; background: #edf2f7; color: #4a5568; padding: 2px 6px; border-radius: 4px; margin-right: 8px; font-size: 12px; font-weight: bold;"><?php echo esc_html($nbetec_plate); ?></span>
    159                             <?php else: ?>
    160                                 <span class="nbetec-plate" style="display: inline-block; background: #fff; border: 1px solid #e2e8f0; color: #e53e3e; padding: 2px 6px; border-radius: 4px; margin-right: 8px; font-size: 12px; font-weight: bold;">&#10084;&#65039;</span>
    161                             <?php endif; ?>
    162                             <span class="nbetec-city-name"><?php echo esc_html($nbetec_city['name']); ?></span>
     248                        <a href="<?php echo esc_url(nbetec_get_url($nbetec_il_slug)); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7; font-weight: 600;">
     249                            TÜMÜ
    163250                        </a>
    164251                    </li>
    165                 <?php endforeach; ?>
    166             </ul>
     252                    <?php foreach($nbetec_ilceler as $ilce_adi): ?>
     253                        <li>
     254                            <a href="<?php echo esc_url(nbetec_get_url($nbetec_il_slug, sanitize_title($ilce_adi))); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7; font-weight: 600;">
     255                                <?php echo esc_html(mb_strtoupper(str_replace(array('i', 'ı', 'ğ', 'ü', 'ş', 'ö', 'ç'), array('İ', 'I', 'Ğ', 'Ü', 'Ş', 'Ö', 'Ç'), $ilce_adi), 'UTF-8')); ?>
     256                            </a>
     257                        </li>
     258                    <?php endforeach; ?>
     259                </ul>
     260            </div>
     261        </div>
     262        <?php endif; ?>
     263
     264        <div class="nbetec-share-actions" style="display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 10px 15px;">
     265            <span class="nbetec-share-label" style="font-weight: 600; color: #2d3748; margin-right: 5px;">Paylaş:</span>
     266            <?php
     267            $share_url = urlencode((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
     268            $share_title = urlencode($nbetec_page_title);
     269            ?>
     270            <a href="https://api.whatsapp.com/send?text=<?php echo $share_title; ?>%20<?php echo $share_url; ?>" target="_blank" style="color: #25D366; display: flex;" title="WhatsApp ile Paylaş"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51a12.8 12.8 0 0 0-.57-.01c-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z"/></svg></a>
     271            <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $share_url; ?>" target="_blank" style="color: #1877F2; display: flex;" title="Facebook ile Paylaş"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.469h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.469h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg></a>
     272            <a href="https://twitter.com/intent/tweet?url=<?php echo $share_url; ?>&text=<?php echo $share_title; ?>" target="_blank" style="color: #000; display: flex;" class="nbetec-x-icon" title="X ile Paylaş"><svg width="22" height="22" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>
     273            <a href="https://t.me/share/url?url=<?php echo $share_url; ?>&text=<?php echo $share_title; ?>" target="_blank" style="color: #0088cc; display: flex;" title="Telegram ile Paylaş"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12zM5.397 11.516l12.186-4.69c.563-.207 1.05.132.85 1.077l-2.077 9.774c-.183.82-.67.1023-.93.834l-2.571-1.896-1.243 1.197c-.138.138-.254.255-.522.255l.184-2.613 4.757-4.296c.207-.184-.045-.286-.32-.102l-5.88 3.7-2.535-.79c-.551-.173-.563-.55.115-.815z"/></svg></a>
     274            <div style="width: 1px; height: 24px; background: #e2e8f0; margin: 0 5px;"></div>
     275            <button onclick="window.print()" class="nbetec-print-btn" style="background: none; border: none; cursor: pointer; color: #4a5568; display: flex; align-items: center; padding: 0;" title="Sayfayı Yazdır"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 6 2 18 2 18 9"></polyline><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path><rect x="6" y="14" width="12" height="8"></rect></svg></button>
    167276        </div>
    168277    </div>
    169278
    170 
    171279    <div class="nbetec-content">
    172         <?php if (empty($nbetec_eczane_data) || empty($nbetec_eczane_data['data'])): ?>
    173             <div class="nbetec-alert nbetec-alert-warning">
    174                 <p><?php esc_html_e('Şu anda bu bölge için nöbetçi eczane bilgisi bulunmamaktadır.', 'nobetci-eczaneler'); ?></p>
    175             </div>
    176         <?php else: ?>
    177            
    178             <?php
    179             // Eczaneleri topla (data içindeki ilk array grubunda bulunuyor)
    180             $nbetec_eczaneler = isset($nbetec_eczane_data['data'][0]) ? $nbetec_eczane_data['data'][0] : array();
    181            
    182             // Benzersiz ilçeleri bul
    183             $nbetec_ilceler = array();
    184             foreach ($nbetec_eczaneler as $nbetec_ecz) {
    185                 $nbetec_ilce_adi = trim($nbetec_ecz['ilce']);
    186                 if (!empty($nbetec_ilce_adi) && !in_array($nbetec_ilce_adi, $nbetec_ilceler)) {
    187                     $nbetec_ilceler[] = $nbetec_ilce_adi;
    188                 }
    189             }
    190             sort($nbetec_ilceler);
    191            
    192             // İlçe filtresi uygula
    193             if ($nbetec_ilce_slug) {
    194                 // İlçe slug'ını Türkçe karakter dönüştürerek veya küçük harf eşleştirerek filtrelememiz lazım.
    195                 $nbetec_filtered = array();
    196                 foreach ($nbetec_eczaneler as $nbetec_ecz) {
    197                     $nbetec_ecz_ilce_slug = sanitize_title($nbetec_ecz['ilce']);
    198                     if ($nbetec_ecz_ilce_slug === $nbetec_ilce_slug) {
    199                         $nbetec_filtered[] = $nbetec_ecz;
    200                     }
    201                 }
    202                 $nbetec_eczaneler = $nbetec_filtered;
    203             }
    204             ?>
    205            
    206             <?php if (!empty($nbetec_ilceler)): ?>
    207 
    208             <div class="nbetec-filters">
    209                 <a href="<?php echo esc_url(home_url(sprintf('/%s-nobetci-eczaneleri', $nbetec_il_slug))); ?>"
    210                    class="nbetec-filter-btn <?php echo empty($nbetec_ilce_slug) ? 'active' : ''; ?>">
    211                     <?php if(empty($nbetec_ilce_slug)): ?><span class="nbetec-filter-icon">&#10003;</span><?php endif; ?><?php esc_html_e('Tümü', 'nobetci-eczaneler'); ?>
    212                 </a>
    213                 <?php foreach ($nbetec_ilceler as $nbetec_ilce_adi):
    214                     $nbetec_current_ilce_slug = sanitize_title($nbetec_ilce_adi);
    215                     $nbetec_is_active = ($nbetec_current_ilce_slug === $nbetec_ilce_slug);
    216                 ?>
    217                     <a href="<?php echo esc_url(home_url(sprintf('/%s-%s-nobetci-eczaneleri', $nbetec_il_slug, $nbetec_current_ilce_slug))); ?>"
    218                        class="nbetec-filter-btn <?php echo $nbetec_is_active ? 'active' : ''; ?>">
    219                         <?php if($nbetec_is_active): ?><span class="nbetec-filter-icon">&#10003;</span><?php endif; ?><?php echo esc_html($nbetec_ilce_adi); ?>
    220                     </a>
    221                 <?php endforeach; ?>
    222             </div>
    223             <?php endif; ?>
    224280           
    225281            <?php if (empty($nbetec_eczaneler)): ?>
    … …  
    233289                            <img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4yLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCA2NCA2NCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNjQgNjQ7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+DQoJLnN0MHtmaWxsOiNDQzAwMDA7fQ0KPC9zdHlsZT4NCjxnPg0KCTxwb2x5Z29uIGlkPSJwb2x5Z29uM18xXyIgY2xhc3M9InN0MCIgcG9pbnRzPSIyNy4yLDQ0LjEgMjcuMiwzNC45IDQ4LjMsMzQuOSA0OC4zLDI1IDI3LjIsMjUgMjcuMiwxOC45IDQ5LjgsMTguOSA0OS44LDkgMjcuMiw5IA0KCQkyNyw5IDEzLDkgMTMsNTQuOCAyNyw1NC44IDI3LjIsNTQuOCA1MS40LDU0LjggNTEuNCw0NC4xIAkiLz4NCgk8cGF0aCBpZD0icGF0aDVfM18iIGNsYXNzPSJzdDAiIGQ9Ik01OS44LDQuM3Y1NS4ySDQuNFY0LjNINTkuOCBNNTkuOCwwSDQuNEMyLDAsMC4xLDIsMC4xLDQuM3Y1NS4yQzAuMSw2MiwyLDY0LDQuNCw2NGg1NS4yDQoJCWMyLjMsMCw0LjMtMiw0LjMtNC4zVjQuM0M2NC4xLDIsNjIuMywwLDU5LjgsMEw1OS44LDB6Ii8+DQo8L2c+DQo8L3N2Zz4NCg==" alt="Eczane" class="nbetec-card-logo">
    234290                            <div style="display: flex; align-items: center; gap: 12px; margin-bottom: 15px;">
    235                                 <h3 class="nbetec-name"><?php echo esc_html($nbetec_eczane['eczane_adi']); ?></h3>
     291                                <h3 class="nbetec-name" style="margin: 0; padding: 0; border: none;"><?php echo esc_html($nbetec_eczane['eczane_adi']); ?></h3>
    236292                            </div>
    237293                            <div class="nbetec-card-content">
    238                                 <div class="nbetec-ilce"><?php echo esc_html($nbetec_eczane['ilce']); ?></div>
     294                                <div class="nbetec-ilce"><?php echo esc_html(mb_strtoupper(str_replace(array('i', 'ı', 'ğ', 'ü', 'ş', 'ö', 'ç'), array('İ', 'I', 'Ğ', 'Ü', 'Ş', 'Ö', 'Ç'), $nbetec_eczane['ilce']), 'UTF-8')); ?></div>
    239295                                <div class="nbetec-address">
    240296                                    <?php
    … …  
    243299                                        : $nbetec_eczane['eczane_adi'] . ' ' . $nbetec_eczane['adres'];
    244300                                    ?>
    245                                     <a href="https://maps.google.com/?q=<?php echo urlencode($nbetec_map_query); ?>" target="_blank" rel="noopener noreferrer" aria-label="<?php echo esc_attr(sprintf('Adres: %s', $nbetec_eczane['adres'])); ?>">
     301                                    <a href="https://maps.google.com/?q=<?php echo urlencode($nbetec_map_query); ?>" target="_blank" rel="noopener noreferrer" aria-label="<?php echo esc_attr(sprintf('Adres: %s', $nbetec_eczane['adres'])); ?>" style="text-decoration: none !important; border: none !important; box-shadow: none !important;">
    246302                                        <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>
    247303                                        <?php echo esc_html($nbetec_eczane['adres']); ?>
    … …  
    249305                                </div>
    250306                                <div class="nbetec-phone">
    251                                     <a href="tel:<?php echo esc_attr(preg_replace('/[^0-9+]/', '', $nbetec_eczane['telefon'])); ?>" aria-label="<?php echo esc_attr(sprintf('Telefon: %s', $nbetec_eczane['telefon'])); ?>">
     307                                    <a href="tel:<?php echo esc_attr(preg_replace('/[^0-9+]/', '', $nbetec_eczane['telefon'])); ?>" aria-label="<?php echo esc_attr(sprintf('Telefon: %s', $nbetec_eczane['telefon'])); ?>" style="text-decoration: none !important; border: none !important; box-shadow: none !important;">
    252308                                        <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>
    253309                                        <?php echo esc_html($nbetec_eczane['telefon']); ?>
    … …  
    270326                </div>
    271327            <?php endif; ?>
    272         <?php endif; ?>
    273328    </div>
    274329</div>
  • nobetci-eczaneler/tags/2.0.0/templates/shortcode-home.php

    r3585474 r3638928  
    77    '01' => ['slug' => 'adana', 'name' => 'Adana'],
    88    '02' => ['slug' => 'adiyaman', 'name' => 'Adıyaman'],
    9     '03' => ['slug' => 'afyonkarahisar', 'name' => 'Afyonkarahisar'],
     9    '03' => ['slug' => 'afyonkarahisar', 'name' => 'A.Karahisar'],
    1010    '04' => ['slug' => 'agri', 'name' => 'Ağrı'],
    1111    '05' => ['slug' => 'amasya', 'name' => 'Amasya'],
    … …  
    5050    '44' => ['slug' => 'malatya', 'name' => 'Malatya'],
    5151    '45' => ['slug' => 'manisa', 'name' => 'Manisa'],
    52     '46' => ['slug' => 'kahramanmaras', 'name' => 'Kahramanmaraş'],
     52    '46' => ['slug' => 'kahramanmaras', 'name' => 'K.Maraş'],
    5353    '47' => ['slug' => 'mardin', 'name' => 'Mardin'],
    5454    '48' => ['slug' => 'mugla', 'name' => 'Muğla'],
    … …  
    8989);
    9090?>
     91<?php
     92$nbetec_global_theme = get_option('nbetec_global_theme', 'light');
     93$nbetec_theme_class = ($nbetec_global_theme === 'dark') ? ' nbetec-theme-dark' : '';
     94?>
    9195
    92 <div class="nbetec-container nbetec-shortcode">
     96<div class="nbetec-container nbetec-shortcode<?php echo esc_attr($nbetec_theme_class); ?>">
    9397    <div class="nbetec-header">
    9498        <h2 class="nbetec-title"><?php esc_html_e('Nöbetçi Eczane İl Seçimi', 'nobetci-eczaneler'); ?></h2>
    … …  
    103107    <div class="nbetec-city-grid">
    104108        <?php foreach ($nbetec_all_cities as $nbetec_plate => $nbetec_city): ?>
    105             <a href="<?php echo esc_url(home_url(sprintf('/%s-nobetci-eczaneleri', sanitize_title($nbetec_city['name'])))); ?>" class="nbetec-city-card" data-search="<?php echo esc_attr($nbetec_plate . ' ' . mb_strtolower($nbetec_city['name'], 'UTF-8')); ?>">
    106                 <span class="nbetec-city-plate"><?php echo $nbetec_plate === 'kibris' ? '❤️' : esc_html($nbetec_plate); ?></span>
     109            <a href="<?php echo esc_url(nbetec_get_url($nbetec_city['slug'])); ?>" class="nbetec-city-card" data-search="<?php echo esc_attr($nbetec_plate . ' ' . mb_strtolower($nbetec_city['name'], 'UTF-8')); ?>" style="text-decoration: none !important;">
     110                <span class="nbetec-city-plate"><?php echo $nbetec_plate === 'kibris' ? '<img src="' . esc_url(NBETEC_URL . 'assets/images/kktc.svg') . '" alt="KKTC" width="24" height="16" style="vertical-align: middle; border: 1px solid #e2e8f0; border-radius: 2px;">' : esc_html($nbetec_plate); ?></span>
    107111                <span class="nbetec-city-name"><?php echo esc_html($nbetec_city['name']); ?></span>
    108112            </a>
  • nobetci-eczaneler/trunk/assets/css/style.css

    r3585474 r3638928  
    151151}
    152152
    153 /* Widget Styles */
    154 .nbetec-widget-wrapper {
    155     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    156     border-radius: 8px;
    157     overflow: hidden;
    158     background: #fff;
    159     box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    160     border: 1px solid #e2e8f0;
    161 }
    162 
    163 .nbetec-widget-header-red {
    164     background: #b91c1c;
    165     color: #fff;
    166     padding: 12px 15px;
    167     font-size: 16px;
    168     text-transform: uppercase;
    169     font-weight: bold;
    170     display: flex;
    171     align-items: center;
    172 }
    173 
    174 .nbetec-widget-subheader-dark {
    175     background: #2d3748;
    176     color: #fff;
    177     padding: 8px 15px;
    178     font-size: 13px;
    179     text-align: center;
    180     font-weight: 500;
    181 }
    182 
    183 .nbetec-widget-list {
    184     list-style: none;
    185     margin: 0;
    186     padding: 0;
    187 }
    188 
    189 .nbetec-widget-item {
    190     border-bottom: 3px solid #cbd5e0;
    191 }
    192 
    193 .nbetec-widget-item:last-child {
    194     border-bottom: none;
    195 }
    196 
    197 .nbetec-w-name {
    198     font-size: 15px;
    199     color: #1a202c;
    200     padding: 10px 15px;
    201     background: #fff;
    202     border-bottom: 1px solid #edf2f7;
    203     display: flex;
    204     align-items: center;
    205 }
    206 
    207 .nbetec-w-e-icon-img {
    208     width: 24px;
    209     height: 24px;
    210     margin-right: 8px;
    211     object-fit: contain;
    212 }
    213 
    214 .nbetec-w-ilce {
    215     color: #718096;
    216     font-size: 13px;
    217     margin-left: 5px;
    218     font-weight: normal;
    219 }
    220 
    221 .nbetec-w-phone, .nbetec-w-address, .nbetec-w-direction {
    222     font-size: 14px;
    223     color: #4a5568;
    224     padding: 10px 15px;
    225     background: #f7fafc;
    226     border-bottom: 1px solid #edf2f7;
    227     display: flex;
    228     align-items: center;
    229 }
    230 
    231 .nbetec-w-address {
    232     background: #fff;
    233     align-items: flex-start;
    234 }
    235 
    236 .nbetec-w-direction {
    237     background: #fdf2f8;
    238     color: #b91c1c;
    239     font-style: italic;
    240 }
    241 
    242 .nbetec-w-phone a, .nbetec-w-address a {
    243     color: #2d3748;
    244     text-decoration: none;
    245 }
    246 
    247 .nbetec-w-phone .dashicons, .nbetec-w-address .dashicons {
    248     font-size: 18px;
    249     width: 18px;
    250     height: 18px;
    251     margin-right: 8px;
    252     color: #4a5568;
    253 }
    254 
    255 .nbetec-w-more {
    256     text-align: center;
    257     padding: 12px;
    258     background: #f7fafc;
    259     border-top: 1px solid #edf2f7;
    260 }
    261 
    262 .nbetec-w-more a {
    263     color: #3182ce;
    264     text-decoration: none;
    265     font-weight: bold;
    266     font-size: 13px;
    267 }
     153
    268154
    269155/* Koyu Tema (Dark) */
    270156.nbetec-theme-dark {
    271     background: #1a202c;
     157    background: #000000;
    272158    border-color: #2d3748;
    273159    color: #e2e8f0;
    274160}
    275 .nbetec-theme-dark .nbetec-widget-item { border-color: #2d3748; }
    276 .nbetec-theme-dark .nbetec-w-name { color: #f7fafc; }
    277 .nbetec-theme-dark .nbetec-w-phone, .nbetec-theme-dark .nbetec-w-address { color: #cbd5e0; }
    278 .nbetec-theme-dark .nbetec-w-more { background: #2d3748; border-color: #4a5568; }
    279 
    280161/* --- Inline Styles Moved Here --- */
    281162.nbetec-breadcrumb { font-size: 14px; margin-bottom: 20px; display: flex; align-items: center; flex-wrap: wrap; }
    … …  
    335216.nbetec-city-card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.08); border-color: #e53e3e; color: #e53e3e; }
    336217.nbetec-city-card:hover .nbetec-city-plate { color: #c53030; }
     218
     219/* Anasayfa İl Seçimi Koyu Tema */
     220.nbetec-theme-dark .nbetec-header .nbetec-title { color: #ffffff; }
     221.nbetec-theme-dark .nbetec-desc, .nbetec-theme-dark .nbetec-header p { color: #ffffff; }
     222.nbetec-theme-dark #nbetec-city-search {
     223    background: #2d3748;
     224    border-color: #4a5568;
     225    color: #f7fafc;
     226}
     227.nbetec-theme-dark #nbetec-city-search::placeholder { color: #a0aec0; }
     228.nbetec-theme-dark .nbetec-search-icon { stroke: #a0aec0; }
     229
     230.nbetec-theme-dark .nbetec-city-card {
     231    background: #2d3748;
     232    border-color: #4a5568;
     233}
     234.nbetec-theme-dark .nbetec-city-card:hover {
     235    background: #1a202c;
     236    border-color: #fc8181;
     237    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
     238}
     239.nbetec-theme-dark .nbetec-city-plate { color: #fc8181; }
     240.nbetec-theme-dark .nbetec-city-name { color: #e2e8f0; }
     241.nbetec-theme-dark .nbetec-city-card:hover .nbetec-city-name { color: #f7fafc; }
     242
     243/* Shortcode / Eczane Listesi Koyu Tema */
     244.nbetec-theme-dark .nbetec-card {
     245    background: #1a202c;
     246    border-color: #2d3748;
     247    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
     248}
     249.nbetec-theme-dark .nbetec-card:hover { border-color: #fc8181; box-shadow: 0 10px 20px rgba(0,0,0,0.7); }
     250.nbetec-theme-dark .nbetec-name { color: #f7fafc; }
     251.nbetec-theme-dark .nbetec-ilce { background: #000000; color: #90cdf4; }
     252.nbetec-theme-dark .nbetec-address, .nbetec-theme-dark .nbetec-phone { background: #000000; }
     253.nbetec-theme-dark .nbetec-address a, .nbetec-theme-dark .nbetec-phone a { color: #e2e8f0; }
     254.nbetec-theme-dark .nbetec-address a:hover, .nbetec-theme-dark .nbetec-phone a:hover { color: #fc8181; }
     255.nbetec-theme-dark .nbetec-address svg, .nbetec-theme-dark .nbetec-phone svg { color: #a0aec0; }
     256.nbetec-theme-dark .nbetec-direction { background: #000000 !important; color: #ffffff !important; border-left-color: #b91c1c !important; }
     257.nbetec-theme-dark .nbetec-direction * { color: #ffffff !important; }
     258/* Dropdown Seçiciler Koyu Tema */
     259.nbetec-theme-dark .nbetec-selector-header, .nbetec-theme-dark .nbetec-selector-dropdown {
     260    background: #1a202c !important;
     261    border-color: #2d3748 !important;
     262    color: #f7fafc !important;
     263}
     264.nbetec-theme-dark .nbetec-selector-header span, .nbetec-theme-dark .nbetec-selector-header strong { color: #f7fafc !important; }
     265.nbetec-theme-dark .nbetec-city-list li a { border-color: #2d3748 !important; color: #e2e8f0 !important; }
     266.nbetec-theme-dark .nbetec-city-list li a:hover { background: #000000 !important; }
     267.nbetec-theme-dark .nbetec-city-list .nbetec-plate { background: #000000 !important; color: #e2e8f0 !important; }
     268.nbetec-theme-dark .nbetec-selector-dropdown > div { background: #1a202c !important; border-color: #2d3748 !important; }
     269.nbetec-theme-dark .nbetec-search-input {
     270    background: #1a202c !important;
     271    border-color: #2d3748 !important;
     272    color: #f7fafc !important;
     273}
     274
     275/* Paylaş Alanı Koyu Tema */
     276.nbetec-theme-dark .nbetec-share-actions { background: #1a202c !important; border-color: #2d3748 !important; color: #e2e8f0 !important; }
     277.nbetec-theme-dark .nbetec-share-label { color: #f7fafc !important; }
     278.nbetec-theme-dark .nbetec-x-icon, .nbetec-theme-dark .nbetec-print-btn { color: #f7fafc !important; }
     279
     280/* Kontrol Satırı (Şehir, İlçe, Paylaş) Düzeni */
     281.nbetec-controls-row {
     282    display: flex;
     283    flex-direction: column;
     284    gap: 15px;
     285    margin-bottom: 20px;
     286}
     287.nbetec-share-actions {
     288    justify-content: center !important;
     289}
     290
     291@media (min-width: 768px) {
     292    .nbetec-controls-row {
     293        flex-direction: row;
     294        align-items: center;
     295    }
     296    .nbetec-city-selector, .nbetec-district-selector, .nbetec-share-actions {
     297        flex: 1;
     298        margin-bottom: 0 !important;
     299    }
     300}
     301
     302/* ========================================= */
     303/* YENI WIDGET TASARIMI (THEME INDEPENDENT)  */
     304/* ========================================= */
     305.nbetec-nw-container {
     306    all: initial !important; /* Reset everything */
     307    display: block !important;
     308    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     309    border-radius: 4px !important;
     310    overflow: hidden !important;
     311    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
     312    background: #fff !important;
     313    border: 1px solid #e2e8f0 !important;
     314}
     315
     316/* Header */
     317.nbetec-nw-theme-red_list .nbetec-nw-header {
     318    background: #b91c1c !important;
     319    padding: 15px !important;
     320    display: flex !important;
     321    align-items: center !important;
     322    gap: 12px !important;
     323}
     324.nbetec-nw-logo-box {
     325    border: 2px solid #ffffff !important;
     326    color: #ffffff !important;
     327    font-size: 24px !important;
     328    font-weight: bold !important;
     329    width: 38px !important;
     330    height: 38px !important;
     331    display: flex !important;
     332    align-items: center !important;
     333    justify-content: center !important;
     334    flex-shrink: 0 !important;
     335    line-height: 1 !important;
     336}
     337.nbetec-nw-title-box {
     338    display: flex !important;
     339    flex-direction: column !important;
     340}
     341.nbetec-nw-title {
     342    color: #ffffff !important;
     343    font-weight: 900 !important;
     344    font-size: 16px !important;
     345    line-height: 1.2 !important;
     346    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     347}
     348.nbetec-nw-city {
     349    color: #ffffff !important;
     350    font-weight: bold !important;
     351    font-size: 14px !important;
     352    margin-top: 2px !important;
     353    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     354}
     355
     356/* Dates */
     357.nbetec-nw-theme-red_list .nbetec-nw-dates {
     358    background: #2d3748 !important;
     359    padding: 12px 15px !important;
     360    display: flex !important;
     361    flex-direction: column !important;
     362    gap: 8px !important;
     363}
     364.nbetec-nw-date-row {
     365    display: flex !important;
     366    align-items: center !important;
     367    gap: 8px !important;
     368}
     369.nbetec-nw-calendar-icon {
     370    width: 16px !important;
     371    height: 16px !important;
     372    color: #cbd5e0 !important;
     373    flex-shrink: 0 !important;
     374}
     375.nbetec-nw-date-row span {
     376    color: #ffffff !important;
     377    box-shadow: none !important;
     378}
     379.nbetec-filter-btn:hover { border-color: #cbd5e0; background: #f7fafc; color: #4a5568; text-decoration: none; }
     380.nbetec-filter-btn.active { border-color: #3182ce; color: #3182ce; background: #ebf8ff; font-weight: 700; }
     381.nbetec-filter-icon { margin-right: 6px; font-size: 12px; font-weight: bold; }
     382
     383.nbetec-shortcode { max-width: 1000px; margin: 0 auto; font-family: inherit; }
     384.nbetec-shortcode .nbetec-header .nbetec-title {
     385    background: linear-gradient(135deg, #e53e3e, #c53030);
     386    -webkit-background-clip: text;
     387    -webkit-text-fill-color: transparent;
     388    display: inline-block;
     389}
     390.nbetec-search-wrapper { position: relative; max-width: 600px; margin: 0 auto 30px auto; }
     391.nbetec-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); pointer-events: none; transition: stroke 0.3s ease; }
     392#nbetec-city-search {
     393    width: 100%; padding: 16px 20px 16px 45px; font-size: 16px; border: 2px solid #e2e8f0;
     394    border-radius: 30px; outline: none; background: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.02); transition: all 0.3s ease;
     395}
     396#nbetec-city-search:focus { border-color: #e53e3e; box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.15); }
     397#nbetec-city-search:focus + .nbetec-search-icon, #nbetec-city-search:focus ~ .nbetec-search-icon { stroke: #e53e3e; }
     398.nbetec-city-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px; }
     399@media (max-width: 992px) { .nbetec-city-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }
     400@media (max-width: 480px) {
     401    .nbetec-city-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
     402    .nbetec-city-card { padding: 10px 4px; }
     403    .nbetec-city-plate { font-size: 18px; margin-bottom: 4px; }
     404    .nbetec-city-name { font-size: 11px; word-break: break-word; line-height: 1.2; }
     405}
     406.nbetec-city-card {
     407    display: flex; flex-direction: column; align-items: center; justify-content: center;
     408    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px 10px;
     409    text-decoration: none; color: #2d3748; transition: all 0.2s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.02);
     410}
     411.nbetec-city-card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.08); border-color: #e53e3e; color: #e53e3e; }
     412.nbetec-city-card:hover .nbetec-city-plate { color: #c53030; }
     413
     414/* Anasayfa İl Seçimi Koyu Tema */
     415.nbetec-theme-dark .nbetec-header .nbetec-title { color: #ffffff; }
     416.nbetec-theme-dark .nbetec-desc, .nbetec-theme-dark .nbetec-header p { color: #ffffff; }
     417.nbetec-theme-dark #nbetec-city-search {
     418    background: #2d3748;
     419    border-color: #4a5568;
     420    color: #f7fafc;
     421}
     422.nbetec-theme-dark #nbetec-city-search::placeholder { color: #a0aec0; }
     423.nbetec-theme-dark .nbetec-search-icon { stroke: #a0aec0; }
     424
     425.nbetec-theme-dark .nbetec-city-card {
     426    background: #2d3748;
     427    border-color: #4a5568;
     428}
     429.nbetec-theme-dark .nbetec-city-card:hover {
     430    background: #1a202c;
     431    border-color: #fc8181;
     432    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
     433}
     434.nbetec-theme-dark .nbetec-city-plate { color: #fc8181; }
     435.nbetec-theme-dark .nbetec-city-name { color: #e2e8f0; }
     436.nbetec-theme-dark .nbetec-city-card:hover .nbetec-city-name { color: #f7fafc; }
     437
     438/* Shortcode / Eczane Listesi Koyu Tema */
     439.nbetec-theme-dark .nbetec-card {
     440    background: #1a202c;
     441    border-color: #2d3748;
     442    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
     443}
     444.nbetec-theme-dark .nbetec-card:hover { border-color: #fc8181; box-shadow: 0 10px 20px rgba(0,0,0,0.7); }
     445.nbetec-theme-dark .nbetec-name { color: #f7fafc; }
     446.nbetec-theme-dark .nbetec-ilce { background: #000000; color: #90cdf4; }
     447.nbetec-theme-dark .nbetec-address, .nbetec-theme-dark .nbetec-phone { background: #000000; }
     448.nbetec-theme-dark .nbetec-address a, .nbetec-theme-dark .nbetec-phone a { color: #e2e8f0; }
     449.nbetec-theme-dark .nbetec-address a:hover, .nbetec-theme-dark .nbetec-phone a:hover { color: #fc8181; }
     450.nbetec-theme-dark .nbetec-address svg, .nbetec-theme-dark .nbetec-phone svg { color: #a0aec0; }
     451.nbetec-theme-dark .nbetec-direction { background: #000000 !important; color: #ffffff !important; border-left-color: #b91c1c !important; }
     452.nbetec-theme-dark .nbetec-direction * { color: #ffffff !important; }
     453/* Dropdown Seçiciler Koyu Tema */
     454.nbetec-theme-dark .nbetec-selector-header, .nbetec-theme-dark .nbetec-selector-dropdown {
     455    background: #1a202c !important;
     456    border-color: #2d3748 !important;
     457    color: #f7fafc !important;
     458}
     459.nbetec-theme-dark .nbetec-selector-header span, .nbetec-theme-dark .nbetec-selector-header strong { color: #f7fafc !important; }
     460.nbetec-theme-dark .nbetec-city-list li a { border-color: #2d3748 !important; color: #e2e8f0 !important; }
     461.nbetec-theme-dark .nbetec-city-list li a:hover { background: #000000 !important; }
     462.nbetec-theme-dark .nbetec-city-list .nbetec-plate { background: #000000 !important; color: #e2e8f0 !important; }
     463.nbetec-theme-dark .nbetec-selector-dropdown > div { background: #1a202c !important; border-color: #2d3748 !important; }
     464.nbetec-theme-dark .nbetec-search-input {
     465    background: #1a202c !important;
     466    border-color: #2d3748 !important;
     467    color: #f7fafc !important;
     468}
     469
     470/* Paylaş Alanı Koyu Tema */
     471.nbetec-theme-dark .nbetec-share-actions { background: #1a202c !important; border-color: #2d3748 !important; color: #e2e8f0 !important; }
     472.nbetec-theme-dark .nbetec-share-label { color: #f7fafc !important; }
     473.nbetec-theme-dark .nbetec-x-icon, .nbetec-theme-dark .nbetec-print-btn { color: #f7fafc !important; }
     474
     475/* Kontrol Satırı (Şehir, İlçe, Paylaş) Düzeni */
     476.nbetec-controls-row {
     477    display: flex;
     478    flex-direction: column;
     479    gap: 15px;
     480    margin-bottom: 20px;
     481}
     482.nbetec-share-actions {
     483    justify-content: center !important;
     484}
     485
     486@media (min-width: 768px) {
     487    .nbetec-controls-row {
     488        flex-direction: row;
     489        align-items: center;
     490    }
     491    .nbetec-city-selector, .nbetec-district-selector, .nbetec-share-actions {
     492        flex: 1;
     493        margin-bottom: 0 !important;
     494    }
     495}
     496
     497/* ========================================= */
     498/* YENI WIDGET TASARIMI (THEME INDEPENDENT)  */
     499/* ========================================= */
     500.nbetec-nw-container {
     501    all: initial !important; /* Reset everything */
     502    display: block !important;
     503    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     504    border-radius: 4px !important;
     505    overflow: hidden !important;
     506    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
     507    background: #fff !important;
     508    border: 1px solid #e2e8f0 !important;
     509}
     510
     511/* Header */
     512.nbetec-nw-theme-red_list .nbetec-nw-header {
     513    background: #b91c1c !important;
     514    padding: 15px !important;
     515    display: flex !important;
     516    align-items: center !important;
     517    gap: 12px !important;
     518}
     519.nbetec-nw-logo-box {
     520    border: 2px solid #ffffff !important;
     521    color: #ffffff !important;
     522    font-size: 24px !important;
     523    font-weight: bold !important;
     524    width: 38px !important;
     525    height: 38px !important;
     526    display: flex !important;
     527    align-items: center !important;
     528    justify-content: center !important;
     529    flex-shrink: 0 !important;
     530    line-height: 1 !important;
     531}
     532.nbetec-nw-title-box {
     533    display: flex !important;
     534    flex-direction: column !important;
     535}
     536.nbetec-nw-title {
     537    color: #ffffff !important;
     538    font-weight: 900 !important;
     539    font-size: 16px !important;
     540    line-height: 1.2 !important;
     541    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     542}
     543.nbetec-nw-city {
     544    color: #ffffff !important;
     545    font-weight: bold !important;
     546    font-size: 14px !important;
     547    margin-top: 2px !important;
     548    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     549}
     550
     551/* Dates */
     552.nbetec-nw-theme-red_list .nbetec-nw-dates {
     553    background: #2d3748 !important;
     554    padding: 12px 15px !important;
     555    display: flex !important;
     556    flex-direction: column !important;
     557    gap: 8px !important;
     558}
     559.nbetec-nw-date-row {
     560    display: flex !important;
     561    align-items: center !important;
     562    gap: 8px !important;
     563}
     564.nbetec-nw-calendar-icon {
     565    width: 16px !important;
     566    height: 16px !important;
     567    color: #cbd5e0 !important;
     568    flex-shrink: 0 !important;
     569}
     570.nbetec-nw-date-row span {
     571    color: #ffffff !important;
     572    font-size: 13px !important;
     573    font-weight: 600 !important;
     574    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     575}
     576
     577/* List */
     578.nbetec-nw-list {
     579    list-style: none !important;
     580    margin: 0 !important;
     581    padding: 0 !important;
     582    max-height: 320px !important;
     583    overflow-y: auto !important;
     584    background: #ffffff !important;
     585}
     586.nbetec-nw-theme-red_list .nbetec-nw-list {
     587    scrollbar-width: auto !important;
     588    scrollbar-color: #ffffff #b91c1c !important;
     589}
     590.nbetec-nw-theme-red_list .nbetec-nw-list::-webkit-scrollbar-track {
     591    background: #b91c1c !important;
     592}
     593.nbetec-nw-theme-red_list .nbetec-nw-list::-webkit-scrollbar-thumb {
     594    background: #ffffff !important;
     595    border-radius: 3px !important;
     596}
     597.nbetec-nw-theme-red_list .nbetec-nw-list::-webkit-scrollbar-thumb:hover {
     598    background: #f7fafc !important;
     599}
     600.nbetec-nw-list li::before, .nbetec-nw-list li::after {
     601    display: none !important;
     602    content: none !important;
     603}
     604.nbetec-nw-item {
     605    list-style: none !important;
     606    margin: 0 !important;
     607    padding: 12px 15px !important;
     608    border-bottom: 1px solid #edf2f7 !important;
     609}
     610.nbetec-nw-theme-red_list .nbetec-nw-item {
     611    background: #b91c1c !important;
     612    border-bottom: 1px solid #9b2c2c !important;
     613}
     614.nbetec-nw-item:last-child {
     615    border-bottom: none !important;
     616}
     617
     618.nbetec-nw-item-header {
     619    display: flex !important;
     620    align-items: center !important;
     621    gap: 10px !important;
     622    margin-bottom: 10px !important;
     623}
     624
     625.nbetec-nw-item-logo {
     626    background: #b91c1c !important;
     627    color: #ffffff !important;
     628    width: 26px !important;
     629    height: 26px !important;
     630    display: flex !important;
     631    align-items: center !important;
     632    justify-content: center !important;
     633    font-weight: bold !important;
     634    font-size: 16px !important;
     635    border-radius: 4px !important;
     636    flex-shrink: 0 !important;
     637}
     638.nbetec-nw-theme-red_list .nbetec-nw-item-logo {
     639    background: #ffffff !important;
     640    color: #b91c1c !important;
     641}
     642
     643.nbetec-nw-item-name-box {
     644    display: flex !important;
     645    flex-direction: column !important;
     646}
     647
     648.nbetec-nw-item-name {
     649    font-weight: bold !important;
     650    font-size: 15px !important;
     651    color: #1a202c !important;
     652    line-height: 1.2 !important;
     653    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     654}
     655.nbetec-nw-theme-red_list .nbetec-nw-item-name {
     656    color: #ffffff !important;
     657}
     658
     659.nbetec-nw-item-district {
     660    font-size: 13px !important;
     661    color: #718096 !important;
     662    margin-top: 2px !important;
     663    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     664}
     665.nbetec-nw-theme-red_list .nbetec-nw-item-district {
     666    color: #fed7d7 !important;
     667}
     668
     669.nbetec-nw-item-details {
     670    display: flex !important;
     671    flex-direction: column !important;
     672    gap: 6px !important;
     673}
     674
     675.nbetec-nw-phone, .nbetec-nw-address {
     676    display: flex !important;
     677    align-items: flex-start !important;
     678    gap: 6px !important;
     679    color: #4a5568 !important;
     680    text-decoration: none !important;
     681    font-size: 13px !important;
     682    line-height: 1.4 !important;
     683    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     684}
     685.nbetec-nw-theme-red_list .nbetec-nw-phone,
     686.nbetec-nw-theme-red_list .nbetec-nw-address {
     687    color: #ffffff !important;
     688}
     689.nbetec-nw-phone:hover, .nbetec-nw-address:hover {
     690    color: #b91c1c !important;
     691}
     692.nbetec-nw-theme-red_list .nbetec-nw-phone:hover,
     693.nbetec-nw-theme-red_list .nbetec-nw-address:hover {
     694    color: #fed7d7 !important;
     695}
     696.nbetec-nw-phone svg, .nbetec-nw-address svg {
     697    width: 14px !important;
     698    height: 14px !important;
     699    flex-shrink: 0 !important;
     700    margin-top: 2px !important;
     701    color: #a0aec0 !important;
     702}
     703.nbetec-nw-theme-red_list .nbetec-nw-phone svg,
     704.nbetec-nw-theme-red_list .nbetec-nw-address svg {
     705    color: #fed7d7 !important;
     706}
     707
     708.nbetec-nw-directions {
     709    font-size: 12px !important;
     710    color: #b91c1c !important;
     711    background: #fef2f2 !important;
     712    padding: 6px 10px !important;
     713    border-radius: 4px !important;
     714    margin-top: 4px !important;
     715    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     716}
     717.nbetec-nw-theme-red_list .nbetec-nw-directions {
     718    color: #ffffff !important;
     719    background: #9b2c2c !important;
     720}
     721
     722.nbetec-nw-more-link {
     723    background: #f7fafc !important;
     724    padding: 12px !important;
     725    text-align: center !important;
     726    border-top: 1px solid #edf2f7 !important;
     727}
     728.nbetec-nw-theme-red_list .nbetec-nw-more-link {
     729    background: #b91c1c !important;
     730    border-top: 1px solid #9b2c2c !important;
     731}
     732.nbetec-nw-more-link a {
     733    color: #3182ce !important;
     734    text-decoration: none !important;
     735    font-weight: bold !important;
     736    font-size: 14px !important;
     737    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     738}
     739.nbetec-nw-theme-red_list .nbetec-nw-more-link a {
     740    color: #ffffff !important;
     741}
     742.nbetec-nw-more-link a:hover {
     743    text-decoration: underline !important;
     744}
     745.nbetec-nw-theme-red_list .nbetec-nw-more-link a:hover {
     746    color: #fed7d7 !important;
     747}
     748
     749/* ========================================= */
     750/* LIGHT THEME OVERRIDES (AÇIK MOD)          */
     751/* ========================================= */
     752
     753.nbetec-nw-theme-light .nbetec-nw-header {
     754    background: #ffffff !important;
     755    padding: 15px !important;
     756    display: flex !important;
     757    align-items: center !important;
     758    gap: 12px !important;
     759    border-bottom: 1px solid #edf2f7 !important;
     760}
     761.nbetec-nw-theme-light .nbetec-nw-logo-box {
     762    border: 2px solid #b91c1c !important;
     763    color: #ffffff !important;
     764    background: #b91c1c !important;
     765}
     766.nbetec-nw-theme-light .nbetec-nw-title {
     767    color: #1a202c !important;
     768}
     769.nbetec-nw-theme-light .nbetec-nw-city {
     770    color: #e53e3e !important;
     771}
     772
     773.nbetec-nw-theme-light .nbetec-nw-dates {
     774    background: #f7fafc !important;
     775    padding: 12px 15px !important;
     776    display: flex !important;
     777    flex-direction: column !important;
     778    gap: 8px !important;
     779    border-bottom: 1px solid #edf2f7 !important;
     780}
     781.nbetec-nw-theme-light .nbetec-nw-date-row span {
     782    color: #4a5568 !important;
     783}
     784.nbetec-nw-theme-light .nbetec-nw-calendar-icon {
     785    color: #a0aec0 !important;
     786}
     787
     788.nbetec-nw-alert {
     789    padding: 15px !important;
     790    color: #c53030 !important;
     791    background: #fff5f5 !important;
     792    font-size: 14px !important;
     793    text-align: center !important;
     794    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
     795}
     796
     797/* ========================================= */
     798/* DARK THEME OVERRIDES (KARANLIK MOD)       */
     799/* ========================================= */
     800.nbetec-nw-theme-dark {
     801    background: #1a202c !important;
     802    border-color: #2d3748 !important;
     803}
     804.nbetec-nw-theme-dark .nbetec-nw-header {
     805    background: #1a202c !important;
     806    border-bottom: 1px solid #2d3748 !important;
     807    padding: 15px !important;
     808    display: flex !important;
     809    align-items: center !important;
     810    gap: 12px !important;
     811}
     812.nbetec-nw-theme-dark .nbetec-nw-logo-box {
     813    border-color: #e53e3e !important;
     814    color: #e53e3e !important;
     815    background: transparent !important;
     816}
     817.nbetec-nw-theme-dark .nbetec-nw-title {
     818    color: #f7fafc !important;
     819}
     820.nbetec-nw-theme-dark .nbetec-nw-city {
     821    color: #fc8181 !important;
     822}
     823
     824.nbetec-nw-theme-dark .nbetec-nw-dates {
     825    background: #2d3748 !important;
     826    border-bottom: 1px solid #4a5568 !important;
     827    padding: 12px 15px !important;
     828    display: flex !important;
     829    flex-direction: column !important;
     830    gap: 8px !important;
     831}
     832.nbetec-nw-theme-dark .nbetec-nw-date-row span {
     833    color: #e2e8f0 !important;
     834}
     835.nbetec-nw-theme-dark .nbetec-nw-calendar-icon {
     836    color: #a0aec0 !important;
     837}
     838
     839.nbetec-nw-theme-dark .nbetec-nw-list {
     840    background: #1a202c !important;
     841    scrollbar-color: #4a5568 #1a202c !important;
     842}
     843.nbetec-nw-theme-dark .nbetec-nw-list::-webkit-scrollbar-track {
     844    background: #1a202c !important;
     845}
     846.nbetec-nw-theme-dark .nbetec-nw-list::-webkit-scrollbar-thumb {
     847    background: #4a5568 !important;
     848}
     849.nbetec-nw-theme-dark .nbetec-nw-list::-webkit-scrollbar-thumb:hover {
     850    background: #718096 !important;
     851}
     852
     853.nbetec-nw-theme-dark .nbetec-nw-item {
     854    border-bottom: 1px solid #2d3748 !important;
     855}
     856.nbetec-nw-theme-dark .nbetec-nw-item-logo {
     857    background: #2d3748 !important;
     858    color: #fc8181 !important;
     859}
     860.nbetec-nw-theme-dark .nbetec-nw-item-name {
     861    color: #e2e8f0 !important;
     862}
     863.nbetec-nw-theme-dark .nbetec-nw-item-district {
     864    color: #a0aec0 !important;
     865}
     866.nbetec-nw-theme-dark .nbetec-nw-phone,
     867.nbetec-nw-theme-dark .nbetec-nw-address {
     868    color: #a0aec0 !important;
     869}
     870.nbetec-nw-theme-dark .nbetec-nw-phone:hover,
     871.nbetec-nw-theme-dark .nbetec-nw-address:hover {
     872    color: #fc8181 !important;
     873}
     874.nbetec-nw-theme-dark .nbetec-nw-phone svg,
     875.nbetec-nw-theme-dark .nbetec-nw-address svg {
     876    color: #718096 !important;
     877}
     878.nbetec-nw-theme-dark .nbetec-nw-phone:hover svg,
     879.nbetec-nw-theme-dark .nbetec-nw-address:hover svg {
     880    color: #fc8181 !important;
     881}
     882
     883.nbetec-nw-theme-dark .nbetec-nw-directions {
     884    background: #2d3748 !important;
     885    color: #cbd5e0 !important;
     886}
     887
     888.nbetec-nw-theme-dark .nbetec-nw-more-link {
     889    background: #1a202c !important;
     890    border-top: 1px solid #2d3748 !important;
     891}
     892.nbetec-nw-theme-dark .nbetec-nw-more-link a {
     893    color: #63b3ed !important;
     894}
     895.nbetec-nw-theme-dark .nbetec-nw-more-link a:hover {
     896    color: #90cdf4 !important;
     897}
  • nobetci-eczaneler/trunk/assets/js/admin.js

    r3585474 r3638928  
    1313       
    1414        if (il) {
     15            $('#nbetec-page-builder-section').slideDown();
    1516            sc += ' il="' + il + '"';
    16             var urlPath = il;
    1717           
    18             if (ilce && ilce !== '') {
    19                 sc += ' ilce="' + ilce + '"';
    20                 urlPath += '-' + ilce;
     18            if (nbetecAdminVars.permalinkStructure) {
     19                var urlPath = il;
     20                if (ilce && ilce !== '') {
     21                    sc += ' ilce="' + ilce + '"';
     22                    urlPath += '-' + ilce;
     23                }
     24                urlPath += '-nobetci-eczaneleri';
     25                url = siteUrl + '/' + urlPath;
     26            } else {
     27                url = siteUrl + '/?nobetci_il=' + il;
     28                if (ilce && ilce !== '') {
     29                    sc += ' ilce="' + ilce + '"';
     30                    url += '&nobetci_ilce=' + ilce;
     31                }
    2132            }
    22             urlPath += '-nobetci-eczaneleri';
    23             url = siteUrl + '/' + urlPath;
     33        } else {
     34            $('#nbetec-page-builder-section').slideUp();
    2435        }
    2536        sc += ']';
    … …  
    6677   
    6778    $('#builder-ilce').on('change', updateBuilder);
     79   
     80    // Bulk Page Builder Logic
     81    $('#nbetec-create-pages-btn').on('click', function() {
     82        var il = $('#builder-il').val();
     83        var ilName = $('#builder-il option:selected').text();
     84        var createDistricts = $('#nbetec-create-district-pages').is(':checked') ? 1 : 0;
     85       
     86        if (!il) return;
     87       
     88        if (!confirm(nbetecAdminVars.i18n.confirmCreate)) {
     89            return;
     90        }
     91       
     92        var btn = $(this);
     93        var btnText = $('#nbetec-create-pages-btn-text');
     94        var originalText = btnText.text();
     95        var statusDiv = $('#nbetec-page-builder-status');
     96       
     97        btn.prop('disabled', true);
     98        btnText.text(nbetecAdminVars.i18n.creating);
     99        statusDiv.hide();
     100       
     101        $.post(ajaxurl, {
     102            action: 'nbetec_create_city_pages',
     103            nonce: nonce,
     104            il_slug: il,
     105            il_name: ilName,
     106            create_districts: createDistricts
     107        }, function(response) {
     108            btn.prop('disabled', false);
     109            btnText.text(originalText);
     110           
     111            if (response.success) {
     112                statusDiv.html('✅ ' + response.data.message).show();
     113            } else {
     114                statusDiv.html('❌ Hata: ' + response.data).show();
     115            }
     116        }).fail(function() {
     117            btn.prop('disabled', false);
     118            btnText.text(originalText);
     119            statusDiv.html('❌ ' + nbetecAdminVars.i18n.error).show();
     120        });
     121    });
    68122});
    69123
    … …  
    86140    });
    87141}
     142
     143// Tab Switching Logic
     144jQuery(document).ready(function($) {
     145    $('.nbetec-admin-tab').on('click', function(e) {
     146        e.preventDefault();
     147       
     148        // Remove active class from all tabs and panes
     149        $('.nbetec-admin-tab').removeClass('active');
     150        $('.nbetec-tab-pane').removeClass('active');
     151       
     152        // Add active class to clicked tab
     153        $(this).addClass('active');
     154       
     155        // Show target pane
     156        var targetId = $(this).data('target');
     157        $('#' + targetId).addClass('active');
     158       
     159        // Save current tab to localStorage
     160        localStorage.setItem('nbetec_active_admin_tab', targetId);
     161    });
     162   
     163    // Restore active tab on load
     164    var savedTab = localStorage.getItem('nbetec_active_admin_tab');
     165    if (savedTab && $('#' + savedTab).length) {
     166        $('.nbetec-admin-tab[data-target="' + savedTab + '"]').click();
     167    }
     168});
  • nobetci-eczaneler/trunk/assets/js/frontend.js

    r3605267 r3638928  
    1313
    1414    // Dropdown Logic
    15     const header = document.querySelector('.nbetec-selector-header');
    16     const dropdown = document.querySelector('.nbetec-selector-dropdown');
    17     const search = document.querySelector('.nbetec-search-input');
    18     const items = document.querySelectorAll('.nbetec-city-list li');
     15    const dropdownContainers = document.querySelectorAll('.nbetec-city-selector, .nbetec-district-selector');
     16   
     17    dropdownContainers.forEach(container => {
     18        const header = container.querySelector('.nbetec-selector-header');
     19        const dropdown = container.querySelector('.nbetec-selector-dropdown');
     20        const search = container.querySelector('.nbetec-search-input');
     21        const items = container.querySelectorAll('.nbetec-city-list li');
     22       
     23        if (header && dropdown) {
     24            header.addEventListener('click', function(e) {
     25                e.stopPropagation();
     26                // Hide other dropdowns
     27                document.querySelectorAll('.nbetec-selector-dropdown').forEach(d => {
     28                    if (d !== dropdown) d.style.display = 'none';
     29                });
     30               
     31                const isShowing = dropdown.style.display === 'block';
     32                dropdown.style.display = isShowing ? 'none' : 'block';
     33                if(!isShowing && search) {
     34                    search.focus();
     35                    search.value = '';
     36                    items.forEach(item => item.style.display = '');
     37                }
     38            });
    1939
    20     if (header && dropdown && search) {
    21         header.addEventListener('click', function(e) {
    22             e.stopPropagation();
    23             const isShowing = dropdown.style.display === 'block';
    24             dropdown.style.display = isShowing ? 'none' : 'block';
    25             if(!isShowing) {
    26                 search.focus();
    27                 search.value = '';
    28                 items.forEach(item => item.style.display = '');
     40            dropdown.addEventListener('click', function(e) {
     41                e.stopPropagation();
     42            });
     43
     44            if (search) {
     45                search.addEventListener('input', function(e) {
     46                    const term = trToLower(e.target.value).trim();
     47                    const normalizedTerm = normalizeTr(term);
     48
     49                    items.forEach(item => {
     50                        const text = trToLower(item.textContent);
     51                        const normalizedText = normalizeTr(text);
     52                        item.style.display = text.includes(term) || normalizedText.includes(normalizedTerm) ? '' : 'none';
     53                    });
     54                });
    2955            }
     56        }
     57    });
     58
     59    document.addEventListener('click', function() {
     60        document.querySelectorAll('.nbetec-selector-dropdown').forEach(d => {
     61            d.style.display = 'none';
    3062        });
    31 
    32         document.addEventListener('click', function() {
    33             dropdown.style.display = 'none';
    34         });
    35 
    36         dropdown.addEventListener('click', function(e) {
    37             e.stopPropagation();
    38         });
    39 
    40         search.addEventListener('input', function(e) {
    41             const term = trToLower(e.target.value).trim();
    42             const normalizedTerm = normalizeTr(term);
    43 
    44             items.forEach(item => {
    45                 const text = trToLower(item.textContent);
    46                 const normalizedText = normalizeTr(text);
    47                
    48                 item.style.display = text.includes(term) || normalizedText.includes(normalizedTerm) ? '' : 'none';
    49             });
    50         });
    51     }
     63    });
    5264
    5365    // Home Search Logic
  • nobetci-eczaneler/trunk/includes/class-admin.php

    r3585474 r3638928  
    1313        // AJAX endpoint for fetching districts
    1414        add_action('wp_ajax_nbetec_get_districts', array($this, 'ajax_get_districts'));
     15        add_action('wp_ajax_nbetec_create_city_pages', array($this, 'ajax_create_city_pages'));
    1516    }
    1617
    … …  
    2021        }
    2122       
     23        wp_enqueue_style('nbetec-admin-style', plugin_dir_url(dirname(__FILE__)) . 'assets/css/admin.css', array(), '1.0.0');
    2224        wp_enqueue_script('nbetec-admin-script', plugin_dir_url(dirname(__FILE__)) . 'assets/js/admin.js', array('jquery'), '1.0.0', true);
    2325       
    … …  
    2527            'nonce' => wp_create_nonce('nbetec_admin_nonce'),
    2628            'siteUrl' => rtrim(site_url(), '/'),
     29            'permalinkStructure' => get_option('permalink_structure'),
    2730            'i18n' => array(
    2831                'selectFirst' => __('Önce il seçiniz...', 'nobetci-eczaneler'),
    … …  
    3134                'notFound' => __('İlçe bulunamadı veya hata oluştu.', 'nobetci-eczaneler'),
    3235                'error' => __('Bağlantı hatası.', 'nobetci-eczaneler'),
    33                 'copyFail' => __('Kopyalama başarısız oldu. Lütfen manuel seçip kopyalayın.', 'nobetci-eczaneler')
     36                'copyFail' => __('Kopyalama başarısız oldu. Lütfen manuel seçip kopyalayın.', 'nobetci-eczaneler'),
     37                'confirmCreate' => __('Bu il için otomatik sayfa oluşturmak istediğinize emin misiniz? (Eğer sayfalar zaten varsa yeniden oluşturulmaz)', 'nobetci-eczaneler'),
     38                'creating' => __('Sayfalar oluşturuluyor, lütfen bekleyin...', 'nobetci-eczaneler')
    3439            )
    3540        ));
    … …  
    6065        sort($districts);
    6166        wp_send_json_success($districts);
     67    }
     68   
     69    public function ajax_create_city_pages() {
     70        check_ajax_referer('nbetec_admin_nonce', 'nonce');
     71       
     72        if (!current_user_can('manage_options') && !current_user_can('publish_pages')) {
     73            wp_send_json_error(__('Yetkiniz yok.', 'nobetci-eczaneler'));
     74        }
     75       
     76        $il_slug = isset($_POST['il_slug']) ? sanitize_title(wp_unslash($_POST['il_slug'])) : '';
     77        $il_name = isset($_POST['il_name']) ? sanitize_text_field(wp_unslash($_POST['il_name'])) : '';
     78        $create_districts = isset($_POST['create_districts']) ? intval($_POST['create_districts']) : 0;
     79       
     80        if (empty($il_slug) || empty($il_name)) {
     81            wp_send_json_error(__('Geçersiz il bilgisi.', 'nobetci-eczaneler'));
     82        }
     83       
     84        $created = 0;
     85        $existed = 0;
     86       
     87        // Create Parent City Page
     88        $parent_slug = $il_slug . '-nobetci-eczaneleri';
     89        $parent_title = $il_name . ' Nöbetçi Eczaneleri';
     90        $parent_content = '[nobetci-eczane il="' . $il_slug . '"]';
     91       
     92        $parent_id = 0;
     93        $page_check = get_page_by_path($parent_slug);
     94       
     95        if ($page_check) {
     96            $parent_id = $page_check->ID;
     97            $existed++;
     98        } else {
     99            $parent_id = wp_insert_post(array(
     100                'post_title'    => $parent_title,
     101                'post_name'     => $parent_slug,
     102                'post_content'  => $parent_content,
     103                'post_status'   => 'publish',
     104                'post_type'     => 'page',
     105            ));
     106           
     107            if ($parent_id && !is_wp_error($parent_id)) {
     108                $created++;
     109            } else {
     110                wp_send_json_error(__('Ana il sayfası oluşturulamadı.', 'nobetci-eczaneler'));
     111            }
     112        }
     113       
     114        // Create District Pages if requested
     115        if ($create_districts && $parent_id && !is_wp_error($parent_id)) {
     116            $api = new NBETEC_API();
     117            $data = $api->get_eczane_data($il_slug);
     118           
     119            if ($data && !empty($data['data'][0])) {
     120                $districts = array();
     121                foreach ($data['data'][0] as $eczane) {
     122                    if (!empty($eczane['ilce']) && !in_array($eczane['ilce'], $districts)) {
     123                        $districts[] = $eczane['ilce'];
     124                    }
     125                }
     126               
     127                foreach ($districts as $ilce) {
     128                    $ilce_slug = sanitize_title($ilce);
     129                    $child_slug = $il_slug . '-' . $ilce_slug . '-nobetci-eczaneleri';
     130                    $child_title = $il_name . ' ' . $ilce . ' Nöbetçi Eczaneleri';
     131                    $child_content = '[nobetci-eczane il="' . $il_slug . '" ilce="' . $ilce_slug . '"]';
     132                   
     133                    // Check if child page exists under this parent
     134                    $child_page_check = get_page_by_path($parent_slug . '/' . $child_slug);
     135                    if ($child_page_check) {
     136                        $existed++;
     137                    } else {
     138                        // Fallback check by direct slug (if path is different)
     139                        $direct_check = get_posts(array(
     140                            'name'        => $child_slug,
     141                            'post_type'   => 'page',
     142                            'post_status' => 'publish',
     143                            'post_parent' => $parent_id,
     144                            'numberposts' => 1
     145                        ));
     146                       
     147                        if ($direct_check) {
     148                            $existed++;
     149                        } else {
     150                            $child_id = wp_insert_post(array(
     151                                'post_title'    => $child_title,
     152                                'post_name'     => $child_slug,
     153                                'post_content'  => $child_content,
     154                                'post_status'   => 'publish',
     155                                'post_type'     => 'page',
     156                                'post_parent'   => $parent_id,
     157                            ));
     158                            if ($child_id && !is_wp_error($child_id)) {
     159                                $created++;
     160                            }
     161                        }
     162                    }
     163                }
     164            }
     165        }
     166       
     167        $msg = '';
     168        if ($created > 0) {
     169            $msg .= sprintf(__('%d yeni sayfa oluşturuldu. ', 'nobetci-eczaneler'), $created);
     170        }
     171        if ($existed > 0) {
     172            $msg .= sprintf(__('%d sayfa zaten mevcuttu. ', 'nobetci-eczaneler'), $existed);
     173        }
     174        if ($created == 0 && $existed == 0) {
     175            $msg = __('Hiçbir sayfa oluşturulmadı.', 'nobetci-eczaneler');
     176        }
     177       
     178        wp_send_json_success(array(
     179            'message' => $msg,
     180            'created' => $created,
     181            'existed' => $existed
     182        ));
    62183    }
    63184
    … …  
    77198        $admin_notice = '';
    78199
    79         // Update Ad Settings
    80         if (isset($_POST['nbetec_save_ads']) && check_admin_referer('nbetec_save_ads_action', 'nbetec_save_ads_nonce')) {
     200        // Handle settings save
     201        if (isset($_POST['nbetec_save_settings']) && check_admin_referer('nbetec_save_settings_action', 'nbetec_save_settings_nonce')) {
    81202            if (isset($_POST['nbetec_ad_code'])) {
    82203                if (current_user_can('unfiltered_html')) {
    83                     // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    84204                    update_option('nbetec_ad_code', wp_unslash($_POST['nbetec_ad_code']));
    85205                } else {
    … …  
    87207                }
    88208            }
     209           
    89210            if (isset($_POST['nbetec_ad_frequency'])) {
    90211                update_option('nbetec_ad_frequency', intval($_POST['nbetec_ad_frequency']));
    91212            }
    92             $admin_notice .= '<div style="background: #fff; border-left: 4px solid #00a32a; padding: 12px 15px; margin: 20px 0; box-shadow: 0 1px 1px rgba(0,0,0,.04);"><p style="margin: 0; font-size: 14px;">✅ ' . esc_html__('Reklam ayarları başarıyla kaydedildi!', 'nobetci-eczaneler') . '</p></div>';
     213           
     214            if (isset($_POST['nbetec_global_theme'])) {
     215                update_option('nbetec_global_theme', sanitize_text_field($_POST['nbetec_global_theme']));
     216            }
     217
     218            if (isset($_POST['nbetec_enable_seo'])) {
     219                update_option('nbetec_enable_seo', 'on');
     220            } else {
     221                update_option('nbetec_enable_seo', 'off'); // Checkbox was unchecked
     222            }
     223           
     224            $admin_notice .= '<div style="background: #fff; border-left: 4px solid #00a32a; padding: 12px 15px; margin: 20px 0; box-shadow: 0 1px 1px rgba(0,0,0,.04);"><p style="margin: 0; font-size: 14px;">✅ ' . esc_html__('Ayarlar başarıyla kaydedildi!', 'nobetci-eczaneler') . '</p></div>';
    93225        }
    94226
    … …  
    127259
    128260        ?>
    129         <div class="wrap">
    130             <h1><?php esc_html_e('Nöbetçi Eczaneler Ayarları', 'nobetci-eczaneler'); ?></h1>
    131             <?php echo wp_kses_post($admin_notice); ?>
    132            
    133             <div class="card" style="max-width: 600px; padding: 20px; margin-top: 20px;">
     261        <div class="nbetec-admin-wrap">
     262            <div class="nbetec-admin-header">
     263                <div class="nbetec-admin-logo">N</div>
     264                <ul class="nbetec-admin-tabs">
     265                    <li><a class="nbetec-admin-tab active" data-target="tab-hosgeldiniz"><?php esc_html_e('Hoşgeldiniz', 'nobetci-eczaneler'); ?></a></li>
     266                    <li><a class="nbetec-admin-tab" data-target="tab-tema"><?php esc_html_e('Genel Ayarlar', 'nobetci-eczaneler'); ?></a></li>
     267                    <li><a class="nbetec-admin-tab" data-target="tab-reklam"><?php esc_html_e('Reklam Ayarları', 'nobetci-eczaneler'); ?></a></li>
     268                    <li><a class="nbetec-admin-tab" data-target="tab-araclar"><?php esc_html_e('Sistem Araçları', 'nobetci-eczaneler'); ?></a></li>
     269                </ul>
     270            </div>
     271           
     272            <div class="nbetec-admin-content">
     273                <?php echo wp_kses_post($admin_notice); ?>
     274               
     275                <div id="tab-hosgeldiniz" class="nbetec-tab-pane active">
     276                    <div class="nbetec-admin-card">
    134277                <h2><?php esc_html_e('Nasıl Kullanılır?', 'nobetci-eczaneler'); ?></h2>
    135278                <p><?php esc_html_e("Bu eklenti SEO uyumlu sayfa yapılandırmasıyla çalışır. Eklenti aktif olduğu sürece fiziksel bir sayfa oluşturmanıza gerek yoktur. Desteklenen tüm iller ve ilçeler URL üzerinden otomatik olarak taranır ve API'den getirilir. Yapmanız gereken sadece", 'nobetci-eczaneler'); ?> <code>[nobetci-eczane]</code> <?php esc_html_e('kodunu oluşturacağınız Nöbetçi Eczaneler sayfasına eklemek.', 'nobetci-eczaneler'); ?></p>
    … …  
    139282                    <p style="margin-bottom: 0;"><?php esc_html_e('Hazırda sayfanız yoksa otomatik oluşturalım.', 'nobetci-eczaneler'); ?> <button type="submit" style="background: none; border: none; padding: 0; margin: 0; font: inherit; color: #2271b1; text-decoration: underline; cursor: pointer;"><?php esc_html_e('Buraya tıklayın.', 'nobetci-eczaneler'); ?></button></p>
    140283                </form>
    141             </div>
    142            
    143             <div class="card" style="max-width: 600px; padding: 20px; margin-top: 20px;">
    144                 <h2><?php esc_html_e('Kısa Kod (Shortcode) Oluşturucu', 'nobetci-eczaneler'); ?></h2>
     284                    </div>
     285                   
     286                    <div class="nbetec-admin-card">
     287                <h2><?php esc_html_e('Kısa Kod (Shortcode) ve Sayfa Oluşturucu', 'nobetci-eczaneler'); ?></h2>
    145288                <p><?php esc_html_e('Eczaneleri istediğiniz sayfada veya yazıda göstermek için aşağıdaki aracı kullanarak kolayca kısa kod oluşturabilirsiniz.', 'nobetci-eczaneler'); ?></p>
    146289               
    … …  
    201344                    <span id="url-copy-status" style="color: green; font-weight: bold; display: none;"><?php esc_html_e('Kopyalandı! ✔️', 'nobetci-eczaneler'); ?></span>
    202345                </div>
    203             </div>
    204 
    205 
    206            
    207             <div class="card" style="max-width: 600px; padding: 20px; margin-top: 20px;">
     346               
     347                <div id="nbetec-page-builder-section" style="display: none; margin-top: 30px; padding-top: 20px; border-top: 1px solid #e2e8f0;">
     348                    <h3 style="margin-top: 0;"><?php esc_html_e('Otomatik Sayfa Oluşturucu', 'nobetci-eczaneler'); ?></h3>
     349                    <p><?php esc_html_e('Seçtiğiniz il için fiziksel bir WordPress sayfası oluşturabilirsiniz. İsterseniz altındaki tüm ilçeler için de ayrı ayrı sayfalar oluşturabilirsiniz.', 'nobetci-eczaneler'); ?></p>
     350                   
     351                    <div style="display: flex; align-items: center; gap: 15px; margin-bottom: 10px;">
     352                        <button type="button" id="nbetec-create-pages-btn" class="button nbetec-admin-btn-primary" style="padding: 0 20px;">
     353                            <span class="dashicons dashicons-admin-page" style="margin-top: 4px; margin-right: 4px;"></span>
     354                            <span id="nbetec-create-pages-btn-text"><?php esc_html_e('Sayfaları Oluştur', 'nobetci-eczaneler'); ?></span>
     355                        </button>
     356                        <label style="display: flex; align-items: center; gap: 5px; cursor: pointer;">
     357                            <input type="checkbox" id="nbetec-create-district-pages">
     358                            <?php esc_html_e('Tüm ilçeler için de ayrı alt sayfalar oluştur', 'nobetci-eczaneler'); ?>
     359                        </label>
     360                    </div>
     361                    <div id="nbetec-page-builder-status" style="display: none; padding: 10px 15px; border-left: 4px solid #00a32a; background: #f2fbf6; color: #1e4620; font-weight: 500; margin-top: 15px;"></div>
     362                </div>
     363                    </div>
     364                </div> <!-- End tab-hosgeldiniz -->
     365               
     366                <div id="tab-reklam" class="nbetec-tab-pane">
     367                    <div class="nbetec-admin-card">
    208368                <h2><?php esc_html_e('Reklam Ayarları (AdSense vb.)', 'nobetci-eczaneler'); ?></h2>
    209369                <p><?php esc_html_e('Eczane listesinin arasına otomatik olarak reklam kodunuzu yerleştirebilirsiniz.', 'nobetci-eczaneler'); ?></p>
    … …  
    232392                    </p>
    233393                </form>
    234             </div>
    235 
    236             <div class="card" style="max-width: 600px; padding: 20px; margin-top: 20px;">
     394                    </div>
     395                </div> <!-- End tab-reklam -->
     396
     397                <div id="tab-tema" class="nbetec-tab-pane">
     398                    <div class="nbetec-admin-card">
     399                <h2><?php esc_html_e('Genel Ayarlar', 'nobetci-eczaneler'); ?></h2>
     400                <p><?php esc_html_e('Eklentinin tema ve SEO gibi genel ayarlarını buradan yapılandırabilirsiniz.', 'nobetci-eczaneler'); ?></p>
     401                <form method="post" action="">
     402                    <?php wp_nonce_field('nbetec_save_settings_action', 'nbetec_save_settings_nonce'); ?>
     403                    <input type="hidden" name="nbetec_save_settings" value="1">
     404                   
     405                    <table class="form-table">
     406                        <tr>
     407                            <th scope="row"><label for="nbetec_global_theme"><?php esc_html_e('Tema Rengi', 'nobetci-eczaneler'); ?></label></th>
     408                            <td>
     409                                <select id="nbetec_global_theme" name="nbetec_global_theme" style="width: 200px;">
     410                                    <option value="light" <?php selected(get_option('nbetec_global_theme', 'light'), 'light'); ?>><?php esc_html_e('Aydınlık Mod', 'nobetci-eczaneler'); ?></option>
     411                                    <option value="dark" <?php selected(get_option('nbetec_global_theme', 'light'), 'dark'); ?>><?php esc_html_e('Karanlık Mod', 'nobetci-eczaneler'); ?></option>
     412                                </select>
     413                                <p class="description"><?php esc_html_e('Tüm eczane sayfaları seçtiğiniz temaya bürünecektir.', 'nobetci-eczaneler'); ?></p>
     414                            </td>
     415                        </tr>
     416                        <tr>
     417                            <th scope="row"><label for="nbetec_enable_seo"><?php esc_html_e('Otomatik SEO Etiketleri', 'nobetci-eczaneler'); ?></label></th>
     418                            <td>
     419                                <label>
     420                                    <input type="checkbox" id="nbetec_enable_seo" name="nbetec_enable_seo" value="on" <?php checked(get_option('nbetec_enable_seo', 'on'), 'on'); ?>>
     421                                    <?php esc_html_e('Açık (Önerilen)', 'nobetci-eczaneler'); ?>
     422                                </label>
     423                                <p class="description"><?php esc_html_e('İl ve ilçe sayfaları için dinamik meta title, meta description ve meta keywords otomatik oluşturulur.', 'nobetci-eczaneler'); ?></p>
     424                            </td>
     425                        </tr>
     426                    </table>
     427                    <p class="submit">
     428                        <input type="submit" class="button nbetec-admin-btn-primary" value="<?php esc_attr_e('Ayarları Kaydet', 'nobetci-eczaneler'); ?>">
     429                    </p>
     430                </form>
     431                    </div>
     432                </div> <!-- End tab-tema -->
     433
     434                <div id="tab-araclar" class="nbetec-tab-pane">
     435                    <div class="nbetec-admin-card">
    237436                <h2><?php esc_html_e('Hızlı İşlemler', 'nobetci-eczaneler'); ?></h2>
    238437                <p><?php esc_html_e('Nöbetçi eczaneler her 1 saatte bir API\'den çekilir ve sitenizi hızlandırmak için önbelleğe alınır. Acil bir durum varsa manuel olarak silebilirsiniz.', 'nobetci-eczaneler'); ?></p>
    … …  
    249448                    <input type="submit" name="nbetec_flush_rules" class="button button-primary" value="<?php esc_attr_e('SEO Bağlantılarını Yenile (Flush Rewrite Rules)', 'nobetci-eczaneler'); ?>">
    250449                </form>
    251             </div>
    252            
    253             <div class="card" style="max-width: 600px; padding: 20px; margin-top: 20px; background-color: #f2fbf6; border: 1px solid #d5ecd8; border-radius: 6px; box-shadow: none;">
    254                 <h3 style="margin-top: 0; font-size: 13px; font-weight: 700; color: #2c3e50; text-transform: uppercase; border-bottom: 1px solid #e3f2e7; padding-bottom: 10px; margin-bottom: 15px; letter-spacing: 0.5px;"><?php esc_html_e('VERİ KAYNAĞI', 'nobetci-eczaneler'); ?></h3>
    255                 <p style="margin: 0; font-size: 14px; color: #5a6b7c;"><?php
    256                     echo sprintf(
    257                         wp_kses(
    258                             /* translators: %s: URL to wpstore.com.tr */
    259                             __('Veriler <a href="%s" target="_blank" style="text-decoration: underline; color: #2271b1;">wpstore.com.tr</a> üzerinden resmi REST API aracılığıyla çekilmektedir.', 'nobetci-eczaneler'),
    260                             array('a' => array('href' => true, 'target' => true, 'style' => true))
    261                         ),
    262                         esc_url('https://wpstore.com.tr')
    263                     );
    264                 ?></p>
    265             </div>
    266            
    267         </div>
     450                    </div>
     451
     452                    <div class="nbetec-admin-card" style="background-color: #f2fbf6; border: 1px solid #d5ecd8; box-shadow: none;">
     453                        <h3 style="margin-top: 0; font-size: 13px; font-weight: 700; color: #2c3e50; text-transform: uppercase; border-bottom: 1px solid #e3f2e7; padding-bottom: 10px; margin-bottom: 15px; letter-spacing: 0.5px;"><?php esc_html_e('VERİ KAYNAĞI', 'nobetci-eczaneler'); ?></h3>
     454                        <p style="margin: 0; font-size: 14px; color: #5a6b7c;"><?php
     455                            echo sprintf(
     456                                wp_kses(
     457                                    /* translators: %s: URL to wpstore.com.tr */
     458                                    __('Veriler <a href="%s" target="_blank" style="text-decoration: underline; color: #2271b1;">wpstore.com.tr</a> üzerinden resmi REST API aracılığıyla çekilmektedir.', 'nobetci-eczaneler'),
     459                                    array('a' => array('href' => true, 'target' => true, 'style' => true))
     460                                ),
     461                                esc_url('https://wpstore.com.tr')
     462                            );
     463                        ?></p>
     464                    </div>
     465                </div> <!-- End tab-araclar -->
     466
     467            </div> <!-- End nbetec-admin-content -->
     468        </div> <!-- End nbetec-admin-wrap -->
    268469        <?php
    269470    }
  • nobetci-eczaneler/trunk/includes/class-api.php

    r3585474 r3638928  
    4343        }
    4444       
    45         // API isteği
     45        // API isteği - Siteyi yavaşlatmaması için timeout 3 saniyeye düşürüldü
    4646        $url = $this->api_base_url . '?city=' . $il_slug;
    47         $response = wp_remote_get($url, array('timeout' => 15));
     47        $response = wp_remote_get($url, array('timeout' => 3));
    4848       
    4949        if (is_wp_error($response)) {
  • nobetci-eczaneler/trunk/includes/class-frontend.php

    r3585474 r3638928  
    3030            $il_slug = sanitize_title($atts['il']);
    3131            $ilce_slug = !empty($atts['ilce']) ? sanitize_title($atts['ilce']) : '';
     32            $nbetec_il_slug = $il_slug;
     33            $nbetec_ilce_slug = $ilce_slug;
    3234            include NBETEC_DIR . 'templates/shortcode-eczane.php';
    3335        } else {
    … …  
    4244        wp_register_script('nbetec-frontend-script', NBETEC_URL . 'assets/js/frontend.js', array(), NBETEC_VERSION, true);
    4345
     46        // Her yerde (Elementor, Sidebar widget vb.) stillerin yüklendiğinden emin olmak için:
     47        wp_enqueue_style('nbetec-style');
     48
     49        // Sadece özel rota (sayfa) için JS'i yükle
    4450        if (get_query_var('nobetci_il')) {
    45             wp_enqueue_style('nbetec-style');
    4651            wp_enqueue_script('nbetec-frontend-script');
    4752        }
  • nobetci-eczaneler/trunk/includes/class-widget.php

    r3605267 r3638928  
    1010            'nbetec_widget',
    1111            'Nöbetçi Eczaneler',
    12             array('description' => 'Sitenizin herhangi bir alanında nöbetçi eczaneleri veya şehir arama kutusunu gösterir.')
     12            array('description' => 'Sitenizin herhangi bir alanında nöbetçi eczaneleri gösterir.')
    1313        );
    1414    }
    … …  
    1818        $il = !empty($instance['il']) ? sanitize_title($instance['il']) : 'istanbul';
    1919        $ilce = !empty($instance['ilce']) ? sanitize_title($instance['ilce']) : '';
    20         $theme = !empty($instance['theme']) ? $instance['theme'] : 'light';
     20        $theme = !empty($instance['theme']) ? $instance['theme'] : 'red_list'; // Default to red theme
    2121
    2222        echo wp_kses_post($args['before_widget']);
    … …  
    2626        }
    2727
    28         echo '<div class="nbetec-widget-wrapper nbetec-theme-' . esc_attr($theme) . '">';
    29 
    30         // Liste Modu
     28        // Tarih Hesaplama
     29        try {
     30            $tz = new DateTimeZone('Europe/Istanbul');
     31            $date_today = new DateTime('now', $tz);
     32            $date_tomorrow = new DateTime('tomorrow', $tz);
     33        } catch (Exception $e) {
     34            $date_today = new DateTime();
     35            $date_tomorrow = new DateTime('+1 day');
     36        }
     37
     38        $tr_months = array('01' => 'Ocak', '02' => 'Şubat', '03' => 'Mart', '04' => 'Nisan', '05' => 'Mayıs', '06' => 'Haziran', '07' => 'Temmuz', '08' => 'Ağustos', '09' => 'Eylül', '10' => 'Ekim', '11' => 'Kasım', '12' => 'Aralık');
     39        $tr_days = array('Monday' => 'Pazartesi', 'Tuesday' => 'Salı', 'Wednesday' => 'Çarşamba', 'Thursday' => 'Perşembe', 'Friday' => 'Cuma', 'Saturday' => 'Cumartesi', 'Sunday' => 'Pazar');
     40
     41        $str_today = $date_today->format('j') . ' ' . $tr_months[$date_today->format('m')] . ' ' . $tr_days[$date_today->format('l')];
     42        $str_tomorrow = $date_tomorrow->format('j') . ' ' . $tr_months[$date_tomorrow->format('m')] . ' ' . $tr_days[$date_tomorrow->format('l')] . ' sabahı';
     43
    3144        $api = new NBETEC_API();
    3245        $eczane_data = $api->get_eczane_data($il);
     46       
     47        // Şehir adı formatlama
     48        $nbetec_all_cities = array(
     49            'adana' => 'Adana', 'adiyaman' => 'Adıyaman', 'afyonkarahisar' => 'Afyonkarahisar', 'agri' => 'Ağrı',
     50            'amasya' => 'Amasya', 'ankara' => 'Ankara', 'antalya' => 'Antalya', 'artvin' => 'Artvin',
     51            'aydin' => 'Aydın', 'balikesir' => 'Balıkesir', 'bilecik' => 'Bilecik', 'bingol' => 'Bingöl',
     52            'bitlis' => 'Bitlis', 'bolu' => 'Bolu', 'burdur' => 'Burdur', 'bursa' => 'Bursa',
     53            'canakkale' => 'Çanakkale', 'cankiri' => 'Çankırı', 'corum' => 'Çorum', 'denizli' => 'Denizli',
     54            'diyarbakir' => 'Diyarbakır', 'edirne' => 'Edirne', 'elazig' => 'Elazığ', 'erzincan' => 'Erzincan',
     55            'erzurum' => 'Erzurum', 'eskisehir' => 'Eskişehir', 'gaziantep' => 'Gaziantep', 'giresun' => 'Giresun',
     56            'gumushane' => 'Gümüşhane', 'hakkari' => 'Hakkari', 'hatay' => 'Hatay', 'isparta' => 'Isparta',
     57            'mersin' => 'Mersin', 'istanbul' => 'İstanbul', 'izmir' => 'İzmir', 'kars' => 'Kars',
     58            'kastamonu' => 'Kastamonu', 'kayseri' => 'Kayseri', 'kirklareli' => 'Kırklareli', 'kirsehir' => 'Kırşehir',
     59            'kocaeli' => 'Kocaeli', 'konya' => 'Konya', 'kutahya' => 'Kütahya', 'malatya' => 'Malatya',
     60            'manisa' => 'Manisa', 'kahramanmaras' => 'Kahramanmaraş', 'mardin' => 'Mardin', 'mugla' => 'Muğla',
     61            'mus' => 'Muş', 'nevsehir' => 'Nevşehir', 'nigde' => 'Niğde', 'ordu' => 'Ordu',
     62            'rize' => 'Rize', 'sakarya' => 'Sakarya', 'samsun' => 'Samsun', 'siirt' => 'Siirt',
     63            'sinop' => 'Sinop', 'sivas' => 'Sivas', 'tekirdag' => 'Tekirdağ', 'tokat' => 'Tokat',
     64            'trabzon' => 'Trabzon', 'tunceli' => 'Tunceli', 'sanliurfa' => 'Şanlıurfa', 'usak' => 'Uşak',
     65            'van' => 'Van', 'yozgat' => 'Yozgat', 'zonguldak' => 'Zonguldak', 'aksaray' => 'Aksaray',
     66            'bayburt' => 'Bayburt', 'karaman' => 'Karaman', 'kirikkale' => 'Kırıkkale', 'batman' => 'Batman',
     67            'sirnak' => 'Şırnak', 'bartin' => 'Bartın', 'ardahan' => 'Ardahan', 'igdir' => 'Iğdır',
     68            'yalova' => 'Yalova', 'karabuk' => 'Karabük', 'kilis' => 'Kilis', 'osmaniye' => 'Osmaniye',
     69            'duzce' => 'Düzce', 'kibris' => 'Kıbrıs'
     70        );
     71        $il_name = isset($nbetec_all_cities[$il]) ? $nbetec_all_cities[$il] : ucfirst($il);
     72        if (!empty($eczane_data) && !empty($eczane_data['detay']['city_name']) && mb_strtolower($eczane_data['detay']['city_name'], 'UTF-8') !== mb_strtolower($il_name, 'UTF-8')) {
     73            $il_name = $eczane_data['detay']['city_name'];
     74        }
     75
     76        echo '<div class="nbetec-nw-container nbetec-nw-theme-' . esc_attr($theme) . '">';
     77
     78        // Kırmızı Tema Başlığı
     79        if ($theme === 'red_list' || true) { // İleride diğer temalar eklenirken burası güncellenir.
     80            echo '<div class="nbetec-nw-header">';
     81            echo '<div class="nbetec-nw-logo-box">E</div>';
     82            echo '<div class="nbetec-nw-title-box">';
     83            echo '<div class="nbetec-nw-title">NÖBETÇİ ECZANELER</div>';
     84            echo '<div class="nbetec-nw-city">' . esc_html(mb_convert_case($il_name, MB_CASE_TITLE, "UTF-8")) . '</div>';
     85            echo '</div>';
     86            echo '</div>';
     87
     88            echo '<div class="nbetec-nw-dates">';
     89            echo '<div class="nbetec-nw-date-row">';
     90            echo '<svg class="nbetec-nw-calendar-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>';
     91            echo '<span>' . esc_html($str_today) . '</span>';
     92            echo '</div>';
     93            echo '<div class="nbetec-nw-date-row">';
     94            echo '<svg class="nbetec-nw-calendar-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>';
     95            echo '<span>' . esc_html($str_tomorrow) . '</span>';
     96            echo '</div>';
     97            echo '</div>';
     98        }
     99
     100        if (empty($eczane_data) || empty($eczane_data['data'][0])) {
     101            echo '<div class="nbetec-nw-alert">Bu bölge için nöbetçi eczane bulunamadı.</div>';
     102        } else {
     103            $eczaneler = $eczane_data['data'][0];
    33104           
    34             $il_name = ucfirst($il);
    35             $date_desc = !empty($eczane_data['detay']['description']) ? $eczane_data['detay']['description'] : gmdate('d.m.Y') . ' Nöbetçi Eczaneleri';
    36 
    37             if ($theme === 'red_list') {
    38                 echo '<div class="nbetec-widget-header-red">';
    39                 echo '<strong><span style="font-size: 1.2em; border: 1px solid #fff; padding: 0 4px; margin-right: 5px;">E</span> NÖBETÇİ ECZANELER</strong>';
    40                 echo '</div>';
    41                 echo '<div class="nbetec-widget-subheader-dark">';
    42                 echo esc_html($date_desc);
     105            if ($ilce) {
     106                $filtered = array();
     107                foreach ($eczaneler as $ecz) {
     108                    if (sanitize_title($ecz['ilce']) === $ilce) {
     109                        $filtered[] = $ecz;
     110                    }
     111                }
     112                $eczaneler = $filtered;
     113            }
     114           
     115            if (empty($eczaneler)) {
     116                echo '<div class="nbetec-nw-alert">Bu ilçe için nöbetçi eczane bulunamadı.</div>';
     117            } else {
     118                echo '<ul class="nbetec-nw-list">';
     119                foreach ($eczaneler as $eczane) {
     120                    echo '<li class="nbetec-nw-item">';
     121                    echo '<div class="nbetec-nw-item-header">';
     122                    echo '<div class="nbetec-nw-item-logo">E</div>';
     123                    echo '<div class="nbetec-nw-item-name-box">';
     124                    echo '<div class="nbetec-nw-item-name">' . esc_html($eczane['eczane_adi']) . '</div>';
     125                    echo '<div class="nbetec-nw-item-district">(' . esc_html($eczane['ilce']) . ')</div>';
     126                    echo '</div>';
     127                    echo '</div>';
     128
     129                    echo '<div class="nbetec-nw-item-details">';
     130                    echo '<a href="tel:' . esc_attr(preg_replace('/[^0-9+]/', '', $eczane['telefon'])) . '" class="nbetec-nw-phone">';
     131                    echo '<svg viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>';
     132                    echo '<span>' . esc_html($eczane['telefon']) . '</span>';
     133                    echo '</a>';
     134                   
     135                    $map_query = (!empty($eczane['latitude']) && !empty($eczane['longitude'])) ? $eczane['latitude'] . ',' . $eczane['longitude'] : $eczane['eczane_adi'] . ' ' . $eczane['adres'];
     136                    echo '<a href="https://maps.google.com/?q=' . urlencode($map_query) . '" target="_blank" rel="noopener noreferrer" class="nbetec-nw-address">';
     137                    echo '<svg viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>';
     138                    echo '<span>' . esc_html($eczane['adres']) . '</span>';
     139                    echo '</a>';
     140
     141                    if (!empty($eczane['adres_tarifi'])) {
     142                        echo '<div class="nbetec-nw-directions">';
     143                        echo wp_kses_post($eczane['adres_tarifi']);
     144                        echo '</div>';
     145                    }
     146                    echo '</div>';
     147                    echo '</li>';
     148                }
     149                echo '</ul>';
     150               
     151                $more_url = nbetec_get_url($il, $ilce);
     152                echo '<div class="nbetec-nw-more-link">';
     153                echo '<a href="' . esc_url($more_url) . '">Tüm Eczaneleri Gör &raquo;</a>';
    43154                echo '</div>';
    44155            }
    45 
    46             if (empty($eczane_data) || empty($eczane_data['data'][0])) {
    47                 echo '<p>Bu bölge için nöbetçi eczane bulunamadı.</p>';
    48             } else {
    49                 $eczaneler = $eczane_data['data'][0];
    50                
    51                 if ($ilce) {
    52                     $filtered = array();
    53                     foreach ($eczaneler as $ecz) {
    54                         if (sanitize_title($ecz['ilce']) === $ilce) {
    55                             $filtered[] = $ecz;
    56                         }
    57                     }
    58                     $eczaneler = $filtered;
    59                 }
    60                
    61                 if (empty($eczaneler)) {
    62                     echo '<p>Bu ilçe için nöbetçi eczane bulunamadı.</p>';
    63                 } else {
    64                     $count = 0;
    65                     echo '<ul class="nbetec-widget-list" style="max-height: 280px; overflow-y: auto;">';
    66                     foreach ($eczaneler as $eczane) {
    67                         ?>
    68                         <li class="nbetec-widget-item">
    69                             <div class="nbetec-w-name">
    70                                 <img src="<?php echo esc_url(NBETEC_URL . 'assets/images/eczane-logo.webp'); ?>" alt="E" class="nbetec-w-e-icon-img">
    71                                 <div style="display: flex; flex-direction: column;">
    72                                     <strong><?php echo esc_html($eczane['eczane_adi']); ?></strong>
    73                                     <span class="nbetec-w-ilce" style="margin-left: 0; margin-top: 2px;">(<?php echo esc_html($eczane['ilce']); ?>)</span>
    74                                 </div>
    75                             </div>
    76                             <div class="nbetec-w-phone">
    77                                 <span class="dashicons dashicons-phone"></span>
    78                                 <a href="tel:<?php echo esc_attr(preg_replace('/[^0-9+]/', '', $eczane['telefon'])); ?>"><?php echo esc_html($eczane['telefon']); ?></a>
    79                             </div>
    80                             <div class="nbetec-w-address">
    81                                 <?php
    82                                 $widget_map_query = (!empty($eczane['latitude']) && !empty($eczane['longitude']))
    83                                     ? $eczane['latitude'] . ',' . $eczane['longitude']
    84                                     : $eczane['eczane_adi'] . ' ' . $eczane['adres'];
    85                                 ?>
    86                                 <a href="https://maps.google.com/?q=<?php echo urlencode($widget_map_query); ?>" target="_blank" rel="noopener noreferrer">
    87                                     <span class="dashicons dashicons-location"></span>
    88                                     <?php echo esc_html($eczane['adres']); ?>
    89                                 </a>
    90                             </div>
    91                             <?php if(!empty($eczane['adres_tarifi'])): ?>
    92                             <div class="nbetec-w-direction">
    93                                 <?php echo esc_html($eczane['adres_tarifi']); ?>
    94                             </div>
    95                             <?php endif; ?>
    96                         </li>
    97                         <?php
    98                     }
    99                     echo '</ul>';
    100                    
    101                     // Tümünü gör linki
    102                     $more_url = home_url('/' . $il . (!empty($ilce) ? '-' . $ilce : '') . '-nobetci-eczaneleri');
    103                     echo '<div class="nbetec-w-more"><a href="' . esc_url($more_url) . '">Tüm Eczaneleri Gör &raquo;</a></div>';
    104                 }
    105             }
     156        }
    106157
    107158        echo '</div>';
     159
    108160        echo wp_kses_post($args['after_widget']);
    109161    }
    … …  
    113165        $il = !empty($instance['il']) ? $instance['il'] : 'istanbul';
    114166        $ilce = !empty($instance['ilce']) ? $instance['ilce'] : '';
    115         $theme = !empty($instance['theme']) ? $instance['theme'] : 'light';
     167        $theme = !empty($instance['theme']) ? $instance['theme'] : 'red_list';
     168
     169        $nbetec_all_cities = array(
     170            'adana' => 'Adana', 'adiyaman' => 'Adıyaman', 'afyonkarahisar' => 'Afyonkarahisar', 'agri' => 'Ağrı',
     171            'amasya' => 'Amasya', 'ankara' => 'Ankara', 'antalya' => 'Antalya', 'artvin' => 'Artvin',
     172            'aydin' => 'Aydın', 'balikesir' => 'Balıkesir', 'bilecik' => 'Bilecik', 'bingol' => 'Bingöl',
     173            'bitlis' => 'Bitlis', 'bolu' => 'Bolu', 'burdur' => 'Burdur', 'bursa' => 'Bursa',
     174            'canakkale' => 'Çanakkale', 'cankiri' => 'Çankırı', 'corum' => 'Çorum', 'denizli' => 'Denizli',
     175            'diyarbakir' => 'Diyarbakır', 'edirne' => 'Edirne', 'elazig' => 'Elazığ', 'erzincan' => 'Erzincan',
     176            'erzurum' => 'Erzurum', 'eskisehir' => 'Eskişehir', 'gaziantep' => 'Gaziantep', 'giresun' => 'Giresun',
     177            'gumushane' => 'Gümüşhane', 'hakkari' => 'Hakkari', 'hatay' => 'Hatay', 'isparta' => 'Isparta',
     178            'mersin' => 'Mersin', 'istanbul' => 'İstanbul', 'izmir' => 'İzmir', 'kars' => 'Kars',
     179            'kastamonu' => 'Kastamonu', 'kayseri' => 'Kayseri', 'kirklareli' => 'Kırklareli', 'kirsehir' => 'Kırşehir',
     180            'kocaeli' => 'Kocaeli', 'konya' => 'Konya', 'kutahya' => 'Kütahya', 'malatya' => 'Malatya',
     181            'manisa' => 'Manisa', 'kahramanmaras' => 'Kahramanmaraş', 'mardin' => 'Mardin', 'mugla' => 'Muğla',
     182            'mus' => 'Muş', 'nevsehir' => 'Nevşehir', 'nigde' => 'Niğde', 'ordu' => 'Ordu',
     183            'rize' => 'Rize', 'sakarya' => 'Sakarya', 'samsun' => 'Samsun', 'siirt' => 'Siirt',
     184            'sinop' => 'Sinop', 'sivas' => 'Sivas', 'tekirdag' => 'Tekirdağ', 'tokat' => 'Tokat',
     185            'trabzon' => 'Trabzon', 'tunceli' => 'Tunceli', 'sanliurfa' => 'Şanlıurfa', 'usak' => 'Uşak',
     186            'van' => 'Van', 'yozgat' => 'Yozgat', 'zonguldak' => 'Zonguldak', 'aksaray' => 'Aksaray',
     187            'bayburt' => 'Bayburt', 'karaman' => 'Karaman', 'kirikkale' => 'Kırıkkale', 'batman' => 'Batman',
     188            'sirnak' => 'Şırnak', 'bartin' => 'Bartın', 'ardahan' => 'Ardahan', 'igdir' => 'Iğdır',
     189            'yalova' => 'Yalova', 'karabuk' => 'Karabük', 'kilis' => 'Kilis', 'osmaniye' => 'Osmaniye',
     190            'duzce' => 'Düzce', 'kibris' => 'Kıbrıs'
     191        );
     192
     193        $ilceler = array();
     194        if (!empty($il)) {
     195            $api = new NBETEC_API();
     196            $eczane_data = $api->get_eczane_data($il);
     197            if (!empty($eczane_data) && !empty($eczane_data['data'][0])) {
     198                foreach ($eczane_data['data'][0] as $ecz) {
     199                    $ilce_slug = sanitize_title($ecz['ilce']);
     200                    $ilceler[$ilce_slug] = trim($ecz['ilce']);
     201                }
     202            }
     203        }
     204        asort($ilceler);
    116205        ?>
    117206        <p>
    … …  
    121210        <p>
    122211            <label for="<?php echo esc_attr($this->get_field_id('il')); ?>">Gösterilecek İl:</label>
    123             <input class="widefat" id="<?php echo esc_attr($this->get_field_id('il')); ?>" name="<?php echo esc_attr($this->get_field_name('il')); ?>" type="text" value="<?php echo esc_attr($il); ?>" placeholder="Örn: adana">
     212            <select class="widefat" id="<?php echo esc_attr($this->get_field_id('il')); ?>" name="<?php echo esc_attr($this->get_field_name('il')); ?>">
     213                <?php foreach ($nbetec_all_cities as $city_slug => $city_name): ?>
     214                    <option value="<?php echo esc_attr($city_slug); ?>" <?php selected($il, $city_slug); ?>><?php echo esc_html($city_name); ?></option>
     215                <?php endforeach; ?>
     216            </select>
    124217        </p>
    125218        <p>
    126219            <label for="<?php echo esc_attr($this->get_field_id('ilce')); ?>">Gösterilecek İlçe (Opsiyonel):</label>
    127             <input class="widefat" id="<?php echo esc_attr($this->get_field_id('ilce')); ?>" name="<?php echo esc_attr($this->get_field_name('ilce')); ?>" type="text" value="<?php echo esc_attr($ilce); ?>" placeholder="Örn: kozan">
     220            <select class="widefat" id="<?php echo esc_attr($this->get_field_id('ilce')); ?>" name="<?php echo esc_attr($this->get_field_name('ilce')); ?>">
     221                <option value="">-- Tüm İlçeler --</option>
     222                <?php foreach ($ilceler as $ilce_slug => $ilce_name): ?>
     223                    <option value="<?php echo esc_attr($ilce_slug); ?>" <?php selected($ilce, $ilce_slug); ?>><?php echo esc_html($ilce_name); ?></option>
     224                <?php endforeach; ?>
     225            </select>
     226            <br><small><em>Not: İli değiştirdiğinizde yeni ilin ilçelerinin gelmesi için önce "Kaydet" butonuna basınız.</em></small>
    128227        </p>
    129228        <p>
    130229            <label for="<?php echo esc_attr($this->get_field_id('theme')); ?>">Tema Rengi:</label>
    131230            <select class="widefat" id="<?php echo esc_attr($this->get_field_id('theme')); ?>" name="<?php echo esc_attr($this->get_field_name('theme')); ?>">
    132                 <option value="light" <?php selected($theme, 'light'); ?>>Açık Tema</option>
     231                <option value="light" <?php selected($theme, 'light'); ?>>Aydınlık</option>
    133232                <option value="red_list" <?php selected($theme, 'red_list'); ?>>Kırmızı Tema</option>
     233                <option value="dark" <?php selected($theme, 'dark'); ?>>Karanlık Mod</option>
    134234            </select>
    135235        </p>
    … …  
    142242        $instance['il'] = (!empty($new_instance['il'])) ? sanitize_text_field($new_instance['il']) : '';
    143243        $instance['ilce'] = (!empty($new_instance['ilce'])) ? sanitize_text_field($new_instance['ilce']) : '';
    144         $instance['theme'] = (!empty($new_instance['theme'])) ? sanitize_text_field($new_instance['theme']) : 'light';
     244        $instance['theme'] = (!empty($new_instance['theme'])) ? sanitize_text_field($new_instance['theme']) : 'red_list';
    145245        return $instance;
    146246    }
  • nobetci-eczaneler/trunk/nobetci-eczaneler.php

    r3605267 r3638928  
    44 * Plugin URI: https://wpstore.com.tr/nobetci-eczane-eklentisi
    55 * Description: Türkiye'nin 81 İl ve İlçesi dahil olmak üzere Kuzey Kıbrıs Türk Cumhuriyeti'nin Nöbetçi Eczanelerini günlük olarak yayınlar.
    6  * Version: 1.1.0
     6 * Version: 2.0.0
    77 * Requires at least: 5.8
    88 * Requires PHP: 7.4
    … …  
    1818}
    1919
    20 define('NBETEC_VERSION', '1.1.0');
     20define('NBETEC_VERSION', '2.0.0');
    2121define('NBETEC_DIR', plugin_dir_path(__FILE__));
    2222define('NBETEC_URL', plugin_dir_url(__FILE__));
    … …  
    2727require_once NBETEC_DIR . 'includes/class-admin.php';
    2828require_once NBETEC_DIR . 'includes/class-widget.php';
     29require_once NBETEC_DIR . 'includes/class-seo.php';
     30
     31/**
     32 * Kalıcı bağlantı (permalink) yapısına göre URL üretir
     33 */
     34function nbetec_get_url($il_slug, $ilce_slug = '') {
     35    if (get_option('permalink_structure')) {
     36        // Özel Kalıcı Bağlantılar (Yazı Adı vb.)
     37        if (!empty($ilce_slug)) {
     38            return home_url('/' . $il_slug . '-' . $ilce_slug . '-nobetci-eczaneleri');
     39        } else {
     40            return home_url('/' . $il_slug . '-nobetci-eczaneleri');
     41        }
     42    } else {
     43        // Düz (Plain) Kalıcı Bağlantılar
     44        $url = home_url('/');
     45        $url = add_query_arg('nobetci_il', $il_slug, $url);
     46        if (!empty($ilce_slug)) {
     47            $url = add_query_arg('nobetci_ilce', $ilce_slug, $url);
     48        }
     49        return $url;
     50    }
     51}
    2952
    3053// Widget Kaydı
    … …  
    4467        new NBETEC_API();
    4568        new NBETEC_Frontend();
     69        new NBETEC_SEO();
    4670        if (is_admin()) {
    4771            new NBETEC_Admin();
  • nobetci-eczaneler/trunk/readme.txt

    r3605267 r3638928  
    55Tested up to: 7.0
    66Requires PHP: 7.4
    7 Stable tag: 1.1.0
     7Stable tag: 2.0.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    8484== Changelog ==
    8585
     86= 2.0.0 =
     87* **[YENİ] Sayfalar İçin Karanlık Mod:** Nöbetçi Eczane sayfalarının (il, ilçe listelemeleri ve ana ekran) görünümü için modern bir **Karanlık Mod (Dark Mode)** eklendi.
     88* **[YENİ] Bileşen (Widget) Temaları:** Bileşen tasarımları zenginleştirildi; mevcut klasik Kırmızı temanın yanına **Aydınlık (Light)** ve **Karanlık (Dark)** olmak üzere 2 yeni tema daha eklendi. Böylelikle bileşenlerde (widget) toplam 3 farklı tema seçeneğine ulaşıldı.
     89* **[YENİ] Dinamik SEO Modülü:** İl ve ilçe eczane sayfaları için otomatik Meta Title, Meta Description ve Keywords oluşturma altyapısı eklendi.
     90* **[YENİ] Güncel Tarihli SEO Etiketleri:** Arama motoru tıklama oranlarını (CTR) artırmak amacıyla SEO başlık ve açıklamalarına her gün otomatik değişen "O Günün Tarihi" (Örn: 8 Ağustos) eklendi.
     91* **[YENİ] Tam SEO Uyumluluğu:** Yeni SEO altyapısının Yoast SEO, Rank Math ve All In One SEO eklentileriyle tam entegre (kanca sistemiyle) ve uyumlu çalışması sağlandı.
     92* **[YENİ] Yönetim Paneli - SEO Kontrolü:** "Genel Ayarlar" sekmesine Otomatik SEO etiketlerini açıp kapatabileceğiniz kontrol butonu eklendi.
     93* **[Geliştirme] Akıllı Sayfa Oluşturucu:** Admin panelinden oluşturulan ilçe sayfalarının başlıklarına SEO için otomatik olarak "İl Adı" eklendi (Örn: Sadece "Merkez" yerine "Bitlis Merkez Nöbetçi Eczaneleri").
     94* **[Geliştirme] SEO Uyumlu URL:** Otomatik oluşturulan ilçe sayfalarının kalıcı bağlantıları (slug) daha SEO dostu olacak şekilde `il-ilce-nobetci-eczaneleri` (Örn: `bitlis-merkez-nobetci-eczaneleri`) formatına güncellendi.
     95* **[Geliştirme] Tasarım Tutarlılığı:** Kısa kod (shortcode) çıktıları ile ana sayfadaki eczane kartı tasarımları birebir eşitlendi.
     96* **[Geliştirme] Breadcrumb (Navigasyon):** İl ve ilçe sayfalarındaki karmaşayı önlemek amacıyla Breadcrumb (Ekmek kırıntısı) menüsünden gereksiz "Anasayfa" bağlantısı kaldırıldı.
     97* **[Düzeltme] Tema Çakışmaları:** Kullanılan WordPress temasının, eczane ve il seçim kartlarındaki linklerin altına otomatik çizgi (underline) atması sorunu çözüldü.
     98* **[Düzeltme] Metin Kesilmesi:** İlçe sayfalarının en altındaki SEO/bilgilendirme metinlerinde yaşanan cümlenin yarıda kesilme hatası giderildi.
     99* **[Düzeltme] Harf Standartları:** Kısa kod ekranında yazdırılan ilçe isimlerinin tasarımla tam uyumlu olması için otomatik "BÜYÜK HARF" filtresi uygulandı.
     100
     101
    86102= 1.1.0 =
    87103* Nöbet gününün bazen yanlış yazımı düzeltildi.
  • nobetci-eczaneler/trunk/templates/eczane-page.php

    r3605267 r3638928  
    163163
    164164$post = new WP_Post($nbetec_dummy_post);
     165wp_cache_add( -99, $post, 'posts' );
    165166$wp_query->post = $post;
    166167$wp_query->posts = array($post);
    167168$wp_query->queried_object = $post;
    168 $wp_query->queried_object_id = $post->ID;
     169$wp_query->queried_object_id = 0;
    169170$wp_query->is_singular = true;
    170171$wp_query->is_single = false;
    … …  
    172173
    173174get_header();
     175
     176$nbetec_global_theme = get_option('nbetec_global_theme', 'light');
     177$nbetec_theme_class = ($nbetec_global_theme === 'dark') ? ' nbetec-theme-dark' : '';
    174178?>
    175 <div class="nbetec-container">
     179<div class="nbetec-container<?php echo esc_attr($nbetec_theme_class); ?>">
    176180    <div class="nbetec-header">
    177181
    … …  
    190194            }
    191195            ?>
    192             <a href="<?php echo esc_url(home_url()); ?>" aria-label="<?php esc_attr_e('Anasayfa', 'nobetci-eczaneler'); ?>">
    193                 <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 5px;"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
    194                 <?php esc_html_e('Anasayfa', 'nobetci-eczaneler'); ?>
    195             </a>
    196             <span class="nbetec-sep">/</span>
     196
    197197            <a href="<?php echo esc_url($nbetec_home_page_url); ?>"><?php echo esc_html($nbetec_home_page_title); ?></a>
    198198            <span class="nbetec-sep">/</span>
    199199            <?php if ($nbetec_ilce_name): ?>
    200                 <a href="<?php echo esc_url(home_url('/' . sanitize_title($nbetec_il_name) . '-nobetci-eczaneleri')); ?>"><?php echo esc_html($nbetec_il_name); ?></a>
     200                <a href="<?php echo esc_url(nbetec_get_url(sanitize_title($nbetec_il_name))); ?>"><?php echo esc_html($nbetec_il_name); ?></a>
    201201                <span class="nbetec-sep">/</span>
    202202                <span class="nbetec-current"><?php echo esc_html($nbetec_ilce_name); ?></span>
    203203            <?php else: ?>
    204                 <a href="<?php echo esc_url(home_url('/' . sanitize_title($nbetec_il_slug) . '-nobetci-eczaneleri')); ?>" class="nbetec-current"><?php echo esc_html($nbetec_il_name); ?></a>
     204                <a href="<?php echo esc_url(nbetec_get_url($nbetec_il_slug)); ?>" class="nbetec-current"><?php echo esc_html($nbetec_il_name); ?></a>
    205205            <?php endif; ?>
    206206        </div>
    … …  
    266266    }
    267267    if(empty($nbetec_current_city_name)) $nbetec_current_city_name = $nbetec_il_name;
     268   
     269    // Eczaneleri topla (data içindeki ilk array grubunda bulunuyor)
     270    $nbetec_eczaneler = isset($nbetec_eczane_data['data'][0]) ? $nbetec_eczane_data['data'][0] : array();
     271   
     272    // Benzersiz ilçeleri bul
     273    $nbetec_ilceler = array();
     274    foreach ($nbetec_eczaneler as $nbetec_ecz) {
     275        $nbetec_ilce_adi = trim($nbetec_ecz['ilce']);
     276        if (!empty($nbetec_ilce_adi) && !in_array($nbetec_ilce_adi, $nbetec_ilceler)) {
     277            $nbetec_ilceler[] = $nbetec_ilce_adi;
     278        }
     279    }
     280    sort($nbetec_ilceler);
     281   
     282    // İlçe filtresi uygula
     283    if ($nbetec_ilce_slug) {
     284        $nbetec_filtered = array();
     285        foreach ($nbetec_eczaneler as $nbetec_ecz) {
     286            $nbetec_ecz_ilce_slug = sanitize_title($nbetec_ecz['ilce']);
     287            if ($nbetec_ecz_ilce_slug === $nbetec_ilce_slug) {
     288                $nbetec_filtered[] = $nbetec_ecz;
     289            }
     290        }
     291        $nbetec_eczaneler = $nbetec_filtered;
     292    }
     293   
     294    $current_url = urlencode(get_permalink());
     295    $page_title = urlencode($nbetec_page_title . " - Güncel Nöbetçi Eczaneler");
    268296    ?>
    269     <div class="nbetec-city-selector" style="position: relative; margin-bottom: 20px; width: 100%; max-width: 400px; font-family: sans-serif;">
    270         <div class="nbetec-selector-header" style="background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #2d3748; font-weight: 500;">
    271             <span><?php esc_html_e('Şehir Seçin:', 'nobetci-eczaneler'); ?> <strong><?php echo esc_html(nbetec_tr_strtoupper($nbetec_current_city_name)); ?></strong></span>
    272             <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
     297    <div class="nbetec-controls-row">
     298        <div class="nbetec-city-selector" style="position: relative; font-family: sans-serif;">
     299            <div class="nbetec-selector-header" style="background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #2d3748; font-weight: 500;">
     300                <span><?php esc_html_e('Şehir Seçin:', 'nobetci-eczaneler'); ?> <strong><?php echo esc_html(nbetec_tr_strtoupper($nbetec_current_city_name)); ?></strong></span>
     301                <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
     302            </div>
     303            <div class="nbetec-selector-dropdown nbetec-city-dropdown" style="display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 100; margin-top: 5px; overflow: hidden;">
     304                <div style="padding: 10px; border-bottom: 1px solid #e2e8f0; background: #f7fafc;">
     305                    <input type="text" class="nbetec-search-input" placeholder="<?php esc_attr_e('şehir adı veya plaka kodu yazın...', 'nobetci-eczaneler'); ?>" style="width: 100%; border: 1px solid #cbd5e0; border-radius: 4px; padding: 8px 12px; outline: none; font-size: 14px; box-sizing: border-box;">
     306                </div>
     307                <ul class="nbetec-city-list" style="max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0;">
     308                    <?php foreach($nbetec_all_cities as $nbetec_plate => $nbetec_city): ?>
     309                        <li>
     310                            <a href="<?php echo esc_url(nbetec_get_url($nbetec_city['slug'])); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7;">
     311                                <?php if($nbetec_plate !== 'kibris'): ?>
     312                                    <span class="nbetec-plate" style="display: inline-block; background: #edf2f7; color: #4a5568; padding: 2px 6px; border-radius: 4px; margin-right: 8px; font-size: 12px; font-weight: bold;"><?php echo esc_html($nbetec_plate); ?></span>
     313                                <?php else: ?>
     314                                    <span class="nbetec-plate" style="display: inline-block; background: #fff; border: 1px solid #e2e8f0; padding: 2px 6px; border-radius: 4px; margin-right: 8px;"><img src="<?php echo esc_url(NBETEC_URL . 'assets/images/kktc.svg'); ?>" alt="KKTC" width="18" height="12" style="vertical-align: middle;"></span>
     315                                <?php endif; ?>
     316                                <span class="nbetec-city-name" style="font-weight: 600; font-size: 15px;"><?php echo esc_html(nbetec_tr_strtoupper($nbetec_city['name'])); ?></span>
     317                            </a>
     318                        </li>
     319                    <?php endforeach; ?>
     320                </ul>
     321            </div>
    273322        </div>
    274         <div class="nbetec-selector-dropdown" style="display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 100; margin-top: 5px; overflow: hidden;">
    275             <div style="padding: 10px; border-bottom: 1px solid #e2e8f0; background: #f7fafc;">
    276                 <input type="text" class="nbetec-search-input" placeholder="<?php esc_attr_e('şehir adı veya plaka kodu yazın...', 'nobetci-eczaneler'); ?>" style="width: 100%; border: 1px solid #cbd5e0; border-radius: 4px; padding: 8px 12px; outline: none; font-size: 14px; box-sizing: border-box;">
     323
     324        <?php if (!empty($nbetec_ilceler)): ?>
     325        <div class="nbetec-district-selector" style="position: relative; font-family: sans-serif;">
     326            <div class="nbetec-selector-header nbetec-district-header" style="background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #2d3748; font-weight: 500;">
     327                <span><?php esc_html_e('İlçe Seçin:', 'nobetci-eczaneler'); ?> <strong><?php echo $nbetec_ilce_name ? esc_html(nbetec_tr_strtoupper($nbetec_ilce_name)) : 'TÜMÜ'; ?></strong></span>
     328                <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
    277329            </div>
    278             <ul class="nbetec-city-list" style="max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0;">
    279                 <?php foreach($nbetec_all_cities as $nbetec_plate => $nbetec_city): ?>
     330            <div class="nbetec-selector-dropdown nbetec-district-dropdown" style="display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 100; margin-top: 5px; overflow: hidden;">
     331                <ul class="nbetec-city-list" style="max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0;">
    280332                    <li>
    281                         <a href="<?php echo esc_url(home_url(sprintf('/%s-nobetci-eczaneleri', $nbetec_city['slug']))); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7;">
    282                             <?php if($nbetec_plate !== 'kibris'): ?>
    283                                 <span class="nbetec-plate" style="display: inline-block; background: #edf2f7; color: #4a5568; padding: 2px 6px; border-radius: 4px; margin-right: 8px; font-size: 12px; font-weight: bold;"><?php echo esc_html($nbetec_plate); ?></span>
    284                             <?php else: ?>
    285                                 <span class="nbetec-plate" style="display: inline-block; background: #fff; border: 1px solid #e2e8f0; color: #e53e3e; padding: 2px 6px; border-radius: 4px; margin-right: 8px; font-size: 12px; font-weight: bold;">&#10084;&#65039;</span>
    286                             <?php endif; ?>
    287                             <span class="nbetec-city-name" style="font-weight: 600; font-size: 15px;"><?php echo esc_html(nbetec_tr_strtoupper($nbetec_city['name'])); ?></span>
     333                        <a href="<?php echo esc_url(nbetec_get_url($nbetec_il_slug)); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7; font-weight: 600;">
     334                            TÜMÜ
    288335                        </a>
    289336                    </li>
    290                 <?php endforeach; ?>
    291             </ul>
     337                    <?php foreach($nbetec_ilceler as $ilce_adi): ?>
     338                        <li>
     339                            <a href="<?php echo esc_url(nbetec_get_url($nbetec_il_slug, sanitize_title($ilce_adi))); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7; font-weight: 600;">
     340                                <?php echo esc_html(nbetec_tr_strtoupper($ilce_adi)); ?>
     341                            </a>
     342                        </li>
     343                    <?php endforeach; ?>
     344                </ul>
     345            </div>
     346        </div>
     347        <?php endif; ?>
     348
     349        <div class="nbetec-share-actions" style="display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 10px 15px;">
     350            <span class="nbetec-share-label" style="font-weight: 600; color: #2d3748; margin-right: 5px;">Paylaş:</span>
     351            <a href="https://api.whatsapp.com/send?text=<?php echo $page_title; ?>%20<?php echo $current_url; ?>" target="_blank" style="color: #25D366;" title="WhatsApp ile Paylaş"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51a12.8 12.8 0 0 0-.57-.01c-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z"/></svg></a>
     352            <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $current_url; ?>" target="_blank" style="color: #1877F2;" title="Facebook ile Paylaş"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.469h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.469h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg></a>
     353            <a href="https://twitter.com/intent/tweet?url=<?php echo $current_url; ?>&text=<?php echo $page_title; ?>" target="_blank" style="color: #000;" class="nbetec-x-icon" title="X ile Paylaş"><svg width="22" height="22" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>
     354            <a href="https://t.me/share/url?url=<?php echo $current_url; ?>&text=<?php echo $page_title; ?>" target="_blank" style="color: #0088cc;" title="Telegram ile Paylaş"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12zM5.397 11.516l12.186-4.69c.563-.207 1.05.132.85 1.077l-2.077 9.774c-.183.82-.67.1023-.93.834l-2.571-1.896-1.243 1.197c-.138.138-.254.255-.522.255l.184-2.613 4.757-4.296c.207-.184-.045-.286-.32-.102l-5.88 3.7-2.535-.79c-.551-.173-.563-.55.115-.815z"/></svg></a>
     355            <div style="width: 1px; height: 24px; background: #e2e8f0; margin: 0 5px;"></div>
     356            <button onclick="window.print()" class="nbetec-print-btn" style="background: none; border: none; cursor: pointer; color: #4a5568; display: flex; align-items: center; padding: 0;" title="Sayfayı Yazdır"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 6 2 18 2 18 9"></polyline><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path><rect x="6" y="14" width="12" height="8"></rect></svg></button>
    292357        </div>
    293358    </div>
    … …  
    302367           
    303368            <?php
    304             // Eczaneleri topla (data içindeki ilk array grubunda bulunuyor)
    305             $nbetec_eczaneler = isset($nbetec_eczane_data['data'][0]) ? $nbetec_eczane_data['data'][0] : array();
    306            
    307             // Benzersiz ilçeleri bul
    308             $nbetec_ilceler = array();
    309             foreach ($nbetec_eczaneler as $nbetec_ecz) {
    310                 $nbetec_ilce_adi = trim($nbetec_ecz['ilce']);
    311                 if (!empty($nbetec_ilce_adi) && !in_array($nbetec_ilce_adi, $nbetec_ilceler)) {
    312                     $nbetec_ilceler[] = $nbetec_ilce_adi;
    313                 }
    314             }
    315             sort($nbetec_ilceler);
    316            
    317             // İlçe filtresi uygula
    318             if ($nbetec_ilce_slug) {
    319                 // İlçe slug'ını Türkçe karakter dönüştürerek veya küçük harf eşleştirerek filtrelememiz lazım.
    320                 $nbetec_filtered = array();
    321                 foreach ($nbetec_eczaneler as $nbetec_ecz) {
    322                     $nbetec_ecz_ilce_slug = sanitize_title($nbetec_ecz['ilce']);
    323                     if ($nbetec_ecz_ilce_slug === $nbetec_ilce_slug) {
    324                         $nbetec_filtered[] = $nbetec_ecz;
    325                     }
    326                 }
    327                 $nbetec_eczaneler = $nbetec_filtered;
    328             }
     369            // İlçe hesaplamaları ve filtrelemeleri yukarı taşındı.
    329370            ?>
    330            
    331             <?php if (!empty($nbetec_ilceler)): ?>
    332 
    333             <div class="nbetec-filters">
    334                 <a href="<?php echo esc_url(home_url(sprintf('/%s-nobetci-eczaneleri', $nbetec_il_slug))); ?>"
    335                    class="nbetec-filter-btn <?php echo empty($nbetec_ilce_slug) ? 'active' : ''; ?>">
    336                     <?php if(empty($nbetec_ilce_slug)): ?><span class="nbetec-filter-icon">&#10003;</span><?php endif; ?><?php esc_html_e('TÜMÜ', 'nobetci-eczaneler'); ?>
    337                 </a>
    338                 <?php foreach ($nbetec_ilceler as $nbetec_ilce_adi):
    339                     $nbetec_current_ilce_slug = sanitize_title($nbetec_ilce_adi);
    340                     $nbetec_is_active = ($nbetec_current_ilce_slug === $nbetec_ilce_slug);
    341                 ?>
    342                     <a href="<?php echo esc_url(home_url(sprintf('/%s-%s-nobetci-eczaneleri', $nbetec_il_slug, $nbetec_current_ilce_slug))); ?>"
    343                        class="nbetec-filter-btn <?php echo $nbetec_is_active ? 'active' : ''; ?>">
    344                         <?php if($nbetec_is_active): ?><span class="nbetec-filter-icon">&#10003;</span><?php endif; ?><?php echo esc_html(nbetec_tr_strtoupper($nbetec_ilce_adi)); ?>
    345                     </a>
    346                 <?php endforeach; ?>
    347             </div>
    348             <?php endif; ?>
    349371           
    350372            <?php if (empty($nbetec_eczaneler)): ?>
  • nobetci-eczaneler/trunk/templates/shortcode-eczane.php

    r3605267 r3638928  
    123123$nbetec_page_title = $nbetec_ilce_name ? "{$nbetec_il_name} {$nbetec_ilce_name} Nöbetçi Eczaneleri" : "{$nbetec_il_name} Nöbetçi Eczaneleri";
    124124
     125$nbetec_global_theme = get_option('nbetec_global_theme', 'light');
     126$nbetec_theme_class = ($nbetec_global_theme === 'dark') ? ' nbetec-theme-dark' : '';
     127
     128// Eczaneleri topla (data içindeki ilk array grubunda bulunuyor)
     129$nbetec_eczaneler = (isset($nbetec_eczane_data) && isset($nbetec_eczane_data['data'][0])) ? $nbetec_eczane_data['data'][0] : array();
     130
     131// Benzersiz ilçeleri bul
     132$nbetec_ilceler = array();
     133foreach ($nbetec_eczaneler as $nbetec_ecz) {
     134    $nbetec_ilce_adi = trim($nbetec_ecz['ilce']);
     135    if (!empty($nbetec_ilce_adi) && !in_array($nbetec_ilce_adi, $nbetec_ilceler)) {
     136        $nbetec_ilceler[] = $nbetec_ilce_adi;
     137    }
     138}
     139sort($nbetec_ilceler);
     140
     141// İlçe filtresi uygula
     142if ($nbetec_ilce_slug) {
     143    $nbetec_filtered = array();
     144    foreach ($nbetec_eczaneler as $nbetec_ecz) {
     145        $nbetec_ecz_ilce_slug = sanitize_title($nbetec_ecz['ilce']);
     146        if ($nbetec_ecz_ilce_slug === $nbetec_ilce_slug) {
     147            $nbetec_filtered[] = $nbetec_ecz;
     148        }
     149    }
     150    $nbetec_eczaneler = $nbetec_filtered;
     151}
     152
     153$nbetec_current_city_name = '';
     154foreach($nbetec_all_cities as $nbetec_plate => $nbetec_city) {
     155    if($nbetec_city['slug'] === $nbetec_il_slug) {
     156        $nbetec_current_city_name = $nbetec_city['name'];
     157        break;
     158    }
     159}
     160if(empty($nbetec_current_city_name)) $nbetec_current_city_name = $nbetec_il_name;
    125161?>
    126 <div class="nbetec-container">
    127     <div class="nbetec-header">
    128         <h1 class="nbetec-title"><?php echo esc_html($nbetec_page_title); ?></h1>
    129         <?php if ($nbetec_eczane_data && !empty($nbetec_eczane_data['detay']['description'])): ?>
    130             <p class="nbetec-desc"><?php echo esc_html($nbetec_eczane_data['detay']['description']); ?></p>
    131         <?php endif; ?>
     162<div class="nbetec-container<?php echo esc_attr($nbetec_theme_class); ?>">
     163    <div class="nbetec-header" style="text-align: left; margin-bottom: 40px;">
     164        <h1 class="nbetec-title" style="margin-bottom: 15px;"><?php echo esc_html($nbetec_page_title); ?></h1>
     165        <?php
     166        // Tarihleri Türkçe oluştur
     167        $nbetec_tr_months = array('', 'Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık');
     168        $nbetec_tr_days = array('Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi');
     169       
     170        // Nöbet tarihi hesaplaması
     171        $current_time = time();
     172        $current_hour = (int)wp_date('G');
     173       
     174        $shift_ts = ($current_hour < 8) ? strtotime('-1 day', $current_time) : $current_time;
     175        $shift_ts = mktime(12, 0, 0, (int)wp_date('n', $shift_ts), (int)wp_date('j', $shift_ts), (int)wp_date('Y', $shift_ts));
     176
     177        $nbetec_current_ts = $shift_ts;
     178
     179        if (isset($nbetec_eczane_data['updated']) && !empty($nbetec_eczane_data['updated'])) {
     180            $nbetec_date_parts = explode('-', $nbetec_eczane_data['updated']);
     181            if (count($nbetec_date_parts) === 3) {
     182                $api_ts = mktime(12, 0, 0, (int)$nbetec_date_parts[1], (int)$nbetec_date_parts[2], (int)$nbetec_date_parts[0]);
     183                if ($api_ts < $shift_ts) {
     184                    $nbetec_current_ts = $api_ts;
     185                }
     186            }
     187        }
     188       
     189        $nbetec_today_m = (int)wp_date('n', $nbetec_current_ts);
     190        $nbetec_today_w = (int)wp_date('w', $nbetec_current_ts);
     191        $nbetec_short_date = wp_date('j', $nbetec_current_ts) . ' ' . $nbetec_tr_months[$nbetec_today_m] . ' ' . $nbetec_tr_days[$nbetec_today_w];
     192        $nbetec_long_date = wp_date('j', $nbetec_current_ts) . ' ' . $nbetec_tr_months[$nbetec_today_m] . ' ' . wp_date('Y', $nbetec_current_ts) . ' ' . $nbetec_tr_days[$nbetec_today_w];
     193       
     194        $nbetec_tomorrow_ts = strtotime('+1 day', $nbetec_current_ts);
     195        $nbetec_tom_m = (int)wp_date('n', $nbetec_tomorrow_ts);
     196        $nbetec_tom_w = (int)wp_date('w', $nbetec_tomorrow_ts);
     197        $nbetec_tom_long_date = wp_date('j', $nbetec_tomorrow_ts) . ' ' . $nbetec_tr_months[$nbetec_tom_m] . ' ' . wp_date('Y', $nbetec_tomorrow_ts) . ' ' . $nbetec_tr_days[$nbetec_tom_w];
     198       
     199        $nbetec_loc_text = $nbetec_il_name;
     200        if (!empty($nbetec_ilce_name)) {
     201            $nbetec_loc_text .= ' ' . $nbetec_ilce_name;
     202        }
     203
     204        $nbetec_mesai_text = in_array($nbetec_today_w, array(0, 6)) ? 'gününden' : 'mesai bitiminden';
     205        ?>
     206        <div class="nbetec-desc" style="font-size: 15px; line-height: 1.6; text-align: justify; margin: 0;">
     207            <p style="margin-top: 0; margin-bottom: 10px;"><strong><?php echo esc_html($nbetec_short_date); ?></strong> <?php echo esc_html($nbetec_loc_text); ?> Nöbetçi Eczanelerine sayfamızdan ulaşabilirsiniz.</p>
     208            <p style="margin-bottom: 0;">Bu sayfada <strong><?php echo esc_html($nbetec_long_date); ?></strong> <?php echo esc_html($nbetec_mesai_text); ?>, <strong><?php echo esc_html($nbetec_tom_long_date); ?></strong> sabaha kadar açık olan <strong><?php echo esc_html($nbetec_loc_text); ?></strong> nöbetçi eczanelerinin listesini bulabilirsiniz. Bazı eczaneler, gece boyu nöbet tutmuyor olabilir; bazıları ise icap nöbeti tutuyor veya mücbir bir sebeple nöbet başında bulunamıyor olabilir. Bu nedenle eczaneye gitmeden önce telefonla açık olduğunu teyit etmeniz tavsiye olunur. Geçmiş olsun dileklerimizle.</p>
     209        </div>
    132210    </div>
    133211   
    134     <?php
    135     $nbetec_current_city_name = '';
    136     foreach($nbetec_all_cities as $nbetec_plate => $nbetec_city) {
    137         if($nbetec_city['slug'] === $nbetec_il_slug) {
    138             $nbetec_current_city_name = $nbetec_city['name'];
    139             break;
    140         }
    141     }
    142     if(empty($nbetec_current_city_name)) $nbetec_current_city_name = $nbetec_il_name;
    143     ?>
    144     <div class="nbetec-city-selector" style="position: relative; margin-bottom: 20px; width: 100%; max-width: 400px; font-family: sans-serif;">
    145         <div class="nbetec-selector-header" style="background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #2d3748; font-weight: 500;">
    146             <span><?php esc_html_e('Şehir Seçin:', 'nobetci-eczaneler'); ?> <strong><?php echo esc_html($nbetec_current_city_name); ?></strong></span>
    147             <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
     212    <div class="nbetec-controls-row">
     213        <div class="nbetec-city-selector" style="position: relative; font-family: sans-serif;">
     214            <div class="nbetec-selector-header" style="background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #2d3748; font-weight: 500;">
     215                <span><?php esc_html_e('Şehir Seçin:', 'nobetci-eczaneler'); ?> <strong><?php echo esc_html(mb_strtoupper(str_replace(array('i', 'ı', 'ğ', 'ü', 'ş', 'ö', 'ç'), array('İ', 'I', 'Ğ', 'Ü', 'Ş', 'Ö', 'Ç'), $nbetec_current_city_name), 'UTF-8')); ?></strong></span>
     216                <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
     217            </div>
     218            <div class="nbetec-selector-dropdown nbetec-city-dropdown" style="display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 100; margin-top: 5px; overflow: hidden;">
     219                <div style="padding: 10px; border-bottom: 1px solid #e2e8f0; background: #f7fafc;">
     220                    <input type="text" class="nbetec-search-input" placeholder="<?php esc_attr_e('şehir adı veya plaka kodu yazın...', 'nobetci-eczaneler'); ?>" style="width: 100%; border: 1px solid #cbd5e0; border-radius: 4px; padding: 8px 12px; outline: none; font-size: 14px; box-sizing: border-box;">
     221                </div>
     222                <ul class="nbetec-city-list" style="max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0;">
     223                    <?php foreach($nbetec_all_cities as $nbetec_plate => $nbetec_city): ?>
     224                        <li>
     225                            <a href="<?php echo esc_url(nbetec_get_url($nbetec_city['slug'])); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7;">
     226                                <?php if($nbetec_plate !== 'kibris'): ?>
     227                                    <span class="nbetec-plate" style="display: inline-block; background: #edf2f7; color: #4a5568; padding: 2px 6px; border-radius: 4px; margin-right: 8px; font-size: 12px; font-weight: bold;"><?php echo esc_html($nbetec_plate); ?></span>
     228                                <?php else: ?>
     229                                    <span class="nbetec-plate" style="display: inline-block; background: #fff; border: 1px solid #e2e8f0; padding: 2px 6px; border-radius: 4px; margin-right: 8px;"><img src="<?php echo esc_url(NBETEC_URL . 'assets/images/kktc.svg'); ?>" alt="KKTC" width="18" height="12" style="vertical-align: middle;"></span>
     230                                <?php endif; ?>
     231                                <span class="nbetec-city-name" style="font-weight: 600; font-size: 15px;"><?php echo esc_html(mb_strtoupper(str_replace(array('i', 'ı', 'ğ', 'ü', 'ş', 'ö', 'ç'), array('İ', 'I', 'Ğ', 'Ü', 'Ş', 'Ö', 'Ç'), $nbetec_city['name']), 'UTF-8')); ?></span>
     232                            </a>
     233                        </li>
     234                    <?php endforeach; ?>
     235                </ul>
     236            </div>
    148237        </div>
    149         <div class="nbetec-selector-dropdown" style="display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 100; margin-top: 5px; overflow: hidden;">
    150             <div style="padding: 10px; border-bottom: 1px solid #e2e8f0; background: #f7fafc;">
    151                 <input type="text" class="nbetec-search-input" placeholder="<?php esc_attr_e('şehir adı veya plaka kodu yazın...', 'nobetci-eczaneler'); ?>" style="width: 100%; border: 1px solid #cbd5e0; border-radius: 4px; padding: 8px 12px; outline: none; font-size: 14px; box-sizing: border-box;">
     238
     239        <?php if (!empty($nbetec_ilceler)): ?>
     240        <div class="nbetec-district-selector" style="position: relative; font-family: sans-serif;">
     241            <div class="nbetec-selector-header nbetec-district-header" style="background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #2d3748; font-weight: 500;">
     242                <span><?php esc_html_e('İlçe Seçin:', 'nobetci-eczaneler'); ?> <strong><?php echo $nbetec_ilce_name ? esc_html(mb_strtoupper(str_replace(array('i', 'ı', 'ğ', 'ü', 'ş', 'ö', 'ç'), array('İ', 'I', 'Ğ', 'Ü', 'Ş', 'Ö', 'Ç'), $nbetec_ilce_name), 'UTF-8')) : 'TÜMÜ'; ?></strong></span>
     243                <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
    152244            </div>
    153             <ul class="nbetec-city-list" style="max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0;">
    154                 <?php foreach($nbetec_all_cities as $nbetec_plate => $nbetec_city): ?>
     245            <div class="nbetec-selector-dropdown nbetec-district-dropdown" style="display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 100; margin-top: 5px; overflow: hidden;">
     246                <ul class="nbetec-city-list" style="max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0;">
    155247                    <li>
    156                         <a href="<?php echo esc_url(home_url(sprintf('/%s-nobetci-eczaneleri', $nbetec_city['slug']))); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7;">
    157                             <?php if($nbetec_plate !== 'kibris'): ?>
    158                                 <span class="nbetec-plate" style="display: inline-block; background: #edf2f7; color: #4a5568; padding: 2px 6px; border-radius: 4px; margin-right: 8px; font-size: 12px; font-weight: bold;"><?php echo esc_html($nbetec_plate); ?></span>
    159                             <?php else: ?>
    160                                 <span class="nbetec-plate" style="display: inline-block; background: #fff; border: 1px solid #e2e8f0; color: #e53e3e; padding: 2px 6px; border-radius: 4px; margin-right: 8px; font-size: 12px; font-weight: bold;">&#10084;&#65039;</span>
    161                             <?php endif; ?>
    162                             <span class="nbetec-city-name"><?php echo esc_html($nbetec_city['name']); ?></span>
     248                        <a href="<?php echo esc_url(nbetec_get_url($nbetec_il_slug)); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7; font-weight: 600;">
     249                            TÜMÜ
    163250                        </a>
    164251                    </li>
    165                 <?php endforeach; ?>
    166             </ul>
     252                    <?php foreach($nbetec_ilceler as $ilce_adi): ?>
     253                        <li>
     254                            <a href="<?php echo esc_url(nbetec_get_url($nbetec_il_slug, sanitize_title($ilce_adi))); ?>" style="display: block; padding: 10px 15px; color: #4a5568; text-decoration: none; border-bottom: 1px solid #edf2f7; font-weight: 600;">
     255                                <?php echo esc_html(mb_strtoupper(str_replace(array('i', 'ı', 'ğ', 'ü', 'ş', 'ö', 'ç'), array('İ', 'I', 'Ğ', 'Ü', 'Ş', 'Ö', 'Ç'), $ilce_adi), 'UTF-8')); ?>
     256                            </a>
     257                        </li>
     258                    <?php endforeach; ?>
     259                </ul>
     260            </div>
     261        </div>
     262        <?php endif; ?>
     263
     264        <div class="nbetec-share-actions" style="display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #cbd5e0; border-radius: 8px; padding: 10px 15px;">
     265            <span class="nbetec-share-label" style="font-weight: 600; color: #2d3748; margin-right: 5px;">Paylaş:</span>
     266            <?php
     267            $share_url = urlencode((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
     268            $share_title = urlencode($nbetec_page_title);
     269            ?>
     270            <a href="https://api.whatsapp.com/send?text=<?php echo $share_title; ?>%20<?php echo $share_url; ?>" target="_blank" style="color: #25D366; display: flex;" title="WhatsApp ile Paylaş"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51a12.8 12.8 0 0 0-.57-.01c-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z"/></svg></a>
     271            <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $share_url; ?>" target="_blank" style="color: #1877F2; display: flex;" title="Facebook ile Paylaş"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.469h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.469h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg></a>
     272            <a href="https://twitter.com/intent/tweet?url=<?php echo $share_url; ?>&text=<?php echo $share_title; ?>" target="_blank" style="color: #000; display: flex;" class="nbetec-x-icon" title="X ile Paylaş"><svg width="22" height="22" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>
     273            <a href="https://t.me/share/url?url=<?php echo $share_url; ?>&text=<?php echo $share_title; ?>" target="_blank" style="color: #0088cc; display: flex;" title="Telegram ile Paylaş"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12zM5.397 11.516l12.186-4.69c.563-.207 1.05.132.85 1.077l-2.077 9.774c-.183.82-.67.1023-.93.834l-2.571-1.896-1.243 1.197c-.138.138-.254.255-.522.255l.184-2.613 4.757-4.296c.207-.184-.045-.286-.32-.102l-5.88 3.7-2.535-.79c-.551-.173-.563-.55.115-.815z"/></svg></a>
     274            <div style="width: 1px; height: 24px; background: #e2e8f0; margin: 0 5px;"></div>
     275            <button onclick="window.print()" class="nbetec-print-btn" style="background: none; border: none; cursor: pointer; color: #4a5568; display: flex; align-items: center; padding: 0;" title="Sayfayı Yazdır"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 6 2 18 2 18 9"></polyline><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path><rect x="6" y="14" width="12" height="8"></rect></svg></button>
    167276        </div>
    168277    </div>
    169278
    170 
    171279    <div class="nbetec-content">
    172         <?php if (empty($nbetec_eczane_data) || empty($nbetec_eczane_data['data'])): ?>
    173             <div class="nbetec-alert nbetec-alert-warning">
    174                 <p><?php esc_html_e('Şu anda bu bölge için nöbetçi eczane bilgisi bulunmamaktadır.', 'nobetci-eczaneler'); ?></p>
    175             </div>
    176         <?php else: ?>
    177            
    178             <?php
    179             // Eczaneleri topla (data içindeki ilk array grubunda bulunuyor)
    180             $nbetec_eczaneler = isset($nbetec_eczane_data['data'][0]) ? $nbetec_eczane_data['data'][0] : array();
    181            
    182             // Benzersiz ilçeleri bul
    183             $nbetec_ilceler = array();
    184             foreach ($nbetec_eczaneler as $nbetec_ecz) {
    185                 $nbetec_ilce_adi = trim($nbetec_ecz['ilce']);
    186                 if (!empty($nbetec_ilce_adi) && !in_array($nbetec_ilce_adi, $nbetec_ilceler)) {
    187                     $nbetec_ilceler[] = $nbetec_ilce_adi;
    188                 }
    189             }
    190             sort($nbetec_ilceler);
    191            
    192             // İlçe filtresi uygula
    193             if ($nbetec_ilce_slug) {
    194                 // İlçe slug'ını Türkçe karakter dönüştürerek veya küçük harf eşleştirerek filtrelememiz lazım.
    195                 $nbetec_filtered = array();
    196                 foreach ($nbetec_eczaneler as $nbetec_ecz) {
    197                     $nbetec_ecz_ilce_slug = sanitize_title($nbetec_ecz['ilce']);
    198                     if ($nbetec_ecz_ilce_slug === $nbetec_ilce_slug) {
    199                         $nbetec_filtered[] = $nbetec_ecz;
    200                     }
    201                 }
    202                 $nbetec_eczaneler = $nbetec_filtered;
    203             }
    204             ?>
    205            
    206             <?php if (!empty($nbetec_ilceler)): ?>
    207 
    208             <div class="nbetec-filters">
    209                 <a href="<?php echo esc_url(home_url(sprintf('/%s-nobetci-eczaneleri', $nbetec_il_slug))); ?>"
    210                    class="nbetec-filter-btn <?php echo empty($nbetec_ilce_slug) ? 'active' : ''; ?>">
    211                     <?php if(empty($nbetec_ilce_slug)): ?><span class="nbetec-filter-icon">&#10003;</span><?php endif; ?><?php esc_html_e('Tümü', 'nobetci-eczaneler'); ?>
    212                 </a>
    213                 <?php foreach ($nbetec_ilceler as $nbetec_ilce_adi):
    214                     $nbetec_current_ilce_slug = sanitize_title($nbetec_ilce_adi);
    215                     $nbetec_is_active = ($nbetec_current_ilce_slug === $nbetec_ilce_slug);
    216                 ?>
    217                     <a href="<?php echo esc_url(home_url(sprintf('/%s-%s-nobetci-eczaneleri', $nbetec_il_slug, $nbetec_current_ilce_slug))); ?>"
    218                        class="nbetec-filter-btn <?php echo $nbetec_is_active ? 'active' : ''; ?>">
    219                         <?php if($nbetec_is_active): ?><span class="nbetec-filter-icon">&#10003;</span><?php endif; ?><?php echo esc_html($nbetec_ilce_adi); ?>
    220                     </a>
    221                 <?php endforeach; ?>
    222             </div>
    223             <?php endif; ?>
    224280           
    225281            <?php if (empty($nbetec_eczaneler)): ?>
    … …  
    233289                            <img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4yLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCA2NCA2NCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNjQgNjQ7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+DQoJLnN0MHtmaWxsOiNDQzAwMDA7fQ0KPC9zdHlsZT4NCjxnPg0KCTxwb2x5Z29uIGlkPSJwb2x5Z29uM18xXyIgY2xhc3M9InN0MCIgcG9pbnRzPSIyNy4yLDQ0LjEgMjcuMiwzNC45IDQ4LjMsMzQuOSA0OC4zLDI1IDI3LjIsMjUgMjcuMiwxOC45IDQ5LjgsMTguOSA0OS44LDkgMjcuMiw5IA0KCQkyNyw5IDEzLDkgMTMsNTQuOCAyNyw1NC44IDI3LjIsNTQuOCA1MS40LDU0LjggNTEuNCw0NC4xIAkiLz4NCgk8cGF0aCBpZD0icGF0aDVfM18iIGNsYXNzPSJzdDAiIGQ9Ik01OS44LDQuM3Y1NS4ySDQuNFY0LjNINTkuOCBNNTkuOCwwSDQuNEMyLDAsMC4xLDIsMC4xLDQuM3Y1NS4yQzAuMSw2MiwyLDY0LDQuNCw2NGg1NS4yDQoJCWMyLjMsMCw0LjMtMiw0LjMtNC4zVjQuM0M2NC4xLDIsNjIuMywwLDU5LjgsMEw1OS44LDB6Ii8+DQo8L2c+DQo8L3N2Zz4NCg==" alt="Eczane" class="nbetec-card-logo">
    234290                            <div style="display: flex; align-items: center; gap: 12px; margin-bottom: 15px;">
    235                                 <h3 class="nbetec-name"><?php echo esc_html($nbetec_eczane['eczane_adi']); ?></h3>
     291                                <h3 class="nbetec-name" style="margin: 0; padding: 0; border: none;"><?php echo esc_html($nbetec_eczane['eczane_adi']); ?></h3>
    236292                            </div>
    237293                            <div class="nbetec-card-content">
    238                                 <div class="nbetec-ilce"><?php echo esc_html($nbetec_eczane['ilce']); ?></div>
     294                                <div class="nbetec-ilce"><?php echo esc_html(mb_strtoupper(str_replace(array('i', 'ı', 'ğ', 'ü', 'ş', 'ö', 'ç'), array('İ', 'I', 'Ğ', 'Ü', 'Ş', 'Ö', 'Ç'), $nbetec_eczane['ilce']), 'UTF-8')); ?></div>
    239295                                <div class="nbetec-address">
    240296                                    <?php
    … …  
    243299                                        : $nbetec_eczane['eczane_adi'] . ' ' . $nbetec_eczane['adres'];
    244300                                    ?>
    245                                     <a href="https://maps.google.com/?q=<?php echo urlencode($nbetec_map_query); ?>" target="_blank" rel="noopener noreferrer" aria-label="<?php echo esc_attr(sprintf('Adres: %s', $nbetec_eczane['adres'])); ?>">
     301                                    <a href="https://maps.google.com/?q=<?php echo urlencode($nbetec_map_query); ?>" target="_blank" rel="noopener noreferrer" aria-label="<?php echo esc_attr(sprintf('Adres: %s', $nbetec_eczane['adres'])); ?>" style="text-decoration: none !important; border: none !important; box-shadow: none !important;">
    246302                                        <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>
    247303                                        <?php echo esc_html($nbetec_eczane['adres']); ?>
    … …  
    249305                                </div>
    250306                                <div class="nbetec-phone">
    251                                     <a href="tel:<?php echo esc_attr(preg_replace('/[^0-9+]/', '', $nbetec_eczane['telefon'])); ?>" aria-label="<?php echo esc_attr(sprintf('Telefon: %s', $nbetec_eczane['telefon'])); ?>">
     307                                    <a href="tel:<?php echo esc_attr(preg_replace('/[^0-9+]/', '', $nbetec_eczane['telefon'])); ?>" aria-label="<?php echo esc_attr(sprintf('Telefon: %s', $nbetec_eczane['telefon'])); ?>" style="text-decoration: none !important; border: none !important; box-shadow: none !important;">
    252308                                        <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>
    253309                                        <?php echo esc_html($nbetec_eczane['telefon']); ?>
    … …  
    270326                </div>
    271327            <?php endif; ?>
    272         <?php endif; ?>
    273328    </div>
    274329</div>
  • nobetci-eczaneler/trunk/templates/shortcode-home.php

    r3585474 r3638928  
    77    '01' => ['slug' => 'adana', 'name' => 'Adana'],
    88    '02' => ['slug' => 'adiyaman', 'name' => 'Adıyaman'],
    9     '03' => ['slug' => 'afyonkarahisar', 'name' => 'Afyonkarahisar'],
     9    '03' => ['slug' => 'afyonkarahisar', 'name' => 'A.Karahisar'],
    1010    '04' => ['slug' => 'agri', 'name' => 'Ağrı'],
    1111    '05' => ['slug' => 'amasya', 'name' => 'Amasya'],
    … …  
    5050    '44' => ['slug' => 'malatya', 'name' => 'Malatya'],
    5151    '45' => ['slug' => 'manisa', 'name' => 'Manisa'],
    52     '46' => ['slug' => 'kahramanmaras', 'name' => 'Kahramanmaraş'],
     52    '46' => ['slug' => 'kahramanmaras', 'name' => 'K.Maraş'],
    5353    '47' => ['slug' => 'mardin', 'name' => 'Mardin'],
    5454    '48' => ['slug' => 'mugla', 'name' => 'Muğla'],
    … …  
    8989);
    9090?>
     91<?php
     92$nbetec_global_theme = get_option('nbetec_global_theme', 'light');
     93$nbetec_theme_class = ($nbetec_global_theme === 'dark') ? ' nbetec-theme-dark' : '';
     94?>
    9195
    92 <div class="nbetec-container nbetec-shortcode">
     96<div class="nbetec-container nbetec-shortcode<?php echo esc_attr($nbetec_theme_class); ?>">
    9397    <div class="nbetec-header">
    9498        <h2 class="nbetec-title"><?php esc_html_e('Nöbetçi Eczane İl Seçimi', 'nobetci-eczaneler'); ?></h2>
    … …  
    103107    <div class="nbetec-city-grid">
    104108        <?php foreach ($nbetec_all_cities as $nbetec_plate => $nbetec_city): ?>
    105             <a href="<?php echo esc_url(home_url(sprintf('/%s-nobetci-eczaneleri', sanitize_title($nbetec_city['name'])))); ?>" class="nbetec-city-card" data-search="<?php echo esc_attr($nbetec_plate . ' ' . mb_strtolower($nbetec_city['name'], 'UTF-8')); ?>">
    106                 <span class="nbetec-city-plate"><?php echo $nbetec_plate === 'kibris' ? '❤️' : esc_html($nbetec_plate); ?></span>
     109            <a href="<?php echo esc_url(nbetec_get_url($nbetec_city['slug'])); ?>" class="nbetec-city-card" data-search="<?php echo esc_attr($nbetec_plate . ' ' . mb_strtolower($nbetec_city['name'], 'UTF-8')); ?>" style="text-decoration: none !important;">
     110                <span class="nbetec-city-plate"><?php echo $nbetec_plate === 'kibris' ? '<img src="' . esc_url(NBETEC_URL . 'assets/images/kktc.svg') . '" alt="KKTC" width="24" height="16" style="vertical-align: middle; border: 1px solid #e2e8f0; border-radius: 2px;">' : esc_html($nbetec_plate); ?></span>
    107111                <span class="nbetec-city-name"><?php echo esc_html($nbetec_city['name']); ?></span>
    108112            </a>
Note: See TracChangeset for help on using the changeset viewer.