mod : The last Five and the Five popular

Hulp nodig bij een modificaties of op zoek naar een MOD? Bekijk ons archief. Support wordt helaas niet meer verleend.
Forumregels

Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
phpBB2.0.x
Gesloten
Jappie
Berichten: 81
Lid geworden op: 21 apr 2004, 07:51

mod : The last Five and the Five popular

Bericht door Jappie » 23 apr 2004, 17:19

Code: Selecteer alles

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

# 
#-----[ ADD BEFORE ]------------------------------ 
# 
	//
	// Okay, let's build the topic recent and popular
	//
$active_topics_sql="SELECT a.topic_id,a.topic_title,  a.topic_replies,  a.topic_last_post_id, c.post_time 
			FROM phpbb_topics a, phpbb_users b, phpbb_posts c, phpbb_forums d 
			where a.topic_last_post_id=c.post_id and b.user_id=c.poster_id 
				and d.forum_id=a.forum_id 
				and d.auth_view=0 
			ORDER BY topic_last_post_id DESC 
			LIMIT 5"; 
$active_topics = $db->sql_query($active_topics_sql); 

$active_topics_sql2="SELECT a.topic_id,a.topic_title,  a.topic_replies,  a.topic_last_post_id, c.post_time 
			FROM phpbb_topics a, phpbb_users b, phpbb_posts c, phpbb_forums d 
			where a.topic_last_post_id=c.post_id and b.user_id=c.poster_id 
				and d.forum_id=a.forum_id 
				and d.auth_view=0 
			ORDER BY topic_replies DESC 
			LIMIT 5"; 
$active_topics2 = $db->sql_query($active_topics_sql2); 

$active_topics_sql3="SELECT a.topic_id,a.topic_title,  a.topic_views, a.topic_replies,  a.topic_last_post_id, c.post_time
			FROM phpbb_topics a, phpbb_users b, phpbb_posts c, phpbb_forums d 
			where a.topic_last_post_id=c.post_id and b.user_id=c.poster_id 
				and d.forum_id=a.forum_id 
				and d.auth_view=0 
			ORDER BY topic_views DESC 
			LIMIT 5"; 
$active_topics3 = $db->sql_query($active_topics_sql3); 

	while (($line = mysql_fetch_array($active_topics)) and ($line2 = mysql_fetch_array($active_topics2)) and ($line3 = mysql_fetch_array($active_topics3)))
	{
		if (strlen($line['topic_title']) > 40)
		{
			$line_topic_title = substr($line['topic_title'], 0, 40)." ...";
		}
		else
		{
			$line_topic_title = $line['topic_title'];
		}
		if (strlen($line2['topic_title']) > 40)
		{
			$line_topic_title2 = substr($line2['topic_title'], 0, 40)." ...";
		}
		else
		{
			$line_topic_title2 = $line2['topic_title'];
		}
		if (strlen($line3['topic_title']) > 40)
		{
			$line_topic_title3 = substr($line3['topic_title'], 0, 40)." ...";
		}
		else
		{
			$line_topic_title3 = $line3['topic_title'];
		}
		$lastpost = "<a href=\"".$phpbb_root_path."viewtopic.php?t=" . $line['topic_id'] . "\" title=\"" . $line['topic_title'] ."\">" . $line_topic_title . "</a>";
		$poppost = "<a href=\"".$phpbb_root_path."viewtopic.php?t=" . $line2['topic_id'] . "\" title=\"" . $line2['topic_title'] ."\">" . $line_topic_title2 . "</a>";
		$poppostc = $line2['topic_replies'];
		$popviewpost = "<a href=\"".$phpbb_root_path."viewtopic.php?t=" . $line3['topic_id'] . "\" title=\"" . $line3['topic_title'] ."\">" . $line_topic_title3 . "</a>";
		$popviewpostc = $line3['topic_views'];
		$template->assign_block_vars('topicrecentpopular', array(
			'TOPICSPOPULAR' => $poppost, 
			'TOPICSPOPULARC' => $poppostc, 
			'TOPICSPOPULARVIEW' => $popviewpost, 
			'TOPICSPOPULARVIEWC' => $popviewpostc, 
			'TOPICSRECENT' => $lastpost)
		);
	}


