bölümleri yan yana sıralama

Başlatan axsi, 10 Haz 2017, 22:10

« önceki - sonraki »

0 Üyeler ve 1 Ziyaretçi konuyu incelemekte.

axsi



yukarıdakı bölümleri şu şekilde yapmak istiyorum;



mod veya eklenti önermeyin lütfen  :dayak:s

kirkagacforum

Konu linki : http://www.simplemachines.org/community/index.php?topic=247079.0

Bu ipucu sayesinde, forum ana sayfasındaki kategoriler, bölümler iki sütun halinde listeleniyor. Belki tema yapımcıları için güzel bir fikir olabilir.

BoardIndex.template.php

Bul:

/* Each category in categories is made up of:
Değiştir:

// How many categories do we have?
$category_count = count($context['categories']);

// Mod it and see if it is an odd number or not.
$category_left_count = $category_count % 2;

// Lucky, its even.
if($category_left_count == 0)
// Just divide it and calculate cat per column.
$category_per_column = $category_count / 2;
else
// Opps, odd number. We just need integer, so add the left part after you divide.
$category_per_column = (($category_count - $category_left_count) / 2) + $category_left_count;

// Keep track of the categories you echoed.
$counter = 0;

// Here comes the table.
echo '
<table>
<tr>';

/* Each category in categories is made up of:

Bul:

echo '
<div class="tborder" style="margin-top: ' , $first ? '0;' : '1ex;' , '' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">

Değiştir:

// Pass to a new column if reset.
if($counter == 0)
echo '
<td width="50%" style="vertical-align: top;">';

echo '
<div class="tborder" style="margin-top: 1ex;' , '' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">

Bul:

}
echo '
</div>';
}

Değiştir:

}
echo '
</div>';

// Increase the number cats echoed.
$counter = $counter + 1;

// If we displayed enough cats, pass to new column
if($counter == $category_per_column) {
echo '
</td>';

// Reset the tracker.
$counter = 0;
}
}

// We need to close the column if it was an odd number.
if($category_left_count != 0)
echo '
</td>';

// Close the table.
echo '
</tr>
</table>';

Kodlardaki 2 rakamlarını 3 olarak değiştirirek 3 sütun haline de getirebilirsiniz.

Bir süre burada durduktan sonra İpuçları ve Hileler bölümüne taşınacak.

Tamamiyle [SiNaN] yapımıdır.

kirkagacforum

Konu linki : https://www.simplemachines.org/community/index.php?topic=444795.0

Bugün bi dostumun isteği üzerine biraz çalıştım. İşin sonunda gayet hoş bi yapı ortaya çıktı ve sizlerle paylaşmak istedim.

BoardIndex.template.php
Kod (Bul) Seç
                echo '
                <tr id="board_', $board['id'], '" class="windowbg2">
                    <td class="icon windowbg"', !empty($board['children']) ? ' rowspan="2"' : '', '>
                        <a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">';

                // If the board or children is new, show an indicator.
                if ($board['new'] || $board['children_new'])
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
                // Is it a redirection board?
                elseif ($board['is_redirect'])
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
                // No new posts at all! The agony!!
                else
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

                echo '
                        </a>
                    </td>
                    <td class="info">
                        <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';

                // Has it outstanding posts for approval?
                if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
                    echo '
                        <a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';

                echo '

                        <p>', $board['description'] , '</p>';

                // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
                if (!empty($board['moderators']))
                    echo '
                        <p class="moderators">', count($board['moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';

                // Show some basic information about the number of posts, etc.
                    echo '
                    </td>
                    <td class="stats windowbg">
                        <p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
                        ', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
                        </p>
                    </td>
                    <td class="lastpost">';

                /* The board's and children's 'last_post's have:
                time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
                link, href, subject, start (where they should go for the first unread post.),
                and member. (which has id, name, link, href, username in it.) */
                if (!empty($board['last_post']['id']))
                    echo '
                        <p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
                        ', $txt['in'], ' ', $board['last_post']['link'], '<br />
                        ', $txt['on'], ' ', $board['last_post']['time'],'
                        </p>';
                echo '
                    </td>
                </tr>';
                // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
                if (!empty($board['children']))
                {
                    // Sort the links into an array with new boards bold so it can be imploded.
                    $children = array();
                    /* Each child in each board's children has:
                            id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
                    foreach ($board['children'] as $child)
                    {
                        if (!$child['is_redirect'])
                            $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' : '') . '</a>';
                        else
                            $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';

                        // Has it posts awaiting approval?
                        if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics']))
                            $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';

                        $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
                    }
                    echo '
                    <tr id="board_', $board['id'], '_children">
                        <td colspan="3" class="children windowbg">
                            <strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children), '
                        </td>
                    </tr>';
                }
            }
        echo '
            </tbody>';
Kod (Değiştir) Seç
// Boxed BoardIndex Start
            echo '
    <tr class="catbox windowbg2">';

            echo '
        <td class="info">
<div class="box100">
<div class="catbox-all">
<a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>
<p>', $board['description'] , '</p>';
                 
            if (!empty($board['last_post']['id']))     
            echo '   
            <p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
            ', $txt['in'], ' ', $board['last_post']['link'], '<br />
            ', $txt['on'], ' ', $board['last_post']['time'],'
            </p>';

            echo '
</div>
</div>
        </td>
    </tr>';

         }
      echo '
         </tbody>';
// Boxed BoardIndex End

Index.css
Kod (Sonuna Ekle) Seç
.catbox
{
   height: 150px;
   float: left;
   margin-bottom: 1%;
}
.catbox-all
{
   width:260px;
   height:150px;
   -webkit-border-radius: 10px;
   -moz-border-radius: 10px;
   border-radius: 10px;
   background-color: #dadfe6;
   padding-left: 3%;
   padding-top: 3%;
}


Kodların XHTML sorunlarını çözen ve kalanları çözmemde yardımcı olan MrGrumpy 'ye çok teşekkür ederim.

Bu iki değişikliği deneyebilirsiniz. Çok tuhaf isimler vermişler onun için bulmak zor oluyor. :)

axsi

Bunu kullanıyorum zaten teşekkürler yinede, konu kilitlenebilir.

tarantula901

Sitenizde işlem yapmadan önce mutlaka yedek alın, yedek alın yedek almayı unutmayın her şeyden önce bu önemli

Pm'den ve Skype'den istenilen destekler ücretlidir. Ücret ödememek için lütfen sitede sorunuzu konu açarak sorabilirsiniz.

Ücretli Smf Destek İçin

kirkagacforum

Düzenleme yaptığım site : www.somaforum.com

İlk cevabımdaki kodları uygulamak istediğimde sıfır boardindex.template.php dosyasında aşağıdaki kodu bulamadım.


echo '
<div class="tborder" style="margin-top: ' , $first ? '0;' : '1ex;' , '' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">

İkinci mesajımdakini de uyguladığımda sitedeki şekilde oldu.

width : 50%; de yaptım ama ortadan olmadı. Amacım ortadan iki sütun olması.

index.css'deki kodlar aşağıdaki şekilde;


.catbox
{
   height: 100px;
   float: left;
   margin-bottom: 1%;
}
.catbox-all
{
   width: 560px;
   height: 80px;
   -webkit-border-radius: 10px;
   -moz-border-radius: 10px;
   border-radius: 10px;
   background-color: #dadfe6;
   padding-left: 3%;
   padding-top: 3%;
}

Ne yapmam lazım, fikri olan var mı?

tarantula901

Sitenizde işlem yapmadan önce mutlaka yedek alın, yedek alın yedek almayı unutmayın her şeyden önce bu önemli

Pm'den ve Skype'den istenilen destekler ücretlidir. Ücret ödememek için lütfen sitede sorunuzu konu açarak sorabilirsiniz.

Ücretli Smf Destek İçin

kirkagacforum

#7
http://custom.simplemachines.org/mods/index.php?mod=1720

Bu modu kurdum.

Lakin biraz daha düzgün olmasını rica ediyorum sizlerden mümkünse.

Site : www.somaforum.com

Şu anki hali;


İstediğim;


Dosya ektedir.

Şimdiden teşekkürler.

tarantula901

Kullanmış olduğunuz mod alt kategorileri düzenli olaran gösteren mod değil kategori sıralı yapıyor sanırım
Sitenizde işlem yapmadan önce mutlaka yedek alın, yedek alın yedek almayı unutmayın her şeyden önce bu önemli

Pm'den ve Skype'den istenilen destekler ücretlidir. Ücret ödememek için lütfen sitede sorunuzu konu açarak sorabilirsiniz.

Ücretli Smf Destek İçin

kirkagacforum

#9
Yapmak istediğim kategorilerin iki sütunlu şekilde gözükmesi.

http://custom.simplemachines.org/mods/index.php?mod=1720

Bu modu kurdum, bu ikili - üçlü yapıyor.

Ama gözüme düzenli gelmedi. Default halinin daraltılmış ve iki sütunlu haline gelmiş gibi bir görüntüde olmasını istiyorum.
Aşağıdaki resimdeki gibi olmasını istiyorum. Bunu fotoşopda yaptım.




Hiç olmazsa iki sütunlu hale getirebileceğim (modsuz) bir kod var mı? Önceden denediğimde üsttekiler olmamıştı.


gecitli

kod bilginiz varsa bunu inceleyip yapa bilirsiniz

Örnek
http://www.webtiryaki.com

webmaster forumu

Free & Premium Responsive Themes for SMF.