Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
474 views
in Q2A Core by
I am trying to implement a simple question paging, one by one, I can do so by adding or substracting one from the id in the url, but this as well shows the hideen posts (This post was hidden by..) and I have a problem that I do not now where to stop counting.

Is there some simple function or method to get either the next not hidden used ID from database or at least a method to get the highest id ?

Shouldnt be that dificult ?

Thanks so far !
Q2A version: 1.5

1 Answer

0 votes
by
selected by
 
Best answer
Not entirely sure what you are trying to do, but on your Q2A site itself, you could just set the page size to 1.

But if you're doing something in a plugin or outside Q2A then incrementing the ID won't work because it will fetch answers and comments too. You can just do a query like:

SELECT * FROM qa_posts WHERE postid>{last_postid} AND type='Q'

(where {last_postid} is the ID you previously looked up)
by
Thank You, I meanwhile could resolve it thanks to Your explication from an older post. I had the problem with hidden posts showing up when just adding or substracting a q id.

What I want to do and what I already did now is paging through questions.

(You are on a question and through two arrows You see the next or last and when there is no newer one left You begin with the first one. This still needs to be enhanced, so that one can for example "surf" through all category or tag related questions.)
...