Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • jdhcreative

    (@jdhcreative)

    Hey Sergi

    If you use a translation service for your website, and want this to be a flash menu system, wouldn’t it just be easiest to find an “SEO friendly” menu system (or build one) that uses

    • tags and has .js file take care of the rest?
    • I haven’t done it yet, but it’s an idea I’ve been pondering…

      – Brad

    Forum: Plugins
    In reply to: Custom Fields Search
    Thread Starter jdhcreative

    (@jdhcreative)

    (and I’ll post it here too! lol I just thought of that walking away… would be nice huh – duh. But it will be around Jan 1st before I get to it, so I don’t want to just leave the thread dead. )

    Forum: Plugins
    In reply to: Custom Fields Search
    Thread Starter jdhcreative

    (@jdhcreative)

    The computer I wrote all my original code and did my WP ‘hacking’ on was stolen a month ago, otherwise I’d post the code right up. The ‘lifelong’ stuff of course I had backed up elsewhere however I lost a big chunk of my work across the board. :-/

    I still plan on finishing the problem, and I will post my solutions (and example of different implementations) on my personal playground with code for all. https://www.bradswebplayground.com

    -Brad

    Forum: Plugins
    In reply to: Custom Fields Search
    Thread Starter jdhcreative

    (@jdhcreative)

    @stephencronin

    Dude, that is awesome.

    Yea, it’s been 9 long grueling months since I first posted this (and I had been working on it long before I asked for help) I finally just picked up a book, learned php/mysql, and made up my own damn solution outside of WP.

    @the world

    What you see here is a solution. I haven’t put my real idea up to apply this method to LOL(candy and bookpages?) but yea, if this is something you’re looking to do read this post carefully, PRINT TO PDF! And there’s more answers then one. This is powerful. A php book wouldn’t hurt either.

    *Cracks a victory beer* (and one for Stephen as well)

    @kafkaesqui — if you happen to read this, sorry again for the prior rudeness and thanks again for your past help. Reading back, that was just me in a dry, losing money on projects frenzy. Code and empty pizza boxes everywhere. Hope you know how it goes!

    Forum: Plugins
    In reply to: Custom Fields Search
    Thread Starter jdhcreative

    (@jdhcreative)

    Yeah. If I figure it out I’ll be sure to share the answer.
    Otherwise you can find me with my Ruby on Rails book and a 12 pack over there —> … starting over.

    jdhcreative

    (@jdhcreative)

    Noelgreen,

    Thanks for commenting on my post

    My only other idea was to actually add columns in the WP_POST and give them identifiers from which I could search from.

    Then, put input boxes in my “Write Post” <form> section of the admin.(Post.php and post-new.php) So when I write a post, I can just select and enter the extra fields. BUT, I’m having problems getting the fields I added to actually write to the DB.

    Trust me if you know anything on making something like that work we can just forget about trying to do a complex search on info that is just scrambled in 2 columns.

    This a method I’ve tried before, and am going back to. I think I’ll have much more luck once I can figure it out.

    Forum: Plugins
    In reply to: Custom Fields Search
    Thread Starter jdhcreative

    (@jdhcreative)

    !Update

    After much play, I feel like I’m so close but so far.

    Eventually I tried calling a SELECT within a SELECT. MySQL wasn’t liking that too much. So now I’m trying to store one result as a variable, reorder the results, and then search my second series of requirements against them.

    But… No luck. Does the following code make sense to anyone?

    If I could get this to work I know a lot of happy word press boys and girls who would go nuts.

    <?php get_header(); ?>
    
    <?PHP 
    
      $area = $_REQUEST['area'] ;
      $bookpgs = $_REQUEST['bookpgs'] ;
      ?> 
    
    <?php
      $subresult = mysql_query("SELECT wposts.*
        FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
        WHERE wposts.ID = wpostmeta.post_id
    	AND wpostmeta.meta_key = 'area'
    		AND wpostmeta.meta_value >= '$area'
    		AND wposts.post_status = 'publish'
        AND wposts.post_type = 'post'");
    
        $num = mysql_Num_Rows($subresult);
    
        $i=0;
    
        $subcriteria="";
    
        while ($i < m)  {
            $subcriteria .= $wpdb->get_results($subresult,$i,"area");
            $subcriteria .=",";
            $i++;
        }      
    
        $subcriteria=substr($subcriteria,0,-1); 
    
        $result = mysql_Query(
            "SELECT wposts.*
    	    FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
        	WHERE wposts.ID = wpostmeta.post_id
    		AND wpostmeta.meta_key = 'bookpgs'
    		AND wpostmeta.meta_value >= '$bookpgs'
    		AND wposts.post_status = 'publish'
     	    AND wposts.post_type = 'post'
    		IN ($subcriteria)");
           $pageposts = $wpdb->get_results($result, OBJECT);
    	     ?>
    
    	<div id="primary" class="twocol-stories">
    		<div class="inside">
          <?php if ($pageposts): ?>
     <?php foreach ($pageposts as $post): ?>
     <?php setup_postdata($post); ?>
    
     <div class="post" id="post-<?php the_ID(); ?>">
     <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
        <?php the_title(); ?></a></h2>
        <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
        <div class="entry">
           <?php the_content('Read the rest of this entry ?'); ?>
        </div>
        <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>
        <?php comments_popup_link('No Comments ?', '1 Comment ?', '% Comments ?'); ?></p>
     </div>
     <?php endforeach; ?>
     <?php else : ?>
        <h2 class="center">Search For Postings</h2>
        <p class="center"></p>
        <?php include (TEMPLATEPATH . "/searchform.php"); ?>
     <?php endif; ?>
    
    			</div>
    
        </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
    Forum: Plugins
    In reply to: Custom Fields Search
    Thread Starter jdhcreative

    (@jdhcreative)

    Someone else out there has to be trying to get this to work, no?

    Forum: Plugins
    In reply to: Custom Fields Search
    Thread Starter jdhcreative

    (@jdhcreative)

    Kafkaesqui,

    Thanks again for the link to your plugin. It has given me a few good ideas to start with.

    In this bit of your code:

    function szub_search_custom_where($where) {
    	global $wp_query, $wp_version, $wpdb;
    	if( !empty($wp_query->query_vars['s']) && szub_is_search_key() ) {
    		$search = $wp_query->query_vars['s'];
    		$key = $_GET['key'];
                    $value = $_GET['value'];
    
    		$status = ($wp_version >= 2.1) ? 'post_type = \'post\' AND post_status = \'publish\'' : 'post_status = \'publish\'';
    		$where = " AND $wpdb->postmeta.meta_key = '$key' AND $wpdb->postmeta.meta_value = '$value' AND $status ";
    	}
    	return $where;
    }

    Is it possible to take $where re-run it through the process but this time with a different Key and Value that was specified in the search form?

    I also modified my own code to try achieving this. Do you see what I am trying to do?

    <?PHP 
    
      $candy = $_REQUEST['candy'] ;
      $mood = $_REQUEST['mood'] ;
      $booktype = $_REQUEST['booktype'] ;
      $bookpgs = $_REQUEST['bookpgs'] ; 
    
     ?> 
    
     <?php
    
     $querystr = "
        SELECT wposts.*
        FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
        WHERE wposts.ID = wpostmeta.post_id
    	AND wpostmeta.meta_key = 'candy'
    		AND wpostmeta.meta_value = '$candy'
    		AND wposts.post_status = 'publish'
        AND wposts.post_type = 'post'
    	    ORDER BY wposts.post_date DESC
     ";
     $querystr .= "
        SELECT wposts.*
        FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
        WHERE wposts.ID = wpostmeta.post_id
    	AND wpostmeta.meta_key = 'mood'
    		AND wpostmeta.meta_value = '$mood'
    		AND wposts.post_status = 'publish'
        AND wposts.post_type = 'post'
    	    ORDER BY wposts.post_date DESC
     ";
    
      $querystr .= "
        SELECT wposts.*
        FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
        WHERE wposts.ID = wpostmeta.post_id
    	AND wpostmeta.meta_key = 'booktype'
    		AND wpostmeta.meta_value = '$bookpgs'
    		AND wposts.post_status = 'publish'
        AND wposts.post_type = 'post'
    	    ORDER BY wposts.post_date DESC
     ";
    
     $pageposts = $wpdb->get_results($querystr, OBJECT); ?>

    If I ask it for just one thing at a time she works like a charm… but I need to somehow filter my results. Time to put on another pot of coffee and keep sifting through my PHP book…. *jitters*

    Thanks for any insight.

    Forum: Plugins
    In reply to: Custom Fields Search
    Thread Starter jdhcreative

    (@jdhcreative)

    Kafkaesqui,

    I appreciate your spirit in promoting your plugin. ??
    But I’m afraid it doesn’t do what I’m looking for.

    Thanks for your suggestion. It’s very close. If you could search multiple keys for their values respectively… then bam.

    I’m still working on an alternative where I just add columns to the database for each key field and make it a much easier search. I added the fields, but am having trouble having the values write to the database. Kind of a sql writing newbie. But it’s coming along!

    any other suggestions?

Viewing 10 replies - 1 through 10 (of 10 total)