Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    New Pligger Requiem's Avatar
    Joined
    May 2010
    Posts
    14
    Ok, I'll give this a go when I get home from work! Thanks for the info!

  2. #12
    New Pligger Requiem's Avatar
    Joined
    May 2010
    Posts
    14
    Quote Originally Posted by Yankidank View Post
    Sorry to be a few days late to this discussion, but I have an idea that might work for you.

    Step 1
    Open up the submit_step_2.tpl template file. Put the following on line 1, replacing the domain name with the domain(s) that you want to only allow them to post.
    Code:
    {if $url_short neq "http://domain.com" || $url_short neq "http://www.domain.com"}
    Step 2
    At the bottom of the same submit_step_2.tpl template file, place the following. You can substitute the error message with your own HTML.
    Code:
    {else}
    Sorry, but you are trying to submit a domain that we do not accept. Please go back and try again.
    {/if}
    Result
    The end result is that users will only be able to submit stories to the domains that you put in that {if} statement. If they try to submit a domain other than the ones specified they will see the error message letting them know that they are not submitting a supported URL.

    I use a similar method to alter what data appears on the Cuteaholic.com submission pages. If they are posting a video URL it shows that the video will automatically embed itself. If they don't post a known video domain URL it will give them an upload field to attach an image to the post.
    Ok, did step 1, I went to the submit_step_2.tpl and pasted that directly into the first line at the very top of the code.
    Did step 2, put what you wrote in the very bottom of the same page (submit_step_2.tpl).

    I then tried testing it with just using news.com (as a test) and it still went through and didn't show a warning about not accepting it. After that, I thought perhaps it's because I was the admin it was possibly bypassing it for me, so I created a mock general user account and it still went through for that too.

    I'm wondering if I'm missing something very simple? I'm still using the wistie template, and I put the modifications in the ../templates/wistie/submit_step_2.tpl

    edit: I just bought the shredit template, and tried it there. Still isn't working. I'm still thinking it's probably something I'm overlooking.

  3. #13
    New Pligger Requiem's Avatar
    Joined
    May 2010
    Posts
    14
    Well I finished the site basically, re-skinned the shredit template a bit, but this issue is the last thing remaining.

    I tried adding the codes that were mentioned on this thread for submit 2 tpl, but it's still not working. I tried entering a variety of websites (news.com, gamespot.com, etc) to see if it's working, but it still isn't. Am I missing something?

    I can't really let this go live until it's fixed because it's site specific and I believe the people who would use it would feel it's a really big turn off to see other websites listed. Any help is appreciated!

  4. #14
    Pligg Developer chuckroast's Avatar
    Joined
    Jun 2006
    Posts
    5,478
    Quote Originally Posted by Requiem View Post
    Well I finished the site basically, re-skinned the shredit template a bit, but this issue is the last thing remaining.

    I tried adding the codes that were mentioned on this thread for submit 2 tpl, but it's still not working. I tried entering a variety of websites (news.com, gamespot.com, etc) to see if it's working, but it still isn't. Am I missing something?

    I can't really let this go live until it's fixed because it's site specific and I believe the people who would use it would feel it's a really big turn off to see other websites listed. Any help is appreciated!
    I think I've solved this for you. Try this.
    This example will only allow you to submit urls from Pligg.com

    Open submit_step_1.tpl

    Find
    Code:
    {checkActionsTpl location="tpl_pligg_submit_step1_middle"}
    After it add the following

    Code:
    {if $pagename eq "submit"} 
    {literal}
    <script type="text/javascript">
    function validate_url(field,alerttxt)
    {
    with (field)
      {
      apos=value.indexOf("pligg.com");
      dotpos=value.lastIndexOf(".");
      if (apos<1||dotpos-apos<2)
        {alert(alerttxt);return false;}
      else {return true;}
      }
    }
    
    function validate_form(thisform)
    {
    with (thisform)
      {
      if (validate_url(url,"Not a valid url!")==false)
        {url.focus();return false;}
      }
    }
    </script>
    {/literal}
    {/if}
    Now find the following line in the same template file.

    Code:
    <form action="{$URL_submit}" method="post" id="thisform">
    Change to
    Code:
    <form action="{$URL_submit}" method="post" id="thisform" onsubmit="return validate_form(this);">

  5. #15
    New Pligger Requiem's Avatar
    Joined
    May 2010
    Posts
    14
    Thanks Mr. Roast!

    *does a little dance*

    It works perfectly! I appreciate the help!


  6. #16
    New Pligger spade5702's Avatar
    Joined
    Sep 2009
    Posts
    23
    the above method is great, although flawed. To bypass it, all the user has to do is turn off the javasript in their browser.

    this worked for me:

    open Submit_Step_2.tpl and enter the following above everything else
    Code:
    {if $url_short eq "http://replacethiswiththeurl.com"}
    at the end of the page, after everything else, add:
    Code:
    {/if}
    then after {/if} add whatever text you like or the link submit form to show only to the users that submit a bad url.

    To add multiple urls, just keep adding more lines like so:
    Code:
    || $url_short eq "http://www.2ndurl.com"
    this way the beginning code would look something like this:
    Code:
    {if $url_short eq "http://replacethiswiththeurl.com" || $url_short eq "http://www.2ndurl.com" || $url_short eq "http://www3rdurl.com"}

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Trouble with submit.php?url=http://example.com
    By alexxa in forum Questions & Comments
    Replies: 16
    Last Post: 10-07-2010, 03:09 AM
  2. Is it possible to submit not http:// ? but
    By Apskaties in forum Questions & Comments
    Replies: 1
    Last Post: 09-19-2008, 06:38 AM
  3. How can I block all sites apart from a select few?
    By zsection in forum Questions & Comments
    Replies: 0
    Last Post: 03-22-2008, 06:16 PM
  4. submit.php?http://myurl.com - not taking me to submit step 2
    By gragland in forum Questions & Comments
    Replies: 1
    Last Post: 08-24-2007, 02:10 PM
  5. Able to submit non-http links?
    By ryx18 in forum Questions & Comments
    Replies: 1
    Last Post: 01-23-2007, 09:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Donate to Pligg CMS Dreamhost Web Hosting Host Gator Web Hosting