Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter sam888

    (@sam888)

    wp_named_users is from a plugin, namedusers or something to that effect. I used it as seems to me to be the only way (other than creating a table from scratch) in getting a user_id and post_id join. But I think the named_users table is defective and will need to rebuild this. I will first go through the process of elimination you suggest and will feed back on where I get to.
    thanks v much for your assistance,

    Sam

    Thread Starter sam888

    (@sam888)

    apljdi- thanks for your help with this—-this is likely a DB table issue as it is working for some users in respect of some posts, but not others. not clear why.

    Thread Starter sam888

    (@sam888)

    thanks–bu unfortunately no success

    <?php
    echo $querystr;
    ?>

    produces

    SELECT wpposts.* FROM wp_posts wpposts, wp_named_users WHERE wpposts.ID = wp_named_users.post_id AND wp_named_users.user_id = ‘1’ AND wpposts.post_type = ‘post’ AND wpposts.post_status = ‘publish’ AND wpposts.post_date < NOW() ORDER BY wpposts.post_date DESC
    Not Found

    Sorry, but you are looking for something that isn’t here.

    not sure where to go from here.

    Sam

    Thread Starter sam888

    (@sam888)

    I have played around with the code and get the following result on the page (no error message):

    array(0) { }
    Not Found

    Sorry, but you are looking for something that isn’t here.

    the reference to the T Object Operator was to the wpdb->show_errors(); had inserted. not clear at all why this script is not reproducing the posts I require: is there an easier way of achieving what I need through a feed or something similar:

    Completley lost ??

    Thread Starter sam888

    (@sam888)

    …just add: I cant see why the “->” would give rise to an error–very strange

    Thread Starter sam888

    (@sam888)

    hi–I added in the additional code and am getting the following error:

    Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/turtle64/public_html/virtuallawdirect.com/wp-content/themes/thematic/page_profile.php on line 62.

    Not surewhere to go from here and any help appreciated.

    thks

    Sam

    Thread Starter sam888

    (@sam888)

    Thanks–no not through the editor; I work through my ftp client and updated the file. this should work and is very frustrating. could it be because there is an existing loop on that page? i am running shortcode for a custom profile plugin through the editor to generate the user page.. will try the error code to see what is going on and report back.

    thks
    Sam

    Thread Starter sam888

    (@sam888)

    Apljdi-thanks very much for the response. I have modified the script a little as appears below and inserted it directly into the wordpress page template; and it now does not return an error message, but goes straight to the ‘else’, and does not return the content of the table that I am looking for, i.e the posts attributed to the user concerned.

    All I am trying to do is reproduce the relevant posts on my user’s home page, rather than in the wp category template.

    the balance of the script is really then the wordpress page template using the ‘thematic’ theme. Is it a problem perhaps with the current loop on that page: full script of that page appears below:

    Any suggestions appreciated

    thks

    Sam

    <?php get_header() ?>

    <div id=”container”>
    <div id=”content”>
    <?php
    echo(‘<p class=”loginmessage”>You are logged in as ‘ . $current_user->user_login . ‘</p>’);
    ?>

    <?php get_sidebar(‘page-top’) ?>

    <?php the_post() ?>

    <div id=”post-<?php the_ID(); ?>” class=”<?php thematic_post_class() ?>”>
    <?php thematic_postheader(); ?>
    <div class=”entry-content”>

    <?php the_content() ?>

    <?php wp_link_pages(“\t\t\t\t\t<div class=’page-link’>”.__(‘Pages: ‘, ‘thematic’), “</div>\n”, ‘number’); ?>

    <?php edit_post_link(__(‘Edit’, ‘thematic’),'<span class=”edit-link”>’,'</span>’) ?>

    </div>
    </div><!– .post –>

    <?php if ( get_post_custom_values(‘comments’) ) thematic_comments_template() // Add a key+value of “comments” to enable comments on this page ?>

    <div>
    <?php
    $querystr = “
    SELECT wpposts.*
    FROM $wpdb->posts wpposts, $wpdb->named_users wp_named_users
    WHERE wpposts.ID = wp_named_users.post_id
    AND wp_named_users.user_id = ‘$current_user->ID’
    AND wpposts.post_type = ‘post’
    AND wpposts.post_status = ‘publish’
    AND wpposts.post_date < NOW()
    ORDER BY wpposts.post_date DESC
    “;

    $pageposts = $wpdb->get_results($querystr);

    ?>
    <?php if ($pageposts): ?>
    <?php foreach ($pageposts as $post): ?>
    <?php setup_postdata($post); ?>

    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h2>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”>
    <?php the_title(); ?>
    </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”>Not Found</h2>
    <p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
    <?php include (TEMPLATEPATH . “/searchform.php”); ?>
    <?php endif; ?>

    </div>

    Thread Starter sam888

    (@sam888)

    thanks–this is driving me crazy ??

    not outside the wp framework

    i have defined the ‘global’ functions, but still not letting me run this.

    Script is in an ‘include file’ which I have ‘required’ in to a wp page template.

    All the help I could get would be appreciated!!

    SAm

    Thread Starter sam888

    (@sam888)

    apologies_i have seen my simple error!!

    but now getting message that SELECT command denied to me on named_users table.

    would this be a local host issue or is it something to do with the wpnameduser plug in??

    thks

    Thread Starter sam888

    (@sam888)

    sorry, again, easy answer: resolved: seen other forum topic on this issue

    Thread Starter sam888

    (@sam888)

    sorry, that was easy wp-terms.

    BUT, where is the ‘intersection’ between category names and posts??????

    Please help: thanks

    Thread Starter sam888

    (@sam888)

    ..to clarify; the solution would enable me to ‘feed’ posts in categories defined by user name or user_id.

    any assistance, appreciated.

    thks

    Thread Starter sam888

    (@sam888)

    Thanks very much Michael:al resolved with social access control, much appreciated

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