April 24th, 2007Phpld deeplinks mod - Validate URLs
Install the phpld deeplinks mod before applying the modification below.
To validate the additional deeplinks you will have to add the following:
First in submit.php
AFTER:
SmartyValidate :: register_validator('v_URL',
'URL','isURL', false, false, 'trim', 'submit_link');
ADD:
SmartyValidate :: register_validator('v_URL1',
'URL1','isURL',true,false,'trim','submit_link');
SmartyValidate :: register_validator('v_URL1_ONLINE',
'URL1','isURLOnline',true,false,null,'submit_link');
FINALLY in submit.tpl
AFTER:
<input type="text" name="URL1"
value="{$URL1|escape|trim}" size="40"
maxlength="255" class="text"/>
ADD:
{validate form="submit_link" id="v_URL1"
message=$smarty.capture.invalid_url}
{validate form="submit_link" id="v_URL1_ONLINE"
message=$smarty.capture.url_not_online}
This will allow to validate the URL1 field when it is not empty. You should do the same for all URLs that you want to validate (straightforward).
11 Responses to “Phpld deeplinks mod - Validate URLs”
Leave a Reply
You must be logged in to post a comment.

June 30th, 2007 at 8:54 pm
Hey,
I added this to my directory, and it doesn’t work. I double checked the installation process too.
Is there a typical mistake that everyone makes?
June 30th, 2007 at 9:43 pm
could you post a part of the code of submit.tpl where you put this?
July 2nd, 2007 at 2:11 pm
not working in mine either:
July 2nd, 2007 at 2:12 pm
oh God, comment can read html code, how do i publish my code out?
July 2nd, 2007 at 4:39 pm
code should be placed between < code> and without spaces.
Make sure you edited submit.php accordingly.
July 5th, 2007 at 4:09 pm
Here is a part of it:
September 6th, 2007 at 4:12 pm
Hi there,
First, please remove the comment before me, damn spammers.
Second, I have a problem with the deep links mod, and I bet everyone has.
If you install hide fields (and probably even if you don’t), the submitter can fill the deep links fields and they are valid and work.
September 6th, 2007 at 5:58 pm
Thanks shutz, I just deleted 366 comments like that one…
Do you mean that if the submitter fills the deep links fields then hide them they still show?
In that case, the javascript code should be changed a little bit so to reset the value of the fields everytime a radio button is selected. You can define a function SetValue similar to SetVisibility that retrieves the element by its id and set its value to ”.
September 8th, 2007 at 7:54 am
yes this is what I mean. can you please show the exact javascript I need? don’t really get what you’re saying.
November 11th, 2007 at 2:30 pm
does it checks for redirection of the links from given sites.
i mean say http://www.xyz.com is submitted.. will this checks for if it redirects to some http://www.prq.com
this is only to avoid the redirected site submission
November 11th, 2007 at 3:03 pm
No it doesn’t do that, this not implemented even for the main url in the original code. The editor should check this when reviewing the submission.