Seleccionar idioma:
Realizar Donación - Mods Premium - Portfolio



Este sitio utiliza cookies propias y de terceros. Si continúa navegando consideramos que acepta el uso de cookies. OK Más Información.
* Another Latest Topics (SMF 2.0)
  Leído 9078 veces
* Viendo el foro
 0 Usuarios y 1 Visitante están viendo este foro.


*
Dic 02 2011


Hello!
When I use this block for only one spesific board ($include_boards = 52;) it only shows posts from the last week. I also have "$num_recent = 10; //LIMIT", but my block still shows only post from the last week. How can I figure that out??

adkportal V1.1
smf 2.0
www,hellasforum.net
#30

Mensajes: 6

Ver Perfil  Email 

En línea

*
Dic 02 2011


nono
This is wrong:
Código: [Seleccionar]
$include_boards = 52;
This is like this:
Código: [Seleccionar]
$include_boards = array(52);

*¤×•·:.·.:·•×¤* ^HeRaCLeS^ *¤×•·:.·.:·•×¤*
*¤×• Todos los Mp seran ignorados | Solo seran considerados los Mp Solicitados por mi •×¤*
*¤×• All Mp will be ignored | Only considers the Mp requested per my •×¤*

SMFPersonal

Adk Portal 3.0.2
2.0.14
www.smfpersonal.net
#31

Mensajes: 13978

Ver Perfil  SMFPersonal 

En línea

*
Dic 02 2011


Ok, I change to $include_boards = array(52);
...but still I only get posts from the last couple of days (last week). In board no. 52 I have hundreds of post, but the block only shows 1 post (from yesterday), the second last post is about 3 weeks old.

I have tried with other boards as well, and the same thing happens.

adkportal V1.1
smf 2.0
www,hellasforum.net
#32

Mensajes: 6

Ver Perfil  Email 

En línea

*
Dic 02 2011


When was the last forum post 52?

*¤×•·:.·.:·•×¤* ^HeRaCLeS^ *¤×•·:.·.:·•×¤*
*¤×• Todos los Mp seran ignorados | Solo seran considerados los Mp Solicitados por mi •×¤*
*¤×• All Mp will be ignored | Only considers the Mp requested per my •×¤*

SMFPersonal

Adk Portal 3.0.2
2.0.14
www.smfpersonal.net
#33

Mensajes: 13978

Ver Perfil  SMFPersonal 

En línea

*
Dic 02 2011


The last post: 2. December
Second last post: 12. November

Here's the board: http://hellasforum.net/index.php?board=52.0

adkportal V1.1
smf 2.0
www,hellasforum.net
#34

Mensajes: 6

Ver Perfil  Email 

En línea

*
Dic 02 2011


But the block shows the latest posts, if the messages are of that date is showing the block.

I do not understand the problem.
You can attach a screenshot?

*¤×•·:.·.:·•×¤* ^HeRaCLeS^ *¤×•·:.·.:·•×¤*
*¤×• Todos los Mp seran ignorados | Solo seran considerados los Mp Solicitados por mi •×¤*
*¤×• All Mp will be ignored | Only considers the Mp requested per my •×¤*

SMFPersonal

Adk Portal 3.0.2
2.0.14
www.smfpersonal.net
#35

Mensajes: 13978

Ver Perfil  SMFPersonal 

En línea

*
Dic 03 2011


The problem is that the block should show 10 posts, not only one from this board. ($num_recent = 10; //LIMIT)

See attachment.

adkportal V1.1
smf 2.0
www,hellasforum.net
#36

Mensajes: 6

Ver Perfil  Email 

En línea

*
Dic 03 2011


Mmmm attach file of the block please

*¤×•·:.·.:·•×¤* ^HeRaCLeS^ *¤×•·:.·.:·•×¤*
*¤×• Todos los Mp seran ignorados | Solo seran considerados los Mp Solicitados por mi •×¤*
*¤×• All Mp will be ignored | Only considers the Mp requested per my •×¤*

SMFPersonal

Adk Portal 3.0.2
2.0.14
www.smfpersonal.net
#37

Mensajes: 13978

Ver Perfil  SMFPersonal 

En línea

*
Dic 03 2011


Here's the code:

Código: [Seleccionar]
/******************************************
* Author: Lucas-ruroken
* Website: www.smfpersonal.net
* Mail: lucas-ruroken@sharedownload.org
* Block: Another Latest Topic
* Compatible (SMF): 2.0 RC4
* Compatible (Adk Portal): 2.0
******************************************/


$num_recent = 10; //LIMIT
adk_ultimosmensajes2($num_recent);

function adk_ultimosmensajes2($num_recent)
{
global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
global $modSettings, $smcFunc, $adkportal, $boardurl;

//SSI FUNCTION
        $exclude_boards = null;
$include_boards = array(52);

$output_method = 'array';

if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = empty($exclude_boards) ? array() : (is_array($exclude_boards) ? $exclude_boards : array($exclude_boards));

// Only some boards?.
if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards = is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method = $include_boards;
$include_boards = array();
}

$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// Find all the posts in distinct topics.  Newer ones will have higher IDs.
$request = $smcFunc['db_query']('substring', '
SELECT
m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.name AS board_name, t.num_replies, t.num_views,
mem.avatar,
mg.online_color,
IFNULL(a.id_attach, 0) AS id_attach, a.filename, a.attachment_type,
IFNULL(mem.real_name, m.poster_name) AS poster_name, ' . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from') . ', SUBSTRING(m.body, 1, 384) AS body, m.smileys_enabled, m.icon
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)' . (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' : '') . '
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = IF(mem.id_group = 0, mem.id_post_group, mem.id_group))
WHERE t.id_last_msg >= {int:min_message_id}
' . (empty($exclude_boards) ? '' : '
AND b.id_board NOT IN ({array_int:exclude_boards})') . '
' . (empty($include_boards) ? '' : '
AND b.id_board IN ({array_int:include_boards})') . '
AND {query_wanna_see_board}' . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}
AND m.approved = {int:is_approved}' : '') . '
ORDER BY t.id_last_msg DESC
LIMIT ' . $num_recent,
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' : $include_boards,
'exclude_boards' => empty($exclude_boards) ? '' : $exclude_boards,
'min_message_id' => $modSettings['maxMsgID'] - 35 * min($num_recent, 5),
'is_approved' => 1,
)
);
$posts = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => '
')));
if ($smcFunc['strlen']($row['body']) > 128)
$row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...';

