Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
1.3k views
in Plugins by
edited by

This is a plugin for developers and admins.

The problem: You get a postid e.g. from a comment, problem is you cannot throw in the id in the URL like mysite.com/1234 if 1234 is a comment. This will return a page not found error.

With this plugin you enter the postid 1234 and it returns the correct path, the correct link and the content of the post.

Enjoy!


Download plugin for free: http://www.q2apro.com/plugins/find-post

For issues use github: https://github.com/q2apro/q2apro-find-post

 

Preview

preview

 

Question2Answer Plugin: Find Post by Postid

Description

This is a plugin for Question2Answer that finds any post by its postid and displays the correct URL and content.

Installation

  1. Install Question2Answer if you haven't already.
  2. Get the source code for this plugin directly from github or from the q2apro plugin page.
  3. Extract the files.
  4. Optional: Change language strings in file q2apro-find-post-lang.php
  5. Upload the files to a subfolder called q2apro-find-post inside the qa-plugin folder of your Q2A installation.
  6. Navigate to your site, go to Admin -> Plugins. Check if the plugin "Find post by postid" is listed.
  7. Navigate to yourq2asite.com/findpost. From there you can start searching your posts as admin.

How-To-Use

  1. Get the postid from the database or somewhere else.
  2. Insert the ID into the input field on page yourq2asite.com/findpost
  3. Click the "Get post and link" button, done!
  4. Note: All requests are done by Ajax, no page reload required. Nice and fast!

Disclaimer

This is beta code. It is probably okay for production environments, but may not work exactly as expected. You bear the risk. Refunds will not be given!

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Copyright

All code herein is OpenSource. Feel free to build upon it and share with the world.

About q2a

Question2Answer is a free and open source PHP software for Q&A sites.

Final Note

If you use the plugin:

  • Consider joining the Question2Answer forum, answer some questions or write your own plugin!
  • You can use the code of this plugin to learn more about q2a-plugins. It is commented code.
  • Visit q2apro.com to get more free and premium plugins.

 

Q2A version: 1.6.3

2 Answers

0 votes
by
Thats a cool plugins . I think it will be helpfull for us sometimes while development .

 

Thanks for another nice plugin . +1
by
edited by
Especially when you are using phpmyadmin :-) or when you are cleaning your database searching for posts etc. =)
by
yah I got it . Thanks :) . Nice idea
0 votes
by

Thank you very much for this free plugin.

This is very useful one.

I installed the plugin. Post Type, Link and URL display correctly but content of the relevent question does not display. (Blank).

Find Post by postid

 
Get post and link

 

by
And no button for "Get post and link". I had to click enter to get the result.
by
edited by
Thanks for reporting. The button is fixed: https://github.com/q2apro/q2apro-find-post

For the empty content, this is weird. Actually it should be returned. Try the mysql query manually (for your example above) and report back if this is empty for content as well:
SELECT type, title, content FROM `qa_posts` WHERE `postid` = "2796" LIMIT 1

Update: I just see that your example question has no content (!) - I have added a message for the ajax return, now you will see "Post is empty. No content."
by
Thank you very much for your quick reply. I did download the updated files and it could correct the button display.

{I just see that your example question has no content (!)} - I am very sorry. I understood that content are the answers and comments of the answers. Sorry for my misunderstanding. Displaying content is working fine.

Thank You. Wish you all the success.
...