collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 284
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Author Topic: is possible this block?  (Read 6038 times)

0 Members and 1 Guest are viewing this topic.

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
is possible this block?
« on: September 18, 2010, 09:17:34 AM »
is possible this block?
statistic and user on line together
« Last Edit: September 18, 2010, 10:16:18 AM by fdr77 »
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline falco

  • Jr. Member
  • **
  • Posts: 55
  • Gender: Male
  • SMF Version: 2 RC2
  • SP Version: 2.3.2
Re: is possible this block?
« Reply #1 on: September 19, 2010, 08:49:57 AM »
That is Tiny Portal.

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: is possible this block?
« Reply #2 on: September 19, 2010, 11:44:19 AM »
you wanted to know if such a thing was possible.
Or on the forum I post count total, total users, total posts.
you can create a block with 24 hours in open discussion and responses in 24 hours?
Thank you
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: is possible this block?
« Reply #3 on: September 22, 2010, 09:46:49 AM »
I managed . Copy the code maybe someone interested. You can see if maybe something is wrong
Code: [Select]
sp_userInfo(array(), $id);
echo '<hr />';
sp_boardStats(array('averages' => 0), $id);
echo '<hr />';
echo '
<b>Utenti on line :</b> ',
sp_whosOnline(array(), $id);
echo '<hr />';
global $db_prefix, $user_info, $modSettings, $context;

// Load the users online today.
$date = @getdate(forum_time(false));
$midnight = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']) - ($modSettings['time_offset'] * 3600);

$s = strpos($user_info['time_format'], '%S') === false ? '' : ':%S';
if (strpos($user_info['time_format'], '%H') === false && strpos($user_info['time_format'], '%T') === false)
$time_fmt = '%I:%M' . $s . ' %p';
else
$time_fmt = '%H:%M' . $s;

