I allow members to enter their web address, facebook address, etc. for their member profiles as well as in directory listing entries. I instruct them to always include "http://" at the beginning of the URL but of course they don't always listen. So in many cases I'm getting URL formatted with no "http://" or "https://" which create bad links.
Is there a way I can essentially do a find a replace for NOT found? So if the URL string does not contain "http://" or "https://" then I can add it back in so the link isn't broken?
I use CE String plugin for other things and I have been trying to work out a way to use it for this purpose but haven't had any luck yet.
Here's the related part of my template:
{if website}<li class="web"><a href="{website}">{exp:low_replace multiple="yes" find="http://|https://"}{website}{/exp:low_replace}</a></li>{/if}
{if facebook}<li class="facebook"><a href="{facebook}">{exp:low_replace multiple="yes" find="http://|https://"}{facebook}{/exp:low_replace}</a></li>{/if}
I need to enter some logic at the beginning of each link's href to add in the "http://" if the member has not included it in their URL string. Would appreciate any help on how to achieve this.