I'm trying to alter this query in the book module:
<?php $node_result = db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent FROM {node} n INNER JOIN {book} b ON n.vid = b.vid WHERE n.nid = %d'), $nid); if (db_num_rows($node_result) > 0) { $node = db_fetch_object($node_result); } ?> To this: <?php $node_result = db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, f.filepath FROM {node} n INNER JOIN {book} b ON {n.vid = b.vid} n join {image_attach} nr on (n.nid = nr.nid)INNER JOIN {files} f ON nr.iid = f.nid WHERE n.nid = %d && f.filename = 'thumbnail''), $nid); if (db_num_rows($node_result) > 0) { $node = db_fetch_object($node_result); } ?> and then add a parameter in the function call: <?php return theme('book_export_html', check_plain($node->title), $node->$content, $node->filepath); ?> and then add this parameter to the function arguments: <?php function theme_book_export_html($title, $content) ?> and then of course print it... This is the error I'm getting in the apache logs: [Wed Nov 21 23:40:54 2007] [error] [client 132.234.220.196] PHP Parse error: syntax error, unexpected T_STRING in /www/itnews2/modules/book/book.module on line 651 Anybody have any suggestions? Sarah
Research Computing Services Sarah.Vardy@student.griffith.edu.au 0402241794
Sarah.Vardy@student.griffith.edu.au schrieb:
|<?php $node_result = db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, f.filepath FROM {node} n INNER JOIN {book} b ON {n.vid = b.vid} n join {image_attach} nr on (n.nid = nr.nid)INNER JOIN {files} f ON nr.iid = f.nid WHERE n.nid = %d && f.filename = 'thumbnail''), $nid);
Your query string ends after "f.filename = ", because you put the whole string in single quotes ['] and "thumbnail" as well. Replace either ones with double quotes ["].
HTH, Eric