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

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 05:08:46 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,105
  • Total Topics: 21,213
  • Online today: 310
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 289
  • Total: 290
  • lurkalot

Modifying User Block

Started by VladTepes, March 31, 2017, 02:43:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

VladTepes

By default the user block appears to show:

QuoteAvatar
username
PM: 0

Show unread
Show replies
Show own posts
Show latest comments

Total Logged In:
0d 1h 45m
Friday, 31 March 2017, 11:36 am

I would like to edit the info that is displayed here to:
- remove show latest comments
- remove the last bit with total logged in time etc

- add a link to the users gallery.

Can you point me to where I'd make these changes please?

Also an example of the URL for a user gallery is:
h ttp://gsx1400owners.org/forum/index.php?action=gallery;su=user;u=12

As you can see there is a number (the user number).  If including in code how would I tell it to link to the gallery page of the currently  logged in user?

Thank you.

illori

look for // Tportal userbox
function TPortal_userbox()
in TPsubs.template.php and edit as you see fit.

VladTepes

Thank you.

Do you know this bit?
Quotelso an example of the URL for a user gallery is:
h ttp://gsx1400owners.org/forum/index.php?action=gallery;su=user;u=12

As you can see there is a number (the user number).  If including in code how would I tell it to link to the gallery page of the currently  logged in user?

Presumably there's a function to call a variable which is equal to the number of the logged in user?

lurkalot

That block has its own options to remove the time date etc.  Just not the latest comments.  If you click the edit button for that block you'll see the ones you can turn off.

The gallery link stuff is way over my head though I'm afraid.

illori

same idea as done here

<li><a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';area=showposts">'.$bullet.$txt['tp-showownposts'].'</a></li>

$context['user']['id'] is the part that brings in the users id.

VladTepes

Thanks lurkalot I'll check that out.

Quote from: illori on April 01, 2017, 11:05:33 AM
same idea as done here

<li><a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';area=showposts">'.$bullet.$txt['tp-showownposts'].'</a></li>

$context['user']['id'] is the part that brings in the users id.

So how would I incorporate that into the existing code?

h ttp://gsx1400owners.org/forum/index.php?action=gallery;su=user;u=12

Obviously where its says u=12 this needs to be replaced with u=variable,
where variable presumably the 'id' referred to in your code?

Sorry but coding is not my forte (far from it).

Thanks

illori

<li><a href="', $scripturl, '?action=profile?action=gallery;u='.$context['user']['id']">'.$bullet.Gallery.'</a></li>

i have not tested it but basically that should work for what you want.

VladTepes

Thanks I'll give that a crack.