collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 395
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Sohbet Kutusu

Refresh History
  • Destek için kullanmay?n!
  • akorkut: Ama desteklerinizi de bekliyoruz.
    November 18, 2016, 08:41:36 AM
  • akorkut: grafitus hocam, yaklaşık 10 yıl.. smf, sp,  sizin ve diğer paylaşımseverin çalışmalarınızl bize destek oldu. Herşey için çok teşekkür ederiz.
    November 18, 2016, 08:40:38 AM
  • grafitus: Merhabalar herkese. Uzun zaman oldu, hayatlar değişti. Vakit ayıramaz olduk. SMF ve SimplePortal'ın yeri farklı olsa da artık aktif olmadıkları aşikar. Belki bir gün yeniden forumlar doğar. :)) Sevgilerle.
    November 18, 2016, 08:26:32 AM
  • tc bolubeyi: gelen giden yok pek
    July 31, 2016, 02:52:53 PM
  • tekniker974: Neredeyse 1 sene olmuş
    May 12, 2016, 01:05:50 AM
  • tekniker974: Günaydın
    May 12, 2016, 01:05:19 AM
  • tc bolubeyi: merhaba dostlara
    August 28, 2015, 08:56:04 AM
  • mert1i: ker alaka
    August 03, 2015, 10:07:49 AM
  • sonkalem: sa
    July 14, 2015, 03:27:51 PM
  • tc bolubeyi: sağolun ben de iyi allaha şükür
    June 10, 2015, 05:52:54 PM
  • mkuru: Teşekkürler Hasan Bey. Sizi sormalı
    May 27, 2015, 02:53:43 AM
  • tc bolubeyi: selam dostlar nasılsınız
    May 23, 2015, 06:52:15 PM
  • streetfire: Ben seviyorum.
    May 01, 2015, 03:39:22 PM
  • streetfire: Valla bilmiyorum. Sitemde çok kullanıyorum.
    May 01, 2015, 03:39:14 PM
  • mkuru: Evet haklısın
    April 03, 2015, 08:23:32 AM
  • mert1i: portalın en çok istenen ama en aaz talep gören kısmı bu chat
    April 01, 2015, 07:35:31 AM
  • mert1i: Selamun aleyküm ahali..
    January 27, 2015, 05:20:06 AM
  • tekniker974: a.s.
    August 12, 2014, 03:22:53 PM
  • delirium: S.a
    August 02, 2014, 10:24:22 AM
  • tekniker974: :nervous-happy:kimse yok
    July 15, 2014, 01:19:26 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Author Topic: Avatarlı son iletiler bloğu  (Read 3247 times)

0 Members and 1 Guest are viewing this topic.

Offline tc bolubeyi

  • Sr. Member
  • ****
  • Posts: 389
  • Gender: Male
    • temrinlerim.org
  • SMF Version: 2 RC3
  • SP Version: 2.3.3
Avatarlı son iletiler bloğu
« on: July 20, 2011, 04:55:00 AM »
Demo: http://www.spinabifidaturkey.com/smf/index.php
PHP Blok Kodları
Code: [Select]
$kacmesaj = 5;
$latestPostOptions = array('number_posts' => $kacmesaj,);
 global $smcFunc, $txt, $user_info, $sourcedir, $modSettings, $context, $settings, $scripturl;
  $context['latest_posts'] = cache_quick_get('boardindex-latest_posts:' . md5($user_info['query_wanna_see_board'] . $user_info['language']), 'Subs-Recent.php', 'cache_getLastPosts', array($latestPostOptions));
  $members = array();
  foreach ($context['latest_posts'] as $post)
   $members[] = $post['poster']['id'];
  $request = $smcFunc['db_query']('', '
   SELECT m.id_member, m.avatar, a.id_attach, a.attachment_type, a.filename
   FROM {db_prefix}members AS m
   LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = m.id_member)
   
   WHERE m.id_member IN ({array_int:member_ids})',
   array(
    'member_ids' => $members,
   )
  );
  $avatar_profile = array();
  while ($row = $smcFunc['db_fetch_assoc']($request))
  {
   $avatar_profile[$row['id_member']] = array(
    'name' => $row['avatar'],
    'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" style="float: left;" width="30" />'),
    'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar_url'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
    'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
    'avatar' => array(
    'name' => $row_members['avatar'],
    'image' => $row_members['avatar'] == '' ? ($row_members['id_attach'] > 0 ? '<img src="' . (empty($row_members['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row_members['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_members['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row_members['avatar'], 'http://') ? '<img src="' . $row_members['avatar'] . '" width="" height="" alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_members['avatar']) . '" alt="" class="avatar" border="0" />'),
    'href' => $row_members['avatar'] == '' ? ($row_members['id_attach'] > 0 ? (empty($row_members['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row_members['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_members['filename']) : '') : (stristr($row_members['avatar'], 'http://') ? $row_members['avatar'] : $modSettings['avatar_url'] . '/' . $row_members['avatar']),
    'url' => $row_members['avatar'] == '' ? '' : (stristr($row_members['avatar'], 'http://') ? $row_members['avatar'] : $modSettings['avatar_url'] . '/' . $row_members['avatar'])
   ),
  );
   
  }
  $smcFunc['db_free_result']($request);
 
  if (!empty($avatar_profile))
   foreach ($context['latest_posts'] as $k => $post)
    if (!empty($avatar_profile[$post['poster']['id']]))
     $context['latest_posts'][$k]['poster']['avatar'] = $avatar_profile[$post['poster']['id']];
     
global $context, $settings, $options, $txt, $scripturl, $modSettings;
  // Only show one post.
  if ($settings['number_recent_posts'] == 1)
  {
   // latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
   echo '
    <strong><a href="', $scripturl, '?action=recent">', $txt['recent_posts'], '</a></strong>
    <p id="infocenter_onepost" class="middletext">
     ', $txt['recent_view'], ' "', $context['latest_post']['link'], '" ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br />
    </p>';
  }
    // Show lots of posts.
  elseif (!empty($context['latest_posts']))
  {
   /* Each post in latest_posts has:
     board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
     subject, short_subject (shortened with...), time, link, and href. */
   foreach ($context['latest_posts'] as $post)
   echo '
   
    <div align="center">
   
    <table  border="0" bordercolor="#003c74" width="210" >
   
   
<tr style="align:left;background:#f5f5f5;">
  <td style=" border:solid 1px #003c74; height: 60px ; width: 60px ;"><img  class="profilresim" src="', !empty($post['poster']['avatar']['href']) ? $post['poster']['avatar']['href'] : $settings['images_url'] . '/noavatar.jpg', '" width="60" height="60"  /></a>
                              </td>
<td style=" border:1px solid #003c74; height: 60px ; width: 100% ;" ><strong>', $post['link'], '<br/></strong> <a style="color:red;">', $txt['by'], ' ', $post['poster']['link'], '</a><br/>', $post['time'], '</td>     
     </tr>   
    </table></div>
';
   
  }

Offline gecitli

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Avatarlı son iletiler bloğu
« Reply #1 on: July 20, 2011, 06:13:02 AM »
sagol bolubeyi güzel düsünce