Last_Popular_Topics_5

Eklentiler ile ilgili soru, sorun ve tartışmalar.

Last_Popular_Topics_5

İleti Kasirga 13.08.2006, 17:17

Ben bu Konu istatistigini kurdum Last_Popular_Topics_5

Kod: Tümünü seç
########################################################
MOD Baþlýðý:          The last Five and the Five popular (answers/views) on index.php
MOD Açýklamasý:    Ana sayfada 3 Blok Halinde Popüler ve yeni açýlan konularý listeler
MOD Versiyonu:        1.1.0
MOD Yazar&yacute; :         Andrey Politov aka Sergeant < andypolv@mail.ru >
tÜRKÇELE&THORN;T&Yacute;RME : CeNK (c.cenk@lycos.co.uk) / www.canver.net
Kurulum Seviyesi : Kolay
Kurulum Süresi:  ~5 dakika
Düzenlenecek Dosyalar:      4 Adet
index.php
templates/teman&yacute;z/index_body.tpl
language/lang_turkish/lang_main.php
##
########################################################
##
## Before Adding This hack To Your Forum,
## You Should Back Up All Files Related To This hack
##
########################################################
##
## Installation Notes:
##
## Follow the steps below.
##
########################################################


#-----[ AÇ ]------------------------------------------
#
index.php

#
#-----[ BUL ]------------------------------------------
#

   //
   // Okay, let's build the index
   //
   for($i = 0; $i < $total_categories; $i++)
   {
      $cat_id = $category_rows[$i]['cat_id'];


#
#-----[ ÖNCES&Yacute;NE EKLE]------------------------------------------
#

//------------------------------------------------------------------------
// Top Topics on Index 1.1.0 - Begin Code Addition
//
   // Get forum auth information to insure privacy of hidden topics
   $topics_auth = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata);
   $topics_auth_sql = '';
   foreach($topics_auth as $k=>$v)
   {
      if( $v['auth_view'] && $v['auth_read'] )
      {
         $topics_auth_sql .= (( empty($topics_auth_sql) ) ? '': ', ') . $k;
      }
   }
   //
   // Okay, let's build the topic recent and popular
   //
   $active_topics_sql = 'SELECT t.topic_id, t.topic_title, t.topic_replies, t.topic_views, t.topic_last_post_id
      FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE. ' f
      WHERE t.forum_id IN (' . $topics_auth_sql . ')
         AND f.forum_id = t.forum_id
      ORDER BY %1$s DESC
      LIMIT 0,5';
   $active_topics_sql_a = sprintf($active_topics_sql, 'topic_last_post_id');
   $active_topics_sql_b = sprintf($active_topics_sql, 'topic_replies');
   $active_topics_sql_c = sprintf($active_topics_sql, 'topic_views');
   $recent_row = $popular_row = $viewed_row = array();

   if( !$active_topics_a = $db->sql_query($active_topics_sql_a))
   {
      message_die(GENERAL_ERROR, 'Could not retrieve recent topics', '', __LINE__, __FILE__, $active_topics_sql_a);
   }
   $recent_row = $db->sql_fetchrowset($active_topics_a);
   $db->sql_freeresult($active_topics_a);

   if( !$active_topics_b = $db->sql_query($active_topics_sql_b))
   {
      message_die(GENERAL_ERROR, 'Could not retrieve popular topics', '', __LINE__, __FILE__, $active_topics_sql_b);
   }
   $popular_row = $db->sql_fetchrowset($active_topics_b);
   $db->sql_freeresult($active_topics_b);

   if( !$active_topics_c = $db->sql_query($active_topics_sql_c))
   {
      message_die(GENERAL_ERROR, 'Could not retrieve most viewed topics', '', __LINE__, __FILE__, $active_topics_sql_c);
   }
   $viewed_row = $db->sql_fetchrowset($active_topics_c);
   $db->sql_freeresult($active_topics_c);

   $template->assign_vars(array(
      'L_TOPICSRECENT' => $lang['TopicsRecent'],
      'L_TOPICSPOPULAR' => $lang['TopicsPopular'],
      'L_TOPICSPOPULARVIEW' => $lang['TopicsPopularView'])
   );

   for( $i = 0; $i < 5; $i++ )
   {
      $recent_topic_title = $recent_row[$i]['topic_title'];
      $popular_topic_title = $popular_row[$i]['topic_title'];
      $viewed_topic_title = $viewed_row[$i]['topic_title'];

      if( strlen($recent_topic_title) > 40 )
      {
         $recent_topic_title = substr($recent_topic_title, 0, 40) . '...';
      }

      if( strlen($popular_topic_title) > 40 )
      {
         $popular_topic_title = substr($popular_topic_title, 0, 40) . '...';
      }

      if( strlen($viewed_topic_title) > 40 )
      {
         $viewed_topic_title = substr($viewed_topic_title, 0, 40) . '...';
      }

      $recent_post = '<a href="viewtopic.php?' . POST_TOPIC_URL . '=' . $recent_row[$i]['topic_id'] . '" title="' . $recent_row[$i]['topic_title'] . '">' . $recent_topic_title . '</a>';
      $popular_post = '<a href="viewtopic.php?' . POST_TOPIC_URL . '=' . $popular_row[$i]['topic_id'] . '" title="' . $popular_row[$i]['topic_title'] . '">' . $popular_topic_title . '</a>';
      $popular_total_replies = $popular_row[$i]['topic_replies'];
      $viewed_post = '<a href="viewtopic.php?' . POST_TOPIC_URL . '=' . $viewed_row[$i]['topic_id'] . '" title="' . $viewed_row[$i]['topic_title'] . '">' . $viewed_topic_title . '</a>';
      $viewed_total_replies = $viewed_row[$i]['topic_views'];

      $template->assign_block_vars('topicrecentpopular', array(
         'TOPICSPOPULAR' => $popular_post,
         'TOPICSPOPULARC' => $popular_total_replies,
         'TOPICSPOPULARVIEW' => $viewed_post,
         'TOPICSPOPULARVIEWC' => $viewed_total_replies,
         'TOPICSRECENT' => $recent_post)
      );
   }
