public function createLinks($result_string = 'Displaying page :current_page_number_displaying of :total_pages<br>:pagination')
    {
        $pagination_data = $this->getPaginationData();

        if (!is_array($pagination_data)) {
            return null;
        }

        if ($result_string == null) {
            $result_string = 'Displaying page :current_page_number_displaying of :total_pages<br>:pagination';
        }

        // render the pagination. --------------------------------------------------------------------------------------------
        $pagination_rendered = "\n";
        if (array_key_exists('overall_tag_open', $pagination_data)) {
            $pagination_rendered .= $pagination_data['overall_tag_open'];
        }
        if (array_key_exists('generated_pages', $pagination_data) && is_array($pagination_data['generated_pages'])) {
            foreach ($pagination_data['generated_pages'] as $page_key => $page_item) {
                if (is_array($page_item)) {
                    if (array_key_exists('tag_open', $page_item)) {
                        $pagination_rendered .= $page_item['tag_open'];
                    }
                    if (array_key_exists('link', $page_item) && $page_item['link'] != null) {
                        $pagination_rendered .= '<a href="' . $page_item['link'] . '">';
                    }
                    if (array_key_exists('text', $page_item)) {
                        $pagination_rendered .= $page_item['text'];
                    }
                    if (array_key_exists('link', $page_item) && $page_item['link'] != null) {
                        $pagination_rendered .= '</a>';
                    }
                    if (array_key_exists('tag_close', $page_item)) {
                        $pagination_rendered .= $page_item['tag_close'];
                    }
                }
            }
            unset($page_item, $page_key);
        }
        if (array_key_exists('overall_tag_close', $pagination_data)) {
            $pagination_rendered .= $pagination_data['overall_tag_close'];
        }
        $pagination_rendered .= "\n";
        // end render the pagination ----------------------------------------------------------------------------------------

        $output = $result_string;
        if (array_key_exists('total_pages', $pagination_data)) {
            $output = str_replace(':total_pages', $pagination_data['total_pages'], $output);
        }
        if (array_key_exists('page_number_type', $pagination_data)) {
            $output = str_replace(':page_number_type', $pagination_data['total_pages'], $output);
        }
        if (array_key_exists('current_page_number_displaying', $pagination_data)) {
            $output = str_replace(':current_page_number_displaying', $pagination_data['current_page_number_displaying'], $output);
        }
        if (isset($pagination_rendered)) {
            $output = str_replace(':pagination', $pagination_rendered, $output);
        }

        unset($pagination_data, $pagination_rendered);
        return $output;
    }