The following warnings occurred:
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message



GetSimple Support Forum
Pulling child page info - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Pulling child page info (/showthread.php?tid=7544)



Pulling child page info - alex809 - 2015-09-13

Hello,
So i have successfully used this: http://get-simple.info/forums/showthread.php?tid=6629

In order to pull page content and then i created a function to pull the page title as well

Code:
function getPageTitle($page,$field='title'){

    $thisfile = file_get_contents(GSDATAPAGESPATH.$page.'.xml');
    $data = simplexml_load_string($thisfile);
    $title = stripslashes(htmlspecialchars_decode($data->$field, ENT_QUOTES));
    if ($field=='title'){
        $title = exec_filter('title',$title);
    }
    echo $title;
}

and i can now use:
<?php getPageTitle($child); ?>

So, now all i need to do is pull the date for the child pages.
However, i can't figure out how to do a function to be able to pull the child page date because the date function is created in theme_functions and not caching_functions.

So how would i go about pulling the child pages correct date?
Currently i can either display the main pages date or what is currently displaying.

[Image: mZACkrA.png]


If someone could help me in pulling the child pages date without any plugins that would be great Big Grin
Since i don't want to have to go through and manually add pages to the file. I want it done automatically so this is why I'm doing it this way.

Thanks
- Alex


RE: Pulling child page info - DimaYakovlev - 2015-09-17

(2015-09-13, 06:44:25)alex809 Wrote: Hello,
So i have successfully used this: http://get-simple.info/forums/showthread.php?tid=6629

In order to pull page content and then i created a function to pull the page title as well



Code:
function getPageTitle($page,$field='title'){

    $thisfile = file_get_contents(GSDATAPAGESPATH.$page.'.xml');
    $data = simplexml_load_string($thisfile);
    $title = stripslashes(htmlspecialchars_decode($data->$field, ENT_QUOTES));
    if ($field=='title'){
        $title = exec_filter('title',$title);
    }
    echo $title;
}

and i can now use:
<?php getPageTitle($child); ?>

So, now all i need to do is pull the date for the child pages.
However, i can't figure out how to do a function to be able to pull the child page date because the date function is created in theme_functions and not caching_functions.

So how would i go about pulling the child pages correct date?
Currently i can either display the main pages date or what is currently displaying.

[Image: mZACkrA.png]


If someone could help me in pulling the child pages date without any plugins that would be great Big Grin
Since i don't want to have to go through and manually add pages to the file. I want it done automatically so this is why I'm doing it this way.

Thanks
- Alex

See this post http://get-simple.info/forums/showthread.php?tid=6629&pid=46969#pid46969
Use getPageField  function to get needed fields from child pages. Smile


RE: Pulling child page info - alex809 - 2015-09-19

(2015-09-17, 17:16:03)DimaYakovlev Wrote: See this post http://get-simple.info/forums/showthread.php?tid=6629&pid=46969#pid46969
Use getPageField  function to get needed fields from child pages. Smile

I got the code from that thread.. http://get-simple.info/forums/showthread.php?tid=6629&pid=46971#pid46971

That isn't gonna help me pull the child pages date. I already got the child page titles and content.

As you can see.
PHP Code:
<?php getPageField($child'date'); ?>

Returns nothing: [Image: JW9wZVf.png]


RE: Pulling child page info - shawn_a - 2015-09-19

its pubDate


RE: Pulling child page info - alex809 - 2015-09-19

(2015-09-19, 03:04:31)shawn_a Wrote: its pubDate

Ok, It works Big Grin
Now how do i get it to display properly? Lol

[Image: Xhacthx.png]
PHP Code:
<div class="published-date"><?php getPageField($child'pubDate'); ?></a></div> 



RE: Pulling child page info - Carlos - 2015-09-19

PHP Code:
<?php echo date('d-m-Y'strtotime(returnPageField($child'pubDate'))); ?>



RE: Pulling child page info - alex809 - 2015-09-21

(2015-09-19, 05:54:45)Carlos Wrote:
PHP Code:
<?php echo date('d-m-Y'strtotime(returnPageField($child'pubDate'))); ?>

Thanks.

I simply switched it to
PHP Code:
<?php echo date('F jS, Y'strtotime(returnPageField($child'pubDate'))); ?>

Actually displays the proper date now Big Grin