SimplePortal

Customization => Custom Coding => Topic started by: azunai on January 19, 2011, 10:23:11 AM

Title: Custom names in Shoutbox (cant find right spot)
Post by: azunai on January 19, 2011, 10:23:11 AM
well as the title says,
i'm trying to modify the username displayed in my Shoutbox..
i know there is the$shout['author']['name'] element, but it seems like the name is converted from the users link

Code: [Select]
li class="smalltext">[' . $shout['time'] . '] ', !$shout['is_me'] ? '<strong>' . $shout['author']['link'] . ':</strong> ' : '', $shout['text'], '', !empty($shout['delete_link_js']) ? '<span class="shoutbox_delete">' . $shout['delete_link_js'] . '</span>' : '' , '</li>';my attempts to change a username like "trollofant" to "trollo<img src=fant.png>" failed
since i dont find the spot where $shout['author']['link'] is parsed to

<a style="color: rgb(0, 0, 0);" title="on Today at 09:06:17 am" href="http://www.forum.com/index.php?action=profile;u=1234">username</a>

guess you got my problem ;)

thanks for reading
Title: Re: Custom names in Shoutbox (cant find right spot)
Post by: azunai on January 20, 2011, 07:12:08 PM
no ideas?
cmn guys :D
Title: Re: Custom names in Shoutbox (cant find right spot)
Post by: 130860 on January 20, 2011, 08:54:08 PM
I believe the Shoutbox options are build in  Sources/Subs-Portal.php

look for function sportal_get_shouts();

specially this part:

Code: [Select]
while ($row = $smcFunc['db_fetch_assoc']($request))
{
// Disable the aeva mod for the shoutbox.
$context['aeva_disable'] = true;
$online_color = !empty($row['member_group_color']) ? $row['member_group_color'] : $row['post_group_color'];
$shouts[$row['id_shout']] = array(
'id' => $row['id_shout'],
'author' => array(
'id' => $row['id_member'],
'name' => $row['member_name'],
'link' => $row['id_member'] ? ('<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" title="' . $txt['on'] . ' ' . strip_tags(timeformat($row['log_time'])) . '"' . (!empty($online_color) ? ' style="color: ' . $online_color . ';"' : '') . '>' . $row['member_name'] . '</a>') : $row['member_name'],
'color' => $online_color,
),
'time' => $row['log_time'],
'text' => parse_bbc($row['body'], true, '', $bbc),
);
}

thats where the  $shout['author']['name'] is created and thats where you can change it.
Title: Re: Custom names in Shoutbox (cant find right spot)
Post by: azunai on January 21, 2011, 03:18:29 AM
hi

well i can change the $shouts[author][name] on multiple spots but it doesnt realy matter since the this value seems not to be used, anyway will try it tonight to see if it leeds me to right spot

thanks
SimplePortal 2.3.8 © 2008-2024, SimplePortal