Member Item links

Hello all,

I am having some custom links in the header, but when I put links like:




<a href="{memberLink}|{memberNick}|profile.php?">View My Profile</a>

<a href="viewFriends.php?iUser={profileID}">My Friends</a>

<a href="browsePhoto.php?userID={memberID}">My Photos</a>

etc....

I assume maybe that a simple a href isnt enough to do this since when I do it that way the links show up as is, and not replacing the {memberID} with the actually member ID. So what would I need to do to make these work?

I am no programmer, so any help would be greatly appreciated.

Thanks.

Cory

Quote · 13 Sep 2009

You can't add links with php var to _header.html file, it will not read your var

You can add code to templates/tmpl_uni/scripts/functions.php

find function HelloMemberSection()

and you will have here if( $logged['member'] ) to members with this code

<div class="hello_actions">
<span><a href="<?= $site['url'] ?>member.php"><?= _t('_My account') ?></a></span>
<span><a href="<?= $site['url'] ?>mail.php?mode=inbox"><?= _t('_My Mail') ?></a><?=' '.$sNewLet;?></span>
<span><a href="<? echo getProfileLink( $memberID ) ?>"><?= _t('_My Profile') ?></a></span>
<span><a href="javascript:void(0);"
onclick="window.open( '<?= $site['url'] ?>presence_pop.php' , 'Presence', 'width=260,height=600,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=1');"
><?= _t('_RayPresence') ?></a></span>
<span><a href="<?= $site['url'] ?>logout.php?action=member_logout"><?= _t('_Log Out2') ?></a></span></div>

If we add My Friends, My Photos and Invite a friend (View My Profile have you here already)

New code will be (green is added)

<div class="hello_actions">
<span><a href="<?= $site['url'] ?>member.php"><?= _t('_My account') ?></a></span>
<span><a href="<?= $site['url'] ?>mail.php?mode=inbox"><?= _t('_My Mail') ?></a><?=' '.$sNewLet;?></span>
<span><a href="<? echo getProfileLink( $memberID ) ?>"><?= _t('_My Profile') ?></a></span>
<span><a href="javascript:void(0);"
onclick="window.open( '<?= $site['url'] ?>presence_pop.php' , 'Presence', 'width=260,height=600,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=1');"
><?= _t('_RayPresence') ?></a></span>
<span><a href="<?= $site['url'] ?>logout.php?action=member_logout"><?= _t('_Log Out2') ?></a></span>

<!-- added by okweb start -->
<div style="padding-left: 50px">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<img border="0" height="16" width="16" alt="<?= _t( '_Friends') ?>" src="<?= "{$site['url']}templates/tmpl_$tmpl/images/icons/action_friends.gif" ?>">&nbsp;<a href="<?= $site['url'] ?>viewFriends.php?iUser=<? echo $memberID ?>"><?= _t('_Friends') ?></a>
&nbsp;&nbsp;&nbsp;
<img border="0" height="16" width="16" src="<?= "{$site['url']}templates/tmpl_$tmpl/images/icons/pph.gif" ?>">&nbsp;<a href="<?= $site['url'] ?>browsePhoto.php?userID=<? echo $memberID ?>"><?= _t('_My Photos') ?></a>
&nbsp;&nbsp;&nbsp;
<img border="0" height="16" width="16" src="<?= "{$site['url']}templates/tmpl_$tmpl/images/icons/frs.gif" ?>">&nbsp;
<a onclick="return launchTellFriend();" href="/tellfriend.php"><?= _t('_Invite a friend') ?></a>
</td>
</tr>
</table>
</div>
<!-- added by okweb end -->

</div>

guess you will have something to work further with now...

Quote · 13 Sep 2009

Thanks. That does help. I actually decided to go with a custom menu with drop downs, not tied into the Dolphin Menu Builder. Reason for this was that I wanted some custom images and functions in the menu dropdowns. So this menu, as well as the guest menu, is coded in functions.php using your member_guest code (great help there by the way).

So this does give me somewhere to start to put those items in my menu.

thanks again for all your help. Do you do custom mods? I have a few things I will be needing.

Cory

Quote · 13 Sep 2009

Correction: menu is in design.inc.php not functions.php.

Quote · 13 Sep 2009

Ok, I am seeing that using php stuff within the

if( $logged['member'] )
{
$ret .= ''

doesn't work

How would I get PHP to work within that code to show up?

Thanks.


Cory

Quote · 13 Sep 2009

Hi

code in my example will add links inside members blocks on header,

and yes menu is in design.inc.php not functions.php

if you will have links at the top were the other links are, you need to code it another way...

and not inside the menu function since you shall have php var here.

I will come back sooner and tell how you can do it...

I assum it shall be visible to members only!!

Ottar

have you tried with getNickName( $memberID )

( <? echo $memberID ?> or $memberID it depend how you add it...and what code you use)

Quote · 13 Sep 2009

Yeah, I tried various things, but any <? or <php tags inside of the:

if( $logged['member'] )
{
$ret .= 'Content Here'

gives me error:

Parse error: syntax error, unexpected T_STRING

Quote · 13 Sep 2009

Yeah, I tried various things, but any <? or <php tags inside of the:

if( $logged['member'] )
{
$ret .= 'Content Here'

gives me error:

Parse error: syntax error, unexpected T_STRING

I will assume so, here is some examples how you can use php var inside $ret .= ''

can be a bit tricky

function getMemberGuest()
{
global $logged;
global $site;

// View my profile Link 3
$memberNick = getNickName( $ID );

$ret = '';

if( $logged['member'] )
{
$ret .= '<a href="' . $site['url'] . 'viewFriends.php?iUser=' . $logged['member'] . '">My Friends</a><br>';
$ret .= '<a href="' . $site['url'] . 'browsePhoto.php?userID=' . $logged['member'] . '">My Photos</a><br>';

// View my profile Link 1
$ret .= '<a href="' . $site['url'] . '' . getNickName( $ID ) . '">View My Profile</a><br>';

// View my profile Link 2
$ret .= '<a href="' . $site['url'] . '' . getNickName( $ID ) . '">' . getNickName( $ID ) . '</a><br>';

// View my profile Link 3
$ret .= '<a href="' . $site['url'] . '' . $memberNick . '">' . $memberNick . '</a><br>';
}
else
{
$ret .= '<b>Guest view</b>';
$ret .= '<br>';
$ret .= 'Add Guest code here...';
}
return $ret;
}

Quote · 13 Sep 2009

Yeah, I tried various things, but any <? or <php tags inside of the:

if( $logged['member'] )
{
$ret .= 'Content Here'

gives me error:

Parse error: syntax error, unexpected T_STRING

Your forgetting the ";"

after $ret .= 'Content Here'

Taking Dolphin and Making Profitable Websites Since 2009 :)
Quote · 5 Aug 2010

You also need to declare the $ret variable before extending it using $ret .=

And then obviously close your if statement.

This is shown in Okweb's example.

Taking Dolphin and Making Profitable Websites Since 2009 :)
Quote · 27 Aug 2010

Hi guys,

that post is really confusing to me. I guess i want to do the same thing :-D

When User1 is on his indexpage i want some simple nice buttons linked to:

#1 links to his Profile (www.randompage.com/user1)
#2 links to the Profile EDIT page (www.randompage.com/pedit.php?ID=2)

I guess i've to put PHP into the HTML Box  (Module: Advanced Add Block Feature 1.1.2)

Do you now what PHP Code exactly?

THX so much!

Quote · 15 Jan 2011

Still nothing?

Quote · 9 Feb 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.