Fikir aliş veriş

Başlatan gecitli, 04 Mayıs 2016 20:14

« önceki - sonraki »

0 Üyeler ve 2 Ziyaretçiler konuyu incelemekte.

*

  1. 150

  2. 40

  3. 175
04 Mayıs 2016 20:14 Son düzenlenme: 04 Mayıs 2016 20:26 gecitli

Merhaba bir konuda yardima ihtiyacim var sorun BoardIndex.template.php konu yu gönderen kismini 3,e cikarmak istiyorum 1 konu goserirken üc konuyu gserecek
bunu yaparken ssi yada confix ozeliğini kulanmadan yapmamiz gerekiyor şoyleki

bu koda

<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>

bir şekilde limit özeliği eklememiz lazim

$limit = 3;
resımdekı şekılde

*

  1. 3,263

  2. 596

  3. 1077
hafızadan yazıyorum hocam hatalı olabilir

bildiğim kadarıyla boardindex.template nin sql sorguları subs-board.. php de
okısımdaki sql sorgularını incelemek lazım öncelikle
ama tahminimce siz yeni yapacağınız temada bunu kullanmayı düşünüyorsunuz ve sources klasörüne müdahele edemiceksiniz
bu durumda yeni bir function oluşturup sql sorgusunu istediğiniz şekle getirip lastpost yerine eklemek gerekecek
rastgele konular diye bir paylaşımız vardı http://smf.konusal.com/index.php?topic=108.0
burdaki sql sorgusunu biraz değiştirip o şekilde uyarlanabilir
boards array yerine  current board kullanılmalı vs...

pek faydalı birşey yazamadım ama :S kusura kalma hocam uygun bir zamanda tekrar bakarım

*

  1. 150

  2. 40

  3. 175
Sağol snrj evet yeni temada kulanicam olumlu bir yontem bulamasam yeni bir php tablosu oluşturma yoluna gidcez gibi gorunuyor.

*

  1. 1,198

  2. 120

  3. 401

Subs-BoardIndex.php şurda geçiyor.
// Prepare the subject, and make sure it's not too long.
censorText($row_board['subject']);
$row_board['short_subject'] = shorten_subject($row_board['subject'], 54);
$this_last_post = array(
'id' => $row_board['id_msg'],
'time' => $row_board['poster_time'] > 0 ? timeformat($row_board['poster_time']) : $txt['not_applicable'],
'timestamp' => forum_time(true, $row_board['poster_time']),
'subject' => $row_board['short_subject'],
'member' => array(
'id' => $row_board['id_member'],
'username' => $row_board['poster_name'] != '' ? $row_board['poster_name'] : $txt['not_applicable'],
'name' => $row_board['real_name'],
'href' => $row_board['poster_name'] != '' && !empty($row_board['id_member']) ? $scripturl . '?action=profile;u=' . $row_board['id_member'] : '',
'link' => $row_board['poster_name'] != '' ? (!empty($row_board['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row_board['id_member'] . '">' . $row_board['real_name'] . '</a>' : $row_board['real_name']) : $txt['not_applicable'],
),
'start' => 'msg' . $row_board['new_from'],
'topic' => $row_board['id_topic']
);

// Provide the href and link.
if ($row_board['subject'] != '')
{
$this_last_post['href'] = $scripturl . '?topic=' . $row_board['id_topic'] . '.msg' . ($user_info['is_guest'] ? $row_board['id_msg'] : $row_board['new_from']) . (empty($row_board['is_read']) ? ';boardseen' : '') . '#new';
$this_last_post['link'] = '<a href="' . $this_last_post['href'] . '" title="' . $row_board['subject'] . '">' . $row_board['short_subject'] . '</a>';
}
else
{
$this_last_post['href'] = '';
$this_last_post['link'] = $txt['not_applicable'];
}

         $this_last_post['href'] = $scripturl . '?topic=' . $row_board['id_topic'] . '.msg' . ($user_info['is_guest'] ? $row_board['id_msg'] : $row_board['new_from']) . (empty($row_board['is_read']) ? ';boardseen' : '') . '#new';
         $this_last_post['link'] = '<a href="' . $this_last_post['href'] . '" title="' . $row_board['subject'] . '">' . $row_board['short_subject'] . '</a>';


Bende bakayım sonuca ulaşabilirsem yazarım.


MENU ×