phpBB - Making a INDEX page

i need to make a index page with all the recent posted topics ok..

http://srilankans.hugetop.com/forum

thats my web site and i need to change the index from that to recent posted top 10 topics ...

can anyone help me on that ??

    Go to phpBBHacks .com and check for MODs there, they should have one if not more of them.

      and whats the mod name ??

      You'll need to search for it.

        i got this index.php downloaded ... anw wat shud i do next ??

        ps : im not that gud at php but i hosted this site (forum) and i need to do that to my index 馃檪

          bpat1434 thanks buddy... ill download them n let ya knw 馃檪

            Well what do you know I found a file for the top 5 (most popular) posts not necessarily most recent. You can change this to the top ten by just changing this line

            // 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,10';//added 10 by Houdini it was 5

            and here is a link to the download right HERE. After you download it then just unzip it and edit the files that it tells you to and within about 10 minutes you will have this working.

              Houdini wrote:

              Well what do you know I found a file for the top 5 (most popular) posts not necessarily most recent. You can change this to the top ten by just changing this line
              and here is a link to the download right HERE. After you download it then just unzip it and edit the files that it tells you to and within about 10 minutes you will have this working.

              hey bro i got it thanks but i only need Recent Topic Category only

              idont want the other two colomns ...

              this is the coding i got from that text file

              TEXT FILE wrote:

              #
              #-----[ OPEN ]------------------------------------------
              #
              index.php

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

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

              #
              #-----[ BEFORE, ADD ]------------------------------------------
              #

              //------------------------------------------------------------------------
              // Top Topics on Index 1.1.0 - Begin Code Addition
              //
              $template->assign_vars(array(
              'L_TOPICSRECENT' => $lang['TopicsRecent'],
              'L_TOPICSPOPULAR' => $lang['TopicsPopular'],
              'L_TOPICSPOPULARVIEW' => $lang['TopicsPopularView'])
              );

              // 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;
              	}
              }
              
              if( empty($topics_auth_sql) )
              {
              	$template->assign_block_vars('topicrecentpopular', array(
              		'TOPICSPOPULAR' => $lang['No_Posts'],
              		'TOPICSPOPULARVIEW' => $lang['No_Posts'],
              		'TOPICSRECENT' => $lang['No_Posts']
              	));
              }
              else
              {
              	//
              	// 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);
              
              	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
              //------------------------------------------------------------------------

              #
              #-----[ OPEN ]------------------------------------------
              #
              templates/subSilver/index_body.tpl

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

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

              #
              #-----[ BEFORE, ADD ]------------------------------------------
              #

              <!-- 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_english/lang_main.php

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

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

              #
              #-----[ BEFORE, ADD ]------------------------------------------
              #

              //------------------------------------------------------------------------
              // Top Topics on Index 1.1.0 - Begin Code Addition
              //
              $lang['TopicsRecent'] = "Recent Topics";
              $lang['TopicsPopular'] = "Popular Topics (by reply)";
              $lang['TopicsPopularView'] = "Popular Topics (by view)";
              //
              // Top Topics on Index 1.1.0 - End Code Addition
              //------------------------------------------------------------------------

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

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

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

              #
              #-----[ BEFORE, ADD ]------------------------------------------
              #

              //------------------------------------------------------------------------
              // Top Topics on Index 1.1.0 - Begin Code Addition
              //
              $lang['TopicsRecent'] = "脧卯帽毛氓盲铆猫氓 貌氓矛没";
              $lang['TopicsPopular'] = "脧卯茂贸毛每冒铆没氓 貌氓矛没 (茂卯 卯貌芒氓貌脿矛)";
              $lang['TopicsPopularView'] = "脧卯茂贸毛每冒铆没氓 貌氓矛没 (茂卯 茂冒卯帽矛卯貌冒脿矛)";
              //
              // Top Topics on Index 1.1.0 - End Code Addition
              //------------------------------------------------------------------------

              #
              #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
              #

              End

                please tell me how to change it back ?? i already applied these 馃檪 just one coloumn (recent topics only)

                  and houdini.. i added that 10 replacing 5 but didnt change 馃檨 why is that ??

                    Here is the other line that needs to be fixed for you to actually show ten posts because the first limits the data recieved from the databse to 10 but to present it there is another section as shown below that you need to change also and then you will get the ten.

                    $viewed_row = $db->sql_fetchrowset($active_topics_c);
                    		$db->sql_freeresult($active_topics_c);
                    
                    	for( $i = 0; $i < 9; $i++ )

                    the reason for nine is because if you put 10 after $i < you would show 11 posts, so change that line also and you will see the change. just do a search (or find) in that file for the $viewed_row = $db->sql_fetchrowset($active_topics_c); line andthen just make the change to the line and there you go.

                    Oh the file is the index.php in the root folder of your install.

                      Ok so you only want just recent topics and not the other two then let me look at what should be removed and how to alter the table layout to get what you want. I actually put this on my CMS and had no idea that some Topic had been viewed so many times, but if all you want is recent posts let me play with my local PC server and I'll post what you need to do.

                        Here is a quick fix that will show only the ten most recent posts it is the index_body.tpl file from your templates folder. Just replace the other code with this as is, then you can play around with the formatting yourself.

                        <!-- Top Topics on Index 1.1.0 - Begin Code Addition -->
                        <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
                          <tr> 
                        	<th width="100%" 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="100%" 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><br />
                        <!-- Top Topics on Index 1.1.0 - End Code Addition 

                        -->

                          Houdini wrote:

                          Here is the other line that needs to be fixed for you to actually show ten posts because the first limits the data recieved from the databse to 10 but to present it there is another section as shown below that you need to change also and then you will get the ten.

                          $viewed_row = $db->sql_fetchrowset($active_topics_c);
                          		$db->sql_freeresult($active_topics_c);
                          
                          	for( $i = 0; $i < 9; $i++ )

                          the reason for nine is because if you put 10 after $i < you would show 11 posts, so change that line also and you will see the change. just do a search (or find) in that file for the $viewed_row = $db->sql_fetchrowset($active_topics_c); line andthen just make the change to the line and there you go.

                          Oh the file is the index.php in the root folder of your install.

                          man u r da best.. seriously u guys hav been very helpful and helped me to understand wat this is like.. thanks alot dude... thanks again.. ill try these now..

                            Houdini wrote:

                            Here is a quick fix that will show only the ten most recent posts it is the index_body.tpl file from your templates folder. Just replace the other code with this as is, then you can play around with the formatting yourself.

                            <!-- Top Topics on Index 1.1.0 - Begin Code Addition -->
                            <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
                              <tr> 
                            	<th width="100%" 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="100%" 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><br />
                            <!-- Top Topics on Index 1.1.0 - End Code Addition 

                            -->

                            hey dude my table structure got jammed.. something wrong in this.. bt that two columns has been removed bt stil the settings r nt that gud...

                            something is missing,.. some statement might be

                              Write a Reply...