function paging_fetch_names in Paging 6
Same name and namespace in other branches
- 7 paging.module \paging_fetch_names()
Return an array of page names for a node.
Parameters
$node_body: Either the nid of the node or the node object itself.
Return value
An array of page names found in the node body.
2 calls to paging_fetch_names()
- paging_render_names in ./
paging.module - Returns a rendered list of page links.
- _paging_nodeapi in ./
paging.module - Helper function for paging_nodeapi().
File
- ./
paging.module, line 419 - Allows users to use a tag to break up a node into multiple pages.
Code
function paging_fetch_names($node_body) {
if (is_numeric($node_body)) {
$node = node_load($node_body);
// Support for CCK.
if (isset($node->field_body[0]['view'])) {
$node_body = $node->field_body[0]['view'];
}
elseif (isset($node->field_body[0]['value'])) {
$node_body = $node->field_body[0]['value'];
}
else {
$node_body = $node->body;
}
}
preg_match("/<!--pagenames:(.*?)-->/", $node_body, $matches);
if (isset($matches[1])) {
return explode('||', $matches[1]);
}
return;
}