MyBB Community Forums

Full Version: How can i make {post['fidX']} a URL?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Pain in the butt i know...

My end result that is desired for inside postbit is:

Quote:Owns: "Insert {$post['fid3']} which is the text that links to that user's Showcase entry"

e.g.

Owns: Model 3

myshowcase_user_link template

<a href="{$showcase_file}?action=list&amp;search=username&amp;searchterm={$post['username']}&amp;exactuser=1">{$showcase_user_link_text} {$user_num_myshowcases}</a><br />

inc/plugins/myshowcase.php

$post['user_details'] .= '<br />'.$showcase_name.':  <a href="'.$showcase_fldr.$showcase_file.'?

search=username&searchterm='.rawurlencode($post['username']).'&exactmatch=1">'.$post['fid3'].'</a>';

Current set up (with your last suggestion) leaves me with

Quote:Garage: "Blank here"
Is the user's fid3 populated? I just did the change on my site to test using fid1 (location) and it worked fine. it was showing "Garage: Modesto, CA" with the link the same.

No changes to templates or other code required. But it is dependend on the fid3 (or whatever custom field you are using, being populated).

You could always modify the code a bit more to test for fid3 being empty and use the default code then

			if($post['fid3') != '')
			{	
				$post['user_details'] .= '<br />'.$showcase_name.':  <a href="'.$showcase_fldr.$showcase_file.'?search=username&searchterm='.rawurlencode($post['username']).'&exactmatch=1">'.$post['fid3'].'</a>';
			}
			else
			{
				$post['user_details'] .= '<br />'.$showcase_name.':  <a href="'.$showcase_fldr.$showcase_file.'?search=username&searchterm='.rawurlencode($post['username']).'&exactmatch=1">'.$data['uids'][$post['uid']].'</a>';
			}
It is a bit odd, my profile for example, Garage & fid3 are populated: http://www.berlingoforum.co.uk/showthread.php?tid=650
make sure you made the proper change, if you like I can access your FTP again and verify the code
Appreciate your help.
that looks fine. I am wondering if you change it to the fid for the location, does that work? Perhaps there is another plugin or something altering that fid3 value.
You are right, changing the fid to location does allow it to work correctly, checked any changes i had made to that sort of area...odd.
are you sure "3" is the correct ID for your custom field? can you verify in the ACP
EDIT: Solved. I'm not sure what i did precisely, but fiddling with the author_user postbit seemed to fix it.

Thanks a bunch again.
glad you got it working. However, I would suggest that you makethe second modification I mentioned if you have not already. that will at least deal with empty links.
Pages: 1 2 3