Wedge

Public area => The Pub => Topic started by: Jurien on August 26th, 2016, 11:28 AM

Title: Donators group showing up on Website Credits page
Post by: Jurien on August 26th, 2016, 11:28 AM
Wanted to give our donators an more prominent place on our Website Credits page,in the same way as moderators are shown up.

So far did these two adjustments, but still no luck,do I forget something or doing something wrong.

Who.template.php
  if (!empty($context['site_credits']['donations']))
{

echo '
<section>
<h6>'
number_context('credits_donateurs'count($context['site_credits']['donations'])), '</h6>
<ul class="last">'
;

foreach ($context['site_credits']['donations'] as $donation)
echo '
<li'
strpos($donation['real_name'], '<img') !== false ' class="witha"' '''><a href="<URL>?action=profile;u='$donation['id_member'], '">'$donation['real_name'], '</a></li>';

echo '
</ul>
</section>'
;
}

Who.dutch.php
// Credits text
$txt['credits_site'] = 'Team-leden';
$txt['credits_admins'] = array(=> 'Administrator''n' => 'Beheerders');
$txt['credits_moderators'] = array(=> 'Moderator''n' => 'Moderators');
$txt['credits_donations'] = array(=> 'Donation''n' => 'Donateurs');
Title: Re: Donators group showing up on Website Credits page
Post by: Nao on August 26th, 2016, 08:23 PM
Haven't touched this code in a while... (Like the rest of the code, you'll tell me.)

Where's $context['site_credits']['donations'] coming from..?
Title: Re: Donators group showing up on Website Credits page
Post by: Jurien on August 26th, 2016, 11:07 PM
Quote from Nao on August 26th, 2016, 08:23 PM
Where's $context['site_credits']['donations'] coming from..?
Added by myself in Who.template.php
Title: Re: Donators group showing up on Website Credits page
Post by: CerealGuy on August 27th, 2016, 01:54 PM
You need to fill $context['site_credits']['donations'] with users in Credits.php. Guess you didn't do that already?
Title: Re: Donators group showing up on Website Credits page
Post by: Jurien on August 27th, 2016, 04:11 PM
Thanks CerealGuy
Started all over again and gives it all Dutch names Who.dutch.php,Who.template.php,at last added donateurs in
Credits.php like this
// It's nicer with avatars, really...
loadMemberData(array_keys($site_team));
foreach ($site_team as $member => $row)
{
if (empty($memberContext[$member]['avatar']))
loadMemberAvatar($membertrue);
$row['real_name'] = (empty($memberContext[$member]['avatar']['image']) ? '' $memberContext[$member]['avatar']['image']) . $row['real_name'];
$context['site_credits'][$row['id_group'] == || (!empty($row['additional_groups']) && in_array(1explode(','$row['additional_groups']))) ? 'admins' 'mods' 'donateurs' ][] = $row;
}

Still no go,even worse Website Credit page won't load or open at all
Title: Re: Donators group showing up on Website Credits page
Post by: Jurien on August 29th, 2016, 11:15 AM
It seems that the additional_groups name donateurs (membersgroup 12)  won´t be regonized the same way as admins and mods,have no clue why ?.

The only thing that rest my is to created group donateurs in Who.template.php
<we:cat>
', $txt['credits_donateurs'], '
</we:cat>

<we:block class="windowbg2">';
$i = 1;
$max = count($context['
credits']);

foreach ($context['
credits'] as $group)
echo '
<section>
<h6>', $group['title'], '</h6>
<ul', $i === $max ? ' class="last"' : '', '>
<li>', implode('</li>
<li>', $group['members']), '</li>
</ul>
</section>';

and add a Credits text in Who.dutch.php and fill in the names of our donators.

$txt['credits_donateurs'] = 'Donateurs :';
However that's not what i wanted in the first place (Goal is to see donators by name and avatar,the same way as admins and moderators are been showed)