Hi antonio, this should do the trick:
#
#---------[ 1. OPEN ]---------------------------------------------------------
#
viewtopic.php
#
#---------[ 2. FIND (line: 244) ]---------------------------------------------
#
if ($cur_post['url'] != '')
$user_contacts[] = '<a href="'.pun_htmlspecialchars($cur_post['url']).'">'.$lang_topic['Website'].'</a>';
#
#---------[ 3. AFTER, ADD ]---------------------------------------------------
#
if (!$pun_user['is_guest'])
$user_contacts[] = '<a href="uploadimg_view.php?view=gallery&id='.$cur_post['poster_id'].'">'.'Gallery'.'</a>';
This will show a Gallery link for each user in viewtopic, but will not be visible for guests.
You will also have to edit uploadimg_view.php to allow all users to view each other's galleries. You can do this by deleting or commenting out the following two lines:
if (!in_array($pun_user['g_title'], $Allow_Stats))
message($lang_common['No permission']);