Support Forums

Mod - Block entry of link

This is a discussion on Mod - Block entry of link within the Modules / Plugins / Modifications forums, part of the Developer Forums category; This small Mod will allow you to prevent the entry of links in the description of an ad. You can ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 01-08-2009, 04:15 PM   #1
Customer
 
hel68c's Avatar
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 289
Rep Power: 22
hel68c is just really nice hel68c is just really nice
Default Mod - Block entry of link

This small Mod will allow you to prevent the entry of links in the description of an ad. You can use it in other fields as needed.

add this code in layout.tpl between <head> </head>

Quote:
<script type="text/javaScript">

{literal}
<!--
function verif(){
var regUrl=/^.*((http|ftp|https):\/\/)?[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^.*=%&:/~\+#]*[\w\-\@?^.*=%&/~\+#])?.*$/m
var ok=document.getElementById('description').value.ma tch(regUrl)?false:true;
if(ok == false)
{
alert("Tss Tss, no URL");
}
}
//-->
{/literal}
</script>
insert verif() in checkout\step3.tpl and user\usermodifylisting.tpl

Quote:
<td><textarea name="description" id="description" style="width:250px; border:1px #000066 solid;" rows="4" onblur="textCounter(this.form.description,this.for m.remLentext,{$cCharacters}),verif();" onKeyUp="textCounter(this.form.description,this.fo rm.remLentext,{$cCharacters});">{$description}</textarea><br /><span class="characters">{$smarty.const.LANG_CHARACTERS_ REMAINING}: <span id="cCharLeft">0</span>/{$cCharacters}</span></td>

If you let the entry of a link in some package, be sure to check the conditions.
__________________
Serge
HobbyClassified.com
V4.08 Developper, Module installed (CIV Scam Filter, Maffo Location System, Maffo News,Youtube, Seller Store)
hel68c is offline   Reply With Quote
Old 01-08-2009, 04:20 PM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Just an FYI. javascript is client side so if someone is clever enough or perhaps has javascript disabled this might not work.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 01-08-2009, 04:37 PM   #3
Customer
 
hel68c's Avatar
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 289
Rep Power: 22
hel68c is just really nice hel68c is just really nice
Default

I will try to find a way in PHP.

If you have some knowledge of PHP, you are welcome.
__________________
Serge
HobbyClassified.com
V4.08 Developper, Module installed (CIV Scam Filter, Maffo Location System, Maffo News,Youtube, Seller Store)
hel68c is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to block url link in ads hel68c Technical Support 15 01-08-2009 01:15 PM
Change Home Page Welcome Block outlook Technical Support 1 06-11-2008 07:32 PM


All times are GMT -4. The time now is 03:08 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0