guzin
Forum Replies Created
-
Forum: Plugins
In reply to: Where is $comments array created? What file, what function?The thing is that with the wordpress functions, pagination works with the entire array of results (comments in this case) and then starts loading them from the page you’re on, so for every page, the entire recordset is loaded then Walker::paged_walk sets the pointer to start loading from whatever page you’re on.
If you’re looking to see where the $comments are created, see wp-includes/query.php, $this->comments is the entire array of comments then passed on to the different functions in comments-template.php and so on.
A solution would be to load the comments based on your own pagination code, querying the database with the LIMIT X,Y and then output the HTML using the standard mysql functions from PHP.
Forum: Plugins
In reply to: Where is $comments array created? What file, what function?I was trying to load a table with some 6000 records using that function ($wpdb->get_results()), and it wouldn’t do it, it would actually break the code, so I figured it had to do with the memory specified in your php.ini (memory_limit), when it is usually 32MB, my attempt to load the 6000 records with the get_results() function was loading a big array into memory (more than 55MB in memory usage), so PHP simply stopped running my code, however, I was able to load the array using OBJECT instead of ARRAY_A (associative arrays are heavier), but we want it to work either way, so I increased the value of “memory_limit” to fit my needs.
I hope this helps.