Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- o1@jupiter:~/static/jupiter-070314/sites/test-270414.click-monkey.net$ drush dl prev_next
- Project prev_next (7.x-1.x-dev) downloaded to /data/disk/o1/static/jupiter-070314/sites/all/modules/prev_next. [success]
- Project prev_next contains 2 modules: prev_next_views, prev_next.
- o1@jupiter:~/static/jupiter-070314/sites/test-270414.click-monkey.net$ drush en prev_next
- The following extensions will be enabled: prev_next
- Do you really want to continue? (y/n): y
- prev_next was enabled successfully. [ok]
- Prev/Next will index from node 50 downward. [status]
- o1@jupiter:~/static/jupiter-070314/sites/test-270414.click-monkey.net$ cd ../themes/garland
- o1@jupiter:~/static/jupiter-070314/themes/garland$ cat template.php
- <?php
- function pn_node($node, $mode = 'n') {
- if (!function_exists('prev_next_nid')) {
- return NULL;
- }
- switch($mode) {
- case 'p':
- $n_nid = prev_next_nid($node->nid, 'prev');
- $link_text = 'previous';
- break;
- case 'n':
- $n_nid = prev_next_nid($node->nid, 'next');
- $link_text = 'next';
- break;
- default:
- return NULL;
- }
- if ($n_nid) {
- $n_node = node_load($n_nid);
- switch($n_node->type) {
- case 'article':
- $html = l('"'.$n_node->title .'"', 'node/'.$n_node->nid);
- return $html;
- }
- }
- }
- o1@jupiter:~/static/jupiter-070314/themes/garland$ cat node.tpl.php
- <?php
- ?>
- <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?>"<?php print $attributes; ?>>
- <?php print $user_picture; ?>
- <?php print render($title_prefix); ?>
- <?php if (!$page): ?>
- <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
- <?php endif; ?>
- <?php print render($title_suffix); ?>
- <?php if ($display_submitted): ?>
- <span class="submitted"><?php print $submitted ?></span>
- <?php endif; ?>
- <div class="content clearfix"<?php print $content_attributes; ?>>
- <?php
- // We hide the comments and links now so that we can render them later.
- hide($content['comments']);
- hide($content['links']);
- print render($content);
- ?>
- </div>
- <div class="clearfix">
- <?php if (!empty($content['links'])): ?>
- <div class="links"><?php print render($content['links']); ?></div>
- <?php endif; ?>
- <?php print render($content['comments']); ?>
- </div>
- <?php
- Print "Hello, World! yes";
- ?>
- <ul>
- <li><?php print pn_node($node, 'n'); ?></li>
- <li><?php print pn_node($node, 'p'); ?></li>
- </ul>
- </div>
- o1@jupiter:~/static/jupiter-070314/themes/garland$
Add Comment
Please, Sign In to add comment