//
// Top Topics on Index 1.1.0 - End Code Addition
//------------------------------------------------------------------------

#
#-----[ AÇ ]------------------------------------------
#
templates/TEMANIZ/index_body.tpl


#
#-----[ BUL ]------------------------------------------
#

<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
  <tr>
   <th colspan="2" class="thCornerL" height="25" nowrap="nowrap">&nbsp;{L_FORUM}&nbsp;</th>
   <th width="50" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>
   <th width="50" class="thTop" nowrap="nowrap">&nbsp;{L_POSTS}&nbsp;</th>
   <th class="thCornerR" nowrap="nowrap">&nbsp;{L_LASTPOST}&nbsp;</th>
  </tr>
  <!-- BEGIN catrow -->

#
#-----[ ÖNCES&Yacute;NE EKLE ]------------------------------------------
#

<!-- Top Topics on Index 1.1.0 - Begin Code Addition -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
  <tr>
   <th width="25%" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICSRECENT}&nbsp;</th>
   <th width="38%" colspan="2" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICSPOPULAR}&nbsp;</th>
   <th width="37%" colspan="2" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICSPOPULARVIEW}&nbsp;</th>
  </tr>
  <!-- BEGIN topicrecentpopular -->
  <tr>
   <td width="29%" class="row2" align="left" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSRECENT}</span></td>
   <td width="31%" class="row2" align="left" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSPOPULAR}</span></td>
   <td width="6%" class="row2" align="center" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSPOPULARC}</span></td>
   <td width="29%" class="row2" align="left" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSPOPULARVIEW}</span></td>
   <td width="6%" class="row2" align="center" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSPOPULARVIEWC}</span></td>
  </tr>
  <!-- END topicrecentpopular -->
</table>
<!-- Top Topics on Index 1.1.0 - End Code Addition -->


#
#-----[ OPEN ]------------------------------------------
#
language/lang_turkish/lang_main.php


#
#-----[ FIND ]------------------------------------------
#

//
// That's all, Folks!
// -------------------------------------------------


#
#-----[ ÖNCES&Yacute;NE EKLE ]------------------------------------------
#

//------------------------------------------------------------------------
// Top Topics on Index 1.1.0 - Begin Code Addition
//
$lang['TopicsRecent'] = "Panoda Yeni Aç&yacute;lan Konular ";
$lang['TopicsPopular'] = " En Çok Cevaplanan Konular";
$lang['TopicsPopularView'] = " En Çok Görüntülenen Konular";
//
// Top Topics on Index 1.1.0 - End Code Addition
//------------------------------------------------------------------------



#
#-----[ KAYDET VE KAPAT]------------------------------------------
#
# B&Yacute;TT&Yacute;!


Bunu kurduktan sonra forumda konu istatistigi istedigim gibi olmustu ,portale gectigimde ise sql hatasi veriyordu ,ne is cözemedim yada ne yapmaliyim cünkü kurulumda sql icin kodlari yok

Kod: Tümünü seç
Could not query poll information

DEBUG MODE

SQL Error : 1030 Got error 28 from storage engine

SELECT t.*, vd.* FROM phpbb_topics AS t, phpbb_vote_desc AS vd WHERE t.forum_id IN (7,7) AND t.topic_status <> 1 AND t.topic_status <> 2 AND t.topic_vote = 1 AND t.topic_id = vd.topic_id ORDER BY t.topic_time DESC LIMIT 0,1

Line : 179
File : fetchposts.php
Kasirga
Üye
Üye
 
İleti: 38
Kayıt: 11.05.2006, 01:09

Cvp: Last_Popular_Topics_5

İleti MUSA21 07.09.2006, 21:22

arkadasim bendede ayni sQl hatasi veriyordu benim soyle cozdum belki sanada yarar benim forum sadece uyeler okuya biliyordu onu degistirdim herkese acdim ve promlem kalmadi cunku oradan kisitlama yaptiysan giris yapmadan forum hata veriyordu istersen bir dene belki isine yarar ben de bu islerde yeniyim onun icin fazla yardim edemiyorum kusura bakma
MUSA21
Üye
Üye
 
İleti: 5
Kayıt: 21.08.2006, 17:12


Soru(n)lar & Tartışmalar



Kimler çevrimiçi

Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 0 misafir

cron