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.
* Modificando el bloque last topic
  Leído 2259 veces
* Viendo el foro
 0 Usuarios y 1 Visitante están viendo este foro.


*
Ene 02 2011


he modificado el bloque a mi gusto lo aculya aci lo tengo listo solo por un incomeninte
nesesito conseguir elnumero de la categoria donde se encunta en contenido

aca les dejo el codigo que tengo

Código: [Seleccionar]
function adk_ultimosmensajes()
{
global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
global $modSettings, $smcFunc, $adkportal, $boardurl;

//SSI FUNCTION
$exclude_boards = null;
$include_boards = null;
$num_recent = $adkportal['ultimos_mensajes'];
$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 />' => '&#10;')));
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);



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'];
}

$boards = !empty($parameters['boards']) ? explode('|', $parameters['boards']) : null;

$type = 'ssi_recent' . (empty($parameters['type']) ? 'Posts' : 'Topics');



$items = $type($limit, null, $boards, 'array');

foreach ($items as $item)
echo'
<table style="width: 100%;">
<tr>
<td><img src="'.$settings['theme_url']. '/icons/' .$row['id_board'].  '/on.png" width="16" height="16" >&nbsp;
<a href="'.$scripturl.'?topic='.$ID_TOPIC.'.0" title="'.$subject.'"><b>'.$subject.'</b></a>&nbsp;
', !$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>


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

}
}

elcualanda bien pero noconsigo imprimir elid de la categoria de donde esta en tema
desde ya muchas gracias
aca les dejo laurl del foro de pruebas que tengo
http://pipi2010.260mb.com/

*


Mensajes: 780

Ver Perfil  Compartiendo las 24hs 

En línea

*
Ene 02 2011


vos queres agarrar el nombre de la categoria donde esta el foro y el mensaje?

ADK Portal 3.0.2
2.0.11
www.smfpersonal.net
#1

Mensajes: 8631

Ver Perfil  SMFPersonal 

En línea

*
Ene 02 2011


no yolounicoque quieroes saver elid dela categoria donde esta el foro y el mensaje
para poder hacer que se imprima un icono antes de cada  link

yo ya lo ice pero no logro recojer el id

<img src="'.$settings['theme_url']. '/icons/' .$row['id_board'].  '/on.png" width="16" height="16" >
esta bien esa variable que coloque
.$row['id_board'].

*

#2

Mensajes: 780

Ver Perfil  Compartiendo las 24hs 

En línea

*
Ene 02 2011


Código: [Seleccionar]
function adk_ultimosmensajes()
{
   global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
   global $modSettings, $smcFunc, $adkportal, $boardurl;
   
   //SSI FUNCTION
   $exclude_boards = null;
   $include_boards = null;
   $num_recent = $adkportal['ultimos_mensajes'];
   $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
         c.id_cat, 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}boards AS b ON (b.id_cat = c.id_cat)
         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(
         'cat_id' => $row['id_cat'],
         '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);
   

     
   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'];
      }
     
         $boards = !empty($parameters['boards']) ? explode('|', $parameters['boards']) : null;

   $type = 'ssi_recent' . (empty($parameters['type']) ? 'Posts' : 'Topics');



   $items = $type($limit, null, $boards, 'array');
   
      foreach ($items as $item)
      echo'
      <table style="width: 100%;">
         <tr>
            <td><img src="'.$settings['theme_url']. '/icons/' .$row['id_board'].  '/on.png" width="16" height="16" >&nbsp;
               <a href="'.$scripturl.'?topic='.$ID_TOPIC.'.0" title="'.$subject.'"><b>'.$subject.'</b></a>&nbsp;
                  ', !$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>
               
               
            </td>
         </tr>
      </table>';
         
   }
}

ADK Portal 3.0.2
2.0.11
www.smfpersonal.net
#3

Mensajes: 8631

Ver Perfil  SMFPersonal 

En línea

*
Ene 02 2011


este es el erro que me dio

Not unique table/alias: 'b'
Archivo: /home/vol10/260mb.com/pacus_6273341/htdocs/Sources/Subs-adkblocks.php
Línea: 1048

*

#4

Mensajes: 780

Ver Perfil  Compartiendo las 24hs 

En línea

*
Ene 02 2011


me confundi, reemplaza
INNER JOIN {db_prefix}boards AS b ON (b.id_cat = c.id_cat)

por
INNER JOIN {db_prefix}categories AS c ON (b.id_cat = c.id_cat)

ADK Portal 3.0.2
2.0.11
www.smfpersonal.net
#5

Mensajes: 8631

Ver Perfil  SMFPersonal 

En línea

*
Ene 03 2011


tengo otro problema ahora

se repitenlos id en todos los link :S

http://share24hs.cz.cc/index.php


*

#6

Mensajes: 780

Ver Perfil  Compartiendo las 24hs 

En línea

*
Ene 03 2011


pero estas usando el $poster['cat_id'];

ADK Portal 3.0.2
2.0.11
www.smfpersonal.net
#7

Mensajes: 8631

Ver Perfil  SMFPersonal 

En línea

*
Ene 03 2011


no estaba usando el $item ['board']['id'] en este sale los id pero serepite el ultimo id en todos los anteriores :(

ahora puese el $poster['cat_id'] y no len los id :(

*

#8

Mensajes: 780

Ver Perfil  Compartiendo las 24hs 

En línea

*
Ene 03 2011


como estas usando la funcion? no se igual para que querias la id de la categoria y despues usas la id del foro, no hacia flatas las modificaciones.

ADK Portal 3.0.2
2.0.11
www.smfpersonal.net
#9

Mensajes: 8631

Ver Perfil  SMFPersonal 

En línea




Otros temas de su interes

Error en Portal cca1690 Junio 17, 2011, 01:41:21 pm *
Bloque Ultimos Temas AlexBarsan Enero 27, 2012, 01:04:14 pm *
Problema con el Portal Adk 3 Alex73 Septiembre 30, 2014, 12:04:30 pm
Ayuda como activo el bloque de ultimos post lSebas Abril 02, 2012, 07:56:09 pm *
Adk Image Random - Pequeña modifcacion - imagenes aleatorias Kvev Septiembre 04, 2012, 12:15:04 pm
medidas apropiada para la imagen juanka Enero 17, 2011, 03:03:03 pm *



Usuario:
Contraseña:
Sesión:
hermes bracelet replica, christian louboutin replica, van cleef and arpels replica, red bottoms replica, cartier love bracelet replica christian louboutin replica, christian louboutin replica, hermes bracelet replica,