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 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
Sort subpages by date in Page Management
#1
Another small trick (for GS 3.0).

In Page Management ("View all pages"), list subpages (children) of a parent sorted by date instead of page title.

Edit /admin/pages.php line 42. Change this:

Code:
$pagesArray[$count]['sort'] = $parentTitle .' '. $data->title;

to:
Code:
$pagesArray[$count]['sort'] = $parentTitle .' '.str_pad(strval(2147483647-strtotime($data->pubDate)),10,'0',STR_PAD_LEFT);

That's for descending (newer first). If you prefer ascending order, change to:
Code:
$pagesArray[$count]['sort'] = $parentTitle .' '.str_pad(strval(strtotime($data->pubDate)),10,'0',STR_PAD_LEFT);

(Note: Parent pages will still be sorted by title.)
Reply
#2
There was a bug in these patches (pages older than Aug 2001 were not sorted properly).

I've edited the post to fix both.
Reply




Users browsing this thread: 1 Guest(s)