Simple Machines Community Forum

SMF Support => Türkçe Bölümü (Turkish) => Language Specific Support => İpuçları ve Hileler => Topic started by: Hoochie Coochie Man on May 11, 2008, 03:25:28 AM

Title: Fancy menu
Post by: Hoochie Coochie Man on May 11, 2008, 03:25:28 AM






Tüyo adı:Fancy menu
Yazan:Hoochie Coochie Man
Açıklama:Flash görünümlü bir menu.
Demo:http://smfthemes.890m.com/forum/index.php?topic=5.0
Anlatım:Default temaya göredir


Büyük Resim... (http://img151.imageshack.us/img151/262/28474458oj8.jpg)




index.template.php'de..
Bul:
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}

// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' , $first , '">&nbsp;</td>';

// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
</td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'search' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
</td>' , $current_action == 'search' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'admin' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
</td>' , $current_action == 'admin' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
</td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
</td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
</td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
</td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
</td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
</td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
</td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The end of tab section.
echo '
<td class="maintab_' , $last , '">&nbsp;</td>
</tr>
</table>';

}


Değiştir:
// Show the menu up top.  Something like [home] [help] [pm] [logout] [login] ...
function template_menu()
{
  global $context, $settings, $options, $scripturl, $txt;


echo '
<div id="fancymenu">
<ul>';

  // Show the [home] button.
  echo '<li class="current" id="ana_sayfa"><a href="', $scripturl, '">' , $txt[103] , '</a></li>';

  // Show the [help] button.
  echo '<li id="yardim"><a href="', $scripturl, '?action=help" >' , $txt[119] , '</a></li>';

  // How about the [search] button?
  if ($context['allow_search'])
echo '<li id="ara"><a href="', $scripturl, '?action=search">' , $txt[182] , '</a></li>';

  // Is the user allowed to administrate at all? ([admin])
  if ($context['allow_admin']){
echo '<li id="admin"><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></li>';
}
  // Edit Profile [profile] :x
  if ($context['allow_edit_profile'])
echo '<li id="profil"><a href="', $scripturl, '?action=profile">' , $txt[79] , '</a></li>';

  // The Private Message [PM]!
  if ($context['allow_pm'])
echo '<li id="mesaj"><a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a></li>';

  // The [calendar]!
  if ($context['allow_calendar'])
echo '<li id="takvim"><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></li>';

  // The [member] list button :)
  if ($context['allow_memberlist'])
echo '<li id="uyeler"><a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a></li>';
 
  // If the user is a guest, show [login] button.
  if ($context['user']['is_guest'])  
echo '<li id="giris_yap"><a href="', $scripturl, '?action=login">' , $txt[34] , '</a></li>';

  // If the user is a guest, show [register] button.
  if ($context['user']['is_guest'])
echo '<li id="kayit"><a href="', $scripturl, '?action=register">' , $txt[97] , '</a></li>';
 
  // Otherwise, they might want to [logout]...
  if ($context['user']['is_logged'])
  echo '<li id="cikis"><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></li>';


  echo '</ul></div>';


}


Bul:
</head>

Öncesine ekle:

<script language="JavaScript" type="text/javascript" src="', $settings['theme_url'], '/mootools.js"></script>
<script language="JavaScript" type="text/javascript" src="', $settings['theme_url'], '/menu.js"></script>
<script language="JavaScript" type="text/javascript" src="', $settings['theme_url'], '/main.js"></script>



Style.css'de..
En alta ekle:
/* Fancymenu by Hoochie Coochie Man */
#fancymenu {
position: relative;
height: 29px;
width: 700px;
background: url('images/bg.gif') no-repeat top;
padding: 15px;
margin: 10px 0;
overflow: hidden;
}

#fancymenu ul, #pictureselect {
padding: 0;
margin: 0;
}

/* Don't apply padding here (offsetWidth will differ in IE)
    If you need padding add it to the child anchor */
#fancymenu ul li, #pictureselect li {
float: left;
list-style: none;
}

#fancymenu ul li a, #pictureselect li a  {
text-indent: -500em;
z-index: 10;
display: block;
float: left;
height: 30px;
position: relative;
overflow: hidden;
}

#ana_sayfa a {
width: 102px;
background: url('images/ana_sayfa.gif') no-repeat center;
}

#yardim a {
width: 76px;
background: url('images/yardim.gif') no-repeat center;
}

#ara a {
width: 49px;
background: url('images/ara.gif') no-repeat center;
}
#profil a {
width: 71px;
background: url('images/profil.gif') no-repeat center;
}

#admin a {
width: 67px;
background: url('images/admin.gif') no-repeat center;
}

#mesaj a {
width: 113px;
background: url('images/mesaj.gif') no-repeat center;
}

