Thank you for your guidance. I have moved this to a new 'issue'. [But it's really more a need to understand.]
My goal is to display an author's pubs in a block on the author's page. I would like the title to be a URL, but that's for another day.
With your advice about the node table, I got a mysql command line query to pull out the correct records.
On the web page, I get a blank display. This is the code in the test page (right now it's a page)(input format is PHP code):
$query = "SELECT node.title, biblio.biblio_year from node,biblio where node.type="biblio" and node.vid=biblio.vid and biblio.biblio_authors like '%someAuthorName%' ORDER BY biblio_year desc";
$result = db_query($query);
while ($term = db_fetch_object($result)) {
$term[] = array($row->title, $row->biblio_year);
}
$output = theme($rows);
return $output;
[I am using an actual author name in the query]
The problem may lie in my understanding of how PHP handles the returned results, or how Drupal themes them, or... ?
I've been studying biblio.module to see how you handle the return from db_fetch_object() but I'm not sure what's going on.
If this is better discussed elsewhere, please advise.
Thank you.
-------
The title of the publication is stored in the {node} table. The secondary title field contains different things depending on the type of publication (Series Title, Book Title, Journal Title, Conference Name etc.)
Try...
SELECT title, biblio_authors, biblio_secondary_title, biblio_year
FROM node n LEFT JOIN biblio b n.vid = b.vid
WHERE biblio_authors like '%whoever%' and n.type='biblio'
ORDER BY biblio_year desc"
Ron.
P.S. If you have any further comments/questions on this topic, please open a new issue as this is somewhat off the topic of the original issue.
Comments
Comment #1
rjerome commentedI think there are a few problems with your PHP code. The following taken out of the biblio_block function at line 1892 of biblio.module... This will give you an html formated list in the $block['content'] variable. (And it includes title links)
Comment #2
Anonymous (not verified) commentedThanks for that detailed advice. It's not displaying anything, but I'm learning just from reading the code.
I have to switch to another project for a few days but will keep at it & let you know if I solve it.
Comment #3
Anonymous (not verified) commentedHere is what I ended up doing for now, in case it could be useful to someone.
Approach: make a block, put the code below in the body, select 'show only on certain pages', and enter the url for the author's personal page.
the block code:
Comment #4
bekasu commentedUpgrade to Biblio 6x and install Views/Panels.
Create a view/panel and configure our theme to show that view in a block.
Marking issue closed.