$result = db_query("
SELECT
mem.ID_MEMBER, mem.lastLogin, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP, mg.groupName
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE mem.lastLogin >= $midnight
LIMIT 20", __FILE__, __LINE__);

$context['num_hidden_users_online_today'] = 0;
$context['users_online_today'] = array();
$context['list_users_online_today'] = array();

while ($row = mysql_fetch_assoc($result))
{
if (empty($row['showOnline']))
{
$context['num_hidden_users_online_today'] = $context['num_hidden_users_online_today'] + 1;
if (!$user_info['is_admin']) continue;
}

$userday = strftime('%d', forum_time(true));
$loginday = strftime('%d', forum_time(true, $row['lastLogin']));
$yesterday = $userday == $loginday ? '' : $txt['uot_yesterday'];

$lastLogin = $yesterday . strftime($time_fmt, forum_time(true, $row['lastLogin']));
$title = ' title="' . $lastLogin . '"';

// Some basic color coding...
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"' . $title . ' style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"' . $title . '>' . $row['realName'] . '</a>';

$is_buddy = in_array($row['ID_MEMBER'], $user_info['buddies']);
if ($is_buddy)
{
$link = '<b>' . $link . '</b>';
}

$context['users_online_today'][$row['lastLogin'] . $row['memberName']] = array(
'id' => $row['ID_MEMBER'],
'username' => $row['memberName'],
'name' => $row['realName'],
'group' => $row['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => $link,
'is_buddy' => $is_buddy,
'hidden' => empty($row['showOnline']),
);

$context['list_users_online_today'][$row['lastLogin'] . $row['memberName']] = empty($row['showOnline']) ? '<i>' . $link . '</i>' : $link;
}
mysql_free_result($result);

krsort($context['users_online_today']);
krsort($context['list_users_online_today']);

$context['num_users_online_today'] = count($context['users_online_today']);

if (!empty($context['users_online_today']))
{
echo '
<b>Utenti on line nelle 24 ore :</b> ', $context['num_users_online_today'], '
<ul>';

foreach ($context['list_users_online_today'] as $user)
echo '
<li>', $user, '</li>';

echo '
</ul>';
}
else
echo 'Nessun utente on line oggi.';


 
global $context, $scripturl, $boarddir, $txt;
global $db_prefix;
echo '
<b>Compleanni :</b><br> ';
require_once($boarddir.'/SSI.php');

//number of days before birthday is shown
$number_of_days = 5;

$last_year = date('U') - (365 * 24 * 60 * 60);

$low_date = strftime('%Y-%m-%d', forum_time(false) - 24 * 3600);
$high_date = strftime('%Y-%m-%d', forum_time(false) + $number_of_days * 24 * 3600);

if (substr($low_date, 0, 4) != substr($high_date, 0, 4))
  $allyear_part = "birthdate BETWEEN '0004" . substr($low_date, 4) . "' AND '0004-12-31'
                   OR birthdate BETWEEN '0004-01-01' AND '0004" . substr($high_date, 4) . "'";
else
  $allyear_part = "birthdate BETWEEN '0004" . substr($low_date, 4) . "' AND '0004" . substr($high_date, 4) . "'";

$year_low = (int) substr($low_date, 0, 4);
$year_high = (int) substr($high_date, 0, 4);

$query= db_query("
                           SELECT ID_MEMBER, realName, YEAR(birthdate) AS birthYear, birthdate
                           FROM {$db_prefix}members
                           WHERE YEAR(birthdate) != '0001'
                           AND ({$allyear_part}
                           OR DATE_FORMAT(birthdate, '{$year_low}-%m-%d') BETWEEN '$low_date' AND '$high_date'" . ($year_low == $year_high ? '' : "
                           OR DATE_FORMAT(birthdate, '{$year_high}-%m-%d') BETWEEN '$low_date' AND '$high_date'") . ")
                           AND lastLogin > '{$last_year}'
                          ORDER BY memberName", __FILE__, __LINE__);


if(db_affected_rows() != 0)
{
  $birthdays = array();
  $member = array();
  while ($row = mysql_fetch_assoc($query))
  {
    $day = substr($row['birthdate'],8,2);
    $month = substr($row['birthdate'],5,2);
    $birthdays[$row['realName']] =  $month . $day;
    $member[$row['realName']] =  $row['ID_MEMBER'];
  }
  echo '<table>';
  asort($birthdays);
  $yesterday = 0;
  foreach ($birthdays as $key => $value)
  {
    if ($value <> $yesterday)
    {
      if (substr($value,0,2) == date("m"))
        $showdate = date("M") . ' ' . substr($value,2,2);
      else
        $showdate = date("M",time() + ($number_of_days * 24 * 3600)) . ' ' .  substr($value,2,2);
      if ($yesterday > 0)
        echo '</td></tr>';
      echo '<tr valign="top"><td>' , $showdate , '</td><td>';
    }
    echo '<a class="normaltext" href="' . $scripturl . '?action=profile;u=' . $member[$key] . '">' . $key . '</a><br />';
    $yesterday = $value;
  }
  echo '</td></tr></table>';
}
else
  echo 'Non ci sono compleanni nei prossimi ' . $number_of_days . ' giorni';

for this
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: is possible this block?
« Reply #4 on: September 22, 2010, 09:48:42 AM »
and this
Code: [Select]
echo '
<b>Utenti on line :</b> ',
sp_whosOnline(array(), $id);
echo '<hr />';
sp_boardStats(array('averages' => 0), $id);
echo '<hr />';

global $context, $scripturl, $boarddir, $txt;
global $db_prefix;
echo '
<b>Compleanni :</b><br> ';
require_once($boarddir.'/SSI.php');

//number of days before birthday is shown
$number_of_days = 5;

$last_year = date('U') - (365 * 24 * 60 * 60);

$low_date = strftime('%Y-%m-%d', forum_time(false) - 24 * 3600);
$high_date = strftime('%Y-%m-%d', forum_time(false) + $number_of_days * 24 * 3600);

if (substr($low_date, 0, 4) != substr($high_date, 0, 4))
  $allyear_part = "birthdate BETWEEN '0004" . substr($low_date, 4) . "' AND '0004-12-31'
                   OR birthdate BETWEEN '0004-01-01' AND '0004" . substr($high_date, 4) . "'";
else
  $allyear_part = "birthdate BETWEEN '0004" . substr($low_date, 4) . "' AND '0004" . substr($high_date, 4) . "'";

$year_low = (int) substr($low_date, 0, 4);
$year_high = (int) substr($high_date, 0, 4);

$query= db_query("
                           SELECT ID_MEMBER, realName, YEAR(birthdate) AS birthYear, birthdate
                           FROM {$db_prefix}members
                           WHERE YEAR(birthdate) != '0001'
                           AND ({$allyear_part}
                           OR DATE_FORMAT(birthdate, '{$year_low}-%m-%d') BETWEEN '$low_date' AND '$high_date'" . ($year_low == $year_high ? '' : "
                           OR DATE_FORMAT(birthdate, '{$year_high}-%m-%d') BETWEEN '$low_date' AND '$high_date'") . ")
                           AND lastLogin > '{$last_year}'
                          ORDER BY memberName", __FILE__, __LINE__);


if(db_affected_rows() != 0)
{
  $birthdays = array();
  $member = array();
  while ($row = mysql_fetch_assoc($query))
  {
    $day = substr($row['birthdate'],8,2);
    $month = substr($row['birthdate'],5,2);
    $birthdays[$row['realName']] =  $month . $day;
    $member[$row['realName']] =  $row['ID_MEMBER'];
  }
  echo '<table>';
  asort($birthdays);
  $yesterday = 0;
  foreach ($birthdays as $key => $value)
  {
    if ($value <> $yesterday)
    {
      if (substr($value,0,2) == date("m"))
        $showdate = date("M") . ' ' . substr($value,2,2);
      else
        $showdate = date("M",time() + ($number_of_days * 24 * 3600)) . ' ' .  substr($value,2,2);
      if ($yesterday > 0)
        echo '</td></tr>';
      echo '<tr valign="top"><td>' , $showdate , '</td><td>';
    }
    echo '<a class="normaltext" href="' . $scripturl . '?action=profile;u=' . $member[$key] . '">' . $key . '</a><br />';
    $yesterday = $value;
  }
  echo '</td></tr></table>';
}
else
  echo 'Non ci sono compleanni nei prossimi ' . $number_of_days . ' giorni';

for this
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: is possible this block?
« Reply #5 on: September 22, 2010, 09:55:14 AM »
Having regard to the help received , I hope I have done something useful to all
« Last Edit: September 22, 2010, 10:00:26 AM by fdr77 »
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline bumbo

  • Just Registered
  • Posts: 1
  • SMF Version: 1.1.11
  • SP Version: None
Re: is possible this block?
« Reply #6 on: September 26, 2010, 03:33:47 AM »
I managed . Copy the code maybe someone interested. You can see if maybe something is wrong
Code: [Select]
sp_userInfo(array(), $id);
echo '<hr />';
sp_boardStats(array('averages' => 0), $id);
echo '<hr />';
echo '
<b>Utenti on line :</b> ',
sp_whosOnline(array(), $id);
echo '<hr />';
global $db_prefix, $user_info, $modSettings, $context;

// Load the users online today.
$date = @getdate(forum_time(false));
$midnight = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']) - ($modSettings['time_offset'] * 3600);

$s = strpos($user_info['time_format'], '%S') === false ? '' : ':%S';
if (strpos($user_info['time_format'], '%H') === false && strpos($user_info['time_format'], '%T') === false)
$time_fmt = '%I:%M' . $s . ' %p';
else
$time_fmt = '%H:%M' . $s;

$result = db_query("
SELECT
mem.ID_MEMBER, mem.lastLogin, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP, mg.groupName
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE mem.lastLogin >= $midnight
LIMIT 20", __FILE__, __LINE__);

$context['num_hidden_users_online_today'] = 0;
$context['users_online_today'] = array();
$context['list_users_online_today'] = array();

while ($row = mysql_fetch_assoc($result))
{
if (empty($row['showOnline']))
{
$context['num_hidden_users_online_today'] = $context['num_hidden_users_online_today'] + 1;
if (!$user_info['is_admin']) continue;
}

$userday = strftime('%d', forum_time(true));
$loginday = strftime('%d', forum_time(true, $row['lastLogin']));
$yesterday = $userday == $loginday ? '' : $txt['uot_yesterday'];

$lastLogin = $yesterday . strftime($time_fmt, forum_time(true, $row['lastLogin']));
$title = ' title="' . $lastLogin . '"';

// Some basic color coding...
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"' . $title . ' style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"' . $title . '>' . $row['realName'] . '</a>';

$is_buddy = in_array($row['ID_MEMBER'], $user_info['buddies']);
if ($is_buddy)
{
$link = '<b>' . $link . '</b>';
}

$context['users_online_today'][$row['lastLogin'] . $row['memberName']] = array(
'id' => $row['ID_MEMBER'],
'username' => $row['memberName'],
'name' => $row['realName'],
'group' => $row['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => $link,
'is_buddy' => $is_buddy,
'hidden' => empty($row['showOnline']),
);

$context['list_users_online_today'][$row['lastLogin'] . $row['memberName']] = empty($row['showOnline']) ? '<i>' . $link . '</i>' : $link;
}
mysql_free_result($result);

krsort($context['users_online_today']);
krsort($context['list_users_online_today']);

$context['num_users_online_today'] = count($context['users_online_today']);

if (!empty($context['users_online_today']))
{
echo '
<b>Utenti on line nelle 24 ore :</b> ', $context['num_users_online_today'], '
<ul>';

foreach ($context['list_users_online_today'] as $user)
echo '
<li>', $user, '</li>';

echo '
</ul>';
}
else
echo 'Nessun utente on line oggi.';


 
global $context, $scripturl, $boarddir, $txt;
global $db_prefix;
echo '
<b>Compleanni :</b><br> ';
require_once($boarddir.'/SSI.php');

//number of days before birthday is shown
$number_of_days = 5;

$last_year = date('U') - (365 * 24 * 60 * 60);

$low_date = strftime('%Y-%m-%d', forum_time(false) - 24 * 3600);
$high_date = strftime('%Y-%m-%d', forum_time(false) + $number_of_days * 24 * 3600);

if (substr($low_date, 0, 4) != substr($high_date, 0, 4))
  $allyear_part = "birthdate BETWEEN '0004" . substr($low_date, 4) . "' AND '0004-12-31'
                   OR birthdate BETWEEN '0004-01-01' AND '0004" . substr($high_date, 4) . "'";
else
  $allyear_part = "birthdate BETWEEN '0004" . substr($low_date, 4) . "' AND '0004" . substr($high_date, 4) . "'";

$year_low = (int) substr($low_date, 0, 4);
$year_high = (int) substr($high_date, 0, 4);

$query= db_query("
                           SELECT ID_MEMBER, realName, YEAR(birthdate) AS birthYear, birthdate
                           FROM {$db_prefix}members
                           WHERE YEAR(birthdate) != '0001'
                           AND ({$allyear_part}
                           OR DATE_FORMAT(birthdate, '{$year_low}-%m-%d') BETWEEN '$low_date' AND '$high_date'" . ($year_low == $year_high ? '' : "
                           OR DATE_FORMAT(birthdate, '{$year_high}-%m-%d') BETWEEN '$low_date' AND '$high_date'") . ")
                           AND lastLogin > '{$last_year}'
                          ORDER BY memberName", __FILE__, __LINE__);


if(db_affected_rows() != 0)
{
  $birthdays = array();
  $member = array();
  while ($row = mysql_fetch_assoc($query))
  {
    $day = substr($row['birthdate'],8,2);
    $month = substr($row['birthdate'],5,2);
    $birthdays[$row['realName']] =  $month . $day;
    $member[$row['realName']] =  $row['ID_MEMBER'];
  }
  echo '<table>';
  asort($birthdays);
  $yesterday = 0;
  foreach ($birthdays as $key => $value)
  {
    if ($value <> $yesterday)
    {
      if (substr($value,0,2) == date("m"))
        $showdate = date("M") . ' ' . substr($value,2,2);
      else
        $showdate = date("M",time() + ($number_of_days * 24 * 3600)) . ' ' .  substr($value,2,2);
      if ($yesterday > 0)
        echo '</td></tr>';
      echo '<tr valign="top"><td>' , $showdate , '</td><td>';
    }
    echo '<a class="normaltext" href="' . $scripturl . '?action=profile;u=' . $member[$key] . '">' . $key . '</a><br />';
    $yesterday = $value;
  }
  echo '</td></tr></table>';
}
else
  echo 'Non ci sono compleanni nei prossimi ' . $number_of_days . ' giorni';

for this

Congratulations masters, this I like it ... only if he could explain where to paste this to your work and how? I'm just a beginner and do not cope very well. Thanks in advance. :thumbsup:rcwc

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: is possible this block?
« Reply #7 on: October 03, 2010, 10:10:42 AM »
 take a php block and paste it there only for smf 1.1.11 and SP 2.3.2
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline dirtymind

  • Semi Newbie
  • *
  • Posts: 26
  • SMF Version: 1.1.11
  • SP Version: 2.3.1
Re: is possible this block?
« Reply #8 on: October 04, 2010, 10:14:08 AM »
this is mine  ;)

Offline Deezel

  • Jr. Member
  • **
  • Posts: 54
  • Gender: Male
  • It Is What It Is
    • Owner/Admin
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: is possible this block?
« Reply #9 on: October 27, 2010, 07:21:57 AM »
this is mine  ;)
Mind sharing the code for that one...looks great!