Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter kwestin

    (@kwestin)

    OK I figured this one out myself. thanks anyways

    Thread Starter kwestin

    (@kwestin)

    Anyone?

    Forum: Fixing WordPress
    In reply to: Better search
    kwestin

    (@kwestin)

    One thing I wondered is why the search does not use a MySQL index? Is it for performance? Below is the code for the search:

    if (!empty($q[‘s’])) {
    $q[‘s’] = addslashes_gpc($q[‘s’]);
    $search = ‘ AND (‘;
    $q[‘s’] = preg_replace(‘/, +/’, ‘ ‘, $q[‘s’]);
    $q[‘s’] = str_replace(‘,’, ‘ ‘, $q[‘s’]);
    $q[‘s’] = str_replace(‘”‘, ‘ ‘, $q[‘s’]);
    $q[‘s’] = trim($q[‘s’]);
    if ($q[‘exact’]) {
    $n = ”;
    } else {
    $n = ‘%’;
    }
    if (!$q[‘sentence’]) {
    $s_array = explode(‘ ‘,$q[‘s’]);
    $q[‘search_terms’] = $s_array;
    $search .= ‘((post_title LIKE \”.$n.$s_array[0].$n.’\’) OR (post_content LIKE \”.$n.$s_array[0].$n.’\’))’;
    for ( $i = 1; $i < count($s_array); $i = $i + 1) {
    $search .= ‘ AND ((post_title LIKE \”.$n.$s_array[$i].$n.’\’) OR (post_content LIKE \”.$n.$s_array[$i].$n.’\’))’;
    }
    $search .= ‘ OR (post_title LIKE \”.$n.$q[‘s’].$n.’\’) OR (post_content LIKE \”.$n.$q[‘s’].$n.’\’)’;
    $search .= ‘)’;
    } else {
    $search = ‘ AND ((post_title LIKE \”.$n.$q[‘s’].$n.’\’) OR (post_content LIKE \”.$n.$q[‘s’].$n.’\’))’;
    }
    }

    Thread Starter kwestin

    (@kwestin)

    Yeah I looked around for something, but could not find anything…maybe this would be a good project for my first wp plugin.

    kwestin

    (@kwestin)

    Was there ever a solution to this?

    Thread Starter kwestin

    (@kwestin)

    Michael this is great! Thanks

    This should be built into the WP core.

    Thread Starter kwestin

    (@kwestin)

    I think the main issue is not having the menus rendered in the correct markup.

    The first level get rendered in “li” tags as they should however there is no
    “ul” wrapper. The second tier navigation renders as it should in wrapped in ul tags.

    This just caused some issues with my layout as I seemed to have less control of the rendering across browsers without the top level being nested in a “ul” tag.

    Thank you for your help.

    Thread Starter kwestin

    (@kwestin)

    Yeah found it about an hour ago, however ran into some issues with it. But it is the closest thing I have found.

    Thread Starter kwestin

    (@kwestin)

    Does anyone have a link to something similar….maybe a template that does this?

    Thread Starter kwestin

    (@kwestin)

    Anybody?

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