Welcome to Geeklog, Anonymous Thursday, May 02 2024 @ 03:44 am EDT

Geeklog Forums

Problem with { and }


Status: offline

Pushkar

Forum User
Regular Poster
Registered: 04/14/09
Posts: 99
Location:Ukraine, Kyiv
When I create a new block and put into it code:
Text Formatted Code
<!--  AdRiver code START. Type:poster Site: ebpo PZ: 0 BN: 2 -->
<script language="javascript" type="text/javascript"><!--
function adriverPoster(L){
    if(typeof(ar_cn)=="undefined")ar_cn=1;
    var W=window,D=document,E=D.documentElement,T=0,N=ar_cn,P=0,C=D.compatMode=="CSS1Compat",
        X='<scr'+'ipt type="text/javascript">var ar_bnum='+N+';setTimeout(function(e){if(!self.CgiHref){document.close();e=parent.document.getElementById("ar_container_"+ar_bnum);e.parentNode.removeChild(e)}},3000);',
        Y='<\/sc'+'ript><sc'+'ript type="text/javascript" src="'+L+'&tail256='+escape(D.referrer||'unknown')+'&rnd='+Math.round(Math.random()*999999999)+'"><\/sc'+'ript>';
    function G(){if(T++<100){var o=D.getElementById('ar_container_'+N);if(o){try{var d=o.contentDocument||(W.ActiveXObject&&W.frames['ar_container_'+N].document);if(d){d.write(X+Y)}else setTimeout(arguments.callee,100)}catch(e){try{o.src = "javascript:{document.write('"+X+'document.domain="'+D.domain+'";'+Y+"')}";return}catch(E){}}}else setTimeout(arguments.callee,100)}}
    function A(e,t,f){if(e.addEventListener)e.addEventListener(t,f,false);else if(e.attachEvent)e.attachEvent('on'+t,f)}
    function R(e,t,f){if(e.removeEventListener)e.removeEventListener(t,f,false);else if(e.detachEvent)e.detachEvent('on'+t,f)}
    function S(){var ch=self.innerHeight||C&&E.clientHeight||D.body.clientHeight,st=self.pageYOffset||C&&E.scrollTop||D.body.scrollTop;if(P>=st&&st+ch>=P){R(W,'scroll',S);G()}}
    A(W,'load',function(){var o=D.getElementById('ad_ph_'+N);if(o){while(o.offsetParent){P+=o.offsetTop;o=o.offsetParent}A(W,'scroll',S);S()}});
    D.write('<div style="position:absolute;visibility:hidden;height:0px;"><iframe id="ar_container_'+N+'" width=1 height=1 marginwidth=0 marginheight=0 scrolling=no frameborder=0><\/iframe><\/div><div id="ad_ph_'+N+'"><\/div>');
    ar_cn++;
}
adriverPoster("http://ad.adriver.ru/cgi-bin/erle.cgi?sid=165981&bn=2&target=blank&bt=49&pz=0");
//--></script><!--  AdRiver code END  -->
 


in page code I have:
Text Formatted Code
<!--  AdRiver code START. Type:poster Site: ebpo PZ: 0 BN: 2 -->

<script language="javascript" type="text/javascript"><!--
function adriverPoster(L)&#123;
    if(typeof(ar_cn)=="undefined")ar_cn=1;
    var W=window,D=document,E=D.documentElement,T=0,N=ar_cn,P=0,C=D.compatMode=="CSS1Compat",
        X='<scr'+'ipt type="text/javascript">var ar_bnum='+N+';setTimeout(function(e)&#123;if(!self.CgiHref)&#123;document.close();e=parent.document.getElementById("ar_container_"+ar_bnum);e.parentNode.removeChild(e)&#125;&#125;,3000);',
        Y='<\/sc'+'ript><sc'+'ript type="text/javascript" src="'+L+'&tail256='+escape(D.referrer||'unknown')+'&rnd='+Math.round(Math.random()*999999999)+'"><\/sc'+'ript>';
    function G()&#123;if(T++<100)&#123;var o=D.getElementById('ar_container_'+N);if(o)&#123;try&#123;var d=o.contentDocument||(W.ActiveXObject&&W.frames['ar_container_'+N].document);if(d)&#123;d.write(X+Y)&#125;else setTimeout(arguments.callee,100)&#125;catch(e)&#123;try&#123;o.src = "javascript:&#123;document.write('"+X+'document.domain="'+D.domain+'";'+Y+"')&#125;";return&#125;catch(E)&#123;&#125;&#125;&#125;else setTimeout(arguments.callee,100)&#125;&#125;
    function A(e,t,f)&#123;if(e.addEventListener)e.addEventListener(t,f,false);else if(e.attachEvent)e.attachEvent('on'+t,f)&#125;
    function R(e,t,f)&#123;if(e.removeEventListener)e.removeEventListener(t,f,false);else if(e.detachEvent)e.detachEvent('on'+t,f)&#125;
    function S()&#123;var ch=self.innerHeight||C&&E.clientHeight||D.body.clientHeight,st=self.pageYOffset||C&&E.scrollTop||D.body.scrollTop;if(P>=st&&st+ch>=P)&#123;R(W,'scroll',S);G()&#125;&#125;
    A(W,'load',function()&#123;var o=D.getElementById('ad_ph_'+N);if(o)&#123;while(o.offsetParent)&#123;P+=o.offsetTop;o=o.offsetParent&#125;A(W,'scroll',S);S()&#125;&#125;);
    D.write('<div style="position:absolute;visibility:hidden;height:0px;"><iframe id="ar_container_'+N+'" width=1 height=1 marginwidth=0 marginheight=0 scrolling=no frameborder=0><\/iframe><\/div><div id="ad_ph_'+N+'"><\/div>');
    ar_cn++;
&#125;
adriverPoster("http://ad.adriver.ru/cgi-bin/erle.cgi?sid=165981&bn=2&target=blank&bt=49&pz=0");
//--></script><!--  AdRiver code END  -->
 


you can see that all "{" and "}" are changed to &#123; and &#125; and the code isn't working

how to fix it?
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Could it be a theme issue? { and } seems to work on the geeklog demo site.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
I just tried it on my site and while the code didn't display anything, when I looked at the page source the "{" were still there.

This sounds a bit like the problem stories have though

http://project.geeklog.net/tracking/view.php?id=1005
One of the Geeklog Core Developers.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Actually, the bugs in question are

http://project.geeklog.net/tracking/view.php?id=1156
http://project.geeklog.net/tracking/view.php?id=1057

Which Geeklog version is that? There was a change in 1.7.0 here that was reverted in 1.7.1:


- Reverted parts of the changes for bug #0001057: Do _not_ escape curly braces
when displaying a block's content (bug #0001156). If you run into the problem
that words in curly braces inside blocks are interpreted as template
variables, simply add a space after the opening and/or the closing brace


bye, Dirk
 Quote

Status: offline

Pushkar

Forum User
Regular Poster
Registered: 04/14/09
Posts: 99
Location:Ukraine, Kyiv
thanks to all!

I have solved the problem. I make changes in libcommon:
Text Formatted Code
$blockcontent = str_replace(array('{', '}'), array('{', '}'),
                                    $blockcontent);


and in the code that I need to put i have made spaces before and after the { and }
 Quote

All times are EDT. The time is now 03:44 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content