/[drupal]/contributions/modules/moviereview/moviereview.module
ViewVC logotype

Diff of /contributions/modules/moviereview/moviereview.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.9, Mon May 29 00:10:34 2006 UTC revision 1.10, Mon May 29 00:14:44 2006 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: moviereview.module,v 1.5 2005/11/12 21:28:46 emiliano Exp $  // $Id: moviereview.module,v 1.6.2.5 2006/05/28 23:34:48 emiliano Exp $
3    
4  // Adapted by Emiliano <emiliano@novayork.com>  // Adapted by Emiliano <emiliano@webinteligente.com.br>
5  // from bookreview module written by Jeremy Andrews <jeremy@kerneltrap.org>  // from bookreview module written by Jeremy Andrews <jeremy@kerneltrap.org>
6    
7  function moviereview_help($section = '') {  function moviereview_help($section = '') {
8      $output = '';
9    switch ($section) {    switch ($section) {
10        case 'admin/help#review':
11          $output .= t('Movie Review module allows users, with permission, to submit movie reviews.');
12      case 'admin/modules#description':      case 'admin/modules#description':
13        $output .= t('Write and publish movie reviews.');        $output .= t('Write and publish movie reviews.');
14        break;        break;
15      case 'node/add#moviereview':      case 'node/add#moviereview':
16        $output = t('Write a movie review.');        $output = t('Write a movie review.');
17        break;        break;
     case 'node/add/moviereview':  
       $output = variable_get('moviereview_help', '');  
       break;  
18    }    }
19    return $output;    return $output;
20  }  }
# Line 42  function moviereview_access($op, $node) Line 42  function moviereview_access($op, $node)
42    }    }
43  }  }
44    
45  function moviereview_node_name() {  function moviereview_node_info() {
46    return t('movie review');    return array('moviereview' => array('name' => t('movie review'), 'base' => 'moviereview'));
47  }  }
48    
49  function moviereview_insert($node) {  function moviereview_insert($node) {
50    
51    db_query("INSERT INTO {moviereview} (nid, movietitle, releaseyear, tvseries, cover, genre, director, writer, runtime, country, language, imdb, media, price, rating, review, location) VALUES (%d, '%s', '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s')", $node->nid, $node->movietitle,  $node->releaseyear,  $node->tvseries, $node->cover, $node->genre,  $node->director,  $node->writer,  $node->runtime,  $node->country, $node->language,  $node->imdb,  $node->media,  $node->price,  $node->rating, $node->review, $node->location);    db_query("INSERT INTO {moviereview} (nid, movietitle, releaseyear, tvseries, cover, genre, director, writer, runtime, country, language, imdb, media, price, rating, review, location) VALUES (%d, '%s', '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s')", $node->nid, $node->movietitle,  $node->releaseyear,  $node->tvseries, $node->cover, $node->genre,  $node->director,  $node->writer,  $node->runtime,  $node->country, $node->language,  $node->imdb,  $node->media,  $node->price,  $node->rating, $node->review, $node->location);
52    
53    foreach ($node->actors as $weight => $actor) {    for ($i = 0; $i < $node->numactors; $i++) {
54      if ($actor) {      $actor = "actor-$i";
55        db_query("INSERT INTO {moviereview_actors} (nid, actor, weight) VALUES (%d, '%s', %d)", $node->nid, $actor, $weight);      if ($node->$actor) {
56          db_query("INSERT INTO {moviereview_actors} (nid, actor, weight) VALUES (%d, '%s', %d)", $node->nid, $node->$actor, $i);
57      }      }
58    }    }
59    $numlinks = count($node->movielinks);  
60    for ($i = 0; $i < $numlinks; $i++) {    for ($i = 0; $i < $node->numlinks; $i++) {
61      if ($node->movielinks[$i]) {      $movielink = "movielink-$i";
62        db_query("INSERT INTO {moviereview_links} (nid, movielink, description, weight) VALUES (%d, '%s', '%s', %d)", $node->nid, $node->movielinks[$i], $node->linkdescriptions[$i], $i);      $linkdescription = "linkdescription-$i";
63        if ($node->$movielink) {
64          db_query("INSERT INTO {moviereview_links} (nid, movielink, description, weight) VALUES (%d, '%s', '%s', %d)", $node->nid, $node->$movielink, $node->$linkdescription, $i);
65      }      }
66    }    }
67    
68  }  }
69    
70  function moviereview_load($node) {  function moviereview_load($node) {
# Line 69  function moviereview_load($node) { Line 73  function moviereview_load($node) {
73    while ($actor = db_fetch_object($actors)) {    while ($actor = db_fetch_object($actors)) {
74      $moviereview->actors[$actor->weight] = $actor->actor;      $moviereview->actors[$actor->weight] = $actor->actor;
75    }    }
76      $moviereview->numactors = count($moviereview->actors);
77    
78    $movielinks = db_query("SELECT movielink, description, weight FROM {moviereview_links} WHERE nid = '$node->nid' ORDER BY weight");    $movielinks = db_query("SELECT movielink, description, weight FROM {moviereview_links} WHERE nid = '$node->nid' ORDER BY weight");
79    while ($movielink = db_fetch_object($movielinks)) {    while ($movielink = db_fetch_object($movielinks)) {
80      $moviereview->movielinks[$movielink->weight] = $movielink->movielink;      $moviereview->movielinks[$movielink->weight] = $movielink->movielink;
81      $moviereview->linkdescriptions[$movielink->weight] = $movielink->description;      $moviereview->linkdescriptions[$movielink->weight] = $movielink->description;
82    }    }
83      $moviereview->numlinks = count($moviereview->movielinks);
84    
85    return $moviereview;    return $moviereview;
86  }  }
87    
# Line 82  function moviereview_update($node) { Line 90  function moviereview_update($node) {
90    db_query("UPDATE {moviereview} SET movietitle = '%s', releaseyear = '%s', tvseries = '%d', cover = '%s', genre = '%s', director = '%s', writer = '%s', runtime = '%s', country = '%s', language = '%s', imdb = '%s', media = '%s', price = '%s', rating = '%d', review = '%s', location = '%s' WHERE nid = %d", $node->movietitle,  $node->releaseyear,  $node->tvseries, $node->cover, $node->genre,  $node->director,  $node->writer,  $node->runtime,  $node->country, $node->language,  $node->imdb,  $node->media,  $node->price,  $node->rating, $node->review, $node->location, $node->nid);    db_query("UPDATE {moviereview} SET movietitle = '%s', releaseyear = '%s', tvseries = '%d', cover = '%s', genre = '%s', director = '%s', writer = '%s', runtime = '%s', country = '%s', language = '%s', imdb = '%s', media = '%s', price = '%s', rating = '%d', review = '%s', location = '%s' WHERE nid = %d", $node->movietitle,  $node->releaseyear,  $node->tvseries, $node->cover, $node->genre,  $node->director,  $node->writer,  $node->runtime,  $node->country, $node->language,  $node->imdb,  $node->media,  $node->price,  $node->rating, $node->review, $node->location, $node->nid);
91    
92    db_query("DELETE FROM {moviereview_actors} WHERE nid = %d", $node->nid);    db_query("DELETE FROM {moviereview_actors} WHERE nid = %d", $node->nid);
93    $numactors = count($node->actors);    for ($i = 0; $i < $node->numactors; $i++) {
94    for ($i = 0; $i < $numactors; $i++) {      $actor = "actor-$i";
95      if ($node->actors[$i]) {      if ($node->$actor) {
96        db_query("INSERT INTO {moviereview_actors} (nid, actor, weight) VALUES (%d, '%s', %d)", $node->nid, $node->actors[$i], $i);        db_query("INSERT INTO {moviereview_actors} (nid, actor, weight) VALUES (%d, '%s', %d)", $node->nid, $node->$actor, $i);
97      }      }
98    }    }
99    
100    db_query("DELETE FROM {moviereview_links} WHERE nid = %d", $node->nid);    db_query("DELETE FROM {moviereview_links} WHERE nid = %d", $node->nid);
101    $numlinks = count($node->movielinks);    for ($i = 0; $i < $node->numlinks; $i++) {
102    for ($i = 0; $i < $numlinks; $i++) {      $movielink = "movielink-$i";
103      if ($node->movielinks[$i]) {      $linkdescription = "linkdescription-$i";
104        db_query("INSERT INTO {moviereview_links} (nid, movielink, description, weight) VALUES (%d, '%s', '%s', %d)", $node->nid, $node->movielinks[$i], $node->linkdescriptions[$i], $i);      if ($node->$movielink) {
105          db_query("INSERT INTO {moviereview_links} (nid, movielink, description, weight) VALUES (%d, '%s', '%s', %d)", $node->nid, $node->$movielink, $node->$linkdescription, $i);
106      }      }
107    }    }
108    
109  }  }
110    
111  function moviereview_delete($node) {  function moviereview_delete($node) {
# Line 131  function moviereview_validate(&$node) { Line 141  function moviereview_validate(&$node) {
141    return $error;    return $error;
142  }  }
143    
144  function moviereview_form(&$node, &$error) {  function moviereview_form(&$node) {
145    $op = arg(1);    $op = arg(1);
146    $edit = $_POST['edit'];    $edit = $_POST['edit'];
147    
148    if (function_exists('taxonomy_node_form')) {    //if (function_exists('taxonomy_node_form')) {
149      $output .= implode('', taxonomy_node_form('moviereview', $node));    //  $output .= implode('', taxonomy_node_form('moviereview', $node));
150    }    //}
151    
152    if ($edit['moviereview_more_actors'] == 1) {    if ($edit['numactors']) {
153      $node->numactors = $node->numactors + 5;      // It's a preview ...
154    }      if ($edit['moviereview_more_actors'] == 1) {
155    elseif ($node->actors) {        // ... and we need more actors
156      $node->numactors = count($node->actors);        //if ($edit['numactors'] % 2) {
157          //  $node->numactors = $edit['numactors'] + 1;
158          //}
159          //else {
160            $node->numactors = $edit['numactors'] + 5;
161          //}
162        }
163        else {
164          // we don't want more actors, just see the preview
165          // (numactors may have change with a previous preview)
166          $node->numactors = $edit['numactors'];
167        }
168    }    }
169    else {    elseif(!$node->numactors) {
170        // Just created review, start with one author.
171      $node->numactors = 5;      $node->numactors = 5;
172    }    }
173    
174    //  if ($edit['moviereview_more_actors'] == 1) {
175    //    $node->numactors = $node->numactors + 5;
176    //  }
177    //  elseif ($node->actors) {
178    //    $node->numactors = count($node->actors);
179    //  }
180    //  else {
181    //    $node->numactors = 5;
182    //  }
183    if ($edit['moviereview_more_links'] == 1) {    if ($edit['moviereview_more_links'] == 1) {
184      $node->numlinks = $node->numlinks + 5;      $node->numlinks = $node->numlinks + 5;
185    }    }
# Line 158  function moviereview_form(&$node, &$erro Line 190  function moviereview_form(&$node, &$erro
190      $node->numlinks = 3;      $node->numlinks = 3;
191    }    }
192    
193    $output .= form_hidden('numactors', $node->numactors);    $form['numactors'] = array(
194    $output .= form_hidden('numlinks', $node->numlinks);      '#type' => 'hidden',
195        '#value' => $node->numactors,
196    $output .= '<div id="moviereview-form">' . form_textfield(t('Movie title'), 'movietitle', $node->movietitle, 60, 255, t('The title of the movie being reviewed, if different than the title of this movie review.'));    );
197    $output .= form_textfield(t('Release year'), 'releaseyear', $node->releaseyear, 4, 255, t('The year the movie was released.  (Format:  YYYY).'));  
198    $output .= form_checkbox(t('Tv series'), 'tvseries', 1, $node->tvseries, t('Is this a tv series?'));    $form['numlinks'] = array(
199    $output .= form_textfield(t('Cover picture'), 'cover', $node->cover, 60, 255, t('URL of movie cover image.'));      '#type' => 'hidden',
200    $output .= form_textfield(t('Genre'), 'genre', $node->genre, 60, 255, t('Genre of the movie.'));      '#value' => $node->numlinks,
201    $output .= form_textfield(t('Director'), 'director', $node->director, 60, 255, t('Director(s) of the movie.'));    );
202    $output .= form_textfield(t('Writer'), 'writer', $node->writer, 60, 255, t('Writing credits.'));  
203      $form['title'] = array(
204    $output .= form_item(t('Actor(s)'), '');      '#type' => 'textfield',
205        '#title' => t('Title'),
206        '#default_value' => $node->title,
207        '#size' => 60,
208        '#maxlength' => 255,
209        '#description' => t('The title of the movie being reviewed.'),
210      );
211    
212    //  $form['movietitle'] = array(
213    //    '#type' => 'textfield',
214    //    '#title' => t('Movie title'),
215    //    '#default_value' => $node->movietitle,
216    //    '#size' => 60,
217    //    '#maxlength' => 255,
218    //    '#description' => t('The title of the movie being reviewed, if different than the title of this movie review.'),
219    //    '#prefix' => '<div id="moviereview-form">',
220    //  );
221    
222      $form['releaseyear'] = array(
223        '#type' => 'textfield',
224        '#title' => t('Release year'),
225        '#default_value' => $node->releaseyear,
226        '#size' => 4,
227        '#maxlength' => 255,
228        '#description' => t('The year the movie was released.  (Format:  YYYY).'),
229      );
230    
231      $form['tvseries'] = array(
232        '#type' => 'checkbox',
233        '#title' => t('Tv series'),
234        '#return_value' => 1,
235        '#default_value' => $node->tvseries,
236        '#description' => t('Is this a tv series?'),
237      );
238    
239      $form['cover'] = array(
240        '#type' => 'textfield',
241        '#title' => t('Cover picture'),
242        '#default_value' => $node->cover,
243        '#size' => 60,
244        '#maxlength' => 255,
245        '#description' => t('URL of movie cover image.'),
246      );
247    
248      $form['genre'] = array(
249        '#type' => 'textfield',
250        '#title' => t('Genre'),
251        '#default_value' => $node->genre,
252        '#size' => 60,
253        '#maxlength' => 255,
254        '#description' => t('Genre of the movie.'),
255      );
256    
257      $form['director'] = array(
258        '#type' => 'textfield',
259        '#title' => t('Director'),
260        '#default_value' => $node->director,
261        '#size' => 60,
262        '#maxlength' => 255,
263        '#description' => t('Director(s) of the movie.'),
264      );
265    
266      $form['writer'] = array(
267        '#type' => 'textfield',
268        '#title' => t('Writer'),
269        '#default_value' => $node->writer,
270        '#size' => 60,
271        '#maxlength' => 255,
272        '#description' => t('Writing credits.'),
273      );
274    
275      $form[] = array(
276        '#type' => 'item',
277        '#title' => t('Actor(s)'),
278        '#default_value' => '',
279      );
280    
281    for ($i = 0; $i < $node->numactors; $i++) {    for ($i = 0; $i < $node->numactors; $i++) {
282      $output .= form_textfield('', "actors][$i", $node->actors[$i], 60, 255, '');      $form["actor-$i"] = array(
283    }        '#type' => 'textfield',
284          '#title' => '',
285    $output .= form_checkbox(t('add more actors'), 'moviereview_more_actors', 1, 0, t('You can create space to list more actors by checking this box and clicking '). '<b>'. t('Preview'). '</b>.');        '#default_value' => $node->actors[$i],
286          '#size' => 60,
287    $output .= form_textfield(t('Runtime'), 'runtime', $node->runtime, 60, 255, t('The movie run time.'));        '#maxlength' => 255,
288    $output .= form_textfield(t('Country'), 'country', $node->country, 60, 255, t('Country of movie production.'));        '#description' => '',
289    $output .= form_textfield(t('Language'), 'language', $node->language, 60, 255, t('Language of the movie.'));      );
290    $output .= form_textfield(t('Imdb'), 'imdb', $node->imdb, 60, 255, t('Imdb id of the movie'));    }
291    $output .= form_textfield(t('Media'), 'media', $node->media, 60, 255, t('Media in which the movie is available'));  
292    $output .= form_textfield(t('Price'), 'price', $node->price, 60, 255, t('The cost of the movie being reviewed.'));    $form['moviereview_more_actors'] = array(
293    $output .= form_select(t('Rating'), 'rating', $node->rating, (array("<" . t('none') . ">") + drupal_map_assoc(range(1, 10))), t('Score of the movie on a 1 to 10 scale.'));      '#type' => 'checkbox',
294        '#title' => t('add more actors'),
295    $output .= form_textarea(t('Synopsis'), 'body', $node->body, 60, 18, t('A synopsis of the movie being reviewed.'));      '#return_value' => 1,
296        '#default_value' => 0,
297        '#description' => t('You can create space to list more actors by checking this box and clicking '). '<b>'. t('Preview'). '</b>.',
298      );
299    
300      $form['runtime'] = array(
301        '#type' => 'textfield',
302        '#title' => t('Runtime'),
303        '#default_value' => $node->runtime,
304        '#size' => 60,
305        '#maxlength' => 255,
306        '#description' => t('The movie run time.'),
307      );
308    
309      $form['country'] = array(
310        '#type' => 'textfield',
311        '#title' => t('Country'),
312        '#default_value' => $node->country,
313        '#size' => 60,
314        '#maxlength' => 255,
315        '#description' => t('Country of movie production.'),
316      );
317    
318      $form['language'] = array(
319        '#type' => 'textfield',
320        '#title' => t('Language'),
321        '#default_value' => $node->language,
322        '#size' => 60,
323        '#maxlength' => 255,
324        '#description' => t('Language of the movie.'),
325      );
326    
327      $form['imdb'] = array(
328        '#type' => 'textfield',
329        '#title' => t('Imdb'),
330        '#default_value' => $node->imdb,
331        '#size' => 60,
332        '#maxlength' => 255,
333        '#description' => t('Imdb id of the movie'),
334      );
335    
336      $form['media'] = array(
337        '#type' => 'textfield',
338        '#title' => t('Media'),
339        '#default_value' => $node->media,
340        '#size' => 60,
341        '#maxlength' => 255,
342        '#description' => t('Media in which the movie is available'),
343      );
344    
345      $form['price'] = array(
346        '#type' => 'textfield',
347        '#title' => t('Price'),
348        '#default_value' => $node->price,
349        '#size' => 60,
350        '#maxlength' => 255,
351        '#description' => t('The cost of the movie being reviewed.'),
352      );
353    
354      $form['rating'] = array(
355        '#type' => 'select',
356        '#title' => t('Rating'),
357        '#default_value' => $node->rating,
358        '#options' => (array("<" . t('none') . ">") + drupal_map_assoc(range(1, 10))),
359        '#description' => t('Score of the movie on a 1 to 10 scale.'),
360      );
361    
362      $form['body'] = array(
363        '#type' => 'textarea',
364        '#title' => t('Synopsis'),
365        '#default_value' => $node->body,
366        '#cols' => 60,
367        '#rows' => 18,
368        '#description' => t('A synopsis of the movie being reviewed.'),
369      );
370    
371    // Only display this field if longer input format was choosen    // Only display this field if longer input format was choosen
372    if (variable_get('moviereview_detail', 0) == 0) {    if (variable_get('moviereview_detail', 0) == 0) {
373      $output .= form_textarea(t('Location'), 'location', $node->location, 60, 18, t('Filming location.'));      $form['location'] = array(
374    }        '#type' => 'textarea',
375    $output .= form_textarea(t('Review'), 'review', $node->review, 60, 18, t('This is the actual movie review.'));        '#title' => t('Location'),
376          '#default_value' => $node->location,
377    $output .= form_item(t('Offsite links'), '');        '#cols' => 60,
378          '#rows' => 18,
379          '#description' => t('Filming location.'),
380        );
381      }
382    
383      $form['review'] = array(
384        '#type' => 'textarea',
385        '#title' => t('Review'),
386        '#default_value' => $node->review,
387        '#cols' => 60,
388        '#rows' => 18,
389        '#description' => t('This is the actual movie review.'),
390      );
391    
392    //  $form[] = array(
393    //    '#type' => 'item',
394    //    '#title' => t('Offsite links'),
395    //    '#default_value' => '',
396    //  );
397    
398    // TODO:  Replace table formatting with css    // TODO:  Replace table formatting with css
399    $output .= '<div id="mr_links">'."<table>\n";  //  $output .= '<div id="mr_links">'."<table>\n";
400    //  for ($i = 0; $i < $node->numlinks; $i++) {
401    //    $output .= "  <tr><td>\n";
402    //    $output .= form_textfield(t('URL'), "movielinks][$i", $node->movielinks[$i], 45, 255, '');
403    //    $output .= "  </td><td>\n";
404    //    $output .= form_textfield(t('Description'), "linkdescriptions][$i", $node->linkdescriptions[$i], 45, 255, '');
405    //    $output .= "  </td></tr>\n";
406    //  }
407    //  $output .= "</table></div>\n";
408    //  $output .= form_checkbox(t('add more links'), 'moviereview_more_links', 1, 0, t('If you need to add more links, check this box and click '). '<b>'. t('Preview'). '</b>.');
409    //  $output .= "</div>";
410    //  $output .= filter_form('format', $node->format);
411    
412    //  return $output;
413    //}
414    
415      $form['offsite_links'] = array(
416        '#type' => 'fieldset',
417        '#title' => t('Offsite links'),
418        '#collapsible' => TRUE,
419        '#collapsed' => TRUE,
420      );
421    
422      $form['offsite_links']['movielinks_begin'] = array(
423          '#type' => 'markup',
424          '#value' => '<table>',
425      );
426    for ($i = 0; $i < $node->numlinks; $i++) {    for ($i = 0; $i < $node->numlinks; $i++) {
427      $output .= "  <tr><td>\n";      $form['offsite_links']["movielink-$i"] = array(
428      $output .= form_textfield(t('URL'), "movielinks][$i", $node->movielinks[$i], 45, 255, '');        '#type' => 'textfield',
429      $output .= "  </td><td>\n";        '#title' => 'URL',
430      $output .= form_textfield(t('Description'), "linkdescriptions][$i", $node->linkdescriptions[$i], 45, 255, '');        '#default_value' => $node->movielinks[$i],
431      $output .= "  </td></tr>\n";        '#size' => 45,
432    }        '#maxlength' => 255,
433    $output .= "</table></div>\n";        '#description' => '',
434    $output .= form_checkbox(t('add more links'), 'moviereview_more_links', 1, 0, t('If you need to add more links, check this box and click '). '<b>'. t('Preview'). '</b>.');        '#prefix' => '<tr><td>',
435    $output .= "</div>";        '#suffix' => '</td>',
436    $output .= filter_form('format', $node->format);      );
437        $form['offsite_links']["linkdescription-$i"] = array(
438          '#type' => 'textfield',
439          '#title' => 'Description',
440          '#default_value' => $node->linkdescriptions[$i],
441          '#size' => 45,
442          '#maxlength' => 255,
443          '#description' => '',
444          '#prefix' => '<td>',
445          '#suffix' => '</td></tr>',
446        );
447      }
448      $form['offsite_links']['movielinks_end'] = array(
449          '#type' => 'markup',
450          '#value' => '</table>',
451      );
452    
453      $form['offsite_links']['moviereview_more_links'] = array(
454        '#type' => 'checkbox',
455        '#title' => t('add more links'),
456        '#value' => 0,
457        '#description' => t('If you need to add more links, check this box and click '). '<strong>'. t('Preview'). '</strong>.',
458      );
459    
460    return $output;    $form['format'] = filter_form($node->format);
461    
462      return $form;
463    
464  }  }
465    
466    
467  function moviereview_menu($may_cache) {  function moviereview_menu($may_cache) {
468    $items = array();    $items = array();
469    
# Line 235  function moviereview_settings() { Line 490  function moviereview_settings() {
490    if (!file_check_location(variable_get('moviereview_css', 'modules/moviereview/moviereview.css'))) {    if (!file_check_location(variable_get('moviereview_css', 'modules/moviereview/moviereview.css'))) {
491      $error['moviereview_css'] = theme('error', t('File does not exist, or is not readable.'));      $error['moviereview_css'] = theme('error', t('File does not exist, or is not readable.'));
492    }    }
493    $output = form_textfield(t('Style sheet'), "moviereview_css", variable_get('moviereview_css', 'modules/moviereview/moviereview.css'), 70, 255, t("Specify the relative path to your moviereview style sheet.  The style sheet specified here will be used to style your moviereview pages.  If you prefer to style your moviereview pages in your theme, you can leave this field blank. ". $error['moviereview_css']));  
494    $output .= form_radios(t('Details to collect'), 'moviereview_detail', variable_get('moviereview_detail', 0), array(t('Synopsis, Location and Review'), t('Synopsis and Review only')), t('Details you would like to collect about the movies as freeform text.'));    $form['moviereview_settings'] = array(
495    $output .= form_textarea(t('Explanation or submission guidelines'), 'moviereview_help', variable_get('moviereview_help', ''), 55, 4, t('This text will be displayed at the top of the movie review submission form.  Useful for helping or instructing your users.'));      '#type' => 'fieldset',
496    $output .= form_select(t('Minimum number of words'), 'minimum_moviereview_size', variable_get('minimum_moviereview_size', 0), drupal_map_assoc(array(0, 10, 25, 50, 75, 100, 125, 150, 175, 200, 500, 1000)), t('The minimum number of words a movie review must have to be considered valid.  This can be useful to prevent submissions that do not meet the site\'s standards, such as short test posts.'));      '#title' => t('Moviereview settings'),
497    return $output;    );
498    
499      $form['moviereview_settings']['stylesheet'] = array(
500        '#type' => 'textfield',
501        '#title' => t('Style sheet'),
502        '#default_value' => variable_get('moviereview_css', 'modules/moviereview/moviereview.css'),
503        '#size' => 70,
504        '#maxlength' => 255,
505        '#description' => t("Specify the relative path to your moviereview style sheet.  The style sheet specified here will be used to style your moviereview pages.  If you prefer to style your moviereview pages in your theme, you can leave this field blank. ". $error['moviereview_css']),
506      );
507    
508      $form['moviereview_settings']['moviereview_detail'] = array(
509        '#type' => 'radios',
510        '#title' => t('Details to collect'),
511        '#default_value' => variable_get('moviereview_detail', 0),
512        '#options' => array(t('Synopsis, Location and Review'), t('Synopsis and Review only')),
513        '#description' => t('Details you would like to collect about the movies as freeform text.'),
514      );
515    
516      $form['moviereview_settings']['moviereview_help'] = array(
517        '#type' => 'textarea',
518        '#title' => t('Explanation or submission guidelines'),
519        '#default_value' => variable_get('moviereview_help', ''),
520        '#cols' => 55,
521        '#rows' => 4,
522        '#description' => t('This text will be displayed at the top of the movie review submission form.  Useful for helping or instructing your users.'),
523      );
524    
525      $form['minimum_moviereview_size'] = array(
526        '#type' => 'select',
527        '#title' => t('Minimum number of words'),
528        '#default_value' => variable_get('minimum_moviereview_size', 0),
529        '#options' => drupal_map_assoc(array(0, 10, 25, 50, 75, 100, 125, 150, 175, 200, 500, 1000)),
530        '#description' => t('The minimum number of words a movie review must have to be considered valid.  This can be useful to prevent submissions that do not meet the site\'s standards, such as short test posts.'),
531      );
532    
533      return $form;
534  }  }
535    
536  function moviereview_page() {  function moviereview_page() {
# Line 428  function theme_moviereview_content(&$nod Line 719  function theme_moviereview_content(&$nod
719    if($node->body) {    if($node->body) {
720      $output .= "  <div class=\"synopsis\">\n";      $output .= "  <div class=\"synopsis\">\n";
721      $output .= "    <span class=\"label4\">". t('Synopsis') ."</span><br />\n";      $output .= "    <span class=\"label4\">". t('Synopsis') ."</span><br />\n";
722      $output .= "    <span class=\"content2\">". check_output($node->body, $node->format) ."</span>\n";      $output .= "    <span class=\"content2\">". check_markup($node->body, $node->format) ."</span>\n";
723      $output .= "  </div><br />\n";      $output .= "  </div><br />\n";
724    }    }
725    if($node->location) {    if($node->location) {
726      $output .= "  <div class=\"location\">\n";      $output .= "  <div class=\"location\">\n";
727      $output .= "    <span class=\"label4\">". t('Location') ."</span><br />\n";      $output .= "    <span class=\"label4\">". t('Location') ."</span><br />\n";
728      $output .= "    <span class=\"content2\">". check_output($node->location, $node->format) ."</span>\n";      $output .= "    <span class=\"content2\">". check_markup($node->location, $node->format) ."</span>\n";
729      $output .= "  </div><br />\n";      $output .= "  </div><br />\n";
730    }    }
731    if($node->review) {    if($node->review) {
732      $output .= "  <div class=\"review\">\n";      $output .= "  <div class=\"review\">\n";
733      $output .= "    <span class=\"label4\">". t('Review') ."</span><br />\n";      $output .= "    <span class=\"label4\">". t('Review') ."</span><br />\n";
734      $output .= "    <span class=\"content2\">". check_output($node->review, $node->format) ."</span>\n";      $output .= "    <span class=\"content2\">". check_markup($node->review, $node->format) ."</span>\n";
735      $output .= "  </div><br />\n";      $output .= "  </div><br />\n";
736    }    }
737    if($node->movielinks[0]) {    if($node->movielinks[0]) {
# Line 452  function theme_moviereview_content(&$nod Line 743  function theme_moviereview_content(&$nod
743        $linkdescription = $node->linkdescriptions[$i] ? $node->linkdescriptions[$i] : $node->movielinks[$i];        $linkdescription = $node->linkdescriptions[$i] ? $node->linkdescriptions[$i] : $node->movielinks[$i];
744        if(ereg('^http://|^https://|ftp://',"$movielink")) {        if(ereg('^http://|^https://|ftp://',"$movielink")) {
745          // off site link          // off site link
746          $movielink = "<a href=\"$movielink\">". check_output($linkdescription, $node->format) .'</a>';          $movielink = "<a href=\"$movielink\">". check_markup($linkdescription, $node->format) .'</a>';
747        }        }
748        elseif($movielink) {        elseif($movielink) {
749          // on site link          // on site link
750          $movielink = l("$linkdescription", "$movielink");          $movielink = l("$linkdescription", "$movielink");
751        }        }
752        $output .= "    <span class=\"content2\">". check_output($movielink, $node->format) ."</span>\n";        $output .= "    <span class=\"content2\">". check_markup($movielink, $node->format) ."</span>\n";
753      }      }
754      $output .= "  </div>\n";      $output .= "  </div>\n";
755    }    }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.2