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
Too many questions today, after a quick search to no avail.

How can i URL link

{$post['fid3']}

so clicking it acts as a URL.

Further, is it possible to condition this to be only a URL if the field actually exists, or will it treat it that way anyway.

I know that this won't work:

<a href="http://www....">{$post['fid3']}</a>
you need a plugin if you want the "only if populated" functionality., either one to do specifically what you need, or the template conditionals (or php in templates) plugin.
May be this:
<a href="{$post['fid3']}">{$post['fid3']}</a>
I want/need to URL entries into pavemen's MyShowcase system, with whatever a user has entered into fid3 on sign up.

I.e If FID3= Vehicle 1

then this becomes URL test for a URL that links to their Garage entry.

I have got most of it working, its just how to URL {post['fid']}
Bumping this for further ideas please.
MyShowcase already has the ability to link to a users entries in each and every Showcase you build. Check out http://www.pavementsucks.com/board/threa...pid1655196 for an example of links to a users "Garage" and "Dock" (truck and boat)

edit: in the postbit under the user details
I was aware of that, but where you plugin allows for say:

Garage:2

I wanted to replace this number 2, with whatever the users entered into {post['fid3']}.

Something like...

<a href="http://www.berlingoforum.co.uk/garage.php?action=list&amp;search=username&amp;searchterm={$post['username']}&amp;exactuser=1">{post['fid3']}</a><br />
Its easy. Edit /inc/plugins/myshowcase.php and find the function

function myshowcase_postbit($post)

and scroll down to the line

				$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>';

and change it to
				$post['user_details'] .= '<br />'.$showcase_name.':  <a href="'.$showcase_fldr.$showcase_file.'?search=username&searchterm='.rawurlencode($post['username']).'&exactmatch=1">'.$post['fid3'].'</a>';

This will only work if you have one showcase setup, otherwise a second showcase will use the same content for the link. In your case, this does not matter as you only have the one garage
Try this:

<a href="{$post['fid3']}#">{$post['fid3']}</a>

The # should make the code legit but if fid3 doesn't exist it will display nothing. At least that's in theory. Test please.
Pages: 1 2 3