Javascript code to get topic id# from post id#.
Is it possible ?
For example if I know the post id = 1234 the function must return the topic id = 21.
That is not true. The posts table post_id is a unique primary key, and is also an auto-increment field. If you clone a topic, the copied posts would automatically get new ids.
You're right: I just tested it now but should immediately have realised that I was wrong as in the past (before I discovered) javiexin's copy post extension) I had to clone a topic to create a cloned post.