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 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
sub-pages into one page
#17
shawn_a, thank you very much for this function. This is so helpful!

I use your code

PHP Code:
<?php
     define
("IN_SUB",true);
 
    $page get_page_slug(false);
 
    $children getChildrenMulti($page,array('title','template','menuOrder'));
 
    $childrenSorted subval_sort($children,'menuOrder');
 
    foreach($childrenSorted as $child) {
 
        $template $child['template'];
 
        $page $child['url'];
 
        if($template!='template.php') include($template);
 
    }
?>

and it works fantastic except for one situation: if you have only one child page I get a warning: Invalid argument supplied for foreach(). Is it possible to fix that and to show only child pages that are public and hide private pages?

Thank you for your help.

Edit: After searching the forum again, I found this solution which is what I needed:

http://get-simple.info/forums/showthread.php?tid=3081

However, thank you for your kind support.
Reply


Messages In This Thread
sub-pages into one page - by Timbow - 2014-02-05, 07:52:19
RE: sub-pages into one page - by shawn_a - 2014-02-05, 08:30:03
RE: sub-pages into one page - by Timbow - 2014-02-05, 08:43:57
RE: sub-pages into one page - by shawn_a - 2014-02-05, 10:32:51
RE: sub-pages into one page - by shawn_a - 2014-02-05, 10:40:35
RE: sub-pages into one page - by shawn_a - 2014-02-05, 10:52:56
RE: sub-pages into one page - by shawn_a - 2014-02-05, 14:29:54
RE: sub-pages into one page - by Timbow - 2014-02-05, 18:24:10
RE: sub-pages into one page - by Timbow - 2014-02-20, 00:29:40
RE: sub-pages into one page - by Timbow - 2014-02-20, 02:04:31
RE: sub-pages into one page - by shawn_a - 2014-02-20, 02:40:48
RE: sub-pages into one page - by shawn_a - 2014-02-20, 02:56:43
RE: sub-pages into one page - by shawn_a - 2014-02-20, 03:12:23
RE: sub-pages into one page - by Timbow - 2014-02-20, 04:51:16
RE: sub-pages into one page - by shawn_a - 2014-02-20, 05:18:01
RE: sub-pages into one page - by Timbow - 2014-02-21, 01:15:38
RE: sub-pages into one page - by smsHH - 2017-09-29, 02:10:28



Users browsing this thread: 1 Guest(s)