what i am trying to do is create some php code where a list is created which shows all the nodes a user has created from a specific custom node type.

I would use views to create this except I am going to display it out side of the Drupal hiearchy using the

require_once './includes/bootstrap.inc'; // assuming your script is in the same folder as Drupal's index.php
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); // you now have access to all Drupal functionality

method.

Any thoughts on how I would do this thanks

Comments

p6’s picture

<?php
        // grab $uid from the $user object, URI arg or set manually.
        $lim = 5; // Set query range
        $result = db_query_range("SELECT n.nid, n.title FROM {node} n WHERE n.type = '<Specific Content Type Here>' AND n.status = 1 AND n.uid = %d ORDER BY n.created DESC", $uid, 0, $lim);
        if (db_num_rows($result)) {
          $items = array();
          while ($cont = db_fetch_object($result)) {
            $items[] = l($cont->title, 'node/'. $cont->nid, array(), NULL, NULL, FALSE, FALSE);
                 }
             }
?>

- Pavan Keshavamurthy
http://grahana.net/

- Pavan Keshavamurthy
http://grahana.net/

quioxte’s picture

works great thanks.

but you forgot the two closing brackets }} at the end. ;-)