Ziyaretçiler ve üyelerin profil ayarlarına girmeden varsayılan temalarını değiştirmelerini sağlar. Forumun en altına tema listesinin seçilmesini sağlayan bir menü ekler.

Default Theme > Babylon Theme> Classic Theme> Dilbermc Theme

source/Themes.php yi aç
bul
[code]
'pick' => 'PickTheme',
[/code]
Sonrasına ekle
[code]

'qpick' => 'QuickPickTheme',[/code]

Bul
[code]function ThemeInstall()[/code]

öncesine ekle

[code]function QuickPickTheme()
{
global $txt, $db_prefix, $sc, $context, $modSettings, $user_info, $ID_MEMBER, $language;

checkSession('get');

loadLanguage('Profile');
loadTemplate('Themes');

$_SESSION['ID_THEME'] = 0;

if (isset($_GET['id']))
$_GET['th'] = $_GET['id'];

// Have we made a desicion, or are we just browsing?
if (isset($_GET['th']))
{
// Save for this user.
if (!isset($_REQUEST['u']) || !allowedTo('admin_forum'))
{
updateMemberData($ID_MEMBER, array('ID_THEME' => (int) $_GET['th']));

redirectexit('');
}
// For everyone.
elseif ($_REQUEST['u'] == '0')
{
updateMemberData(null, array('ID_THEME' => (int) $_GET['th']));

redirectexit('');
}
// Change the default/guest theme.
elseif ($_REQUEST['u'] == '-1')
{
updateSettings(array('theme_guests' => (int) $_GET['th']));

redirectexit('');
}
// Change a specific member's theme.
else
{
updateMemberData((int) $_REQUEST['u'], array('ID_THEME' => (int) $_GET['th']));

redirectexit('');
}
}

// Figure out who the member of the minute is, and what theme they've chosen.
if (!isset($_REQUEST['u']) || !allowedTo('admin_forum'))
{
$context['current_member'] = $ID_MEMBER;
$context['current_theme'] = $user_info['theme'];
}
// Everyone can't chose just one.
elseif ($_REQUEST['u'] == '0')
{
$context['current_member'] = 0;
$context['current_theme'] = 0;
}
// Guests and such...
elseif ($_REQUEST['u'] == '-1')
{
$context['current_member'] = -1;
$context['current_theme'] = $modSettings['theme_guests'];
}
// Someones else :P.
else
{
$context['current_member'] = (int) $_REQUEST['u'];

$request = db_query("
SELECT ID_THEME
FROM {$db_prefix}members
WHERE ID_MEMBER = $context[current_member]
LIMIT 1", __FILE__, __LINE__);
list ($context['current_theme']) = mysql_fetch_row($request);
mysql_free_result($request);
}
// Get the theme name and descriptions.
$context['available_themes'] = array();
if (!empty($modSettings['knownThemes']))
{
$knownThemes = implode("[/swf2][swf3]", explode(',', $modSettings['knownThemes']));

$request = db_query("
SELECT ID_THEME, variable, value
FROM {$db_prefix}themes
WHERE variable IN ('name[/swf2][swf3]theme_url[/swf2][swf3]theme_dir[/swf2][swf3]images_url')" . (empty($modSettings['theme_default']) && !allowedTo('admin_forum') ? "
AND ID_THEME IN ('$knownThemes')
AND ID_THEME != 1" : '') . "
AND ID_THEME != 0
LIMIT " . count(explode(',', $modSettings['knownThemes'])) * 8, __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
if (!isset($context['available_themes'][$row['ID_THEME']]))
$context['available_themes'][$row['ID_THEME']] = array(
'id' => $row['ID_THEME'],
'selected' => $context['current_theme'] == $row['ID_THEME'],
'num_users' => 0
);
$context['available_themes'][$row['ID_THEME']][$row['variable']] = $row['value'];
}
mysql_free_result($request);
}

// Okay, this is a complicated problem: the default theme is 1, but they aren't allowed to access 1!
if (!isset($context['available_themes'][$modSettings['theme_guests']]))
{
$context['available_themes'][0] = array(
'num_users' => 0
);
$guest_theme = 0;
}
else
$guest_theme = $modSettings['theme_guests'];

$request = db_query("
SELECT ID_THEME, COUNT(*) AS theCount
FROM {$db_prefix}members
GROUP BY ID_THEME DESC", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
// Figure out which theme it is they are REALLY using.
if ($row['ID_THEME'] == 1 && empty($modSettings['theme_default']))
$row['ID_THEME'] = $guest_theme;
elseif (empty($modSettings['theme_allow']))
$row['ID_THEME'] = $guest_theme;

if (isset($context['available_themes'][$row['ID_THEME']]))
$context['available_themes'][$row['ID_THEME']]['num_users'] += $row['theCount'];
else
$context['available_themes'][$guest_theme]['num_users'] += $row['theCount'];
}
mysql_free_result($request);

foreach ($context['available_themes'] as $ID_THEME => $theme_data)
{
// Don't try to load the forum or board default theme's data... it doesn't have any!
if ($ID_THEME == 0)
continue;

$settings = $theme_data;
$settings['theme_id'] = $ID_THEME;

if (file_exists($settings['theme_dir'] . '/languages/Settings.' . $user_info['language'] . '.php'))
include($settings['theme_dir'] . '/languages/Settings.' . $user_info['language'] . '.php');
elseif (file_exists($settings['theme_dir'] . '/languages/Settings.' . $language . '.php'))
include($settings['theme_dir'] . '/languages/Settings.' . $language . '.php');
else
{
$txt['theme_thumbnail_href'] = $settings['images_url'] . '/thumbnail.gif';
$txt['theme_description'] = '';
}

$context['available_themes'][$ID_THEME]['thumbnail_href'] = $txt['theme_thumbnail_href'];
$context['available_themes'][$ID_THEME]['description'] = $txt['theme_description'];
}

// As long as we're not doing the default theme...
if (!isset($_REQUEST['u']) || $_REQUEST['u'] >= 0)
{
if ($guest_theme != 0)
$context['available_themes'][0] = $context['available_themes'][$guest_theme];

$context['available_themes'][0]['id'] = 0;
$context['available_themes'][0]['name'] = $txt['theme_forum_default'];
$context['available_themes'][0]['selected'] = $context['current_theme'] == 0;
$context['available_themes'][0]['description'] = $txt['theme_global_description'];
}

ksort($context['available_themes']);

$context['page_title'] = &$txt['theme_pick'];
$context['sub_template'] = 'qpick';
}
[/code]

language/Modifications.turkish.php yi aç

Bul


[code] ?> [/code]

öncesine ekle

[code]$txt['qthemes'] = 'TEMALAR';
$txt['qthemeselect'] = 'Lütfen bir tema seçin'; [/code]


language/Modifications.turkish-utf8.php yi aç

bul

[code] ?> [/code]


öncesine ekle

[code]$txt['qthemes'] = 'TEMALAR';
$txt['qthemeselect'] = 'Lütfen bir tema seçin'; [/code]

language/Modifications.english.php yi aça,

bul

[code] ?> [/code]

öncesine ekle

[code] $txt['qthemes'] = 'THEMES';
$txt['qthemeselect'] = 'Please Select Theme'; [/code]

language/Modifications.english-utf8.php yi aç

bul

[code] ?> [/code]

öncesine ekle

[code] $txt['qthemes'] = 'THEMES';
$txt['qthemeselect'] = 'Please Select Theme'; [/code]

theme/index.template.php yi aç

bul

[code] // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere! [/code]

öncesine ekle

[code] //Added By Badboy
//Show Theme Picker ;)
echo '








'; [/code]

bul

[code]?> [/code]

öncesine ekle

[code]
// This neat function finds and returns info about all of our themes.
function getQuickThemeData()
{
global $db_prefix, $user_info, $scripturl, $settings, $options, $modSettings;

$themes = array();

// Get all of our themes.
$request = db_query("
SELECT value, ID_THEME
FROM {$db_prefix}themes
WHERE variable = 'name'
AND ID_THEME != $settings[theme_id]" . (empty($modSettings['theme_default']) ? '
AND ID_THEME != 1' : '') . "
ORDER BY value", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
$themes[] = array(
'id' => $row['ID_THEME'],
'name' => $row['value'],
);
}
return $themes;
}
[/code]

board/Themes/babylon/index.template.php yi aç

bul

[code]
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
[/code]

öncesine ekle

[code]
//Show Theme Picker ;)
echo '












';
[/code]

Bul

[code]
?>
[/code]

öncesine ekle

[code]
// This neat function finds and returns info about all of our themes.
function getQuickThemeData()
{
global $db_prefix, $user_info, $scripturl, $settings, $options, $modSettings;

$themes = array();

// Get all of our themes.
$request = db_query("
SELECT value, ID_THEME
FROM {$db_prefix}themes
WHERE variable = 'name'
AND ID_THEME != $settings[theme_id]" . (empty($modSettings['theme_default']) ? '
AND ID_THEME != 1' : '') . "
ORDER BY value", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
$themes[] = array(
'id' => $row['ID_THEME'],
'name' => $row['value'],
);
}
return $themes;
}
[/code]

board/Themes/classic/index.template.php yi açın

bul

[code]
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
[/code]

öncesine ekle

[code]
//Show Theme Picker ;)
echo '









';
[/code]

Bul

[code]
?>
[/code]

öncesine ekle

[code]
// This neat function finds and returns info about all of our themes.
function getQuickThemeData()
{
global $db_prefix, $user_info, $scripturl, $settings, $options, $modSettings;

$themes = array();

// Get all of our themes.
$request = db_query("
SELECT value, ID_THEME
FROM {$db_prefix}themes
WHERE variable = 'name'
AND ID_THEME != $settings[theme_id]" . (empty($modSettings['theme_default']) ? '
AND ID_THEME != 1' : '') . "
ORDER BY value", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
$themes[] = array(
'id' => $row['ID_THEME'],
'name' => $row['value'],
);
}
return $themes;
}
[/code]


board/Themes/dilbermc/index.template.php yi aç

bul

[code]
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
[/code]

öncesine ekle

[code]
//Show Theme Picker ;)
echo '







';
[/code]

Bul
[code]
?>
[/code]

öncesine ekle

[code]
// This neat function finds and returns info about all of our themes.
function getQuickThemeData()
{
global $db_prefix, $user_info, $scripturl, $settings, $options, $modSettings;

$themes = array();

// Get all of our themes.
$request = db_query("
SELECT value, ID_THEME
FROM {$db_prefix}themes
WHERE variable = 'name'
AND ID_THEME != $settings[theme_id]" . (empty($modSettings['theme_default']) ? '
AND ID_THEME != 1' : '') . "
ORDER BY value", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
$themes[] = array(
'id' => $row['ID_THEME'],
'name' => $row['value'],
);
}
return $themes;
}
[/code]

Beğeniler: 0
Favoriler: 0
İzlenmeler: 503
favori
like
share
bir_tebessum Tarih: 07.06.2008 02:14
öfff ne zahmetli is yemin ederim var ya smf forumu kurdum canimdan bezecege benziyorum bakalim hayirlisi