Don't show Olark for non-trial/non-pro users.
parent
47d63b0e6c
commit
e1989b85d0
|
@ -417,46 +417,48 @@
|
||||||
{% include 'snipts/snipt-edit-js-template.html' %}
|
{% include 'snipts/snipt-edit-js-template.html' %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% if request.user.profile.get_account_age <= 7 or request.user.profile.is_pro %}
|
{% if request.user.is_authenticated %}
|
||||||
{% if not debug %}
|
{% if request.user.profile.get_account_age <= 7 or request.user.profile.is_pro %}
|
||||||
{% block olark %}
|
{% if not debug %}
|
||||||
<!-- begin olark code -->
|
{% block olark %}
|
||||||
<script data-cfasync="false" type='text/javascript'>/*<![CDATA[*/window.olark||(function(c){var f=window,d=document,l=f.location.protocol=="https:"?"https:":"http:",z=c.name,r="load";var nt=function(){
|
<!-- begin olark code -->
|
||||||
f[z]=function(){
|
<script data-cfasync="false" type='text/javascript'>/*<![CDATA[*/window.olark||(function(c){var f=window,d=document,l=f.location.protocol=="https:"?"https:":"http:",z=c.name,r="load";var nt=function(){
|
||||||
(a.s=a.s||[]).push(arguments)};var a=f[z]._={
|
f[z]=function(){
|
||||||
},q=c.methods.length;while(q--){(function(n){f[z][n]=function(){
|
(a.s=a.s||[]).push(arguments)};var a=f[z]._={
|
||||||
f[z]("call",n,arguments)}})(c.methods[q])}a.l=c.loader;a.i=nt;a.p={
|
},q=c.methods.length;while(q--){(function(n){f[z][n]=function(){
|
||||||
0:+new Date};a.P=function(u){
|
f[z]("call",n,arguments)}})(c.methods[q])}a.l=c.loader;a.i=nt;a.p={
|
||||||
a.p[u]=new Date-a.p[0]};function s(){
|
0:+new Date};a.P=function(u){
|
||||||
a.P(r);f[z](r)}f.addEventListener?f.addEventListener(r,s,false):f.attachEvent("on"+r,s);var ld=function(){function p(hd){
|
a.p[u]=new Date-a.p[0]};function s(){
|
||||||
hd="head";return["<",hd,"></",hd,"><",i,' onl' + 'oad="var d=',g,";d.getElementsByTagName('head')[0].",j,"(d.",h,"('script')).",k,"='",l,"//",a.l,"'",'"',"></",i,">"].join("")}var i="body",m=d[i];if(!m){
|
a.P(r);f[z](r)}f.addEventListener?f.addEventListener(r,s,false):f.attachEvent("on"+r,s);var ld=function(){function p(hd){
|
||||||
return setTimeout(ld,100)}a.P(1);var j="appendChild",h="createElement",k="src",n=d[h]("div"),v=n[j](d[h](z)),b=d[h]("iframe"),g="document",e="domain",o;n.style.display="none";m.insertBefore(n,m.firstChild).id=z;b.frameBorder="0";b.id=z+"-loader";if(/MSIE[ ]+6/.test(navigator.userAgent)){
|
hd="head";return["<",hd,"></",hd,"><",i,' onl' + 'oad="var d=',g,";d.getElementsByTagName('head')[0].",j,"(d.",h,"('script')).",k,"='",l,"//",a.l,"'",'"',"></",i,">"].join("")}var i="body",m=d[i];if(!m){
|
||||||
b.src="javascript:false"}b.allowTransparency="true";v[j](b);try{
|
return setTimeout(ld,100)}a.P(1);var j="appendChild",h="createElement",k="src",n=d[h]("div"),v=n[j](d[h](z)),b=d[h]("iframe"),g="document",e="domain",o;n.style.display="none";m.insertBefore(n,m.firstChild).id=z;b.frameBorder="0";b.id=z+"-loader";if(/MSIE[ ]+6/.test(navigator.userAgent)){
|
||||||
b.contentWindow[g].open()}catch(w){
|
b.src="javascript:false"}b.allowTransparency="true";v[j](b);try{
|
||||||
c[e]=d[e];o="javascript:var d="+g+".open();d.domain='"+d.domain+"';";b[k]=o+"void(0);"}try{
|
b.contentWindow[g].open()}catch(w){
|
||||||
var t=b.contentWindow[g];t.write(p());t.close()}catch(x){
|
c[e]=d[e];o="javascript:var d="+g+".open();d.domain='"+d.domain+"';";b[k]=o+"void(0);"}try{
|
||||||
b[k]=o+'d.write("'+p().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}a.P(2)};ld()};nt()})({
|
var t=b.contentWindow[g];t.write(p());t.close()}catch(x){
|
||||||
loader: "static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]});
|
b[k]=o+'d.write("'+p().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}a.P(2)};ld()};nt()})({
|
||||||
/* custom configuration goes here (www.olark.com/documentation) */
|
loader: "static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]});
|
||||||
olark.identify('9104-133-10-2665');/*]]>*/</script><noscript><a href="https://www.olark.com/site/9104-133-10-2665/contact" title="Contact us" target="_blank">Questions? Feedback?</a> powered by <a href="http://www.olark.com?welcome" title="Olark live chat software">Olark live chat software</a></noscript>
|
/* custom configuration goes here (www.olark.com/documentation) */
|
||||||
<!-- end olark code -->
|
olark.identify('9104-133-10-2665');/*]]>*/</script><noscript><a href="https://www.olark.com/site/9104-133-10-2665/contact" title="Contact us" target="_blank">Questions? Feedback?</a> powered by <a href="http://www.olark.com?welcome" title="Olark live chat software">Olark live chat software</a></noscript>
|
||||||
|
<!-- end olark code -->
|
||||||
|
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
olark('api.visitor.updateEmailAddress', { emailAddress: '{{ request.user.email }}' });
|
olark('api.visitor.updateEmailAddress', { emailAddress: '{{ request.user.email }}' });
|
||||||
olark('api.visitor.updateFullName', { fullName: '{{ request.user.username }}' });
|
olark('api.visitor.updateFullName', { fullName: '{{ request.user.username }}' });
|
||||||
olark('api.visitor.updateCustomFields', {
|
olark('api.visitor.updateCustomFields', {
|
||||||
userId: {{ request.user.id }},
|
userId: {{ request.user.id }},
|
||||||
createdAt: '{{ request.user.date_joined }}',
|
createdAt: '{{ request.user.date_joined }}',
|
||||||
sniptsCount: {% snipts_count_for_user %},
|
sniptsCount: {% snipts_count_for_user %},
|
||||||
isPro: window.user_is_pro,
|
isPro: window.user_is_pro,
|
||||||
blogDomain: '{{ request.user.profile.blog_domain }}',
|
blogDomain: '{{ request.user.profile.blog_domain }}',
|
||||||
proDate: '{% firstof request.user.profile.pro_date 'null' %}'
|
proDate: '{% firstof request.user.profile.pro_date 'null' %}'
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue