Página 2 de 2

Re: añadir temas activos a barra de mitch

Publicado: 30 Abr 2012, 08:45
por micasamitelefono
hopmbre, yo creo que lo suyo es sacar el código del gym, que creo que no va porque debe faltar algun include, porque en la misma página del gym lo tienen, incluso en una página personalizada.

Re: añadir temas activos a barra de mitch

Publicado: 30 Abr 2012, 12:29
por Rainwod
micasamitelefono escribió:hopmbre, yo creo que lo suyo es sacar el código del gym, que creo que no va porque debe faltar algun include, porque en la misma página del gym lo tienen, incl........
Si men si yo lo he sacado y estoy tratando de ver porqué no me funciona, si no te sirve el top five entonces sigo con lo de extraer el code del gym. En cuanto lo solucione te posteo. :cerveza:

Re: añadir temas activos a barra de mitch

Publicado: 30 Abr 2012, 16:30
por micasamitelefono
ok, gracias

Re: añadir temas activos a barra de mitch

Publicado: 30 Abr 2012, 20:01
por Megabyte
Rainwod escribió:Men yo te voy a ayudar, es mi deber como soporte...
Aunque posteo no para ayudar, pero creo q vale la pena hacer mención que por palabras asi, se conoce a los que realmente están comprometidos con phpbb-es.com (y ojo que todo ésto es add-honorem).... Gracias Rainwod, sé que ayudarás...

Re: añadir temas activos a barra de mitch

Publicado: 30 Abr 2012, 21:03
por Makoto
podrias usar el codigo de forum goal de stoker que creo que tiene esa opcion de mostrar temas mas activos, ahora la cosa seria donde deseas mostrar dicha tabla, solo en el indice?

Re: añadir temas activos a barra de mitch

Publicado: 02 May 2012, 16:51
por Megabyte
makoto, si pudieras dejar el enlace de lo que dices, yo podría sacarlo y dejarlo acá. El lugar donde mostrarlo no importa, pues solo se explicaria donde iría el codigo, tanto de la raiz, como en el template... :wink:

Re: añadir temas activos a barra de mitch

Publicado: 02 May 2012, 21:53
por Makoto
me equivoque de mod era top stats :lol:

Código: Seleccionar todo

// Most viewed topics
if (!empty($config['tsmvt_enable']) && sizeof($flist))
{
	if( ( $most_viewed = $cache->get('_ts_most_viewed_topics') ) === false )
	{	
		$sql = 'SELECT topic_id, forum_id, topic_title, topic_views, topic_time, topic_first_poster_name, topic_first_poster_colour, topic_poster, topic_last_poster_id
			FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $flist) . '
			ORDER BY topic_views DESC';
		$result = $db->sql_query_limit($sql, $config['tsmvt_number']);
		
		$most_viewed = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$most_viewed[] = $row;
		}
	  
		$db->sql_freeresult($result);

		// Cache for 1 hour
		$cache->put('_ts_most_viewed_topics', $most_viewed, 3600);
	}
	
	foreach( $most_viewed as $row )
	{
		$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']);
		$view_first_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_poster']);
		$view_last_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_last_poster_id']);
		
		$template->assign_block_vars('most_viewed', array(
			'TOPIC_ID'						=> $row['topic_id'], 
			'FORUM_ID'	    				=> $row['forum_id'],
			'TOPIC_TITLE'					=> $row['topic_title'],
			'TOPIC_VIEWS'					=> $row['topic_views'],
			'TOPIC_TIME'                    => $user->format_date($row['topic_time']), 
			'TOPIC_FIRST_POSTER_NAME'		=> $row['topic_first_poster_name'],
			'TOPIC_FIRST_POSTER_COLOUR'		=> $row['topic_first_poster_colour'],
			'U_FIRST_TOPIC'					=> $view_topic_url,
			'USERNAME_FIRST'				=> $view_first_poster,
			'USERNAME_LAST'					=> $view_last_poster,
		));
	}
	$db->sql_freeresult($result);
	
	$template->assign_vars(array(
		'S_TSMVT_ENABLE'      			=> $config['tsmvt_enable'],
		'TSMVT_NUMBER'					=> $config['tsmvt_number'],
    ));
}
este parte se puede usar pero debe modificarse para el topfive mod

Código: Seleccionar todo

// Most viewed topics
if( ( $most_viewed = $cache->get('_ts_most_viewed_topics') ) === false )
	{	
		$sql = 'SELECT topic_id, forum_id, topic_title, topic_views, topic_time, topic_first_poster_name, topic_first_poster_colour, topic_poster, topic_last_poster_id
			FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $flist) . '
			ORDER BY topic_views DESC';
		$result = $db->sql_query_limit($sql, 5);
		
		$most_viewed = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$most_viewed[] = $row;
		}
	  
		$db->sql_freeresult($result);

		// Cache for 1 hour
		$cache->put('_ts_most_viewed_topics', $most_viewed, 3600);
	}
	
	foreach( $most_viewed as $row )
	{
		$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']);
		$view_first_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_poster']);
		$view_last_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_last_poster_id']);
		
		$template->assign_block_vars('most_viewed', array(
			'TOPIC_ID'						=> $row['topic_id'], 
			'FORUM_ID'	    				=> $row['forum_id'],
			'TOPIC_TITLE'					=> $row['topic_title'],
			'TOPIC_VIEWS'					=> $row['topic_views'],
			'TOPIC_TIME'                    => $user->format_date($row['topic_time']), 
			'TOPIC_FIRST_POSTER_NAME'		=> $row['topic_first_poster_name'],
			'TOPIC_FIRST_POSTER_COLOUR'		=> $row['topic_first_poster_colour'],
			'U_FIRST_TOPIC'					=> $view_topic_url,
			'USERNAME_FIRST'				=> $view_first_poster,
			'USERNAME_LAST'					=> $view_last_poster,
		));
	}
seria algo asi
tambien agregar por el inicio

Código: Seleccionar todo

 $flist = $auth->acl_getf('f_read', true);
	$flist = array_unique(array_keys($flist));

Re: añadir temas activos a barra de mitch

Publicado: 03 May 2012, 04:43
por Megabyte
Prueba con ésta carpeta, ahi va el instalador, si funciona nos avisas.

Basado en el mod que makoto dejó, con detalles de como instalarlo.