You can check tab ids from
-your database
-your HTML source
-by trial and error
I changed the plugin to use tab names instead of ids.
For the custom query, any query which returns 1 or nothing.
The format is:
[code:1]
select 1 from {some tables} where {the condition to be filled if the user is premium} limit 1
[/code:1]
-mikko