arrange one under another

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
Nutu.
Registered User
Posts: 13
Joined: Tue Feb 20, 2018 8:27 pm

arrange one under another

Post by Nutu. »

hello again, i've got this

Code: Select all

    <div class="forabg responsive-hide" id="top_five">
        <div class="inner">
            <ul class="topiclist">
                <li class="header">
                    <dl class="<!-- IF S_PHPBB_IS_32 -->row-item<!-- ELSE -->icon<!-- ENDIF -->">
                        <dt><div class="inner"><center><b><font size="3", color="#FFFFFF">Most Thanked Users</font></b></center></div></dt>
                    </dl>
                    <!-- IF U_TOPFIVE_COLLAPSE_URL -->
                    <a href="{U_TOPFIVE_COLLAPSE_URL}" class="collapse-btn collapse-<!-- IF S_TOPFIVE_HIDDEN -->show<!-- ELSE -->hide<!-- ENDIF -->" data-hidden="{S_TOPFIVE_HIDDEN}" data-ajax="phpbb_collapse" data-overlay="true" title="{L_COLLAPSIBLE_CATEGORIES_TITLE}" style="display: none; line-height: 0;"></a>
                    <!-- ENDIF -->
                </li>
            </ul>
            <ul class="topiclist forums">
                <li class="row">
                    <dl>
                        <dt>
					<div class="inner">
						<ul>
			       	<li class="row">
                      	{{ THANKS_LIST }}
                    </li>
						</ul>
					</div>
				</dt>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
and it looks like this https://prnt.sc/qjp2lk
and i've used the same thing to posts and it looks like this https://prnt.sc/qjp33o
what should i change to first one in order to look like posts' one? one under another.

I was searching in Thanks for post (viewtopic.php?t=2423931) but i couldn't found what do i have to edit.
and i'm not that experinced.
any help?

User avatar
warmweer
Jr. Extension Validator
Posts: 4008
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: arrange one under another

Post by warmweer »

This is a question better asked in the extension support topic.
To me it seems that the code you pasted doesn't show the list (THANKS_LIST) being made (I could be wrong) so I can't find out where to put a delimiter without looking for and at the extension.
We should embrace problems, without which there wouldn't be any solutions.

User avatar
mrgoldy
Registered User
Posts: 1310
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: arrange one under another

Post by mrgoldy »

warmweer is indeed correct, you will have to alter where the THANKS_LIST is generated in the PHP side of the extension.
That's the best solution to alter it. It is probably somewhere in the event folder of the extension.

Alternatively, you can try and use this:

Code: Select all

<li class="row">
    {{ THANKS_LIST|explode(lang('COMMA_SEPARATOR'))|join('<br>') }}
</li>
But if there are any comma's in the usernames, it will not work properly.
The above assumes that the extension's uses the $language->lang('COMMA_SEPARATOR'); as glue.
Otherwise you can just hard code the ,.

Nutu.
Registered User
Posts: 13
Joined: Tue Feb 20, 2018 8:27 pm

Re: arrange one under another

Post by Nutu. »

it crashes the forum
Last edited by Mick on Tue Jan 07, 2020 8:38 am, edited 1 time in total.
Reason: Removed unnecessary full quoting.

User avatar
mrgoldy
Registered User
Posts: 1310
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: arrange one under another

Post by mrgoldy »

Change explode to split.
So it would be:

Code: Select all

<li class="row">
    {{ THANKS_LIST|split(lang('COMMA_SEPARATOR'))|join('<br>') }}
</li>
Next time, please try to provide atleast the slightest of information on errors...

Nutu.
Registered User
Posts: 13
Joined: Tue Feb 20, 2018 8:27 pm

Re: arrange one under another

Post by Nutu. »

now it works, thanks!
do you have any idea where can i change the design? like I want if possible to be
Username
Thanks: X

i've searched in thanks for post ext style but didnt found anything

User avatar
warmweer
Jr. Extension Validator
Posts: 4008
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: arrange one under another

Post by warmweer »

Nutu. wrote:
Mon Jan 06, 2020 2:10 pm
now it works, thanks!
do you have any idea where can i change the design? like I want if possible to be
Username
Thanks: X

i've searched in thanks for post ext style but didnt found anything
If what you are getting now =
Username
Posts: X

then it's probably just a matter of replacing Posts by Thanks (either in the language files: although that might influence other pages also) (or in the php file generating the output).

Post the section in the php part which generates the output list (the THANKS_LIST) and the html part so that we can evaluate what would be the most simple way.
We should embrace problems, without which there wouldn't be any solutions.

User avatar
mrgoldy
Registered User
Posts: 1310
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: arrange one under another

Post by mrgoldy »

I think your best bet is to just start editing the place where the list is generated, rather than manipulating it in the template.

Revert the above changes I provided and do the following:
Open ThanksForPosts/core/helper.php
Find (line 766):

Code: Select all

$thanks_list .= (($thanks_list != '') ? ', ' : '') . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) . ' (' . $row['tally'] . ')';
And replace that line with:

Code: Select all

$thanks_list .= $thanks_list !== '' ? '<br>' : '';
$thanks_list .= get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
$thanks_list .= '<br>';
$thanks_list .= $this->user->lang('THANK_POST_SHORT') . $this->user->lang('COLON') . ' (' . $row['tally'] . ')';

Nutu.
Registered User
Posts: 13
Joined: Tue Feb 20, 2018 8:27 pm

Re: arrange one under another

Post by Nutu. »

it works!! thank you!! :)
Last edited by Mick on Tue Jan 07, 2020 8:37 am, edited 1 time in total.
Reason: Removed unnecessary full quoting.

Post Reply

Return to “phpBB Custom Coding”