News: When asking for support, it helps us and you, if you read the Posting Guidelines

Login  |  Register
* * *

Welcome !!!

Welcome, Guest. Please login or register.
Did you miss your activation email?
Please welcome Beowulf1976, our newest member.

 
 

TinyPortal on Twitter
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2017, 11:45:49 AM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 181004
  • Total Topics: 20308
  • Online Today: 61
  • Online Ever: 383
  • (January 02, 2015, 05:58:49 AM)
Users Online
Users: 3
Guests: 41
Total: 44

Please read the Posting Guidelines


Author Topic: Modifying User Block  (Read 1025 times)

0 Members and 1 Guest are viewing this topic.

Offline VladTepes

  • Jr. Member
  • **
  • Posts: 45
Modifying User Block
« on: March 30, 2017, 07:43:10 PM »
By default the user block appears to show:

Quote
Avatar
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.

Online illori

  • Administrator
  • *
  • Posts: 1712
Re: Modifying User Block
« Reply #1 on: March 31, 2017, 03:24:05 AM »
look for
Code: [Select]
// Tportal userbox
function TPortal_userbox()
in TPsubs.template.php and edit as you see fit.

Offline VladTepes

  • Jr. Member
  • **
  • Posts: 45
Re: Modifying User Block
« Reply #2 on: March 31, 2017, 04:41:13 AM »
Thank you.

Do you know this bit?
Quote
lso 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?

Online lurkalot

  • Administrator
  • *
  • Posts: 3480
    • Camera Craniums
Re: Modifying User Block
« Reply #3 on: March 31, 2017, 10:46:26 AM »
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.
Mick aka lurkalot.  Running TP1.2 and TP1.2R

Camera Craniums Running SMF 2.0.13 / Tinyportal 1.2
Guitarist Guild Running SMF 2.0.13 / Tinyportal 1.2R Beta
The Garden Machinery Forum Running SMF 2.0.13 / Tinyportal 1.2R Beta

Online illori

  • Administrator
  • *
  • Posts: 1712
Re: Modifying User Block
« Reply #4 on: April 01, 2017, 04:05:33 AM »
same idea as done here

Code: [Select]
<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.

Offline VladTepes

  • Jr. Member
  • **
  • Posts: 45
Re: Modifying User Block
« Reply #5 on: April 02, 2017, 07:30:26 PM »
Thanks lurkalot I'll check that out.

same idea as done here

Code: [Select]
<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?
Code: [Select]
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

Online illori

  • Administrator
  • *
  • Posts: 1712
Re: Modifying User Block
« Reply #6 on: April 03, 2017, 03:26:11 AM »
Code: [Select]
<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.

Offline VladTepes

  • Jr. Member
  • **
  • Posts: 45
Re: Modifying User Block
« Reply #7 on: April 03, 2017, 05:53:16 AM »
Thanks I'll give that a crack.