UBB.Dev
Posted By: webwolfe_dup1 modifying showprofile.php - 02/21/2004 6:05 PM
I have a forum called "have lists" where my members can post a list of all the items they "have" to trade or sell.

I configured the 'extra2' field as Have lists and members enter the post# of their have list within the "have lists
" forum in this field.

I am trying to modify showprofile.php so that when you view a members profile it will provide a link straight to their post in the "have lists" forum. I modified showprofile.php like this:

if ($config['extra2']) {
$extra2 = "
</td></tr><tr><td valign="top" class="darktable">
{$config['extra2']}
</td><td colspan="2"><a href="http://www.pokemon-trading-cards.net/forums/showflat.php?Cat=&Number=$Extra2">Click to View Have List
";
}


the only trouble I am having is that if a member has not added anything into the extra2 field in their profile it still creates the link but doesnt work as the post# isnt added to the end of the url.

I would like to know how to modify the code so that if the extra2 field is empty it wont put anything there.

an example profile with the extra2 field populated is here

an example of a profile without the extra2 field populated here

hope this makes sense. any and all help would be greatly appreciated
Posted By: Anno Re: modifying showprofile.php - 02/22/2004 4:27 AM
Just from the top of the head:

if ( $config['extra2'] && $config['extra2'] != '' )
Posted By: webwolfe_dup1 Re: modifying showprofile.php - 03/01/2004 5:36 AM
could you be a little more specific about what im supposd to do?
Posted By: webwolfe_dup1 Re: modifying showprofile.php - 03/03/2004 4:15 AM
do i need to explain this better before the "php gurus" will help me??
Posted By: JoshPet Re: modifying showprofile.php - 03/03/2004 7:36 AM
I think Anno's advice will work -

I don't totally understand your problem

are you wanting to not make the link if $config['extra2'] isn't set or if $Extra2 isn't set???


If the variable you're using is $Extra2 - then adding changing that first "if" line to this

if (($config['extra2']) && ($Extra2) && ($Extra2 != '')) {


Should cover all the bases.
© UBB.Developers