This forum is for assistance with theme development.

Theming bookreview module problems. How to properly use tables in php?

Hello all.

I am attempting to re-do how the theme_bookreview_list function is displaying my books. In template.php I have the following function to override the theme_bookreview_list function:

function phptemplate_bookreview_list() {
  $header = array(' ', array('data' => t('Title'), 'field' => 'n.title', 'sort' => 'asc'), array('data' => t('Author'), 'field' => 'b.author'));

  $sql = "SELECT DISTINCT n.nid, n.title, b.author from {node} n INNER JOIN {bookreview_authors} b on n.nid = b.nid WHERE n.type = 'bookreview'";
  $sql .= tablesort_sql($header);
  $result = pager_query($sql, 20);

  while ($node = db_fetch_object($result)) {
$output = '<table width="100%"><tr><td>';

    if ($node->title) {$output .= '<h2>'. l($node->title, "node/$node->nid"). ' - ';}
    else {$output .= '<h2>No Title';}

$output .= '</td><td align="right">';
    if ($node->author) {$output .= t($node->author). '</h2>';}
    else {$output .= 'Unknown Author </h2>';}

$output .= '</td></tr></table>';
    $rows[] = array(array('data' => $output, 'colspan' => '5'));
  }

  if (!$rows) {
    $rows[] = array(array('data' => t('No books available.'), 'colspan' => '4'));
  }

  $pager = theme('pager', NULL, 20, 0);
  if (!empty($pager)) {
    $rows[] = array(array('data' => $pager, 'colspan' => '2'));
  }

  return theme('table', $header, $rows);
}
?>

A way to style previews in your theme

If you've tried to apply a special style to node or comment previews in your theme, you've probably found that the information just isn't there to let you do it. This is unfortunate, because the similarity between a preview and a normal page view makes it easy to lose data when you forget to save after previewing.

Is it possible to make the Masthead image into a series of rotating images?

Dear forum,

I apologize for the poor title of this post. Let me try to explain what I want to do. At the moment on my site I have a masthead image that is a white neon light through a green background. Say I made copies of that masthead image and turned each copy into a different color so there was a green one, a red one, a blue one etc. Then would It be possible to have the images change every 5 to 10 seconds or so? What would it take to do that?

Any suggestions would be most appreciated.

Thanks alot

FrancisQ

Skilled themer? Get paid for your skills!

Hi,

I'm running a quite large non-profit website that currently are converting to Drupal from another CMS. We have no understanding of Drupal-theming and need a new theme developed rather quickly. We have a couple of themes we like (FriendsElectric, Kubrick, SpreadFireFox) and we're looking to do some modifications of these themes to fit our need - or develop a new theme from scratch with these themes as a sample.

Is the new PhpTemplate back ported to work with 4.5.2 yet?

My node.tpl.php file is extremely over-crowded (making exceptions for different node types). I'd like to clean it up by creating seperate template files for each node type (as mentioned in the new PhpTemplate engine functionality).

Adrian mentioned that he was going to backport this a few days ago, but I have heard nothing yet. Is it done? Can I download the CVS version and will it work on 4.5.2?

Thanks a million for the awesome engine!

Mateo

Need help theming article list using phptemplate.

Below is a site I am setting up. This link leads directly to the area in question.

http://72.9.242.6/article

When you click on one of the article categories ("Biographies, Politics, Literature, etc.) A list is displayed of all articles in that category. As it is now (example: http://72.9.242.6/article/literature ) it lists the title, the teaser, and the $links below it.

Pages

Subscribe with RSS Subscribe to RSS - Theme development