// Censor the subject.
censorText($row['subject']);
censorText($row['body']);

if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

// Build the array.
$posts[] = array(
'board' => array(
'id' => $row['id_board'],
'name' => $row['board_name'],
'href' => $scripturl . '?board=' . $row['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['board_name'] . '</a>'
),
'avatar' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img width="50" height="50" src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img width="50" height="50" src="' . $row['avatar'] . '" alt="" border="0" />' : '<img width="50" height="50" src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($row['avatar']) . '" alt="" border="0" />'),
'topic' => $row['id_topic'],
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'
),
'online_color' => $row['online_color'],
'subject' => $row['subject'],
'replies' => $row['num_replies'],
'views' => $row['num_views'],
'short_subject' => shorten_subject($row['subject'], 25),
'preview' => $row['body'],
'time' => timeformat($row['poster_time']),
'timestamp' => forum_time(true, $row['poster_time']),
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new" rel="nofollow">' . $row['subject'] . '</a>',
// Retained for compatibility - is technically incorrect!
'new' => !empty($row['is_read']),
'is_new' => empty($row['is_read']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
);
}
$smcFunc['db_free_result']($request);


$i = 0;
$u = 0;
echo'
<table style="width: 100%;">
<tr>';
foreach($posts AS $Output)
{
$ID_TOPIC = $Output['topic'];
$subject = $Output['subject'];
$posterTime = timeformat($Output['timestamp']);


$id_member = $Output['poster']['id'];
$href_last = $Output['href'];

if($id_member == 0)
{
$MEMBER_STARTED = $txt['adk_guest'];
$avatar = '<img src="'.$boardurl.'/adkportal/images/noavatar.jpg" class="adk_avatar" alt="" />';
$color_online = '';
}
else
{
$MEMBER_STARTED = $Output['poster']['name'];
if(!empty($Output['avatar']))
$avatar = $Output['avatar'];
else
$avatar = '<img src="'.$boardurl.'/adkportal/images/noavatar.jpg" class="adk_avatar" alt="" />';


$color_online = $Output['online_color'];
}

if($i == 2){
echo'</tr><tr>';
$i = 0;
}

if($u == 1){
$win = 'windowbg';
$u = 0;
}
else
$win = 'windowbg';


echo'
<td style="width: 50%;" class="'.$win.'">
<table><tr>
<td width="55">
'.$avatar.'
</td>
<td>
<a href="'.$scripturl.'?topic='.$ID_TOPIC.'.0" title="'.$subject.'"><b>'.$subject.'</b></a>
', !$Output['is_new'] ? '' : '<a href="' . $scripturl . '?topic=' . $Output['topic'] . '.msg' . $Output['new_from'] . ';topicseen#new" rel="nofollow"><img src="' . $settings['lang_images_url'] . '/new.gif" alt="' . $txt['new'] . '" border="0" /></a>', '
<div style="float: right;">
<a href="'.$href_last.'">
<img alt="" src="'.$settings['images_url'].'/icons/last_post.gif" />
</a>
</div>
<br />
<span class="smalltext">'.$txt['adk_last_updated'] .': <a href="'.$scripturl.'?action=profile;u='.$id_member.'"><b style="color: '.$color_online.';">'.$MEMBER_STARTED.'</b></a>
- '.$posterTime.'</span>

</td></tr></table>
</td>';

$i++;
$u++;
}
echo'
</tr>
</table>';

}


adkportal V1.1
smf 2.0
www,hellasforum.net
#38

Mensajes: 6

Ver Perfil  Email 

En línea

*
Mar 06 2012


Hola

he introducido este código php pero no me muestra el dato del foro al que pertenece cada tema " en cambio a vosotros si os lo muestra", tampoco me sale con el mismo estilo con los bordes redondeados etc etc

alguna idea?

mkportal, ultimateportal
2.0.2
www.auxcad.com
#39

Mensajes: 3

Ver Perfil 

En línea




Otros temas de su interes

Last Topics (Popup and Marquee-Popup) ^HeRaCLeS^ Julio 06, 2011, 07:44:52 pm
Dias Online/Online Days lucas-ruroken Marzo 15, 2010, 12:23:48 am
Last Users ^HeRaCLeS^ Julio 04, 2011, 05:45:06 pm
Adk Only Img ^HeRaCLeS^ Febrero 22, 2012, 08:17:37 pm
Last Download (Extreme Download System) Adk Team Mayo 30, 2010, 05:05:18 am
Another Latest Topics (SMF 2.0) lucas-ruroken Diciembre 05, 2010, 07:40:23 pm



Usuario:
Contraseña:
Sesión: