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

on page /qa-shortcode-layer.php

After the line of 

            qa_html_theme_base::c_item_content($c_item);
        }

 

             //country detection
                function country()
                {
                $country_code = trim(file_get_contents("http://ipinfo.io/country"));
                }


        function shortcode_replace($text) {
            
            foreach($this->shortcodes as $sc) {
                if(!$sc['t']) {

                    // remove tags
                    
                    preg_match_all('/<[^>]+>/', $text, $tags);
                    $idx = 0;
                    while(preg_match('/<[^>]*[^>0-9][^>]*>/',$text) > 0)
                        $text = preg_replace('/<[^>]*[^>0-9][^>]*>/', '<'.($idx++).'>', $text,1);
                        
                }

                // replace shortcode

                if($sc['x'])
                    $text = preg_replace($sc['s'],$sc['r'],$text);
                else
                    $text = str_replace($sc['s'],$sc['r'],$text);
                    
                
                if(!$sc['t']) {
                    // restore tags
                    
                    foreach($tags[0] as $idx => $tag) {
                        $text = str_replace('<'.$idx.'>',$tag,$text);
                    }
                }
            }
                if ($country_code = "BD" ) {
            return $text;            
        }
        else

       {
        echo "I Want to print a message only for my contry. but if i add some lines All the short code page answer was hide, now what can i do ";
            }

}
}

 

I add some code colored as red. I want to show a message using short code on some Answers. only for my country. And other country cannot show this. But when i using it others country's visitor cannot show answers, they show a blank answers field. now what can i do? only shows echo""; but answer cannot show

Please log in or register to answer this question.

...