Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit 6d84f6e

Browse files
committed
2 parents 37c769d + 0277e6b commit 6d84f6e

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

authMgrPlus/plugin.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,4 +624,48 @@ function amp_is_valid_user() {
624624

625625
return $valid;
626626
}
627+
628+
yourls_add_action( 'html_footer', 'amp_format_table_javascript' );
629+
630+
function amp_format_table_javascript() {
631+
echo <<<JS
632+
633+
<script>
634+
if($("body").hasClass("index")) {
635+
document.querySelector("#main_table tfoot th").colSpan = 7;
636+
document.querySelector("#nourl_found td").colSpan = 7;
637+
}
638+
</script>
639+
640+
JS;
641+
}
642+
643+
function array_insert($array, $position, $insert_array) {
644+
$first_array = array_splice($array, 0, $position);
645+
$array = array_merge($first_array, $insert_array, $array);
646+
647+
return $array;
648+
}
649+
650+
yourls_add_filter('table_head_cells', 'amp_username_table_head');
651+
function amp_username_table_head( $cells ) {
652+
$user_head = array( 'username' => 'Username' );
653+
$cells = array_insert($cells, 5, $user_head);
654+
return $cells;
655+
}
656+
657+
yourls_add_filter('table_add_row_cell_array', 'amp_add_user_row');
658+
function amp_add_user_row( $cells, $keyword ) {
659+
$username = amp_keyword_owner($keyword);
660+
$user_cell = array(
661+
'username' => array(
662+
'template' => '%username%',
663+
'username' => $username,
664+
)
665+
);
666+
$cells = array_insert($cells, 5, $user_cell);
667+
668+
return $cells;
669+
}
670+
627671
?>

0 commit comments

Comments
 (0)