Support » Plugin: Cat + Tag Filter » HELP URGENT – Error in parameters wrong url

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ajayver

    (@ajayver)

    When you choose Any tag + Any category the filter is disabled and generates a normal link to your homepage. Choose some tag or category to test the filter.

    When a category and a tag is selected it works, but when i choose any tag + any categ i have to do the following tweak:

    if( $cat == -1)
    {
    	$url = $_POST["home_url"] . $tag;
    }
    else
    {
    	$url = $_POST["home_url"] . $cat . $tag;
    }
    
    if( ($cat == -1) and ($tag == -1) )
    {
    	$url = "http://www.guiagcr.com.br/estabelecimentos/";
    }
    elseif( ($cat != -1) and ($tag == -1) )
    {
    	$url = "http://www.guiagcr.com.br/estabelecimentos/";
    }

    this because the orginal was generating urls with numbers characters like like:

    http://www.guiagcr.com.br-1-1

    instead

    http://www.guiagcr.com.br

    same mboratto@gmail.com only working with Required choose cata + tag. If you choose:
    + Only cata no choose tag: not work.
    + Only Tag no cata: not work.
    + No tag no cata : not work.
    Now you can fix it by:
    Replace the code below

    if ($_POST["ctf_submit"] == 1) {
    if ($_POST["cat"] != -1) {$cat = '/?category_name=' . $_POST['cat'];
    if ($_POST["tag"] != -1) $tag = '&tag=' . $_POST["tag"];}
    else {if ($_POST["tag"] != -1) $tag = '/?tag=' . $_POST["tag"];}
    $url = $_POST["home_url"] . $cat . $tag;
    header('Location: ' . $url);
    }

    By code :

    if ($_POST["ctf_submit"] == 1) {
    	if ($_POST["cat"] != -1) {
    		$cat = '/?category_name=' . $_POST['cat'];
    		if ($_POST["tag"] != -1) {
    			$tag = '&tag=' . $_POST["tag"];
    			$url = $_POST["home_url"] .$cat . $tag;}
    		else
    			{$url = $_POST["home_url"] .$cat;}
    		}
    		else {
    			if ($_POST["tag"] != -1) {
    				$tag = '/?tag=' . $_POST["tag"];
    				$url = $_POST["home_url"] . $tag;}
    			else
    				{$url = $_POST["home_url"];}
    			}
    	header('Location: ' . $url);
    }

    If ajayver visit this thead please fix send fix to everyone.
    Thanks you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘HELP URGENT – Error in parameters wrong url’ is closed to new replies.