To use this website completely, it is necessary to store cookies on your computer.
 

* Navigator

Expand - Collapse

* Statistic


  • *Total Posts: 16431
  • *Total Topics: 2522
  • *Online Today: 7
  • *Most Online: 292
(12. Nov 2016, 09:37:31)
  • *Users: 1
  • *Guests: 0
  • *Spiders: 1
  • *Total: 2

* Calendar

Mo
Tu
We
Th
Fr
Sa
Su
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

How to make a php block?

Started by neverhurry, 26. Aug 2009, 22:48:27

previous topic - next topic

0 Members and 0 Guests are viewing this topic.

neverhurry

26. Aug 2009, 22:48:27
Hello there, i found a very good SMF forum mod "Top stats" (http://custom.simplemachines.org/mods/index.php?mod=1687), thinking if it is possible to put in a PortaMX php block. The code for SMF 2.0 is here, i copied it and paste it into a php block but it doesn't work. How should I do? I am a beginner, but i would like very much to learn to grasp the powerful PortaMX, i will appreciate very much any help from you. Thanks.
PS: I like the portamx.com's community, i found it very friendly, all my best wishes to you.

Code Select
// top stats collapse object.
echo '
<script language="JavaScript" type="text/javascript"><!-- // -->';

echo chr(60) . chr(33) . chr(91) . chr(67) . chr(68) . chr(65) . chr(84) . chr(65) . chr(91);
echo '
var current_header_tops = ', empty($options['collapse_header_tops']) ? 'false' : 'true', ';
function shrinkHeaderTOPS(mode)
{';
if ($context['user']['is_guest'])
echo '
xxx = "upshrinkTOPS=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header_tops", mode ? 1 : 0, null, "', $context['session_id'], '");';

echo '
document.getElementById("upshrink_tops").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");
document.getElementById("upshrinkHeaderTOPS").style.display = mode ? "none" : "";
current_header_tops = mode;
}
// ';
echo chr(93) . chr(93) . chr(62);
echo '
</script>';

      //top stats start. by www.gorselsanatlar.org
loadLanguage('Stats');

echo '<br />
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' : '', '>
<div class="catbg" style="padding: 6px; vertical-align: middle; text-align: center; ">
<a href="#" onclick="shrinkHeaderTOPS(!current_header_tops); return false;"><img id="upshrink_tops" src="', $settings['images_url'], '/', empty($options['collapse_header_tops']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin-right: 2ex;" align="right" /></a>
', $txt['forum_stats'], '
</div>
<div id="upshrinkHeaderTOPS"', empty($options['collapse_header_tops']) ? '' : ' style="display: none;"', '>
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">

    <tr>
        <td class="titlebg" width="10%" colspan="2" align="center">', $txt['new'] ,' ', $txt['members_title'], '</td>
        <td class="titlebg" width="24%" colspan="2" align="center">', $txt['top_topics_views'], '</td>
        <td class="titlebg" width="66%" colspan="3" align="center">', $txt['recent_posts'], '</td>
    </tr>
    <tr>
        <td class="windowbg2" width="10%" colspan="2" valign="top"><span class="smalltext"><b>', $txt['user'], '</b></span><br />';
                  foreach ($context['new_members'] as $poster)
        {
         echo '
         <img alt="" src="', $settings['images_url'], '/icons/online.gif', '" width="12" height="12" />
        <span class="smalltext">',$poster['link'], '</span><br />';
        }
        echo '
        </td>
        <td class="windowbg2" width="18%" valign="top"><span class="smalltext"><b>', $txt['board_topics'], '</b></span><br />';
            foreach ($context['top_topics_views'] as $topic)
        echo '
        <img alt="" src="', $settings['images_url'], '/email_sm.gif', '" width="12" />
        <span class="smalltext">', $topic['link'], '</span><br />';   
        echo '</td>
        <td class="windowbg2" width="6%" align="right" valign="top"><span class="smalltext"><b>', $txt['views'] ,'</b></span><br />';
            foreach ($context['top_topics_views'] as $topic)
        echo '
        <img alt="" src="', $settings['images_url'], '/icons/field_valid.gif" height="8" />       
        <span class="smalltext">', $topic['num_views'], '</span><br />';
        echo '</td>
        <td class="windowbg2" width="22%" rowspan="3" valign="top"><span class="smalltext"><b>', $txt['board_topics'], '</b></span><br />';
            if (!empty($context['latest_posts']))
            foreach ($context['latest_posts'] as $post)
        echo '
        <img src="', $settings['images_url'], '/email_sm.gif', '" width="12" alt="" />
        <span class="smalltext"><a href="',$post['href'],'">', $post['short_subject'], '</a></span><br />';
        echo '</td>
        <td class="windowbg2" width="14%" rowspan="3" valign="top"><span class="smalltext"><b>', $txt['author'] ,'</b></span><br />';
            if (!empty($context['latest_posts']))
            foreach ($context['latest_posts'] as $post)
        echo '
        <img alt="" src="', $settings['images_url'], '/icons/online.gif', '" width="12" height="12" />
        <span class="smalltext">', $post['poster']['link'], '</span><br />';
        echo'
        </td>
        <td class="windowbg2" width="20%" rowspan="3" valign="top"><span class="smalltext"><b>', $txt['date'] ,'</b></span><br />';
            if (!empty($context['latest_posts']))
            foreach ($context['latest_posts'] as $post)
            echo '
            <img alt="" src="', $settings['images_url'], '/icons/calendar.gif', '" width="12" />
            <span class="smalltext">', $post['time'], '</span><br />';
        echo '</td>
    </tr>
    <tr>
        <td class="titlebg" width="20%" colspan="2" align="center">', $txt['top_posters'], '</td>
        <td class="titlebg" width="24%" colspan="2" align="center">', $txt['top_starters'], '</td>
    </tr>
    <tr>
        <td class="windowbg2" width="14%" valign="top"><span class="smalltext"><b>', $txt['user'], '</b></span><br />';
            foreach ($context['top_posters'] as $poster)
        echo '
