Log in

View Full Version : How to make ''Location' in postbit a link depending on text?


MikesSite
05-22-2009, 02:28 PM
Basically I would like to make the 'Location' in postbit (where it says Join Date, Location, and Posts) to be a link depending on what it says. For example if the location reads "UK" then I would like 'UK' to be a link to a page that I will create called UK.php. If it says US, I would want it to link to the US subpage called US.php. Do you know what I mean?? Can this be done with simple if statements?? Thanks for the help!!

Lynne
05-22-2009, 03:09 PM
This is how it is currently in the postbit:
<if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>

You could change it to something like this:
<if condition="$post['field2']"><div>$vbphrase[location_perm]: <a href="$post[field2].php">$post[field2]</a></div></if>

However, what if the user writes "U.K."? Then the page isn't valid - U.K..php instead of UK.php. So, you would almost have to remove this field and make your own with a dropdown and then you would have control over what is input and thus all your pages would work.