• Hello all –

    I installed narchives and it works perfectly except when I attempt to view via “categories.” I get the following error:

    Database error: [You have an error in your SQL syntax near ‘ORDER BY cat_name DESC’ at line 1]
    SELECT * FROM wp_categories WHERE cat_ID != ORDER BY cat_name DESC

    Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter userx

    (@userx)

    Sorry, I forgot this –

    I’m guessing this is the part of the plugin the error is referring to, I think?

    <?php
    //Make sure categories get parsed out, they are deprecated in wp-blog-header.php
    if ($_POST[“orderby”] == ‘category’) {
    global $author, $m;
    $orderby = ‘category’;
    if ($_POST[“order”] == ”) $order = “DESC”;
    else $order = $_POST[“order”];
    $year = ” . intval($_POST[“m”]);
    $m = $year;
    $author = ”.intval($_POST[“author”]);
    if (empty($author)) {
    $whichauthor=”;
    } else {
    $author = ”.urldecode($author).”;
    $author = addslashes_gpc($author);
    if (stristr($author, ‘-‘)) {
    $eq = ‘!=’;
    $andor = ‘AND’;
    $author = explode(‘-‘, $author);
    $author = ”.intval($author[1]);
    } else {
    $eq = ‘=’;
    $andor = ‘OR’;
    }
    $author_array = explode(‘ ‘, $author);
    $whichauthor .= ‘ AND (post_author ‘.$eq.’ ‘.intval($author_array[0]);
    for ($i = 1; $i < (count($author_array)); $i = $i + 1) {
    $whichauthor .= ‘ ‘.$andor.’ post_author ‘.$eq.’ ‘.intval($author_array[$i]);
    }
    $whichauthor .= ‘)’;
    }

    Thread Starter userx

    (@userx)

    Anyone have an idea of where I can even start on this one?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘nArchives & Databse’ is closed to new replies.