<img alt="" src="', $settings['images_url'], '/icons/online.gif', '" width="12" height="12" />
        <span class="smalltext">', $poster['link'], '</span><br />';
        echo '</td>
        <td class="windowbg2" valign="top" align="right" width="6%"><span class="smalltext"><b>', $txt['posts'], '</b></span><br />';
            foreach ($context['top_posters'] as $poster)   
        echo '
        <img alt="" src="', $settings['images_url'], '/icons/field_valid.gif" height="8" /> 
        <span class="smalltext">', $poster['num_posts'], '</span><br />';
        echo '</td>
        <td class="windowbg2" valign="top" width="18%"><span class="smalltext"><b>', $txt['user'], '</b></span><br />';
            foreach ($context['top_starters'] as $poster)
        echo '
        <img alt="" src="', $settings['images_url'], '/icons/online.gif', '" width="12" height="12" />
        <span class="smalltext">', $poster['link'], '</span><br />';
        echo '</td>
        <td class="windowbg2" valign="top" align="right" width="6%"><span class="smalltext"><b>', $txt['board_topics'], '</b></span><br />';
           foreach ($context['top_starters'] as $poster)
        echo '
        <img alt="" src="', $settings['images_url'], '/icons/field_valid.gif" height="8" />   
        <span class="smalltext">', $poster['num_topics'], '</span><br />';
        echo '</td>
    </tr>
</table>
</div>
</div>';
   
    //top stats finish. by www.gorselsanatlar.org

bancherd

#1
27. Aug 2009, 00:25:10
I think you need to:

global $context, $txt;

and do something about "loadLanguage" ? etc.

I'll check it out since I was thinking of making one of these myself.

neverhurry

#2
27. Aug 2009, 00:37:29
Thank you, it is really nice of you to give me such suggestion. I tried it, but it is empty, maybe i should call the Subs-Recent.php once? Who knows?

Norv

#3
27. Aug 2009, 01:21:18
Do you have the mod installed?

Please try as bancherd suggested, to have the global variables declared, but there are more of them:
Code Select

// top stats collapse object.
  global $context, $txt,  $top_starters, $top_posters, $top_topic_views, $new_members, $settings;

at the beginning.

Then, I'm not sure, but I suspect you may need to display it in the place of recent posts on board index, that is, the block should be displayed on action=forum, for it to work. I would say to test it on action=forum, see if it works and whether there may be something missing. Then we can see about other actions.

feline

#4
27. Aug 2009, 01:33:56
All fields are empty .. Ithink, there is a db query missing ?  :-\

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Norv

#5
27. Aug 2009, 01:39:04
The queries are in BoardIndex.php (put there by the mod). So I guess that for this block to work (as it is), the mod must be installed, and the block displaying the values ... would still work only where BoardIndex.php code gets called, and can fill the fields. (please note that the mod would do the displaying of values in BoardIndex.template.php).
Guess a code can be written though, to achieve the result elsewhere.

