News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Üyenin gönderdiği mesajları bu biçimde kısaltarak listeleme..

Started by boranjudge, April 20, 2008, 08:48:42 AM

Previous topic - Next topic

boranjudge

İyi günler, bir üyenin Gönderdiği mesajları ekte ki resim gibi içeriğini kısaltarak listeleme yapabilirmiyiz



boranjudge


sajT®


boranjudge



Yağız...


sajT®

Sources'daki Değişken Profile.template.php'den Çağıralacak Uğraşmam Gerekiyo Bayağı  ::)

boranjudge

Quote from: Yağız on April 21, 2008, 05:01:29 PM
Hem hayır, hem evet. Iki dosyayada ekleme yapilmali.

Sevgili Yağız, Anlatımını yaparak, Yardımcı olursanız çok sevinirim, uzun süredir kurmak istediğim modlardan birisi .
Teşekkür ederim.

Yağız...


[SiNaN]

Kısalatarak göstermek için:

../Sources/Profile.php

Bul:

global $txt, $user_info, $scripturl, $modSettings, $db_prefix;
global $context, $user_profile, $ID_MEMBER, $sourcedir;


Değiştir:

global $txt, $user_info, $scripturl, $modSettings, $db_prefix;
global $context, $user_profile, $ID_MEMBER, $sourcedir, $func;


Bul:

// Do the code.
$row['body'] = parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']);


Öncesine ekle:

//Message body length.
$message_length = 150;

// Do we need to cut it off?
if ($func['strlen']($row['body']) > $message_length)
{
$row['body'] = $func['substr']($row['body'], 0, $message_length);

// Check for space or line break.
$cutoff = max(strrpos($row['body'], ' '), strrpos($row['body'], '<'));

if ($cutoff !== false)
$row['body'] = $func['substr']($row['body'], 0, $cutoff);
$row['body'] .= '...';
}



150 yerine istediğiniz uzunluğu girmelisiniz.
Former SMF Core Developer | My Mods | SimplePortal


boranjudge

Çok teşekkür ederim Sevgili sinan, güzel bir kısmı tamamlandı sayende.

Yağız...


boranjudge

Quote from: Yağız on April 27, 2008, 10:34:40 AM
O sorun çözüldügüne göre baska bir sorun kaldi mi?

Sevgili Yağız,
Tablolama ve linkler açısından resimde ki gibi bir geliştirme kaldı.

tarihogretmeni

Öncelikle teşekkürler...

Bu değişiklik ile üyelerin gönderdiği son konularda kısalma oldu fakat son mesajlarda değişiklik olmadı.
"Tomurcuk derdinde olmayan ağaç odundur."

Yağız...

Aynı kodlardan ikişer tane olması gerekiyor. Siz ilk kodları değiştirmişsiniz. Diğer kodlarıda değiştirmeyi deneyin.

Yağız...

Tam olarak olmadı ama idare eder :)
Sources/Profile.php'de bulun:
t.ID_MEMBER_STARTED, t.ID_FIRST_MSG, t.ID_LAST_MSG, m.body, m.smileysEnabled,
m.subject, m.posterTime
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)

Degistirin:
t.ID_MEMBER_STARTED, t.ID_FIRST_MSG, t.ID_LAST_MSG, m.body, m.smileysEnabled,
m.subject, m.posterTime, mem.memberName
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = t.ID_MEMBER_STARTED)

Bulun:
'topic' => $row['ID_TOPIC'],
Öncesine ekleyin:
'poster' => array(
'name' => $row['memberName'],
'url' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER_STARTED'],
),

Themes/default/Profile.template.php dosyasinda bulun(burada tüm fonksiyonu degistiricez, yoksa çok uzun sürer):
// Template for showing all the posts of the user, in chronological order.
function template_showPosts()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;

echo '
<table border="0" width="85%" cellspacing="1" cellpadding="4" class="bordercolor" align="center">
<tr class="titlebg">
<td colspan="3" height="26">
&nbsp;<img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" align="top" />&nbsp;', $txt['showPosts'], '
</td>
</tr>';