# 
#-----[ SAVE & CLOSE index.php ]------------------------------ 
# 

# 
#-----[ FIND IN templates/subSilver/index_body.tpl ]------------------------------ 
# 
<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 -->

# 
#-----[ ADD BEFORE ]------------------------------ 
# 
<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>

&nbsp;

# 
#-----[ SAVE & CLOSE templates/subSilver/index_body.tpl ]------------------------------ 
# 

# 
#-----[ FIND IN language/lang_dutch/lang_main.php ]------------------------------ 
# 
$lang['Topics'] = 'Topics';

# 
#-----[ ADD AFTER ]------------------------------ 
# 
$lang['TopicsRecent'] = "Recent Topics";
$lang['TopicsPopular'] = "Populaire Topics (Antwoorden)";
$lang['TopicsPopularView'] = "Populaire Topics (Bekeken)";

# 
#-----[ SAVE & CLOSE language/lang_dutch/lang_main.php ]------------------------------
#-----[ DONE ]------------------------------ 

Hij geeft dus heel mooi die 3 top 5s weer, maar niet welke top 5s het zijn. Hij zet niet boven zo'n top 5 welke het is. Wat heb ik fout gedaan ?

Hij werkt ook niet helemaal zoals het hoort hij geeft van alles 4 weer en bij de top5 reply's staat niks bij views weer wel.

Afbeelding

Gebruikersavatar
Luuk
Berichten: 7311
Lid geworden op: 22 okt 2003, 10:07
Locatie: Delft

Bericht door Luuk » 23 apr 2004, 17:58

hij zet het er wel neer, kijk maar:
je script schreef:

Code: Selecteer alles

<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>
Ik denk dat je de lang aanpassingen niet (goed) hebt gedaan. Als je de NL stijl hebt moet je het niet alleen in language/lang_english/lang_main.php aanpassen, maar ook in language/lang_dutch/lang_main.php
Afbeelding

Jappie
Berichten: 81
Lid geworden op: 21 apr 2004, 07:51

Bericht door Jappie » 23 apr 2004, 19:07

dat heb ik dus gedaan maar nog doet die het niet 100%

Jappie
Berichten: 81
Lid geworden op: 21 apr 2004, 07:51

Bericht door Jappie » 24 apr 2004, 15:17

Code: Selecteer alles

$lang['TopicsRecent'] = "Recent Topics"; 
$lang['TopicsPopular'] = "Populaire Topics (Antwoorden)"; 
$lang['TopicsPopularView'] = "Populaire Topics (Bekeken)"; 
moet dat niet dit zijn?

Code: Selecteer alles

$lang['TopicsRecent'] = 'Recent Topics'; 
$lang['TopicsPopular'] = 'Populaire Topics (Antwoorden)'; 
$lang['TopicsPopularView'] = 'Populaire Topics (Bekeken)'; 
met ' ipv. " ?

Gebruikersavatar
WebSiteNet
Berichten: 6524
Lid geworden op: 20 okt 2003, 16:56
Locatie: Wieringerwerf
Contacteer:

Bericht door WebSiteNet » 24 apr 2004, 15:47

Maakt met 3 niks uit.

Jappie
Berichten: 81
Lid geworden op: 21 apr 2004, 07:51

Bericht door Jappie » 24 apr 2004, 16:51

ik snap dan echt nog steeds niet waarom die niet die tekst weer geeft ik heb alles nog een keer over gedaan in een engelse versie phpBB maar daar komt ook de tekst boven die dingen niet te staan. is er niet iemand die dit ff kan testen ? zodat ik weet wat ik dan fout doe ofzo :?

niemand weet dus waar het aan zou kunnen liggen ???

Gesloten