We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12684
    • 118 Posts
    I have set up WebloginPE and I am starting to wrap my head around it.

      • 28033
      • 925 Posts
      http://docs.webloginpe.info/parameters.html

      Look around the &usersList parameter, namely the filter(value). That should be able to sort that (and further by whatever state/etc. you need by specifiying a value).

      Sadly, you’ll have to create a new search "query" for each new state/etc., unless you can code a script to pass the value into the value parameter.
        My Snippets
        -> PopUpChunk v1.0
        • 12684
        • 118 Posts
        With using the filter value, I am basically going to have to make a page for each individual state and then in that document I would apply the filter. e.g. California.html (id.32)
        [!WebLoginPE? &type=`users` &usersList=`Vendors in California, state(california)`!]


        Then of course have the person registering list what state they are in.

        Then have a page listing all states (perhaps even a drop down box) that visitors can choose from and it would take them to that page.

        Is that what you mean by "search ’query’"?

        Or is there a better way?
          • 28033
          • 925 Posts
          Yep. smiley

          I don’t have the skill to code it, but someone here might be able to code a script to "create" state search queries on the fly (by "passing" the state value into the WLPE call).

          That way, you wouldn’t have to create a page each time.
            My Snippets
            -> PopUpChunk v1.0
            • 4749
            • 623 Posts
            Yes, yes, yes. I would be very interested in something like this. The ability to separate users/people/whatever by a specific criteria or value. Actually, in this case I need it to be a state too! So, if anyone has done this it would be great to tell how you did it. Thanks.
              The MODx has you...
              Utah Web Design
              • 26435
              • 1,193 Posts
              I think we could edit the filter method to first check if a particular $_GET parameter is set (for instance, www.yoursite.url/search.html?pe_filterby=california).
              So, if $_GET[’pe_filterby’] is not null, we could escape it and then pass it as the filter. Using a php if block, a default filter could still be set and could be overridden by the get parameter.

              I would have to spend some time reacquainting myself with the WLPE code.

              -sD-
              Dr. Scotty Delicious, DFPA.
                Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                All of the above... in no specific order.


                I send pointless little messages
                • 12684
                • 118 Posts
                Scotty,

                Thank you mate.

                  • 28033
                  • 925 Posts
                  Quote from: Dr. at Jun 13, 2008, 05:45 PM

                  I think we could edit the filter method to first check if a particular $_GET parameter is set (for instance, www.yoursite.url/search.html?pe_filterby=california).
                  So, if $_GET[’pe_filterby’] is not null, we could escape it and then pass it as the filter. Using a php if block, a default filter could still be set and could be overridden by the get parameter.

                  I would have to spend some time reacquainting myself with the WLPE code.

                  -sD-
                  Dr. Scotty Delicious, DFPA.

                  I could find that really useful on my site as well. smiley

                  And good to see you around these parts again, Mr. Pirate. ^.^
                    My Snippets
                    -> PopUpChunk v1.0
                    • 24530
                    • 100 Posts
                    Some time ago I did a handy little snippet which helped me a lot:

                    <?php
                    /*
                    ==================================================
                    	RequestChunk
                    ==================================================
                    
                    Returns a Chunk according to request-value.
                    
                    Author:  Tobias Zucali
                    Version: 0.1 beta @2008
                    License: LGPL
                    
                    --------------------------------------------------
                    */
                    
                    
                    
                    /* Parameters
                    ----------------------------------------------- 
                    $name              obligatory, $_REQUEST[$name]
                    $values            value1::chunk1||value2::chunk2||...
                    $result            chunk | tv, default chunk
                    $default           defaultchunk
                    
                    example: [!RequestChunk? &name=`show` &values=`content::chunkForContent||total::chunkForTotal` &default=`chunkForTotal`!]  
                    
                    */
                    unset($output);
                    
                    if (!isset($name)) {
                    	return '<!-- emty name for RequestChunk -->';
                    } else {
                    	trim($name);
                    }
                    
                    if (isset($_REQUEST[$name])){
                    	$rcRequestVal = trim($_REQUEST[$name]);  
                    	if (isset($values)){
                    		$values = explode('||', $values);
                    		if (count($values) == 1 && !strpos($values, '||')) {
                    			$rcResultName = trim($values[0]);
                    		} else {
                    			foreach ($values as $rcValuePair) {
                    				$rcValuePair = explode('::', $rcValuePair);
                    				if (trim($rcValuePair[0]) == $rcRequestVal) {
                    					$rcResultName = trim($rcValuePair[1]);
                    				}
                    			}
                    		}
                    	} else {
                    		return '<!-- emty values for RequestChunk -->';
                    	}
                    }
                    
                    if (!isset($rcResultName) && isset($default)) {
                    	$rcResultName = trim($default);
                    }
                    if (isset($rcResultName)) {
                        $output .= ($result != 'tv') ? '{{'.$rcResultName.'}} <!-- RequestChunk results chunk: '.$rcResultName.'-->' : '[*'.$rcResultName.'*] <!-- RequestChunk results tv: '.$rcResultName.'-->'; 
                                              
                    } else {
                        $output .= '<!-- no output for RequestChunk -->';
                    }
                    
                    unset($rcResultName, $values, $rcRequestVal);
                    
                    return $output;
                    ?>


                    This way you just have to create a snippet for each state, not the whole page.





                    For your purpose I just cut it down a little bit - I didn´t test it yet ...

                    <?php
                    /*
                    ==================================================
                    	PassRequest
                    ==================================================
                    
                    Returns a Chunk according to request-value.
                    
                    --------------------------------------------------
                    */
                    
                    
                    
                    /* Parameters
                    ----------------------------------------------- 
                    $name              obligatory, $_REQUEST[$name]
                    $default           defaultchunk
                    
                    example: [!PassRequest? &name=`show` &default=`gitarrenTemplate`!]  
                    
                    */
                    unset($prResult, $output);
                    
                    if (!isset($name)) {
                    	return '<!-- emty name for PassRequest -->';
                    } else {
                    	$name = trim($name);
                    }
                    
                    if (isset($_REQUEST[$name])){
                    	$output = trim($_REQUEST[$name]);
                    } elseif (isset($default)) {
                    	$output = trim($default);
                    } else {
                      $output = '';
                    }
                    
                    unset($prResult, $prRequestVal);
                    
                    return $output;
                    ?>



                    Maybee you could combine with a call like this (and a uncached page!):
                    [!WebLoginPE? &type=`users` &usersList=`Vendors in [[PassRequest? &name=`state` &default=`USA`]], state([[PassRequest? &name=`state` &default=`USA`]])`!]

                    www.yoursite.url/search.html?state=california
                      my newest webpage [url=http://gitarren.zucali.at]Meisterwerkstatt f
                      • 28033
                      • 925 Posts
                      Wouldn’t that require using PHx, since it’s running a snippet call inside of another snippet call?
                        My Snippets
                        -> PopUpChunk v1.0