Smf yeni istatislik top on

Başlatan orhan, Ara 21, 2018, 10:37 öö

« önceki - sonraki »
Ara 21, 2018, 10:37 öö Son düzenlenme: Oca 02, 2019, 09:34 ös orhan


Uzun zamandir düşünüyordum yapmayi zira yapilan istatislik modlarininin hic biri işe yaramas kimi formu sorguyla dolduruyor kimi db sorgusuyla formu kasiyor kisacasi bu mod smf kodlamasiyla bire bir entegredir
modu geliştire bilirsiniz ben başlangic,ini yapiyorum

CANLI DEMO

./Sources/Subs-Recent.php

bul

IFNULL(mem.real_name, m.poster_name) AS poster_name,
degis

IFNULL(mem.real_name, m.poster_name) AS poster_name, t.id_board, b.name AS board_name, t.num_views, t.num_replies,
bul

'time' => timeformat($row['poster_time']),
altina ekle

'views' => comma_format($row['num_views']),
        'replies' => comma_format($row['num_replies']),

./Themes/default/BoardIndex.template.php

bul (2 tane var uste ciksin derseniz ustu editleyin yoksa alti)

// Show lots of posts.
      elseif (!empty($context['latest_posts']))
      {
        echo '
            <dl id="ic_recentposts" class="middletext">';

        /* 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 '
              <dt><strong>', $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</dt>
              <dd>', $post['time'], '</dd>';
        echo '
            </dl>';
degis

// Show lots of posts.
      elseif (!empty($context['latest_posts']))
      {
        echo '
                              <table cellpadding="0" cellspacing="1" width="100%" border="0">
              <tr>
              <td class="catbg2" style="text-align:left;" colspan="2">',$txt['recent_title'],'</td>
              <td class="catbg2" style="text-align:center;">',$txt['recent_replies'],'</td>
              <td class="catbg2" style="text-align:center;">',$txt['recent_views'],'</td>
              <td class="catbg2" style="text-align:center;">',$txt['recent_boardname'],'</td>
              <td class="catbg2" style="text-align:center;">',$txt['recent_by'],'</td>
              <td class="catbg2" style="text-align:right;">',$txt['recent_time'],'</td>
            </tr>';


        /* 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. */
                  $cnt = 0;
        foreach ($context['latest_posts'] as $post){
        $cnt++;
        $class = ($cnt % 2) ? 'windowbg' : 'windowbg2';
       
        echo '
                    <tr>
                    <td></td>
                        <td class="', $class, '" title="', $post['preview'] ,'">', $post['link'], '</td>
                        <td class="', $class, '" style="text-align:center;">', $post['replies'], '</td>
                        <td class="', $class, '" style="text-align:center;">', $post['views'], '</td>                       
                        <td class="', $class, '" style="text-align:center;">',$post['board']['link'], '</td>
                        <td class="', $class, '" style="text-align:center;">',$post['poster']['link'], '</td>
                        <td class="', $class, '" style="text-align:right;" nowrap="nowrap">', $post['time'], '</td>

                    </tr>';
      }

        echo '
            </table>';

./Themes/default/languages/Modifications.english.php

bul
?>
Öncesine Ekle:

$txt['recent_title'] = 'Subject';
$txt['recent_views'] = 'Views';
$txt['recent_replies'] = 'Replies';
$txt['recent_boardname'] = 'Board name';
$txt['recent_by'] = 'Author';
$txt['recent_time'] = 'Date';

kulandiginiz dil dosyasina

$txt['recent_title'] = 'Son Konular';
$txt['recent_views'] = 'Gösterim';
$txt['recent_replies'] = 'Yanit';
$txt['recent_boardname'] = 'Bölüm Adi';
$txt['recent_by'] = 'Gönderen';
$txt['recent_time'] = 'Tarih';

ustte cikmasini isteyen

bul sil

// This is the "Recent Posts" bar.
 if (!empty($settings['number_recent_posts']) && (!empty($context['latest_posts']) || !empty($context['latest_post'])))
 {
 echo '
 <div class="title_barIC">
 <h4 class="titlebg">
 <span class="ie6_header floatleft">
 <a href="', $scripturl, '?action=recent"><img class="icon" src="', $settings['images_url'], '/post/xx.gif" alt="', $txt['recent_posts'], '" /></a>
 ', $txt['recent_posts'], '
 </span>
 </h4>
 </div>
 <div class="hslice" id="recent_posts_content">
 <div class="entry-title" style="display: none;">', $context['forum_name_html_safe'], ' - ', $txt['recent_posts'], '</div>
 <div class="entry-content" style="display: none;">
 <a rel="feedurl" href="', $scripturl, '?action=.xml;type=webslice">', $txt['subscribe_webslice'], '</a>
 </div>';

 // 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'], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br />
 </p>';
 }
 // Show lots of posts.
 elseif (!empty($context['latest_posts']))
 {
 echo '
 <dl id="ic_recentposts" class="middletext">';

 /* 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 '
 <dt><strong>', $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</dt>
 <dd>', $post['time'], '</dd>';
 echo '
 </dl>';
 }
 echo '
 </div>';
 }

bul

echo '
  <div id="boardindex_table">
      <table class="table_list">';

ustune ekle

// This is the "Recent Posts" bar.
 if (!empty($settings['number_recent_posts']))
 {
 echo '
 <div class="cat_bar">
 <h3 class="catbg">
 <span class="ie6_header floatleft">
 <a href="', $scripturl, '?action=recent"><i class="icon-edit-sign icon-large"></i></a>
 ', $txt['recent_posts'], '
 </span>
 </h3>
 </div>
 <div class="hslice" id="recent_posts_content">
 <div class="entry-title" style="display: none;">', $context['forum_name_html_safe'], ' - ', $txt['RecentTopicsOnBoardIndex_recenttopics'], '</div>
 <div class="entry-content" style="display: none;">
 <a rel="feedurl" href="', $scripturl, '?action=.xml;type=webslice">', $txt['subscribe_webslice'], '</a>
 </div>';

 // 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'], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br />
 </p>';
 }
 // Show lots of posts.
 elseif (!empty($context['latest_posts']))
 {
 echo '
 <table width="100%" cellpadding="0" cellspacing="2" style="font-size:11px;border:1px solid #ccc;padding:1px;">
          <tr>
              <td class="catbg2" style="text-align:left;" colspan="2">',$txt['recent_title'],'</td>
              <td class="catbg2" style="text-align:center;">',$txt['recent_replies'],'</td>
              <td class="catbg2" style="text-align:center;">',$txt['recent_views'],'</td>
              <td class="catbg2" style="text-align:center;">',$txt['recent_boardname'],'</td>
              <td class="catbg2" style="text-align:center;">',$txt['recent_by'],'</td>
              <td class="catbg2" style="text-align:right;">',$txt['recent_time'],'</td>
            </tr>';


 /* 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. */
 $cnt = 0;
 foreach ($context['latest_posts'] as $post){
        $cnt++;
        $class = ($cnt % 2) ? 'windowbg' : 'windowbg2';
       
        echo '
 <tr>
 <td></td>
 <td class="', $class, '" title="', $post['preview'] ,'">', $post['link'], '</td>
 <td class="', $class, '" style="text-align:center;">', $post['replies'], '</td>
 <td class="', $class, '" style="text-align:center;">', $post['views'], '</td>
 <td class="', $class, '" style="text-align:center;">',$post['board']['link'], '</td>
 <td class="', $class, '" style="text-align:center;">',$post['poster']['link'], '</td>
 <td class="', $class, '" style="text-align:right;" nowrap="nowrap">', $post['time'], '</td>

 </tr>';
      }

 echo '
 </table>
 <br/>';
 
 }
 echo '
 </div>';
 }

Oca 02, 2019, 04:09 ös #1 Son düzenlenme: Oca 02, 2019, 04:47 ös replikacep
bu paylaştıgınız 2.0  içinmi  2.1 ise  kodlar degişmiş  kodların çogu 2.1 son halinde yok

paylaştıklarınızı denedim calışmadı malesef [attach name=sshot-1.png type=image/png]40[/attach]

resimdeki gibi bekliyordum ben