TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 01, 2024, 02:24:19 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 167
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 103
  • Total: 103

Adding Ghost Member

Started by alhaudhie, October 10, 2009, 06:26:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alhaudhie


G6Cad

TP uses the database calls from SMF so if you have ghost users in your SMF online list, they should also show up in the block for tps stats block

I might understand you wrong, but with the info you gave this is the only answer i can give until you explain more what your asking us about.

Also, Please read the Posting Guidelines.html

jebong

related to the package parser for that mod.. we must adding

    if (!(empty($modSettings['ghost_total_members'])))
echo '
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $ghostmember = ($context['num_guests'] + $modSettings['ghost_total_members']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'], ' ';
      else
      echo '
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'], ' ';



and

// Begin Ghost Members
if (!empty($modSettings['allow_ghost']))
{

if (!empty($modSettings['ghost_mem_1']))
echo ',&nbsp;<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_1'], '">', $modSettings['ghost_mem_1'], '</a>';
if (!empty($modSettings['ghost_mem_2']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_2'], '"> ', $modSettings['ghost_mem_2'], '</a>';
if (!empty($modSettings['ghost_mem_3']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_3'], '"> ', $modSettings['ghost_mem_3'], '</a>';
if (!empty($modSettings['ghost_mem_4']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_4'], '"> ', $modSettings['ghost_mem_4'], '</a>';
if (!empty($modSettings['ghost_mem_5']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_5'], '"> ', $modSettings['ghost_mem_5'], '</a>';
if (!empty($modSettings['ghost_mem_6']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_6'], '"> ', $modSettings['ghost_mem_6'], '</a>';
if (!empty($modSettings['ghost_mem_7']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_7'], '"> ', $modSettings['ghost_mem_7'], '</a>';
if (!empty($modSettings['ghost_mem_8']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_8'], '"> ', $modSettings['ghost_mem_8'], '</a>';
if (!empty($modSettings['ghost_mem_9']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_9'], '"> ', $modSettings['ghost_mem_9'], '</a>';
if (!empty($modSettings['ghost_mem_10']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_10'], '"> ', $modSettings['ghost_mem_10'], '</a>';
if (!empty($modSettings['ghost_mem_11']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_11'], '"> ', $modSettings['ghost_mem_11'], '</a>';
if (!empty($modSettings['ghost_mem_12']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_12'], '"> ', $modSettings['ghost_mem_12'], '</a>';
if (!empty($modSettings['ghost_mem_13']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_13'], '"> ', $modSettings['ghost_mem_13'], '</a>';
if (!empty($modSettings['ghost_mem_14']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_14'], '"> ', $modSettings['ghost_mem_14'], '</a>';
if (!empty($modSettings['ghost_mem_15']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_15'], '"> ', $modSettings['ghost_mem_15'], '</a>';
if (!empty($modSettings['ghost_mem_16']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_16'], '"> ', $modSettings['ghost_mem_16'], '</a>';
if (!empty($modSettings['ghost_mem_17']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_17'], '"> ', $modSettings['ghost_mem_17'], '</a>';
if (!empty($modSettings['ghost_mem_18']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_18'], '"> ', $modSettings['ghost_mem_18'], '</a>';
if (!empty($modSettings['ghost_mem_19']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_19'], '"> ', $modSettings['ghost_mem_19'], '</a>';
if (!empty($modSettings['ghost_mem_20']))
echo ',<a href="', $scripturl, '?action=profile;u=', $modSettings['ghost_pro_20'], '"> ', $modSettings['ghost_mem_20'], '</a>';
}
// End Ghost Members


in the boardindex.template.php
............................................

thats why i think we must change some tp file...

ZarPrime

There shouldn't be any TP files that need to be changed for this to work.  After the install in the default theme, the only file that might need to be edited is the ./Themes/custom_theme/BoardIndex.template.php if there is one.

It sounds like a nice Mod and it may be something I'll look at using but not until the author has edited it to allow the Ghost members profiles to show up when someone wants to look at them.

ZarPrime

alhaudhie

Quote from: ZarPrime on October 11, 2009, 02:40:50 PM
There shouldn't be any TP files that need to be changed for this to work.  After the install in the default theme, the only file that might need to be edited is the ./Themes/custom_theme/BoardIndex.template.php if there is one.

It sounds like a nice Mod and it may be something I'll look at using but not until the author has edited it to allow the Ghost members profiles to show up when someone wants to look at them.

ZarPrime
i have tried it.. but cant be done.. can we add in ssi_whosOnline in ssi.php file?

alhaudhie

hope anybody can help for this...

JPDeni

Do you need the ssi_whosOnline function? Put this into the SSI.php file.


// Shows a list of online users:  YY Guests, ZZ Users and then a list...
function ssi_whosOnline($output_method = 'echo')
{
global $scripturl, $db_prefix, $user_info, $txt;

// Load the users online right now.
$result = db_query("
SELECT
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP
FROM {$db_prefix}log_online AS lo
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.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))", __FILE__, __LINE__);

$return['users'] = array();
$return['guests'] = 0;
$return['hidden'] = 0;
$return['buddies'] = 0;
$show_buddies = !empty($user_info['buddies']);

while ($row = mysql_fetch_assoc($result))
{
if (!isset($row['realName']))
$return['guests']++;
elseif (!empty($row['showOnline']) || allowedTo('moderate_forum'))
{
// Some basic color coding...
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" class="' . $row['onlineColor'] . '">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';

// Bold any buddies.
if ($show_buddies && in_array($row['ID_MEMBER'], $user_info['buddies']))
{
$return['buddies']++;
$link = '<b>' . $link . '</b>';
}

$return['users'][$row['logTime'] . $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,
'hidden' => empty($row['showOnline']),
'is_last' => false,
);
}
else
$return['hidden']++;
}
mysql_free_result($result);

if (!empty($return['users']))
{
krsort($return['users']);
$userlist = array_keys($return['users']);
$return['users'][$userlist[count($userlist) - 1]]['is_last'] = true;
}
$return['num_users'] = count($return['users']) + $return['hidden'];
$return['total_users'] = $return['num_users'] + $return['guests'];

if ($output_method != 'echo')
return $return;

echo '
', $return['guests'], ' ', $return['guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $return['num_users'], ' ', $return['num_users'] == 1 ? $txt['user'] : $txt['users'];

// Hidden users, or buddies?
if ($return['hidden'] > 0 || $show_buddies)
echo '
(' . ($show_buddies ? ($return['buddies'] . ' ' . ($return['buddies'] == 1 ? $txt['buddy'] : $txt['buddies'])) : '') . ($show_buddies && $return['hidden'] ? ', ' : '') . (!$return['hidden'] ? '' : $return['hidden'] . ' ' . $txt['hidden']) . ')';

echo '<br />';
foreach ($return['users'] as $user)
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'], $user['is_last'] ? '' : ', ';
}

alhaudhie

Quote from: JPDeni on December 16, 2009, 05:04:59 PM
Do you need the ssi_whosOnline function? Put this into the SSI.php file.


// Shows a list of online users:  YY Guests, ZZ Users and then a list...
function ssi_whosOnline($output_method = 'echo')
{
global $scripturl, $db_prefix, $user_info, $txt;

// Load the users online right now.
$result = db_query("
SELECT
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP
FROM {$db_prefix}log_online AS lo
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.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))", __FILE__, __LINE__);

$return['users'] = array();
$return['guests'] = 0;
$return['hidden'] = 0;
$return['buddies'] = 0;
$show_buddies = !empty($user_info['buddies']);

while ($row = mysql_fetch_assoc($result))
{
if (!isset($row['realName']))
$return['guests']++;
elseif (!empty($row['showOnline']) || allowedTo('moderate_forum'))
{
// Some basic color coding...
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" class="' . $row['onlineColor'] . '">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';

// Bold any buddies.
if ($show_buddies && in_array($row['ID_MEMBER'], $user_info['buddies']))
{
$return['buddies']++;
$link = '<b>' . $link . '</b>';
}

$return['users'][$row['logTime'] . $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,
'hidden' => empty($row['showOnline']),
'is_last' => false,
);
}
else
$return['hidden']++;
}
mysql_free_result($result);

if (!empty($return['users']))
{
krsort($return['users']);
$userlist = array_keys($return['users']);
$return['users'][$userlist[count($userlist) - 1]]['is_last'] = true;
}
$return['num_users'] = count($return['users']) + $return['hidden'];
$return['total_users'] = $return['num_users'] + $return['guests'];

if ($output_method != 'echo')
return $return;

echo '
', $return['guests'], ' ', $return['guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $return['num_users'], ' ', $return['num_users'] == 1 ? $txt['user'] : $txt['users'];

// Hidden users, or buddies?
if ($return['hidden'] > 0 || $show_buddies)
echo '
(' . ($show_buddies ? ($return['buddies'] . ' ' . ($return['buddies'] == 1 ? $txt['buddy'] : $txt['buddies'])) : '') . ($show_buddies && $return['hidden'] ? ', ' : '') . (!$return['hidden'] ? '' : $return['hidden'] . ' ' . $txt['hidden']) . ')';

echo '<br />';
foreach ($return['users'] as $user)
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'], $user['is_last'] ? '' : ', ';
}


yes.. because i want to show ghost in tp online users.. i will try it.. tq

alhaudhie

#8
i cant see any code for Ghost in your ssi.php...

related: http://custom.simplemachines.org/mods/index.php?mod=2128

JPDeni

I don't know what Ghost members even are. (People who have died but still log in?) I just saw your question

Quote
can we add in ssi_whosOnline in ssi.php file?

and answered it. Someone who has a clue about Ghost Members (in the sky-y) will have to go further.