You are here

README.txt in Recently Read 6

Same filename and directory in other branches
  1. 8 README.txt
  2. 7.3 README.txt
  3. 7 README.txt
  4. 7.2 README.txt
== SUMMARY ==

The Recently Read module displays the history of recently read content (nodes) 
a particular user has viewed. Each authenticated user has its own history 
recorded, so this module may be useful i.e. for displaying recently viewed 
products on the e-commerce site. The history is displayed as a block and each 
content type gets its own block.

If you need more flexibility, this module can be replaced by properly configured
Flag, Rules and Views modules. Check out the following links for more details:
* http://drupal.org/node/405754
* http://jan.tomka.name/blog/list-recently-viewed-nodes-drupal

For a full description of the module, visit the project page:
  http://drupal.org/sandbox/pgorecki/1080970

To submit bug reports and feature suggestions, or to track changes:
  http://drupal.org/project/issues/1080970


== REQUIREMENTS ==

None.


== INSTALLATION ==

* Install as usual, see http://drupal.org/node/70151 for further information.


== CONFIGURATION ==

* Customize the module settings in Administer >> Site configuration >> 
  Recently read content. On this pace you can:

  - Select which content types will should be tracked by the module

    After enabling content type tracking, go to Administer >> Site building >>
    Blocks to configure the block settings of each tracked content type.

  - Recently read list length specifies the maximum number of nodes 
    per user per content type that will be stored in a databse. Note that this
    is different from "Maximum number of links to display in the block" setting
    available in the Recently read block configutation options.

== CUSTOMIZATION ==

Recently read module lacks UI for advanced configuration, but most tasks can
be easily implemented by code snippets or in the theme layer.

* Displaying more than a node title

  By default, Recently Read block displays a list of links to node titles.
  You can customize the output by overriding theme_recently_read_item() and
  theme_recently_read_item_list() functions in your theme.
  
  For example, to display an image field and a link:
  
  function mytemplate_recently_read_item($item) {
    $output = '';  
    if ($item['type'] == 'page') {
      $node = node_load($item['nid']);
      if (isset($node->field_image[0])) {
        $output .= theme('imagefield_item', $node->field_image[0]);
      }
    }
    $output .= l($item['title'], 'node/' . $item['nid']);
    return $output;
  }

* Multiple content types in the same block

  To display multiple content types in the same block, create a new block with PHP body
  and modify the following examlpe to your needs:

  <?php
  // disable page caching if this block is displayed
  recently_read_disable_page_cache();
  // get 3 recently read pages and articles items for current user
  // (you can skip the last argument to display all items)
  global $user;
  user_is_logged_in() ? $user_id = $user->uid : 0;
  $items = recently_read_get_read_items(array('page', 'article'), $user_id, 3);
  // get html string with all items
  return theme('recently_read_item_list', array('items' => $items));
  ?>


-- CONTACT --

Current maintainer:
* Przemyslaw Gorecki (pgorecki) - http://drupal.org/user/642012

File

README.txt
View source
  1. == SUMMARY ==
  2. The Recently Read module displays the history of recently read content (nodes)
  3. a particular user has viewed. Each authenticated user has its own history
  4. recorded, so this module may be useful i.e. for displaying recently viewed
  5. products on the e-commerce site. The history is displayed as a block and each
  6. content type gets its own block.
  7. If you need more flexibility, this module can be replaced by properly configured
  8. Flag, Rules and Views modules. Check out the following links for more details:
  9. * http://drupal.org/node/405754
  10. * http://jan.tomka.name/blog/list-recently-viewed-nodes-drupal
  11. For a full description of the module, visit the project page:
  12. http://drupal.org/sandbox/pgorecki/1080970
  13. To submit bug reports and feature suggestions, or to track changes:
  14. http://drupal.org/project/issues/1080970
  15. == REQUIREMENTS ==
  16. None.
  17. == INSTALLATION ==
  18. * Install as usual, see http://drupal.org/node/70151 for further information.
  19. == CONFIGURATION ==
  20. * Customize the module settings in Administer >> Site configuration >>
  21. Recently read content. On this pace you can:
  22. - Select which content types will should be tracked by the module
  23. After enabling content type tracking, go to Administer >> Site building >>
  24. Blocks to configure the block settings of each tracked content type.
  25. - Recently read list length specifies the maximum number of nodes
  26. per user per content type that will be stored in a databse. Note that this
  27. is different from "Maximum number of links to display in the block" setting
  28. available in the Recently read block configutation options.
  29. == CUSTOMIZATION ==
  30. Recently read module lacks UI for advanced configuration, but most tasks can
  31. be easily implemented by code snippets or in the theme layer.
  32. * Displaying more than a node title
  33. By default, Recently Read block displays a list of links to node titles.
  34. You can customize the output by overriding theme_recently_read_item() and
  35. theme_recently_read_item_list() functions in your theme.
  36. For example, to display an image field and a link:
  37. function mytemplate_recently_read_item($item) {
  38. $output = '';
  39. if ($item['type'] == 'page') {
  40. $node = node_load($item['nid']);
  41. if (isset($node->field_image[0])) {
  42. $output .= theme('imagefield_item', $node->field_image[0]);
  43. }
  44. }
  45. $output .= l($item['title'], 'node/' . $item['nid']);
  46. return $output;
  47. }
  48. * Multiple content types in the same block
  49. To display multiple content types in the same block, create a new block with PHP body
  50. and modify the following examlpe to your needs:
  51. // disable page caching if this block is displayed
  52. recently_read_disable_page_cache();
  53. // get 3 recently read pages and articles items for current user
  54. // (you can skip the last argument to display all items)
  55. global $user;
  56. user_is_logged_in() ? $user_id = $user->uid : 0;
  57. $items = recently_read_get_read_items(array('page', 'article'), $user_id, 3);
  58. // get html string with all items
  59. return theme('recently_read_item_list', array('items' => $items));
  60. ?>
  61. -- CONTACT --
  62. Current maintainer:
  63. * Przemyslaw Gorecki (pgorecki) - http://drupal.org/user/642012