1 (edited by antonio 2012-07-05 17:49)

Topic: Adding a specific link into each user's post

Hey guys,

I use this extension as my image gallery, version 1.2 I suppose... each link to user's gallery consist of "my_website/uploadimg_view.php?view=gallery&id=NUMBER" where the "number" is same as profil number of the user (my_website/profile.php?id=NUMBER).

So I need help with adding such link into each user's post, just below e-mail or website link. But how to do it?

Many thanks

Re: Adding a specific link into each user's post

You can write an extension to do this pretty easily, do you know php?

3 (edited by antonio 2011-06-23 18:05)

Re: Adding a specific link into each user's post

I reckon it would be pretty easy, however not for me. Only thing I am able to do is put the resulting code on the right place, that's why I ask.

Edit: Should I rather hang it on punres?

Re: Adding a specific link into each user's post

No one? This is part of code of viewtopic.php where I need to put it. Ideally invisible for guests.

<dt><strong><?php echo $username ?></strong></dt>
<dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>
<dd class="postavatar"><?php echo $user_avatar ?></dd>

<?php if (count($user_info)) echo "\t\t\t\t\t".implode('</dd>'."\n\t\t\t\t\t", $user_info).'</dd>'."\n"; ?>
<?php if (count($user_contacts)) echo "\t\t\t\t\t".'<dd class="usercontacts">'.implode('&nbsp;&nbsp;', $user_contacts).'</dd>'."\n"; ?>

5 (edited by Koos 2011-07-05 07:53)

Re: Adding a specific link into each user's post

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']);

Re: Adding a specific link into each user's post

Many many thanks Koos, works excellent. wink