Jump to content

Phpbb, anyone? Profile help needed!


Recommended Posts

Hello, lovelies!

 

I need some help getting my new phpbb board off the ground, customizing just the mini-profiles section. What I am trying to do is have two sets of avatars:

 

120 x 120 on the member list and as the last post icon.

450 x 250 on the member profile, not visible anywhere else. 

 

http://blacksunrising.org/forum

 

Has anyone out there done this kind of work on a forum before? 

 

Mandie

 

BemXdb.gif.201ed108748c74682ea6af13aa3d30ac.gif

Link to comment
Share on other sites

@HelloMandie

 

I might be able to help you with this! I dabble a lot on phpBB lately. To clarify, do you want the avatar on the member list page (which has a list of all members) and then the actual member profile, but then have the avatar hidden from the topic view?

 

Also, with the two different avatar sizes you're specifying, are you okay with adjusting the sizes via CSS or do you actually want people to upload a smaller and then larger avatar?

Edited by memoria

banner-01-88x31.jpg
Khyeras: an original fantasy RPG.

 

"I keep wanting to write 'dwarves' as 'drawers'."

"Land of the Drawers... we call it... Ikea."

Link to comment
Share on other sites

That's where I get stuck! All the phpbb forums I go to say that there is no more custom styling on CSS or modules, and everything is done via extensions.  Yet, in order to get the style of profile I want, I have to custom code. 

 

What I am trying to do is emulate my current profile style on my old ProBoards forum508083001_ScreenShot2018-07-24at1_40_58PM.thumb.png.344225fece559f4949ebad382bd4039c.png  

The image on the right side is the 250 x 450 avatar. This is the view you get when you visit their member profile.

 

And this is what you get when you read a thread:

1280642710_ScreenShot2018-07-24at1_44_54PM.thumb.png.826bf3d7489a3637da6bd0e4a1b36f69.png

 

I don't need rollover effects, or anything particularly fancy.  I just want to make sure that when someone visits the site they only see their 120 x 120 avatar icon on the member list and as the last poster versus this huge image. 

 

BemXdb.gif.201ed108748c74682ea6af13aa3d30ac.gif

Link to comment
Share on other sites

Quote

That's where I get stuck! All the phpbb forums I go to say that there is no more custom styling on CSS or modules, and everything is done via extensions.  Yet, in order to get the style of profile I want, I have to custom code. 

 

There are indeed no more modules as of 3.1, but creating a child theme is still a thing you can do. When it comes to questions about code placement or tweaking theme template files, support can be hard to find. My thoughts are that if it can be altered using what is provided by phpBB's theme templates, then use a theme rather than an extension. I believe the main reason people tell you to use extensions these days is because they essentially make upgrading easier. With extensions, you can use the event hooks located in themes, thereby never touching your theme. The issue I have with this is that event hooks are usually before and after things and sometimes I just want to edit HTML directly.

 

Phew, sorry, I went off on a slight tangent there. Anyway, for your actual question, see below.

 

Step 1

 

Assuming I read correctly, the main avatar you want people to see is the 120x120 size. Go into ACP > General > Avatar Settings and set the "Maximum avatar dimensions" to 120x120. If people have already added avatars, this won't effect current avatars. Only those added after this rule.

 

Step 2

 

For the secondary 250x450 avatar, you'll want to make a custom profile field under ACP > Users and Groups > Custom profile fields. If you have not used these yet, check out this article. phpBB comes with a "URL" type custom profile field, but you might want to download and install Advanced Profile Fields Pack extension which adds an "Image Upload" type that you can specify (like avatars) min and max image dimensions.

 

When creating this new image field, make sure you check the following options:

  • Publicly display profile field: Yes
  • Display in user control panel: Yes 

There are other places you may want to enable this, but that's the minimum.

 

Step 3

 

To add the new image to the member's profile, you'll need to edit your theme files through FTP, cPanel, or something like that. Look for styles/themename/template/memberlist_view.html. If this file is not in your theme, copy the same file from prosilver and add it to your theme in the template directory. Look for the code that surrounds AVATAR_IMG. In prosilver, it looks like this:

<!-- IF AVATAR_IMG -->
<dl class="left-box">
  <dt class="profile-avatar">{AVATAR_IMG}</dt>
  <!-- EVENT memberlist_view_rank_avatar_before -->
  <!-- IF RANK_TITLE --><dd style="text-align: center;">{RANK_TITLE}</dd><!-- ENDIF -->
  <!-- IF RANK_IMG --><dd style="text-align: center;">{RANK_IMG}</dd><!-- ENDIF -->
  <!-- EVENT memberlist_view_rank_avatar_after -->
</dl>
<!-- ENDIF -->

 

To add the new image, you should be able to use the following code in this file:

<!-- IF S_PROFILE_MYFIELD -->
	{PROFILE_MYFIELD_NAME}<br />
	{PROFILE_MYFIELD_VALUE}
<!-- ELSE -->
	add default image here
<!-- ENDIF -->

 

Replace MYFIELD with the name of the field you created (in all caps). You can find the field name under the "Field identification" column in "Custom profile fields". The "if" conditional should always have S_PROFILE_ whereas the actual display name and value should be prefixed with PROFILE_, so keep that as is.

 

Step 4

 

I don't think you want to display this avatar on topics, but just in case, the process is similar. When creating the custom field, make sure "Display on viewtopic screen" is set to "Yes". Then find the file viewtopic_body.html the same way you did for memberlist_view.html. The avatar code is a little bit different on this file and looks like this:

 

<!-- IF postrow.POSTER_AVATAR -->
	<!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}" class="avatar">{postrow.POSTER_AVATAR}</a><!-- ELSE --><span class="avatar">{postrow.POSTER_AVATAR}</span><!-- ENDIF -->
<!-- ENDIF -->

 

To add the new image here, it's like the member profile, only you will need to add postrow. before the field, so:

<!-- IF postrow.S_PROFILE_MYFIELD -->
	{postrow.PROFILE_MYFIELD_NAME}<br />
	{postrow.PROFILE_MYFIELD_VALUE}
<!-- ELSE -->
	add default image here
<!-- ENDIF -->

 

Step 5

 

If you are not seeing your changes to the templates, go to ACP > General > and click the button for "Purge the cache".

 

Hope that helps!

  • Love 1

banner-01-88x31.jpg
Khyeras: an original fantasy RPG.

 

"I keep wanting to write 'dwarves' as 'drawers'."

"Land of the Drawers... we call it... Ikea."

Link to comment
Share on other sites

Thank you so much! This was immensely helpful! 

 

❤️❤️❤️

 

 

BemXdb.gif.201ed108748c74682ea6af13aa3d30ac.gif

Link to comment
Share on other sites

You're welcome! I hope it works out! Custom profile fields can be pretty fun once you get to understand how to use them.

  • I read this! 1

banner-01-88x31.jpg
Khyeras: an original fantasy RPG.

 

"I keep wanting to write 'dwarves' as 'drawers'."

"Land of the Drawers... we call it... Ikea."

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.