Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

how do I trigger a pop up when a new question is posted and viewed?

+1 vote
48 views
asked Oct 8 in Q2A Core by mayur
edited Oct 8 by mayur

Is there any way I can show the user a popup message when a question is posted and viewed for the first time?

I got a code to override the body.

<?php

class qa_html_theme_layer extends qa_html_theme_base {

function body_script(){

qa_html_theme_base::body_script();

// only load if enabled

if(qa_opt('ss_enabled')) {

$this->output('some code goes here ');

if() { // here I want to check that new question is posted event triggered. how do verify it here?

//var_dump($this -> content);

$this->output('<script type="text/javascript">alert("New question is posted!");

</script>');

}

} // end enabled

} // end head_script

}

1 Answer

+1 vote
answered Oct 9 by mayur
I got the workaround for this. You can analyze below plugin

https://github.com/PublicityPort/q2a-social-share-plugin
...