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

It's creating issues when looking a the site through https (since I'm using shared hosting)

http_site: mysite.com/
https_site: https://gator0101.hostgator.com/~username/


Error message: 


[blocked] The page at 'https_site/question_url' was loaded over HTTPS, but ran insecure content from 'http_site/qa-plugin/q2apro-on-site-notifications/styles.css': this content should also be loaded over HTTPS.


Q2A version: 1.6.3

1 Answer

0 votes
I have updated all plugin files to prevent the use of qa_opt('site_url'). Please download the latest version: https://github.com/q2apro/q2apro-on-site-notifications and tell me if it works for you (also the icons that use qa_path_absolute() now).
Thanks for putting the time and effort!. I tested the new version, yet I have reveser a few changes in q2apro-onsitenotifications-page.php (lines 187 & 199)

There I had:
$activity_url = qa_path_absolute(qa_q_request($parent['postid'], $parent['title']), null, $anchor);

and I changed it a bit to
$activity_url = qa_path(qa_q_request($parent['postid'], $parent['title']), '', $anchor);

Using qa_path_absolute was taking me to the same address defined in the site_url variable (the http_site)
I think I need to do more changes, If I'm at the admin tab and click on a notification I get and "/admin/" string added in my url (therefore Not found error).

You will probably know best, but I think using an empty string ( ' ' ) instead of null provide me a pseudo absolute path? (I mean a relative path which is always based on the site root, without including the domain name).
"click on a notification I get and "/admin/" string added in my url"
This is because you use qa_path(). Problem is: The AJAX call goes to the server, the server does not know that you are at /admin/ and assumes you are in the root. It returns the relative path "./123/question" which gets added to your *recent* URL. That's why you must use an absolute path, not relative ones. I hope this explanation makes it clear ;-)

The "https" issue is indeed a special one, and maybe you are the only one having this issue currently. My ideas:

1. Do the ajax call with https? see "var eventNotify = ..." (use the https instead http)
2. Do not use https anyways.
3. Maybe there is a way for the server to check if it is a httpS request, then you could build a workaround.

The error message you mentioned in your question, is it coming from JS or PHP? I assume JS, then see here as well: http://stackoverflow.com/q/22196927/1066234