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 1121 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 830 postParser->parse_message
/showthread.php 1121 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 1121 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 830 postParser->parse_message
/showthread.php 1121 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 830 postParser->parse_message
/showthread.php 1121 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
get_page_content(FALSE)
#1
I need a function which returns whether the page has content or not. So i modified the function get_page_content() in this way

PHP Code:
function get_page_content($echo true) {
    global 
$content;
    
exec_action('content-top');
    
$content strip_decode($content);
    
$content exec_filter('content',$content);
    if(
getDef('GSCONTENTSTRIP',true)) $content strip_content($content);
    if (
$echo) {
        echo 
$content;
    } else {
        return 
$content;
    }
    
exec_action('content-bottom');

Can you include it in the core so that it can be called by get_page_content(FALSE)?

Thx

Alex
Reply
#2
Hi Alexander,

Thank you for showing your php code in this new use of the function get_page_content()

I think it would be better not to change anything in the GS core for maximum GS portability.

We can always write our own customized functions and put them inside
/theme/your_theme/functions.php

Grts,
F.
Reply
#3
(2019-10-23, 23:15:15)Felix Wrote: I think it would be better not to change anything in the GS core for maximum GS portability.

So do I - therefore i asked to include it in the GS core on next update :-)

Alex
Reply
#4
you can get page contents to put into a variable for testing and process without echoing it,using the function
returnPageContent()
PHP Code:
$stuff=returnPageContent('page_slug'); 
does this do what you want ?

lesh
Reply




Users browsing this thread: 1 Guest(s)