The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Way to get List of all the Pages in a plugin?
#3
I tried menu_data() and breaks the code. As you suggested I went to the pages.php and looked at how it lists the pages there. I ended up copying some code and turned it into a function:

Code:
function getPages()
{
    $path         = GSDATAPAGESPATH;
    //display all pages
    $filenames = getFiles($path);
    $count="0";
    $pagesArray = array();
    if (count($filenames) != 0) {
        foreach ($filenames as $file) {
            if (isFile($file, $path, 'xml')) {
                $data = getXML($path .$file);
                $status = $data->menuStatus;
                //$pagesArray[$count]['title'] = $data->title;
                $pagesArray[$count]['title'] = html_entity_decode($data->title, ENT_QUOTES, 'UTF-8');
                $pagesArray[$count]['parent'] = $data->parent;
                $pagesArray[$count]['menuStatus'] = $data->menuStatus;
                $pagesArray[$count]['private'] = $data->private;
                if ($data->parent != '') {
                    $parentdata = getXML($path . $data->parent .'.xml');
                    $parentTitle = $parentdata->title;
                    $pagesArray[$count]['sort'] = $parentTitle .' '. $data->title;
                } else {
                    $pagesArray[$count]['sort'] = $data->title;
                }
                $pagesArray[$count]['url'] = $data->url;
                $pagesArray[$count]['date'] = $data->pubDate;
                $parentTitle = '';
                $count++;
            }
        }
    }
    
    return $pagesArray;
}

I think if you guys include this into a global/common functions, then It can be useful for other plugin developers.
- Julian

My GetSimple Plugins: Simple Image Gallery | TweetMeme reTweet Button
Reply


Messages In This Thread
Way to get List of all the Pages in a plugin? - by juliancc - 2010-03-06, 07:40:19



Users browsing this thread: 2 Guest(s)