Previous Thread
Next Thread
Print Thread
Rate Thread
#269654 02/21/2004 11:05 AM
Joined: Aug 2002
Posts: 51
Power User
Power User
Offline
Joined: Aug 2002
Posts: 51
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

Sponsored Links
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
Just from the top of the head:

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

Joined: Aug 2002
Posts: 51
Power User
Power User
Offline
Joined: Aug 2002
Posts: 51
could you be a little more specific about what im supposd to do?

Joined: Aug 2002
Posts: 51
Power User
Power User
Offline
Joined: Aug 2002
Posts: 51
do i need to explain this better before the "php gurus" will help me??

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)