goKhaN-c3
Moderatör
İleti: 940
Teşekkür Sayısı: 64
Çevrimdışı
Cinsiyet: 
|
 |
« : 25 Temmuz 2010, 12:16:35 » |
|
Modifikasyon Adı: Simple Theme Changer Yazar: Fustrate
Yedek Alarak Başlayın...
İndex.php'de Bul:
loadSession(); Sonrasına Ekle:
// Simple Theme Changer $request = $smcFunc['db_query']('', ' SELECT * FROM {db_prefix}themes WHERE variable = {string:name} AND id_member = 0 AND id_theme IN ({raw:known})', array('name' => 'name', 'known' => $modSettings['knownThemes']) ); $context['themes'] = array(); while ($row = $smcFunc['db_fetch_assoc']($request)) $context['themes'][$row['id_theme']] = $row['value']; $smcFunc['db_free_result']($request); // End Simple Theme Changer ./Themes/default/index.template.php
Bul:
</table>'; // Show the load time? Değiştir:
<tr> <td colspan="3" style="text-align: right;"> <select id="simple_theme_changer" onchange="switch_theme();"> <optgroup label="', $txt['simple_theme_changer_name'], '">'; foreach ($context['themes'] as $id => $theme) echo ' <option value="', $id, '"', (($settings['theme_id'] == $id) ? ' selected="selected"' : ''), '>', $theme, '</option>'; echo ' </optgroup> </select> </td> </tr> </table>'; // Show the load time? Bul:
echo ' </div> </div>'; } Değiştir:
echo ' </div> <div class="floatright"> <select id="simple_theme_changer" onchange="switch_theme();"> <optgroup label="', $txt['simple_theme_changer_name'], '">'; foreach ($context['themes'] as $id => $theme) echo ' <option value="', $id, '"', (($settings['theme_id'] == $id) ? ' selected="selected"' : ''), '>', $theme, '</option>'; echo ' </optgroup> </select> </div> </div>'; } ./Themes/scripts/script.js
Sonuna Ekle:
function switch_theme(){ theme_changer = document.getElementById('simple_theme_changer'); var id = theme_changer.options[theme_changer.selectedIndex].value; var page = new String(window.location); var themereg = new RegExp("theme=([0-9]+);?"); var hash = ""; page = page.replace(themereg, ""); // Remove anything after a hash... sorry if(page.search("#") != -1){ hash = page.substr(page.search("#")); page = page.substr(0, page.search("#")); } // Remove any ending question marks... while (page.charAt(page.length-1) == "?" || page.charAt(page.length-1) == ";") page = page.substr(0, page.length - 1); // Are there already things in a query string? if(page.search("/index.php") < (page.length - 10) && page.search("/index.php") != -1) window.location = page + ";theme=" + id + hash; // or is index.php at the end? else if(page.search("/index.php") == (page.length - 10)) window.location = page + "?theme=" + id + hash; // Are we ending with a slash? else if(page.charAt(page.length-1) == "/") window.location = page + "index.php?theme=" + id + hash; // or are we pretty much nowhere? else window.location = page + "/index.php?theme=" + id + hash; return false; } languages/Modifications.english.php Bul:
?> Üstüne Ekle:
$txt['simple_theme_changer_name'] = 'Simple Theme Changer'; default/languages/Modifications.turkish.php Bul:
?> Üstüne Ekle:
$txt['simple_theme_changer_name'] = 'Bir Tema Secin'; RC5 Sürüm Kullananlar yukarıdaki değişiklik yerine Index.template.php dosyasında aşağıdaki değişikliği yapsınlar. Bul:
// Show the load time?Üstüne ekle:
echo ' <select id="simple_theme_changer" onchange="switch_theme();"> <optgroup label="', $txt['simple_theme_changer_name'], '">'; foreach ($context['themes'] as $id => $theme) echo ' <option value="', $id, '"', (($settings['theme_id'] == $id) ? ' selected="selected"' : ''), '>', $theme, '</option> </optgroup> </select>';
|