Drupal Pagers

The page creates 4 global variables
Array of the number of items per page for each pager.
global $pager_limits;
Array of current page number for each pager.
Note: the page numbering starts at 0. 0 represents page 1, 1 reprensents 2 and so forth.
global $pager_page_array
Array of the total number of pages for each pager.
global $pager_total;
Array of the total number of items found for each pager.
global $pager_total_items;	

Programmatically attach an image to a node

At times it is necessary to programmatically attach an image to a node. Below is a snippet of code to do so.
    //the file to attach
    $filename = '/Users/me/Desktop/ion-2.jpg';
    $base = basename($filename);
 
    //load the image to memory
    $image = file_get_contents($filename);  
    //save the image to the database and return the image
    $file = file_save_data($image, 'public://'.$base,FILE_EXISTS_RENAME);
    
    //create a node to attach the image to
    $n = new stdClass();
    $n->title = 'my test: TEST';
    $n->type = 'test';//the node type
    

Pages