Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Submit URL Restriction

  1. #1
    Member
    Join Date
    Jan 2011
    Posts
    31
    Thanks
    2
    Thanked 1 Time in 1 Post

    Exclamation Submit URL Restriction

    Hi...

    Im building squidoo directory and i would like to restrict submissions from NON-Squidoo pages...

    So basicly i would like users to only be able to submit their lenses, so url they are submitting must have ht*p://squidoo.com/their-lens

    Can anyone help me with this please?

    thanks

  2. #2
    Design & Development carlo75's Avatar
    Join Date
    Oct 2009
    Location
    Italy - Perugia
    Posts
    509
    Thanks
    62
    Thanked 105 Times in 58 Posts

    Default

    Hi drvosjeca,
    you can simply block URL from admin panel, section Blocked List, select domain and add all the domain that you want disable.

  3. #3
    Member
    Join Date
    Jan 2011
    Posts
    31
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default

    ufff.... you are killing me

    I wana disable all domains, only squidoo should be available to submit


    Any way to do this?

  4. #4
    Design & Development carlo75's Avatar
    Join Date
    Oct 2009
    Location
    Italy - Perugia
    Posts
    509
    Thanks
    62
    Thanked 105 Times in 58 Posts

    Default

    Sorry, I've read too quickly...

    So if you want to prevent all *.* site, except from SQUIDOO, I think you have to draft something in hotaru core, in submit.php or libs/SubmitFunctions.php inside Submit Plugin.
    I'll do some tries...
    Last edited by carlo75; 10-17-2011 at 11:30 AM.

  5. #5
    Senior Member
    Join Date
    Jun 2011
    Location
    Thailand
    Posts
    294
    Thanks
    0
    Thanked 69 Times in 63 Posts

    Default

    In plugins/submit/templates/submit1.php change the following line:

    PHP Code:
    <form name='submit_1' action='<?php echo BASEURL?>index.php?page=submit1' method='post'>
    to:

    PHP Code:
    <form name='submit_1' action='<?php echo BASEURL?>index.php?page=submit1' method='post' onsubmit='return checkurl()'>
    Add following lines to the end of submit1.php:
    PHP Code:
    <script type="text/javascript">
    function 
    checkurl() {
    var 
    url = $("#submit_orig_url").val();
    if ( 
    url.indexOf("squidoo.com") == -1){ 
    alert("You can only submit squidoo.com links. Please try again.");
    return 
    false;
    }
    else { return 
    true;}
    }
    </script> 
    User cannot proceed further until he submits a squidoo.com link.

  6. Thanked by:


  7. #6
    Design & Development carlo75's Avatar
    Join Date
    Oct 2009
    Location
    Italy - Perugia
    Posts
    509
    Thanks
    62
    Thanked 105 Times in 58 Posts

    Default

    Got it:
    you can reverse engine the Blocked List function, adding http://www.squidoo.com like a domain to block. Suddenly you need to edit SubmitFunctions at line ~695 with this:

    /**
    * Check if url or domain is on the blocked list
    *
    * @param string $url
    * @return bool - true if blocked
    */
    public function checkBlocked($h, $url)
    {
    // Is url blocked?
    if ($h->isBlocked('url', $url)) {
    return false;
    }

    // Is domain blocked?
    $domain = get_domain($url); // returns the domain including http
    if ($h->isBlocked('url', $domain)) {
    return false;
    }

    // Is domain extension blocked?
    $host = parse_url($url, PHP_URL_HOST); // returns www.google.com
    $ext = substr(strrchr($host, '.'), 1);
    if ($h->isBlocked('url', '.' . $ext)) { // dot added here
    return false;
    }

    return true; // not blocked
    }

    Not so much elegant but it'll works

  8. Thanked by:


  9. #7
    Design & Development carlo75's Avatar
    Join Date
    Oct 2009
    Location
    Italy - Perugia
    Posts
    509
    Thanks
    62
    Thanked 105 Times in 58 Posts

    Default

    Quote Originally Posted by PuckRobin View Post
    In plugins/submit/templates/submit1.php change the following line:

    PHP Code:
    <form name='submit_1' action='<?php echo BASEURL?>index.php?page=submit1' method='post'>
    to:

    PHP Code:
    <form name='submit_1' action='<?php echo BASEURL?>index.php?page=submit1' method='post' onsubmit='return checkurl()'>
    Add following lines to the end of submit1.php:
    PHP Code:
    <script type="text/javascript">
    function 
    checkurl() {
    var 
    url = $("#submit_orig_url").val();
    if ( 
    url.indexOf("squidoo.com") == -1){ 
    alert("You can only submit squidoo.com links. Please try again.");
    return 
    false;
    }
    else { return 
    true;}
    }
    </script> 
    User cannot proceed further until he submits a squidoo.com link.
    Definitely a better solution!

    But with JAVA disabled... it's ok... probably all hotaru system doesn't work ;-)
    Last edited by carlo75; 10-17-2011 at 11:52 AM.

  10. #8
    Member
    Join Date
    Jan 2011
    Posts
    31
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default

    Thank you guys...

    I have used solution @PuckRobin posted and it solved my problem.

    Well... if users have java disabled, then site wont be working at all, as you said carlo

  11. #9
    Senior Member
    Join Date
    Jun 2011
    Location
    Thailand
    Posts
    294
    Thanks
    0
    Thanked 69 Times in 63 Posts

    Default

    Does Hotaru even work with javascript disabled? I am not sure about that, but if it works and somebody cares about those people who can still live on the Internet with javascript disabled, he has the liberty to modify submit.php and SubmitFunctions.php I think But me, no thanks

  12. #10
    Design & Development carlo75's Avatar
    Join Date
    Oct 2009
    Location
    Italy - Perugia
    Posts
    509
    Thanks
    62
    Thanked 105 Times in 58 Posts

    Default

    Sure... mine was an ironic supposition

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need help desperately : Unable to submit after Submit page1 - 403 error
    By dreamzsiva in forum How-To and Troubleshooting
    Replies: 14
    Last Post: 05-24-2010, 04:04 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •