SimplePortal

Support => Turkish (Türkçe) => International Support => Ki?iselle?tirme => Topic started by: gecitli on June 09, 2011, 12:29:50 PM

Title: Bölüm haberlerini 2 li yan yana dizme
Post by: gecitli on June 09, 2011, 12:29:50 PM
kodu grafitus yazmis BURDA (http://simpleportal.net/index.php?topic=7283.0) Ben biraz gelistirdim DEMO (http://www.gecitli.de/index.php)

(http://img854.imageshack.us/img854/6961/image1lb.png)

./Sources/PortalBlocks.php'yi açın.
bulun
Code: [Select]
if ($context['SPortal']['core_compat'])
{
foreach ($return as $news)
{
echo '
<div class="tborder">
<table class="sp_block">
<tr class="catbg">
<td class="sp_middle">', $news['icon'], '</td>
<td class="sp_middle sp_regular_padding sp_fullwidth"><a href="', $news['href'], '" >', $news['subject'], '</a>
</tr>
<tr class="windowbg">
<td class="sp_regular_padding" colspan="2">';

if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
echo '
<img src="', $news['avatar']['href'], '" alt="', $news['poster']['name'], '" width="30" style="float: right;" />
<div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], '<br />', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';
else
echo '
<div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], ' | ', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';

echo '
<div class="post"><hr />', $news['body'], '<br /><br /></div>
</td>
</tr>
<tr>
<td class="windowbg2" colspan="2">
<div class="sp_right sp_regular_padding">', $news['link'], ' ',  $news['new_comment'], '</div>
</td>
</tr>
</table>
</div>
<br />';
}
}
else
{
foreach ($return as $news)
{
echo '
<h3 class="catbg"><span class="left"></span>
<span class="sp_float_left sp_article_icon">', $news['icon'], '</span><a href="', $news['href'], '" >', $news['subject'], '</a>
</h3>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="sp_content_padding">';

if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
echo '
<img src="', $news['avatar']['href'], '" alt="', $news['poster']['name'], '" width="30" class="sp_float_right" />
<div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], '<br />', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';
else
echo '
<div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], ' | ', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';

echo '
<div class="post"><hr />', $news['body'], '</div>
<div class="sp_right">', $news['link'], ' ',  $news['new_comment'], '</div>
</div>
<span class="botslice"><span></span></span>
</div>
<br />';
}
}

Degisin

Code: [Select]
$counter = false;
if ($context['SPortal']['core_compat'])
{
foreach ($return as $news)
{
echo '
<div style="width: 300px; float: ', $counter ? 'right' : 'left', '; display:block; position:relative;">
<div class="tborder">
<table class="sp_block">
<tr class="catbg">
<td class="sp_middle">', $news['icon'], '</td>
<td class="sp_middle sp_regular_padding sp_fullwidth"><a href="', $news['href'], '" >', $news['subject'], '</a>
</tr>
<tr class="windowbg">
<td class="sp_regular_padding" colspan="2">';

if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
echo '
<img src="', $news['avatar']['href'], '" alt="', $news['poster']['name'], '" width="30" style="float: right;" />
<div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], '<br />', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';
else
echo '
<div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], ' | ', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';

echo '
<div class="post"><hr />', $news['body'], '<br /><br /></div>
</td>
</tr>
<tr>
<td class="windowbg2" colspan="2">
<div class="sp_right sp_regular_padding">', $news['link'], ' ',  $news['new_comment'], '</div>
</td>
</tr>
</table>
</div>
</div>
', $counter ? '<br />' : '', '';
$counter = !$counter;
}
}
else
{
foreach ($return as $news)
{
echo '
<div style="width: 333px; float: ', $counter ? 'right' : 'left', '; margin-right:25px;float: left;position: relative;height:327px; margin-top:10px;overflow: hidden;border-bottom: 1px dotted #8a9397;">

           
<a href="', $news['href'], '" >', $news['subject'], '</a>
</h3>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="sp_content_padding">';
                           echo '
<img src="' . $settings['images_url'] . '/calendar.jpg" alt="" /><span class="sp_right:5px">', $news['time'], '</a>';
 
echo '
<span style="float:right">
<img style="vertical-align: middle"> <img src="' . $settings['images_url'] . '/eye.png" alt="Visitas" width="16" height="16" original-title="Visitas">
<img style="vertical-align: middle"> <img src="' . $settings['images_url'] . '/comments.png" alt="Comentarios" width="19" height="16" original-title="Comentarios">
</span>
<div class="post"><style="height:168px; overflow:hidden;"><hr />', $news['body'], '</div>
<div class="sp_right">', $news['link'], ' ',  $news['new_comment'], '</div>
</div>
<span class="botslice"><span></span></span>
</div>
</div>
', $counter ? '<br />' : '', '';
$counter = !$counter;
}
}
altaki resimleri temanizin images kilasorune atin

umarim yararli olur




Title: Re: Bölüm haberlerini 2 li yan yana dizme
Post by: mkuru on June 10, 2011, 04:37:42 AM
Code: [Select]
if ($context['SPortal']['core_compat'])
Sources/PortalBlocks.php dosyasında böyle bir kod bulamadım ben.

Code: [Select]
compat
kelime olarak tarattırdım böyle bir kelime ve kod bulamadım.
Title: Re: Bölüm haberlerini 2 li yan yana dizme
Post by: gecitli on June 10, 2011, 10:53:40 AM
PortalBlocks.php nizi ekleyin birde ben bakayim isterseniz acaba smf surumunde degisiyormu ben rc 5 kulaniyorum
Title: Re: Bölüm haberlerini 2 li yan yana dizme
Post by: EfsaNe TÜRK on July 21, 2011, 07:16:31 AM
merhabalar ben dediğiniz şekilde yaptım ancak aşağıdaki resimdeki gibi oldu sonuç sayfa geçiş numaraları falan hep kaydı. Yardımcı olursanız sevinirim. Şimdiden Teşekkürler..

