Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
aXenDev Posted July 11, 2021 Posted July 11, 2021 Hi, I have a problem with pagination in user profiles (Tabs). I create an application: I'll add a Profile named ProfileClassname.php in Extensions Its contents have not been changed, except for the render function to: /** * Display * * @return string */ public function render() { $table = new \IPS\Helpers\Table\Content('IPS\testpagination\TestPagination', $this->member->url()->setQueryString(array('tab' => 'node_testpagination_Profile'))); $table->rowsTemplate = array(\IPS\Theme::i()->getTemplate('profile', 'testpagination', 'front'), 'testpaginationRow'); $table->limit = 2; $table->noModerate = TRUE; return (string) $table; } I have created a testpaginationRow.phtml file with the contents: <ips:template parameters="$table, $headers, $rows" /> {{foreach $rows as $row}} test {{endforeach}} IPS\testpagination\TestPagination class content: <?php namespace IPS\testpagination; /* To prevent PHP errors (extending class does not exist) revealing path */ if (!\defined('\IPS\SUITE_UNIQUE_KEY')) { header((isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0') . ' 403 Forbidden'); exit; } class _TestPagination extends \IPS\Content\Item { /** * @brief Database Table */ public static $databaseTable = 'testpagination_members'; /** * @brief Application */ public static $application = 'testpagination'; /** * @brief Database Prefix */ public static $databasePrefix = 'testpagination_'; /** * @brief Database Column Map */ public static $databaseColumnMap = array( 'date' => 'date' ); } The effect is what I wanted: But when I change the page, nothing happens and console in the browser shows me an error: Ajax request failed (parsererror): SyntaxError: Unexpected token < in JSON at position 0 Here is test application:test pagination 1.0.0 (1).tar dev.zip
Recommended Posts