#takvim a {
width: 76px;
background: url('images/takvim.gif') no-repeat center;
}

#uyeler a {
width: 76px;
background: url('images/uyeler.gif') no-repeat center;
}

#giris_yap a {
width: 93px;
background: url('images/giris_yap.gif') no-repeat center;
}

#kayit a {
width: 64px;
background: url('images/kayit.gif') no-repeat center;
}

#cikis a {
width: 58px;
background: url('images/cikis.gif') no-repeat center;
}

#fancymenu li.background {
background: url('images/bg_menu_right.gif') no-repeat top right;
z-index: 8;
position: absolute;
visibility: hidden;
}

#fancymenu .background .left {
background: url('images/bg_menu.gif') no-repeat top left;
height: 30px;
margin-right: 9px; /* 7px is the width of the rounded shape */
}


Son olarak ekteki üç .js dosyasını temanızın içine.. images klasöründeki resimleride kendi temanızın images kalsörüne atıyorsunuz..

Guillermo Rauch'un paylaşıma sunduğu Fancymenu'nün SMF'ye uyarlanmış şeklidir.
Default renk turuncu dışındaki diğer tüm renkleri ben yaptım.
Ayrıca Conte Crayon ve son olarakta tüm renklerin mozaik arka planlarını ekledim.
Bitti.. Kolay gelsin..
Title: Re: Fancy menu
Post by: [-Delete-] on May 11, 2008, 04:12:17 AM
çok güzel görünümü var , teşekkürler hcm denicem inş. :)
Title: Re: Fancy menu
Post by: sevdaligul on May 11, 2008, 02:55:04 PM
emegine saglık arakdaşım
Title: Re: Fancy menu
Post by: Fabulox on May 13, 2008, 07:22:59 AM
Süpersin abi Eline Sağlık.Bunu temamızda kullanabilir miyiz ? (izninle)
Title: Re: Fancy menu
Post by: Hoochie Coochie Man on May 13, 2008, 10:03:31 AM
Yahu zaten onun için paylaştım :)
Title: Re: Fancy menu
Post by: Hoochie Coochie Man on May 13, 2008, 03:25:34 PM
Quote from: mehmet on May 11, 2008, 04:12:17 AM
çok güzel görünümü var , teşekkürler hcm denicem inş. :)
Ben teşekkür ederim.. :)

Quote from: sevdaligul on May 11, 2008, 02:55:04 PM
emegine saglık arakdaşım
Sende sağol.. :)
Title: Re: Fancy menu
Post by: Hoochie Coochie Man on May 19, 2008, 12:26:23 PM
Quote from: xxnine on May 19, 2008, 12:10:36 PM
"Hoochie Coochie Man" Özel Menü Yapıyor Musun?

Hayır..
Title: Re: Fancy menu
Post by: Alpay on May 20, 2008, 05:57:49 PM
Bir kaç yazında görmüştüm HCM js kullanmayi pek tercih etmiyorum demiştin bu aralar görüyorum js lerden başını kaldıramaz oldun :P
Title: Re: Fancy menu
Post by: Hoochie Coochie Man on May 21, 2008, 04:39:55 AM
Yok ben bunu kullanmıyorum. Burda paylaştığım hiçbir .js yi kullanmıyorum.. Bunları sizler için yapıyorum..
Title: Re: Fancy menu
Post by: Alpay on May 21, 2008, 04:44:57 AM
Bende kullanmam ki JS leri =) Güven meselesi (js lere) sanırsam...
Hem bakalım sen kendi sitende kullanmıyorsun da millete neden kullandırıyorsun ya acık cıkarsa :P
Ya da biton siteye girdiginde 3-6 tane extradan js yüklettiorsun nasıl devlet kardeşim burası :P
Neyse takıldım tabi ki emeğine sağlık.

Kolay gelsin.
Title: Re: Fancy menu
Post by: Hoochie Coochie Man on May 21, 2008, 04:51:27 AM
Biliyorum zaten takıldığını..
Kim demiş ben kendi sitemde kullanmıyorum diye :)
Dikkat edersen ben burda paylaştığım scriptleri kullanmıyorum dedim..
Kendi sitemdekileri paylaşırsam bana özel olmaz. Ne anlamı kalır?
Hem dikkatini çekerim konu bahsi geçen Mootools. Sıradan bir .js değil..
Neredeyse dünya kullanıyor.. emin ol güvenilirler ;)
Title: Re: Fancy menu
Post by: grafitus on June 06, 2008, 04:44:25 PM
İşte menü budur ya :D
Title: Re: Fancy menu
Post by: Sweet Rebel on July 02, 2008, 10:16:41 PM
Hoochie Coochie Man ..Döndüğünü gördüğüme çok sevindim.İdolüm,kahramanım benim.