(http://img850.imageshack.us/img850/169/19472180.jpg)
Title: Re: Bölüm haberlerini 2 li yan yana dizme
Post by: mkuru on July 21, 2011, 03:05:08 PM
Hocam ben smf 1.1.14 sürümü kullanıyorum. Sources/PortalBlocks.php dosyasında yukarıdaki kodlar yok. Aynı olayı 1.1.x sürümleri için nasıl uygulayabiliriz.
Title: Re: Bölüm haberlerini 2 li yan yana dizme
Post by: EfsaNe TÜRK on July 25, 2011, 06:47:11 AM
kimse yokmu arkadaşlar yardımcı olabilecek bu konuda ? :(
Title: Re: Bölüm haberlerini 2 li yan yana dizme
Post by: kimyaci on July 26, 2011, 02:48:56 PM
Aşağıda ki kodu bir deneyiniz.Yükseklik piksel ayarını kendi sitenizde ki blog yüksekliklerine göre değştirebilirsiniz.Ayrıca

Code: [Select]

if ($context['SPortal']['core_compat'])
{
foreach ($return as $news)
{
echo '
<div style="width: 49%; float: ', $counter ? 'right' : 'left', '; display:block; position:relative;">
<div style="height: 320px; float: ; display:block; position:relative;">
<div class="tborder">
<table class="sp_block" "height:"100%">
<tr class="roundframe">
<td class="sp_middle">', $news['icon'], '</td>
<td class="sp_middle sp_regular_padding sp_fullwidth"><a href="', $news['href'], '" >', $news['subject'], '</a>
</tr>
<tr class="information">
<td class="sp_regular_padding" colspan="2">';

if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
echo '
<img src="', $news['avatar']['href'], '" alt="', $news['poster']['name'], '" width="30" style="float: right;" />
<div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], '<br />', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';
else
echo '
<div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], ' | ', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';

echo '
<div class="post"><hr />', $news['body'], '<br /><br /></div>
</td>
</tr>
<tr>
<td class="information" colspan="2">
<div class="sp_right sp_regular_padding">', $news['link'], ' ',  $news['new_comment'], '</div>
</td>
</tr>
</div>
</div>
</div>
</table>
</div>',

$counter ? '<br />' : '', '';
$counter = !$counter;
}
}
else
{
foreach ($return as $news)
{
echo '
<div style="width: 49%; float: ', $counter ? 'right' : 'left', '; display:block; position:relative;">
<div style="height: 320px; float: display:block; position:relative;">
<h3 class="roundframe "><span class="left"></span>
<span class="sp_float_left sp_article_icon">', $news['icon'], '</span><a href="', $news['href'], '" >', $news['subject'], '</a>
</h3>
<div class="">
<span class="topslice"><span></span></span>
<div class="sp_content_padding">';

if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
echo '
<img src="', $news['avatar']['href'], '" alt="', $news['poster']['name'], '" width="30" class="sp_float_right" />
<div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], '<br />', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';
else
echo '
<div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], ' | ', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';

echo '
<div class="post"><hr />', $news['body'], '</div>
<div class="sp_right">', $news['link'], ' ',  $news['new_comment'], '</div>
</div>
<span class="botslice"><span></span></span>
</div>
</div>
</div>
', $counter ? '<br />' : '', '';
$counter = !$counter;
}
}


Ayrıca bloglarda ki resimlerin aynı ölçülerde olup kayma olmaması için de portal.js da aşağıda ki ayarlamayı aptım.

Code: [Select]
if (temp_image.height > 180)
{
possible_images[i].height = 200;
possible_images[i].width = 310;
}

Demo olarak benim siteme bakabilirsiniz.
Title: Re: Bölüm haberlerini 2 li yan yana dizme
Post by: bysabo on July 26, 2011, 03:10:39 PM
Bunu sadece html bloklar için yapmamız mümkün değil mi ?
Title: Re: Bölüm haberlerini 2 li yan yana dizme
Post by: EfsaNe TÜRK on August 21, 2011, 07:37:18 AM
merhabalar ben dediğiniz şekilde yaptım ancak aşağıdaki resimdeki gibi oldu sonuç sayfa geçiş numaraları falan hep kaydı. Yardımcı olursanız sevinirim. Şimdiden Teşekkürler..

(http://img850.imageshack.us/img850/169/19472180.jpg)

yine aynı durum söz konusu kardeş görüntü aynen bu şekilde oluyor alttaki sayfa numaraları falan sağa kayıyor
Title: Re: Bölüm haberlerini 2 li yan yana dizme
Post by: macgyver on October 23, 2011, 02:33:31 PM
Parse error: syntax error, unexpected T_ELSE in C:\AppServ\www\Sources\PortalBlocks.php on line 1518 böyle bir hata alıyorum kodları değiştirdiğimde lütfen yardım edin
Title: Re: Bölüm haberlerini 2 li yan yana dizme
Post by: grafitus on October 23, 2011, 03:05:58 PM
Bu kişiselleştirme, SP 2.3.4 yayınlandıktan sonra bir eklenti olarak, daha farklı şekilleriyle (bununla ilgili fikirlerinizi bana ÖM ile gönderebilirsiniz) kullanıma sunulacaktır.

Bu sebeple konu kilitlenmiştir.
SimplePortal 2.3.8 © 2008-2024, SimplePortal