Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get content published in other page
#19
Here it is, I've removed all the Customfields code.

In my example I've created a page called "portfolio"
then created all the subpages with the parent set to "portfolio"

Just style the output to what you need.

Mike..
Code:
function getPortfolio(){
    global $PRETTYURLS;
    global $SITEURL;    
    $path = "data/pages";
        $dir_handle = @opendir($path) or die("Unable to open $path");
        $filenames = array();
        while ($filename = readdir($dir_handle)) {
            $filenames[] = $filename;
        }
        $pagesArray = array();
        if (count($filenames) != 0) {
            foreach ($filenames as $file) {
                if ($file == "." || $file == ".." || is_dir("data/pages/".$file) || $file == ".htaccess"  ) {
                    // not a page data file
                } else {
                    $thisfile = @file_get_contents('data/pages/'.$file);
                    $data = simplexml_load_string($thisfile);
                    
                    //change portfolio to your top page name....
                    if ($data->parent == 'portfolio' && $data->private!="Y") {

                    echo "<li>";                      
                        echo stripslashes(htmlspecialchars_decode($data->content, ENT_QUOTES));
                       echo "</li>";    
                        
                    }
                }
            }
        }
    
}
My Github Repos: Github
Website: DigiMute
Reply


Messages In This Thread
Get content published in other page - by Soueb - 2009-08-19, 00:11:54
Get content published in other page - by ccagle8 - 2009-12-14, 12:09:24
Get content published in other page - by focoves - 2009-12-16, 05:59:36
Get content published in other page - by focoves - 2009-12-19, 02:11:25
Get content published in other page - by melmoth - 2010-02-04, 22:03:52
Get content published in other page - by melmoth - 2010-02-05, 21:41:03
Get content published in other page - by melmoth - 2010-02-10, 19:32:26
Get content published in other page - by geggal - 2010-09-28, 05:30:45
Get content published in other page - by geggal - 2010-09-28, 06:04:57
Get content published in other page - by n00dles101 - 2010-09-28, 06:20:55
Get content published in other page - by geggal - 2010-09-28, 06:35:27



Users browsing this thread: 1 Guest(s)