// Only show posts if they have made some!
if (!empty($context['posts']))
{
// Page numbers.
echo '
<tr class="catbg3">
<td colspan="3">
', $txt[139], ': ', $context['page_index'], '
</td>
</tr>
</table>';

// Button shortcuts
$quote_button = create_button('quote.gif', 145, 'smf240', 'align="middle"');
$reply_button = create_button('reply_sm.gif', 146, 146, 'align="middle"');
$remove_button = create_button('delete.gif', 121, 31, 'align="middle"');
$notify_button = create_button('notify_sm.gif', 131, 125, 'align="middle"');

// For every post to be displayed, give it its own subtable, and show the important details of the post.
foreach ($context['posts'] as $post)
{
echo '
<table border="0" width="85%" cellspacing="1" cellpadding="0" class="bordercolor" align="center">
<tr>
<td width="100%">
<table border="0" width="100%" cellspacing="0" cellpadding="4" class="bordercolor" align="center">
<tr class="titlebg2">
<td style="padding: 0 1ex;">
', $post['counter'], '
</td>
<td width="75%" class="middletext">
&nbsp;<a href="', $scripturl, '#', $post['category']['id'], '">', $post['category']['name'], '</a> / <a href="', $scripturl, '?board=', $post['board']['id'], '.0">', $post['board']['name'], '</a> / <a href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '">', $post['subject'], '</a>
</td>
<td class="middletext" align="right" style="padding: 0 1ex; white-space: nowrap;">
', $txt[30], ': ', $post['time'], '
</td>
</tr>
<tr>
<td width="100%" height="80" colspan="3" valign="top" class="windowbg2">
<div class="post">', $post['body'], '</div>
</td>
</tr>
<tr>
<td colspan="3" class="windowbg2" align="', !$context['right_to_left'] ? 'right' : 'left', '"><span class="middletext">';

if ($post['can_delete'])
echo '
<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';sa=showPosts;start=', $context['start'], ';delete=', $post['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '?\');">', $remove_button, '</a>';
if ($post['can_delete'] && ($post['can_mark_notify'] || $post['can_reply']))
echo '
', $context['menu_separator'];
if ($post['can_reply'])
echo '
<a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '">', $reply_button, '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], ';sesc=', $context['session_id'], '">', $quote_button, '</a>';
if ($post['can_reply'] && $post['can_mark_notify'])
echo '
', $context['menu_separator'];
if ($post['can_mark_notify'])
echo '
<a href="' . $scripturl . '?action=notify;topic=' . $post['topic'] . '.' . $post['start'] . '">' . $notify_button . '</a>';

echo '
</span></td>
</tr>
</table>
</td>
</tr>
</table>';
}

// Show more page numbers.
echo '
<table border="0" width="85%" cellspacing="1" cellpadding="4" class="bordercolor" align="center">
<tr>
<td colspan="3" class="catbg3">
', $txt[139], ': ', $context['page_index'], '
</td>
</tr>
</table>';
}
// No posts? Just end the table with a informative message.
else
echo '
<tr class="windowbg2">
<td>
', $txt[170], '
</td>
</tr>
</table>';
}

Degistirin:
// Template for showing all the posts of the user, in chronological order.
function template_showPosts()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;

echo '
<table border="0" width="85%" cellspacing="1" cellpadding="4" class="bordercolor" align="center">
<tr class="titlebg">
<td colspan="3" height="26">
&nbsp;<img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" align="top" />&nbsp;', $txt['showPosts'], '
</td>
</tr>';

// Only show posts if they have made some!
if (!empty($context['posts']))
{
// Page numbers.
echo '
<tr class="catbg3">
<td colspan="3">
', $txt[139], ': ', $context['page_index'], '
</td>
</tr>
</table>';

// For every post to be displayed, give it its own subtable, and show the important details of the post.
foreach ($context['posts'] as $post)
{
echo '
<table cellpadding="6" cellspacing="1" border="0" width="85%" align="center" class="bordercolor">
<tr>
<td class="titlebg" style="font-weight:normal">
<span style="float:right">
Forum: <a href="', $scripturl, '?board=', $post['board']['id'], '.0">', $post['board']['name'], '</a>
</span>
', $post['time'], '
</td>
</tr>
<tr>
<td class="windowbg">
<div>
<a href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '"><strong>', $post['subject'], '</strong></a>
</div>
<div class="smalltext">
Baslatan: <a href="', $post['poster']['url'], '">', $post['poster']['name'], '</a>
</div>
<div class="windowbg2" style="margin:6px 0px 6px 0px; padding:6px; border:2px groove">
<div class="smalltext"><em>
<img style="vertical-align: middle;" src="images/icons/icon1.gif" alt="" border="0" />
<a href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '">', $post['subject'], '</a><br />
<br />
', $post['body'], '
</em></div>
</div>
</td>
</tr>
</table>';
}

// Show more page numbers.
echo '
<table border="0" width="85%" cellspacing="1" cellpadding="4" class="bordercolor" align="center">
<tr>
<td colspan="3" class="catbg3">
', $txt[139], ': ', $context['page_index'], '
</td>
</tr>
</table>';
}
// No posts? Just end the table with a informative message.
else
echo '
<tr class="windowbg2">
<td>
', $txt[170], '
</td>
</tr>
</table>';
}

boranjudge

Sevgili Yağız, emeğinize sağlık eğer demosu varsa verebilirseniz daha iyi olur ben denedim hata verdi ama büyük ihtimalle benden kaynaklı bir hata, çünkü kombinasyonlar kurarak değiştirmiştim dosyaların kodlarını şöyle birşey çıktı sonuç olarak

http://www.boranjudge.org/index.php?action=profile;u=1;sa=showPosts

Bu kadarıda şimdilik yeterli benim için,

umarım bu modu geliştiren arkadaşlar olur, güzel bir mod olduğunu düşünüyorum

İlgi ve alakanız için teşekkür ederim Sevgilerimle boranjudge.

Advertisement: