Advertisement:

Author Topic: SimplePortal  (Read 1514820 times)

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Re: SimplePortal - 2.3.5 Released!
« Reply #4920 on: June 19, 2014, 01:52:49 PM »
Ouch! I'm sorry! Was that me?

I would recommend one of the SMF coding boards instead of this mod support topic.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Offline mulwa

  • Jr. Member
  • **
  • Posts: 119
Re: SimplePortal - 2.3.5 Released!
« Reply #4921 on: June 22, 2014, 05:01:02 AM »
pls how do i make the "articles" and "recent posts" to be centered in the blocks? Pls i need help

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Re: SimplePortal - 2.3.5 Released!
« Reply #4922 on: June 23, 2014, 06:11:43 AM »
The first thing I would try is using the custom block style to apply the CSS for text-align: center

http://simpleportal.net/index.php?action=docs;area=block_editor
http://www.w3.org/Style/Examples/007/center.en.html#text

Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Offline mulwa

  • Jr. Member
  • **
  • Posts: 119
Re: SimplePortal - 2.3.5 Released!
« Reply #4923 on: June 23, 2014, 09:37:24 AM »
thanks for that @Angelina. But i don't know where to start editing it, pls help me if possible.

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Re: SimplePortal - 2.3.5 Released!
« Reply #4924 on: June 23, 2014, 09:47:42 AM »
All you need to do is put text-align: center in the custom body style.  Then see if it helps center the text in the block.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Offline mulwa

  • Jr. Member
  • **
  • Posts: 119
Re: SimplePortal - 2.3.5 Released!
« Reply #4925 on: June 26, 2014, 03:14:22 PM »
@Angelina Belle God bless you!
That one worked perfectly for me!
Pls i have one problem, i removed the icon that it used to display before the articles; and when it was removed it displayed "Topic" which is not clickable before the Article link. If possible i would like to remove "Topic" before the clickable text (the "topic" is not clickable). And how do i make the articles that appear in the block to be more than five?
Pls don't be weard of my questions; am just a newbie. Thank  you

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Re: SimplePortal - 2.3.5 Released!
« Reply #4926 on: June 26, 2014, 03:27:04 PM »
I think that there is a setting for the number of articles to display in the block -- use the block editor and check this.

You did some changes in portalblocks.php to remove the icon?  Then you already know how to make some changes to the HTML.
You can just remove the part that says "topic" -- only it will be $txt['      <-- and something between quotation marks.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Offline mulwa

  • Jr. Member
  • **
  • Posts: 119
Re: SimplePortal - 2.3.5 Released!
« Reply #4927 on: June 26, 2014, 05:10:23 PM »
thanks a lot for your concern, but unfortunately, i couldn't trace it out. I removed that icon by deleting it from the theme files inside "sp folder"cause i couldn't get the link in the portalblocks,. I tried removing the "topic" in "portalblocks.php"  but it wasn't working.  and there is no number of articles to be displayed in the article block settings. Thank  you for your time.

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Re: SimplePortal - 2.3.5 Released!
« Reply #4928 on: June 26, 2014, 05:20:35 PM »
I am sorry I misunderstood. If you are comfortable working in the CSS files, you may be able to make "topic" display: none; in CSS.  Come on over to simpleportal.net for more help in customizing your blocks!
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Offline Padre gremista

  • Jr. Member
  • **
  • Posts: 236
  • Gender: Male
Re: SimplePortal - 2.3.5 Released!
« Reply #4929 on: July 01, 2014, 11:20:47 AM »
How Modify for have 1000 topics in "recent posts bloc"?
www.gremioemfoco.info - A comunidade gremista na internet.

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Re: SimplePortal - 2.3.5 Released!
« Reply #4930 on: July 01, 2014, 11:45:24 AM »
Simply use the http://simpleportal.net/index.php?action=docs;area=block_editor to change the number of posts/topics to show.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Offline Padre gremista

  • Jr. Member
  • **
  • Posts: 236
  • Gender: Male
Re: SimplePortal - 2.3.5 Released!
« Reply #4931 on: July 01, 2014, 12:35:58 PM »
Simply use the http://simpleportal.net/index.php?action=docs;area=block_editor to change the number of posts/topics to show.

Yes, but I set to show 1000 topics and show only around 30. How I make manually edit for show more topics that the permitted?
www.gremioemfoco.info - A comunidade gremista na internet.

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Re: SimplePortal - 2.3.5 Released!
« Reply #4932 on: July 01, 2014, 02:12:54 PM »
Ahh yes.  You will have to look in SSI.php.  There, in two places, it limits how far back to look in your recent posts.

you will see 35 * min(  ... something, 5) -- which severly limits things.  Increase the 35 to something large enough.
In the other place, there might be a 50 instead of a 35.  Increase this as well.

To get to 1000, of course, you need 200 * 5.  Do you really want to see 1000 recent posts in a block?

This will slow down your forum because of the fact that, every time that block is loaded, it is checking more messages in you database.

You can test this out and see if you can tell the difference.

Enjoy!
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Offline Padre gremista

  • Jr. Member
  • **
  • Posts: 236
  • Gender: Male
Re: SimplePortal - 2.3.5 Released!
« Reply #4933 on: July 01, 2014, 11:46:06 PM »
Possible is add the avatar miniature of the last user that posted beside the text marked in image annexed?
www.gremioemfoco.info - A comunidade gremista na internet.

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Re: SimplePortal - 2.3.5 Released!
« Reply #4934 on: July 02, 2014, 04:03:04 AM »
That is certainly possible, and would require some php code writing.  You might bring the idea to one of the customization boards at simpleportal.net to see if anyone is interested in working with you on this.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Offline Padre gremista

  • Jr. Member
  • **
  • Posts: 236
  • Gender: Male
Re: SimplePortal - 2.3.5 Released!
« Reply #4935 on: July 02, 2014, 01:29:05 PM »
I try register in simpleportal.net but the captcha is always error. I can not register.

Can you post my mod request there?
« Last Edit: July 02, 2014, 01:41:14 PM by Padre gremista »
www.gremioemfoco.info - A comunidade gremista na internet.

Offline Dhayzon

  • Sophist Member
  • *****
  • Posts: 1,168
  • Gender: Male
  • DhayZone RevolutioN
    • Dhayzon on GitHub
    • @dhayzon on Twitter
    • http://dhayzon.com/
Re: SimplePortal - 2.3.5 Released!
« Reply #4936 on: July 02, 2014, 03:34:12 PM »
I try register in simpleportal.net but the captcha is always error. I can not register.

Can you post my mod request there?

Code: [Select]
<?php

/*
Block: Recent posts with post preview
Author: Blue @ Simple Portal.net
Version: 1.6
*/

/* [SETUP WHAT YOU WANT HERE] */

$topics_posts 1; // TOPICS - 1 | MESSAGES - 2
$limit 6; // How many recent posts do you want to output?
$number 30; // How many characters do you want to output?
$exclude_boards null; // IF null guests can see all boards | IF you want to hide some boards use: array( ID1, ID2, ID3) where ID is the board's ID
$htmlspecialcharacters false// Do you need to show html special characters like Greek characters?


// Do you want to translate it to your own language? :P
$text['sportal_false'] = 'Simple Portal not found';
$text['board'] = 'in';
$text['who'] = 'by';

/* [STOP!] - THIS IS THE END OF SETUP */

//Only code from now on ;)
global $smcFunc$scripturl$sourcedir$modSettings$user_info$settings$context$txt;

// Lets see if you are using Simple Portal. If not...well...go get them :D
if (!file_exists($sourcedir '/PortalBlocks.php'))
{
echo $text['sportal_false'];
return;
}

// Let's grab some database results
if ($topics_posts == 1) {

if (is_array($exclude_boards) || (int) $exclude_boards === $exclude_boards)
{
$exclude_boards is_array($exclude_boards) ? $exclude_boards : array($exclude_boards);
}
elseif ($exclude_boards != null)
{
$output_method $exclude_boards;
$exclude_boards = array();
}

$posts_result $smcFunc['db_query']('''
   SELECT m.poster_name,m.icon, m.poster_time, m.id_msg,t.num_views, t.num_replies, t.id_member_updated, m.subject, m.body, m.id_topic, b.name, t.id_last_msg, u.avatar, g.online_color,' 
. ($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'
) . '
   FROM {db_prefix}topics AS t
   LEFT JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
   LEFT JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
   LEFT JOIN {db_prefix}members AS u ON (t.id_member_updated = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)
   ' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = m.id_topic AND lt.id_member = ' 
$user_info['id'] . ')
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = ' 
$user_info['id'] . ')' '') . '
   WHERE m.approved=1'   
. (empty($exclude_boards) ? '' '
AND b.id_board NOT IN ({array_int:exclude_boards})'
) . ' AND {query_see_board}
   ORDER BY t.id_last_msg DESC
   LIMIT ' 
$limit,
array(
'exclude_boards' => empty($exclude_boards) ? '' $exclude_boards,
)
   );
$posts = array();
while (
$row_posts $smcFunc['db_fetch_assoc']($posts_result))
{

      global 
$memberContext;
      
loadMemberData($row_posts['id_member_updated']);
      
loadMemberContext($row_posts['id_member_updated']);

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

   
$posts[] = array(
  'id' => $row_posts['id_member_updated'],
  'views' => $row_posts['num_views'],
  'replies' => $row_posts['num_replies'],
  'icon' => '<img src="' $settings[$icon_sources[$row_posts['icon']]] . '/post/' $row_posts['icon'] . '.gif" align="middle" alt="' $row_posts['icon'] . '" border="0" />',
      
'username' => '<a style="color: ' $row_posts['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_posts['id_member_updated'] . '">' $row_posts['poster_name'] . '</a>',
      
'subject' => '<a style="font-weight: bold;" title="' $text['board'] . '&nbsp;' $row_posts['name'] .'" href="' $scripturl '?topic=' $row_posts['id_topic'] . '.msg' $row_posts['id_last_msg'] . ';topicseen#new">' $row_posts['subject'] . '</a>',
      
'body' => $row_posts['body'],
  'avatar' => $row_posts['avatar'] == '' $memberContext[$row_posts['id_member_updated']]['avatar']['href'] : (stristr($row_posts['avatar'], 'http://') ? $row_posts['avatar'] : $modSettings['avatar_url'] . '/' $row_posts['avatar']),
  'board' => $row_posts['name'],
  'time' => timeformat($row_posts['poster_time']),
  'poster' => array(
'id' => $row_posts['id_member'],
'name' => $row_posts['poster_name'],
'href' => !empty($row_posts['id_member']) ? $scripturl '?action=profile;u=' $row_posts['id_member'] : '',
'link' => !empty($row_posts['id_member']) ? '<a href="' $scripturl '?action=profile;u=' $row_posts['id_member'] . '">' $row_posts['poster_name'] . '</a>' $row_posts['poster_name']
),

  'new' => !empty($row_posts['is_read'])
   );
}
$smcFunc['db_free_result']($posts_result);

} else {

if (is_array($exclude_boards) || (int) $exclude_boards === $exclude_boards)
{
$exclude_boards is_array($exclude_boards) ? $exclude_boards : array($exclude_boards);
}
elseif ($exclude_boards != null)
{
$output_method $exclude_boards;
$exclude_boards = array();
}



$posts_result $smcFunc['db_query']('''
   SELECT  u.real_name,m.icon,m.poster_time, m.id_msg, m.id_member, m.subject, m.body, m.id_topic, b.name, b.id_board, u.avatar, g.online_color,' 
. ($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'
) . '
   FROM {db_prefix}messages AS m
   LEFT JOIN {db_prefix}boards AS b ON (m.id_board = b.id_board)
   LEFT JOIN {db_prefix}members AS u ON (m.id_member = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)
   ' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = m.id_topic AND lt.id_member = ' 
$user_info['id'] . ')
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = ' 
$user_info['id'] . ')' '') . '
   WHERE m.approved=1'   
. (empty($exclude_boards) ? '' '
AND b.id_board NOT IN ({array_int:exclude_boards})'
) . ' AND {query_see_board}
   ORDER BY m.id_msg DESC
   LIMIT ' 
$limit,
array(
'exclude_boards' => empty($exclude_boards) ? '' $exclude_boards,
)
   );
$posts = array();

      while (
$row_posts $smcFunc['db_fetch_assoc']($posts_result))
      {
      
if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row_posts['icon']]))
$icon_sources[$row_posts['icon']] = file_exists($settings['theme_dir'] . '/images/post/' $row_posts['icon'] . '.gif') ? 'images_url' 'default_images_url';

      global 
$memberContext;
      
loadMemberData($row_posts['id_member']);
      
loadMemberContext($row_posts['id_member']);
$posts[] = array(
  'id' => $row_posts['id_member'],
  'icon' => '<img src="' $settings[$icon_sources[$row_posts['icon']]] . '/post/' $row_posts['icon'] . '.gif" align="middle" alt="' $row_posts['icon'] . '" border="0" />',
  'username' => '<a style="color: ' $row_posts['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_posts['id_member'] . '">'.$row_posts['real_name'] . '</a>',
  'subject' => '<a title="'.$row_posts['subject'].'" href="' $scripturl '?topic=' $row_posts['id_topic'] . '.msg' $row_posts['id_msg'] . ';topicseen#new">' .$row_posts['subject']. '</a>',
  'body' => $row_posts['body'],
  'avatar' => $row_posts['avatar'] == '' $memberContext[$row_posts['id_member']]['avatar']['href'] : (stristr($row_posts['avatar'], 'http://') ? $row_posts['avatar'] : $modSettings['avatar_url'] . '/' $row_posts['avatar']),
  'board' => $row_posts['name'],
  'time' => timeformat($row_posts['poster_time']),
  'new' => !empty($row_posts['is_read'])
);
      }

$smcFunc['db_free_result']($posts_result);

}
echo
'<div class="container-fluid nuevos_temas_indice">
'
;
foreach (
$posts as $post) {

// Lets fix the BBCode bug and Strip the Text
//' . $text['who'] . '&nbsp;

$content1 str_replace("[""<"$post['body']);
$content2 str_replace("]"">"$content1);
$content3 strip_tags($content2);
$preview substr ($content3,0,$number);
$preview2 preg_replace('/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i'''$preview);
echo
' <div class="row nuevas_respuestas_indice">
 <div class="col-xs-6 col-md-1">
 '
.$post['icon'].'
 </div>
  <div class="col-xs-12 col-md-6">'
;

 echo
'<h4 class="media-heading">' $post['subject']; if (!$post['new'] && $context['user']['is_logged'])
echo '&nbsp &nbsp<span class="label label-success">Nuevo</span>';
 echo
'</h4>
 '
;

    if (
$htmlspecialcharacters) {
echo htmlspecialchars($previewENT_NOQUOTES"UTF-8") . '...';
} else {
echo' <small>'.$preview2.' en  →',$post['board'],'</small>';
}
   echo
'</div>

<div class="col-xs-6 col-md-2">
<span><img src="/Themes/bootz/images/views.gif" title="Views" alt=" Views">&nbsp &nbsp<span class="label label-warning">'
.$post['views'].'</span></span>
<Span class="pull-right"><img src="/Themes/bootz/images/coments.gif" title="Replies" alt="Replies">&nbsp &nbsp<span class="label label-info"> '
$post['replies'], '</span></Span>
</div>

<div class="col-xs-6 col-md-3">
  <a class="pull-left" href="#" style=" margin-right: 10px; ">'
;
   if (empty(
$post['avatar']))
    {
 echo '<img class="media-object avatar" src="/avatars/noavatar.gif"  alt="no tengo avatar xD" width="34px" height="34px" />';
     }
else{

       echo 
'<img class="media-object avatar" src="' $post['avatar'] .'" alt="" width="34px" height="34px" />';
}
    echo
'

  </a>


  <div class="media-body">
   <span style="padding: 0 5px;display: inline-block;margin-bottom: 5px;"> ' 
$post['username'] . '</span><br><div><small>' $post['time'] .'</small></div>';



echo 
'
   </div>

  </div>
  </div>
'
;





}

echo'
</div>'
;


?>

http://simpleportal.net/index.php?topic=9138.0


preview


Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Re: SimplePortal - 2.3.5 Released!
« Reply #4937 on: July 02, 2014, 03:51:58 PM »
Please try to listen to the CAPTCHA, if there is a problem with CAPTCHA display.  That could work.
How many letters do you see when you look at the CAPTCHA, by the way?  How many do you hear when you listen to the captcha?


Thanks.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Offline Padre gremista

  • Jr. Member
  • **
  • Posts: 236
  • Gender: Male
Re: SimplePortal - 2.3.5 Released!
« Reply #4938 on: July 02, 2014, 11:03:27 PM »
I try register in simpleportal.net but the captcha is always error. I can not register.

Can you post my mod request there?

Code: [Select]
<?php

/*
Block: Recent posts with post preview
Author: Blue @ Simple Portal.net
Version: 1.6
*/

/* [SETUP WHAT YOU WANT HERE] */

$topics_posts 1; // TOPICS - 1 | MESSAGES - 2
$limit 6; // How many recent posts do you want to output?
$number 30; // How many characters do you want to output?
$exclude_boards null; // IF null guests can see all boards | IF you want to hide some boards use: array( ID1, ID2, ID3) where ID is the board's ID
$htmlspecialcharacters false// Do you need to show html special characters like Greek characters?


// Do you want to translate it to your own language? :P
$text['sportal_false'] = 'Simple Portal not found';
$text['board'] = 'in';
$text['who'] = 'by';

/* [STOP!] - THIS IS THE END OF SETUP */

//Only code from now on ;)
global $smcFunc$scripturl$sourcedir$modSettings$user_info$settings$context$txt;

// Lets see if you are using Simple Portal. If not...well...go get them :D
if (!file_exists($sourcedir '/PortalBlocks.php'))
{
echo $text['sportal_false'];
return;
}

// Let's grab some database results
if ($topics_posts == 1) {

if (is_array($exclude_boards) || (int) $exclude_boards === $exclude_boards)
{
$exclude_boards is_array($exclude_boards) ? $exclude_boards : array($exclude_boards);
}
elseif ($exclude_boards != null)
{
$output_method $exclude_boards;
$exclude_boards = array();
}

$posts_result $smcFunc['db_query']('''
   SELECT m.poster_name,m.icon, m.poster_time, m.id_msg,t.num_views, t.num_replies, t.id_member_updated, m.subject, m.body, m.id_topic, b.name, t.id_last_msg, u.avatar, g.online_color,' 
. ($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'
) . '
   FROM {db_prefix}topics AS t
   LEFT JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
   LEFT JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
   LEFT JOIN {db_prefix}members AS u ON (t.id_member_updated = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)
   ' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = m.id_topic AND lt.id_member = ' 
$user_info['id'] . ')
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = ' 
$user_info['id'] . ')' '') . '
   WHERE m.approved=1'   
. (empty($exclude_boards) ? '' '
AND b.id_board NOT IN ({array_int:exclude_boards})'
) . ' AND {query_see_board}
   ORDER BY t.id_last_msg DESC
   LIMIT ' 
$limit,
array(
'exclude_boards' => empty($exclude_boards) ? '' $exclude_boards,
)
   );
$posts = array();
while (
$row_posts $smcFunc['db_fetch_assoc']($posts_result))
{

      global 
$memberContext;
      
loadMemberData($row_posts['id_member_updated']);
      
loadMemberContext($row_posts['id_member_updated']);

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

   
$posts[] = array(
  'id' => $row_posts['id_member_updated'],
  'views' => $row_posts['num_views'],
  'replies' => $row_posts['num_replies'],
  'icon' => '<img src="' $settings[$icon_sources[$row_posts['icon']]] . '/post/' $row_posts['icon'] . '.gif" align="middle" alt="' $row_posts['icon'] . '" border="0" />',
      
'username' => '<a style="color: ' $row_posts['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_posts['id_member_updated'] . '">' $row_posts['poster_name'] . '</a>',
      
'subject' => '<a style="font-weight: bold;" title="' $text['board'] . '&nbsp;' $row_posts['name'] .'" href="' $scripturl '?topic=' $row_posts['id_topic'] . '.msg' $row_posts['id_last_msg'] . ';topicseen#new">' $row_posts['subject'] . '</a>',
      
'body' => $row_posts['body'],
  'avatar' => $row_posts['avatar'] == '' $memberContext[$row_posts['id_member_updated']]['avatar']['href'] : (stristr($row_posts['avatar'], 'http://') ? $row_posts['avatar'] : $modSettings['avatar_url'] . '/' $row_posts['avatar']),
  'board' => $row_posts['name'],
  'time' => timeformat($row_posts['poster_time']),
  'poster' => array(
'id' => $row_posts['id_member'],
'name' => $row_posts['poster_name'],
'href' => !empty($row_posts['id_member']) ? $scripturl '?action=profile;u=' $row_posts['id_member'] : '',
'link' => !empty($row_posts['id_member']) ? '<a href="' $scripturl '?action=profile;u=' $row_posts['id_member'] . '">' $row_posts['poster_name'] . '</a>' $row_posts['poster_name']
),

  'new' => !empty($row_posts['is_read'])
   );
}
$smcFunc['db_free_result']($posts_result);

} else {

if (is_array($exclude_boards) || (int) $exclude_boards === $exclude_boards)
{
$exclude_boards is_array($exclude_boards) ? $exclude_boards : array($exclude_boards);
}
elseif ($exclude_boards != null)
{
$output_method $exclude_boards;
$exclude_boards = array();
}



$posts_result $smcFunc['db_query']('''
   SELECT  u.real_name,m.icon,m.poster_time, m.id_msg, m.id_member, m.subject, m.body, m.id_topic, b.name, b.id_board, u.avatar, g.online_color,' 
. ($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'
) . '
   FROM {db_prefix}messages AS m
   LEFT JOIN {db_prefix}boards AS b ON (m.id_board = b.id_board)
   LEFT JOIN {db_prefix}members AS u ON (m.id_member = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)
   ' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = m.id_topic AND lt.id_member = ' 
$user_info['id'] . ')
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = ' 
$user_info['id'] . ')' '') . '
   WHERE m.approved=1'   
. (empty($exclude_boards) ? '' '
AND b.id_board NOT IN ({array_int:exclude_boards})'
) . ' AND {query_see_board}
   ORDER BY m.id_msg DESC
   LIMIT ' 
$limit,
array(
'exclude_boards' => empty($exclude_boards) ? '' $exclude_boards,
)
   );
$posts = array();

      while (
$row_posts $smcFunc['db_fetch_assoc']($posts_result))
      {
      
if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row_posts['icon']]))
$icon_sources[$row_posts['icon']] = file_exists($settings['theme_dir'] . '/images/post/' $row_posts['icon'] . '.gif') ? 'images_url' 'default_images_url';

      global 
$memberContext;
      
loadMemberData($row_posts['id_member']);
      
loadMemberContext($row_posts['id_member']);
$posts[] = array(
  'id' => $row_posts['id_member'],
  'icon' => '<img src="' $settings[$icon_sources[$row_posts['icon']]] . '/post/' $row_posts['icon'] . '.gif" align="middle" alt="' $row_posts['icon'] . '" border="0" />',
  'username' => '<a style="color: ' $row_posts['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_posts['id_member'] . '">'.$row_posts['real_name'] . '</a>',
  'subject' => '<a title="'.$row_posts['subject'].'" href="' $scripturl '?topic=' $row_posts['id_topic'] . '.msg' $row_posts['id_msg'] . ';topicseen#new">' .$row_posts['subject']. '</a>',
  'body' => $row_posts['body'],
  'avatar' => $row_posts['avatar'] == '' $memberContext[$row_posts['id_member']]['avatar']['href'] : (stristr($row_posts['avatar'], 'http://') ? $row_posts['avatar'] : $modSettings['avatar_url'] . '/' $row_posts['avatar']),
  'board' => $row_posts['name'],
  'time' => timeformat($row_posts['poster_time']),
  'new' => !empty($row_posts['is_read'])
);
      }

$smcFunc['db_free_result']($posts_result);

}
echo
'<div class="container-fluid nuevos_temas_indice">
'
;
foreach (
$posts as $post) {

// Lets fix the BBCode bug and Strip the Text
//' . $text['who'] . '&nbsp;

$content1 str_replace("[""<"$post['body']);
$content2 str_replace("]"">"$content1);
$content3 strip_tags($content2);
$preview substr ($content3,0,$number);
$preview2 preg_replace('/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i'''$preview);
echo
' <div class="row nuevas_respuestas_indice">
 <div class="col-xs-6 col-md-1">
 '
.$post['icon'].'
 </div>
  <div class="col-xs-12 col-md-6">'
;

 echo
'<h4 class="media-heading">' $post['subject']; if (!$post['new'] && $context['user']['is_logged'])
echo '&nbsp &nbsp<span class="label label-success">Nuevo</span>';
 echo
'</h4>
 '
;

    if (
$htmlspecialcharacters) {
echo htmlspecialchars($previewENT_NOQUOTES"UTF-8") . '...';
} else {
echo' <small>'.$preview2.' en  →',$post['board'],'</small>';
}
   echo
'</div>

<div class="col-xs-6 col-md-2">
<span><img src="/Themes/bootz/images/views.gif" title="Views" alt=" Views">&nbsp &nbsp<span class="label label-warning">'
.$post['views'].'</span></span>
<Span class="pull-right"><img src="/Themes/bootz/images/coments.gif" title="Replies" alt="Replies">&nbsp &nbsp<span class="label label-info"> '
$post['replies'], '</span></Span>
</div>

<div class="col-xs-6 col-md-3">
  <a class="pull-left" href="#" style=" margin-right: 10px; ">'
;
   if (empty(
$post['avatar']))
    {
 echo '<img class="media-object avatar" src="/avatars/noavatar.gif"  alt="no tengo avatar xD" width="34px" height="34px" />';
     }
else{

       echo 
'<img class="media-object avatar" src="' $post['avatar'] .'" alt="" width="34px" height="34px" />';
}
    echo
'

  </a>


  <div class="media-body">
   <span style="padding: 0 5px;display: inline-block;margin-bottom: 5px;"> ' 
$post['username'] . '</span><br><div><small>' $post['time'] .'</small></div>';



echo 
'
   </div>

  </div>
  </div>
'
;





}

echo'
</div>'
;


?>

http://simpleportal.net/index.php?topic=9138.0


preview



Where I must put this code?
www.gremioemfoco.info - A comunidade gremista na internet.

Offline Dhayzon

  • Sophist Member
  • *****
  • Posts: 1,168
  • Gender: Male
  • DhayZone RevolutioN
    • Dhayzon on GitHub
    • @dhayzon on Twitter
    • http://dhayzon.com/
Re: SimplePortal - 2.3.5 Released!
« Reply #4939 on: July 03, 2014, 12:13:12 AM »
in new block   php