30 Tem 2021 13:37 Yeni Konu Oluştur

Haberler:

Üye kayıt esnasında E-posta adresinizin doğru olduğuna ve Aktivasyon Mailinize bakmayı unutmayın.


smf 2.1 beta 1 için sidebar modu

Başlatan snrj, 25 Eki 2014 15:53

« önceki - sonraki »

0 Üyeler ve 1 Ziyaretçi konuyu incelemekte.

*

  1. 3,096

  2. 585

  3. 985
25 Eki 2014 15:53 Son düzenlenme: 23 Oca 2015 19:10 konusal

bildiğiniz gibi sidebar modu yaptık bunu 2.1 de kullanmak isteyenler için editlenmiş hali ektedir
şuan anasayfamızda görebilirsiniz



*

  1. 3,096

  2. 585

  3. 985
Sitemizde şuan kullandığımız sidebardaki tabbed menü için sidebarınızın php kod kısmına alttaki kodları yapıştırın

[IMG]http://i.imgur.com/50ddkvt.png[/img]


echo'<br/><style>
.tabbed dt{width: 85%; float: left;}.tabbed dd{width: 10%; float: left;}
.tab-link {text-decoration: none;display: block;float: left;width: 32%;padding: 5px 0px;text-align: center;}
.tab {clear: both;display: none;}
.tabs-hover .tab-link:hover,{ background: #ddd;}
.tabs-hover .tab-link:hover:after,{ position: absolute; content: "";margin: 5px 0 0 0;width: 55px;height: 1px;display: block;background: #ddd;}
.tabs-hover .tab:nth-of-type(3),
.tabs-hover span.tab-link:nth-of-type(2):hover ~ .tab:nth-of-type(2),
.tabs-hover span.tab-link:nth-of-type(3):hover ~ .tab:nth-of-type(1),
.tabs-hover .tab:hover{ display: block;}
.tabs-hover span.tab-link:nth-of-type(2):hover ~ .tab:nth-of-type(3),
.tabs-hover span.tab-link:nth-of-type(3):hover ~ .tab:nth-of-type(3),
.tabs-hover .tab:nth-of-type(1):hover ~ .tab:nth-of-type(3),
.tabs-hover .tab:nth-of-type(2):hover ~ .tab:nth-of-type(3)
{display: none !important;}
</style>';
global $txt, $scripturl, $modSettings, $user_info, $context, $smcFunc;
// How many users are online now.
$result = $smcFunc['db_query']('', '
SELECT COUNT(*)
FROM {db_prefix}log_online',
array(
)
);
list ($context['users_online']) = $smcFunc['db_fetch_row']($result);
$smcFunc['db_free_result']($result);

// Statistics such as number of boards, categories, etc.
$result = $smcFunc['db_query']('', '
SELECT COUNT(*)
FROM {db_prefix}boards AS b
WHERE b.redirect = {string:blank_redirect}',
array(
'blank_redirect' => '',
)
);
list ($context['num_boards']) = $smcFunc['db_fetch_row']($result);
$smcFunc['db_free_result']($result);

$result = $smcFunc['db_query']('', '
SELECT COUNT(*)
FROM {db_prefix}categories AS c',
array(
)
);
list ($context['num_categories']) = $smcFunc['db_fetch_row']($result);
$smcFunc['db_free_result']($result);

// Format the numbers nicely.
$context['users_online'] = comma_format($context['users_online']);
$context['num_boards'] = comma_format($context['num_boards']);
$context['num_categories'] = comma_format($context['num_categories']);

$context['num_members'] = comma_format($modSettings['totalMembers']);
$context['num_posts'] = comma_format($modSettings['totalMessages']);
$context['num_topics'] = comma_format($modSettings['totalTopics']);
$context['most_members_online'] = array(
'number' => comma_format($modSettings['mostOnline']),
'date' => timeformat($modSettings['mostDate'])
);
$context['latest_member'] = &$context['common_stats']['latest_member'];

// Are you on a larger forum?  If so, let's try to limit the number of topics we search through.
if ($modSettings['totalMessages'] > 100000)
{
$request = $smcFunc['db_query']('', '
SELECT id_topic
FROM {db_prefix}topics
WHERE num_replies != {int:no_replies}' . ($modSettings['postmod_active'] ? '
AND approved = {int:is_approved}' : '') . '
ORDER BY num_replies DESC
LIMIT 100',
array(
'no_replies' => 0,
'is_approved' => 1,
)
);
$topic_ids = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$topic_ids[] = $row['id_topic'];
$smcFunc['db_free_result']($request);
}
else
$topic_ids = array();

// Topic replies top 10.
$topic_reply_result = $smcFunc['db_query']('', '
SELECT m.subject, t.num_replies, t.id_board, t.id_topic, b.name
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != {int:recycle_board}' : '') . ')
WHERE {query_see_board}' . (!empty($topic_ids) ? '
AND t.id_topic IN ({array_int:topic_list})' : ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}' : '')) . '
ORDER BY t.num_replies DESC
LIMIT 5',
array(
'topic_list' => $topic_ids,
'recycle_board' => $modSettings['recycle_board'],
'is_approved' => 1,
)
);
$context['top_topics_replies'] = array();
$max_num_replies = 1;
while ($row_topic_reply = $smcFunc['db_fetch_assoc']($topic_reply_result))
{
censorText($row_topic_reply['subject']);

$context['top_topics_replies'][] = array(
'id' => $row_topic_reply['id_topic'],
'board' => array(
'id' => $row_topic_reply['id_board'],
'name' => $row_topic_reply['name'],
'href' => $scripturl . '?board=' . $row_topic_reply['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row_topic_reply['id_board'] . '.0">' . $row_topic_reply['name'] . '</a>'
),
'subject' => $row_topic_reply['subject'],
'num_replies' => $row_topic_reply['num_replies'],
'href' => $scripturl . '?topic=' . $row_topic_reply['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row_topic_reply['id_topic'] . '.0">' . shorten_subject($row_topic_reply['subject'], 24) . '</a>'
);

if ($max_num_replies < $row_topic_reply['num_replies'])
$max_num_replies = $row_topic_reply['num_replies'];
}
$smcFunc['db_free_result']($topic_reply_result);

foreach ($context['top_topics_replies'] as $i => $topic)
{
$context['top_topics_replies'][$i]['post_percent'] = round(($topic['num_replies'] * 100) / $max_num_replies);
$context['top_topics_replies'][$i]['num_replies'] = comma_format($context['top_topics_replies'][$i]['num_replies']);
}

// Large forums may need a bit more prodding...
if ($modSettings['totalMessages'] > 100000)
{
$request = $smcFunc['db_query']('', '
SELECT id_topic
FROM {db_prefix}topics
WHERE num_views != {int:no_views}
ORDER BY num_views DESC
LIMIT 100',
array(
'no_views' => 0,
)
);
$topic_ids = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$topic_ids[] = $row['id_topic'];
$smcFunc['db_free_result']($request);
}
else
$topic_ids = array();

// Topic views top 10.
$topic_view_result = $smcFunc['db_query']('', '
SELECT m.subject, t.num_views, t.id_board, t.id_topic, b.name
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != {int:recycle_board}' : '') . ')
WHERE {query_see_board}' . (!empty($topic_ids) ? '
AND t.id_topic IN ({array_int:topic_list})' : ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}' : '')) . '
ORDER BY t.num_views DESC
LIMIT 5',
array(
'topic_list' => $topic_ids,
'recycle_board' => $modSettings['recycle_board'],
'is_approved' => 1,
)
);
$context['top_topics_views'] = array();
$max_num_views = 1;
while ($row_topic_views = $smcFunc['db_fetch_assoc']($topic_view_result))
{
censorText($row_topic_views['subject']);

$context['top_topics_views'][] = array(
'id' => $row_topic_views['id_topic'],
'board' => array(
'id' => $row_topic_views['id_board'],
'name' => $row_topic_views['name'],
'href' => $scripturl . '?board=' . $row_topic_views['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row_topic_views['id_board'] . '.0">' . $row_topic_views['name'] . '</a>'
),
'subject' => $row_topic_views['subject'],
'num_views' => $row_topic_views['num_views'],
'href' => $scripturl . '?topic=' . $row_topic_views['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row_topic_views['id_topic'] . '.0">' . shorten_subject($row_topic_views['subject'], 24) . '</a>'
);

if ($max_num_views < $row_topic_views['num_views'])
$max_num_views = $row_topic_views['num_views'];
}
$smcFunc['db_free_result']($topic_view_result);

foreach ($context['top_topics_views'] as $i => $topic)
{
$context['top_topics_views'][$i]['post_percent'] = round(($topic['num_views'] * 100) / $max_num_views);
$context['top_topics_views'][$i]['num_views'] = comma_format($context['top_topics_views'][$i]['num_views']);
}

$txt['users_online']='Çevrimiçi Kullanıcılar:';
$txt['most_online']='En Çok Çevrimiçi:';
echo'<section class="tabs-hover">
<span class="tab-link" tabindex="1"><span class="generic_icons topics_replies"></span></span>
<span class="tab-link" tabindex="2"><span class="generic_icons starters"></span></span>
<span class="tab-link" tabindex="3"><span class="generic_icons general"></span></span>
<article class="tab">
<div class="title_bar">
<h4 class="titlebg">
<span class="ie6_header floatleft">
<span class="generic_icons general"></span> Forum Bilgisi
</span>
</h4>
</div>
<dl class="tabbed">
<dt>', $txt['total_members'], ':</dt>
<dd>', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' . $context['num_members'] . '</a>' : $context['num_members'], '</dd>
<dt>', $txt['total_posts'], ':</dt>
<dd>', $context['num_posts'], '</dd>
<dt>', $txt['total_topics'], ':</dt>
<dd>', $context['num_topics'], '</dd>
<dt>', $txt['total_cats'], ':</dt>
<dd>', $context['num_categories'], '</dd>
<dt>', $txt['users_online'], ':</dt>
<dd>', $context['users_online'], '</dd>
<dt>', $txt['most_online'], ':</dt>
<dd>', $context['most_members_online']['number'], '</dd>';
if (!empty($modSettings['hitStats']))
echo '
<dt>', $txt['num_hits'], ':</dt>
<dd>', $context['num_hits'], '</dd>';
echo ' </dl>
</article>
<article class="tab">
<div class="title_bar">
<h4 class="titlebg">
<span class="ie6_header floatleft">
<span class="generic_icons starters"></span> En Çok Görüntülenen
</span>
</h4>
</div>
<dl class="tabbed">';
foreach ($context['top_topics_views'] as $topic)
{
echo '
<dt>', $topic['link'], '</dt>
<dd>';
if (!empty($topic['post_percent']))
echo '
<span class="righttext">' . $topic['num_views'] . '</span>
</dd>';
}
echo '</dl>
</article>
<article class="tab">
<div class="title_bar">
<h4 class="titlebg">
<span class="ie6_header floatleft">
<span class="generic_icons topics_replies"></span> En Çok Cevaplanan
</span>
</h4>
</div>
<dl class="tabbed">';
foreach ($context['top_topics_replies'] as $topic)
{
echo '
<dt>
', $topic['link'], '
</dt>
<dd>';
if (!empty($topic['post_percent']))
echo '
<span class="righttext">' . $topic['num_replies'] . '</span>
</dd>';
}
echo ' </dl>
</article>
</section><br/>';



bu kodları 2.0.X de kullanabilirsiniz sadece resimleri kendinize göre düzeltmeniz lazım



  1. 632

  2. 251
Slider için hangi php kodu kullanacağız.

*

  1. 3,096

  2. 585

  3. 985

slider için php alanına alttaki kodları ekleyin  js lere burdaki konudan ulaşabilirsiniz
kodların içindeki $board=array(17,18); kendinize göre düzeltin hangi bölümden resimlerin çekilmesini istiyorsanız o bölüm numaralarını girin

global $settings;
    echo '
   <script type="text/javascript" src="http://teknoromi.com/Themes/teknoloji/scripts/jquery.js"></script>
    <script type="text/javascript" src="http://teknoromi.com/Themes/teknoloji/scripts/jquery_002.js"></script>';
 
 global $smcFunc, $scripturl, $settings, $options, $txt ,$context, $modSettings;
$board=array(17,18);

$request = $smcFunc['db_query']('', '
  SELECT t.id_topic, m.subject, m.body
  FROM {db_prefix}topics AS t
     INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
  WHERE t.id_board IN ({array_int:boards})
  ORDER BY t.id_topic DESC
       LIMIT {int:limit}',
  array(
    'boards' => $board,
               'limit' => 7,
  )
);
$topics = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
  $topics[] = array(
     'id_topic' => $row['id_topic'],
     'subject' => $row['subject'],
     'first_image'  => preg_match_all('~\[img.*?\]([^\]]+)\[\/img\]~i', $row['body'],  $images) ? '<img src="' . $images[1][0] . '"  alt="' .  $row['subject'] . '"/>      ' : '',
  );
$smcFunc['db_free_result']($request);

     echo '<div class="flex-container">
 <div class="flexslider">
 <ul class="slides">';
 foreach ($topics as $topic)
 if (!empty($topic['first_image']))
 echo '
                <li class="" style="width: 100%; float: left; margin-right: -100%; position: relative; display: none;"><a  href="', $scripturl, '?topic=', $topic['id_topic'], '.0">',  $topic['first_image'], ' </a>
                 <p>', $topic['subject'], '</p>
    </li>';
 else {
 echo '
                  <li class="" style="width: 100%; float: left; margin-right: -100%; position: relative; display: none;"><a  href="', $scripturl, '?topic=', $topic['id_topic'], '.0"><img src="'.$settings['images_url'].'/th_resimyok.gif" alt="" /></a>
                  <p>', $topic['subject'], '</p>
 </li>';
 }     

echo '</ul>
 <ul class="flex-direction-nav"><li><a class="flex-prev" href="#">Previous</a></li><li><a class="flex-next" href="#">Next</a></li></ul></div>
</div>
<script>
$(document).ready(function () {
 $(\'.flexslider\').flexslider({
 animation: \'fade\',
 controlsContainer: \'.flexslider\'
 });
});
</script>';



MENU ×