feline

#6
27. Aug 2009, 01:53:06
The data comming from a mod? If so, can you give me the link?

forget it .. I have found the link ... uahh  :D

Fel
Many are stubborn in relation to the path, a few in relation to the target.

feline

#7
27. Aug 2009, 04:05:11
I have look at this mod .. and it works now  :)
You can see it here, by click on PortaMx Forum Stats in the linkblock (top right).

And now the settings and the code:
1. create a new php block

2. make follow settings:
       Overflow action: none
       Inner padding: 0
       header: titlebg
       frame: tborder
       body: none
       bodytext none

3. copy the follow code in:
Code Select

// top stats start. by www.gorselsanatlar.org
// modify for a PortaMx PHP block by Feline
function TopStats()
{
   global $context, $smcFunc, $txt, $db_prefix, $scripturl, $modSettings;
         // Newest members top 10
   $members_result =  $smcFunc['db_query']('', '
      SELECT id_member, real_name, posts
      FROM {db_prefix}members
      ORDER BY id_member DESC
      LIMIT 10',
      array(
      )
   );
   $context['new_members'] = array();
   while ($row_members = $smcFunc['db_fetch_assoc']($members_result))
   {
      $context['new_members'][] = array(
         'name' => $row_members['real_name'],
         'id' => $row_members['id_member'],
         'href' => $scripturl . '?action=profile;u=' . $row_members['id_member'],
         'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['id_member'] . '">' . $row_members['real_name'] . '</a>'
      );
   }
   $smcFunc['db_free_result']($members_result);
   //// Newest members top 10 Finish
// Poster top 10.
$members_result = $smcFunc['db_query']('', '
SELECT id_member, real_name, posts
FROM {db_prefix}members
WHERE posts > {int:no_posts}
ORDER BY posts DESC
LIMIT 10',
array(
'no_posts' => 0,
)
);
$context['top_posters'] = array();
$max_num_posts = 1;
$context['MemberColor_ID_MEMBER'] = array();
while ($row_members = $smcFunc['db_fetch_assoc']($members_result))
{
$context['top_posters'][] = array(
'name' => $row_members['real_name'],
'id' => $row_members['id_member'],
'num_posts' => $row_members['posts'],
'href' => $scripturl . '?action=profile;u=' . $row_members['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['id_member'] . '">' . $row_members['real_name'] . '</a>'
);

if ($max_num_posts < $row_members['posts'])
$max_num_posts = $row_members['posts'];
if (!empty($modSettings['MemberColorStats']) && !empty($row_members['id_member']))
$context['MemberColor_ID_MEMBER'][$row_members['id_member']] = $row_members['id_member'];
}
$smcFunc['db_free_result']($members_result);

foreach ($context['top_posters'] as $i => $poster)
{
$context['top_posters'][$i]['post_percent'] = round(($poster['num_posts'] * 100) / $max_num_posts);
$context['top_posters'][$i]['num_posts'] = comma_format($context['top_posters'][$i]['num_posts']);
}

// Board top 10.
$boards_result = $smcFunc['db_query']('', '
SELECT id_board, name, num_posts
FROM {db_prefix}boards AS b
WHERE {query_see_board}' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != {int:recycle_board}' : '') . '
AND b.redirect = {string:blank_redirect}
ORDER BY num_posts DESC
LIMIT 10',
array(
'recycle_board' => $modSettings['recycle_board'],
'blank_redirect' => '',
)
);
$context['top_boards'] = array();
$max_num_posts = 1;
while ($row_board = $smcFunc['db_fetch_assoc']($boards_result))
{
$context['top_boards'][] = array(
'id' => $row_board['id_board'],
'name' => $row_board['name'],
'num_posts' => $row_board['num_posts'],
'href' => $scripturl . '?board=' . $row_board['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row_board['id_board'] . '.0">' . $row_board['name'] . '</a>'
);

if ($max_num_posts < $row_board['num_posts'])
$max_num_posts = $row_board['num_posts'];
}
$smcFunc['db_free_result']($boards_result);

foreach ($context['top_boards'] as $i => $board)
{
$context['top_boards'][$i]['post_percent'] = round(($board['num_posts'] * 100) / $max_num_posts);
$context['top_boards'][$i]['num_posts'] = comma_format($context['top_boards'][$i]['num_posts']);
}
// Are you on a larger forum?  If so, let's try to limit the number of topics we search through.
if ($modSettings['totalMessages'] > 100000)
{
$request = $smcFunc['db_query']('', '
SELECT id_topic
FROM {db_prefix}topics
WHERE num_replies != {int:no_replies}' . ($modSettings['postmod_active'] ? '
AND approved = {int:is_approved}' : '') . '
ORDER BY num_replies DESC
LIMIT 100',
array(
'no_replies' => 0,
'is_approved' => 1,
)
);
$topic_ids = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$topic_ids[] = $row['id_topic'];
$smcFunc['db_free_result']($request);
}
else
$topic_ids = array();
// Topic views top 10.
$topic_view_result = $smcFunc['db_query']('', '
SELECT m.subject, t.num_views, t.id_board, t.id_topic, b.name
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
AND b.id_board != {int:recycle_board}' : '') . ')
WHERE {query_see_board}' . (!empty($topic_ids) ? '
AND t.id_topic IN ({array_int:topic_list})' : ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}' : '')) . '
ORDER BY t.num_views DESC
LIMIT 10',
array(
'topic_list' => $topic_ids,
'recycle_board' => $modSettings['recycle_board'],
'is_approved' => 1,
)
);
$context['top_topics_views'] = array();
$max_num_views = 1;
while ($row_topic_views = $smcFunc['db_fetch_assoc']($topic_view_result))
{
censorText($row_topic_views['subject']);
$row_topic_views['subject'] = shorten_subject($row_topic_views['subject'], 18);
$context['top_topics_views'][] = array(
'id' => $row_topic_views['id_topic'],
'board' => array(
'id' => $row_topic_views['id_board'],
'name' => $row_topic_views['name'],
'href' => $scripturl . '?board=' . $row_topic_views['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row_topic_views['id_board'] . '.0">' . $row_topic_views['name'] . '</a>'
),
'subject' => $row_topic_views['subject'],
'num_views' => $row_topic_views['num_views'],
'href' => $scripturl . '?topic=' . $row_topic_views['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row_topic_views['id_topic'] . '.0">' . $row_topic_views['subject'] . '</a>'
);

if ($max_num_views < $row_topic_views['num_views'])
$max_num_views = $row_topic_views['num_views'];
}
$smcFunc['db_free_result']($topic_view_result);

foreach ($context['top_topics_views'] as $i => $topic)
{
$context['top_topics_views'][$i]['post_percent'] = round(($topic['num_views'] * 100) / $max_num_views);
$context['top_topics_views'][$i]['num_views'] = comma_format($context['top_topics_views'][$i]['num_views']);
}

// Try to cache this when possible, because it's a little unavoidably slow.
if (($members = cache_get_data('stats_top_starters', 360)) == null)
{
$request = $smcFunc['db_query']('', '
SELECT id_member_started, COUNT(*) AS hits
FROM {db_prefix}topics' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
WHERE id_board != {int:recycle_board}' : '') . '
GROUP BY id_member_started
ORDER BY hits DESC
LIMIT 10',
array(
'recycle_board' => $modSettings['recycle_board'],
)
);
$members = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$members[$row['id_member_started']] = $row['hits'];
$smcFunc['db_free_result']($request);

cache_put_data('stats_top_starters', $members, 360);
}

if (empty($members))
$members = array(0 => 0);

// Topic poster top 10.
$members_result = $smcFunc['db_query']('', '
SELECT id_member, real_name
FROM {db_prefix}members
WHERE id_member IN ({array_int:member_list})
ORDER BY FIND_IN_SET(id_member, {string:top_topic_posters})
LIMIT 10',
array(
'member_list' => array_keys($members),
'top_topic_posters' => implode(',', array_keys($members)),
)
);
$context['top_starters'] = array();
$max_num_topics = 1;
while ($row_members = $smcFunc['db_fetch_assoc']($members_result))
{
$context['top_starters'][] = array(
'name' => $row_members['real_name'],
'id' => $row_members['id_member'],
'num_topics' => $members[$row_members['id_member']],
'href' => $scripturl . '?action=profile;u=' . $row_members['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['id_member'] . '">' . $row_members['real_name'] . '</a>'
);

if ($max_num_topics < $members[$row_members['id_member']])
$max_num_topics = $members[$row_members['id_member']];
if (!empty($modSettings['MemberColorStats']))
$context['MemberColor_ID_MEMBER'][$row_members['id_member']] = $row_members['id_member'];
}
$smcFunc['db_free_result']($members_result);

foreach ($context['top_starters'] as $i => $topic)
{
$context['top_starters'][$i]['post_percent'] = round(($topic['num_topics'] * 100) / $max_num_topics);
$context['top_starters'][$i]['num_topics'] = comma_format($context['top_starters'][$i]['num_topics']);
}

//Yeah baby give me some colors =).
if (!empty($modSettings['MemberColorLinkInstalled']) && !empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
$cmemcolid = null;
if (!empty($modSettings['MemberColorStats'])) {
// First the Top Posters =)
foreach($context['top_posters'] as $key => $value) {
$cmemcolid = $context['top_posters'][$key]['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['top_posters'][$key]['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
// First the Top Starter =)
foreach($context['top_starters'] as $key => $value) {
$cmemcolid = $context['top_starters'][$key]['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['top_starters'][$key]['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
}
if (!empty($modSettings['latestMember']) && !empty($modSettings['MemberColorLatestMember'])) {
if(!empty($colorDatas[$modSettings['latestMember']]['colored_link']))
$context['latest_member']['link'] = $colorDatas[$modSettings['latestMember']]['colored_link'];
}
}
}

// ----------------------------------------
// call topsstats and get last 23 topics
// ----------------------------------------
global  $context, $txt, $settings, $options, $user_info;
TopStats();
$latestPostOptions = array('number_posts' =>23);
$latest_posts = cache_quick_get('boardindex-latest_posts:' . md5($user_info['query_wanna_see_board'] . $user_info['language']), 'Subs-Recent.php', 'cache_getLastPosts', array($latestPostOptions));
loadLanguage('Stats');

// now output all the data...
echo '
<div style="margin:0 -1px ;">
<table border="0" width="101%" cellspacing="1" cellpadding="4">
    <tr>
        <td class="catbg" width="10%" colspan="2" align="center">', $txt['new'] ,' ', $txt['members_title'], '</td>
        <td class="catbg" width="24%" colspan="2" align="center">', $txt['top_topics_views'], '</td>
        <td class="catbg" width="66%" colspan="3" align="center">', $txt['recent_posts'], '</td>
    </tr>
    <tr>
        <td class="windowbg2" width="10%" colspan="2" valign="top"><span class="smalltext"><b>', $txt['user'], '</b></span><br />';
                  foreach ($context['new_members'] as $poster)
        {
         echo '
         <img alt="" src="', $settings['images_url'], '/icons/online.gif', '" width="16" height="12" />
        <span class="smalltext">',$poster['link'], '</span><br />';
        }
        echo '
        </td>
        <td class="windowbg2" width="18%" valign="top"><span class="smalltext"><b>', $txt['board_topics'], '</b></span><br />';
            foreach ($context['top_topics_views'] as $topic)
        echo '
        <img alt="" src="', $settings['images_url'], '/email_sm.gif', '" width="16" height="12"/>
        <span class="smalltext">', $topic['link'], '</span><br />';   
        echo '</td>
        <td class="windowbg2" width="6%" align="right" valign="top"><span class="smalltext"><b>', $txt['views'] ,'</b></span><br />';
            foreach ($context['top_topics_views'] as $topic)
        echo '
        <img alt="" src="', $settings['images_url'], '/icons/field_valid.gif" height="8" />       
        <span class="smalltext">', $topic['num_views'], '</span><br />';
        echo '</td>
        <td class="windowbg2" width="22%" rowspan="3" valign="top"><span class="smalltext"><b>', $txt['board_topics'], '</b></span><br />';
            if (!empty($latest_posts))
            foreach ($latest_posts as $post)
        echo '
        <img src="', $settings['images_url'], '/email_sm.gif', '" width="16" height="12" alt="" />
        <span class="smalltext"><a href="',$post['href'],'">', $post['short_subject'], '</a></span><br />';
        echo '</td>
        <td class="windowbg2" width="14%" rowspan="3" valign="top"><span class="smalltext"><b>', $txt['author'] ,'</b></span><br />';
            if (!empty($latest_posts))
            foreach ($latest_posts as $post)
        echo '
        <img alt="" src="', $settings['images_url'], '/icons/online.gif', '" width="16" height="12" />
        <span class="smalltext">', $post['poster']['link'], '</span><br />';
        echo'
        </td>
        <td class="windowbg2" width="20%" rowspan="3" valign="top"><span class="smalltext"><b>', $txt['date'] ,'</b></span><br />';
            if (!empty($latest_posts))
            foreach ($latest_posts as $post)
            echo '
            <img alt="" src="', $settings['images_url'], '/icons/calendar.gif', '" width="16" height="12" />
            <span class="smalltext">', $post['time'], '</span><br />';
        echo '</td>
    </tr>
    <tr>
        <td class="catbg" width="20%" colspan="2" align="center">', $txt['top_posters'], '</td>
        <td class="catbg" width="24%" colspan="2" align="center">', $txt['top_starters'], '</td>
    </tr>
    <tr>
        <td class="windowbg2" width="14%" valign="top"><span class="smalltext"><b>', $txt['user'], '</b></span><br />';
            foreach ($context['top_posters'] as $poster)
        echo '
<img alt="" src="', $settings['images_url'], '/icons/online.gif', '" width="16" height="12" />
        <span class="smalltext">', $poster['link'], '</span><br />';
        echo '</td>
        <td class="windowbg2" valign="top" align="right" width="6%"><span class="smalltext"><b>', $txt['posts'], '</b></span><br />';
            foreach ($context['top_posters'] as $poster)   
        echo '
        <img alt="" src="', $settings['images_url'], '/icons/field_valid.gif" height="8" /> 
        <span class="smalltext">', $poster['num_posts'], '</span><br />';
        echo '</td>
        <td class="windowbg2" valign="top" width="18%"><span class="smalltext"><b>', $txt['user'], '</b></span><br />';
            foreach ($context['top_starters'] as $poster)
        echo '
        <img alt="" src="', $settings['images_url'], '/icons/online.gif', '" width="16" height="12" />
        <span class="smalltext">', $poster['link'], '</span><br />';
        echo '</td>
        <td class="windowbg2" valign="top" align="right" width="6%"><span class="smalltext"><b>', $txt['board_topics'], '</b></span><br />';
           foreach ($context['top_starters'] as $poster)
        echo '
        <img alt="" src="', $settings['images_url'], '/icons/field_valid.gif" height="8" />   
        <span class="smalltext">', $poster['num_topics'], '</span><br />';
        echo '</td>
    </tr>
</table>
</div>';


Fel
Many are stubborn in relation to the path, a few in relation to the target.

Norv

#8
27. Aug 2009, 11:33:55
Cheers, it works like a charm, of course!
*is considering using it too...*

neverhurry

#9
27. Aug 2009, 12:32:03
WOW, you are splendid...  O0 O0 O0 :)) THANK YOU!!!

neverhurry

#10
29. Aug 2009, 12:06:31
Hello, this block is so good and so important, i recommend to every admin....
I would be very grateful if someone can tell me how to add to this great block 10 latest articles short subjects with auther and date from PMXBlog, it seems there is no place to put them inside, maybe i can sacrifice 10 new members, thank you in advance.

I really love PortaMX and PMXBlog.

Cool

#11
29. Aug 2009, 12:34:11
that will be very easy to extend the queries for the blog. but this should be done when the new blog module comes out.
|I Use: SMF 2.0.5 | PortaMx 1.51
Q: What do you do when you see a bear in the woods?
A: Play Dead!
H-A-H-L = Happy Admins Have Linux

neverhurry

#12
29. Aug 2009, 19:44:14
Quote from: neverhurry on 29. Aug 2009, 12:06:31
Hello, this block is so good and so important, i recommend to every admin....
I would be very grateful if someone can tell me how to add to this great block 10 latest articles short subjects with auther and date from PMXBlog, it seems there is no place to put them inside, maybe i can sacrifice 10 new members, thank you in advance.

I really love PortaMX and PMXBlog.


I think again, 10 latest articles info should include the short subject, last author (who writes the comment) and the last date. thanks!

feline

#13
30. Aug 2009, 13:54:35
As i say in a other tread ... PmxBlog comes with a PmxBlog_SSI.
For now wha have a function for "recent" Articles, they show the n latest articles and unread articles/comments in the same format as recent posts ...

Fel
Many are stubborn in relation to the path, a few in relation to the target.

neverhurry

#14
30. Aug 2009, 13:58:36
Quote from: feline on 30. Aug 2009, 13:54:35
As i say in a other tread ... PmxBlog comes with a PmxBlog_SSI.
For now wha have a function for "recent" Articles, they show the n latest articles and unread articles/comments in the same format as recent posts ...

Fel


Thanks, that is great. But I don't know SSI very well, would like to learn to use it.