Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Emebed issue with Version 2.1b2

13567

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2013

    That is the weirdness I saw in your embed code.

    However the link problem happens even if you use iframe. Try using this code extracted from your js see what happens, I still think it is a theme thing for the most part

    <iframe id="vanilla18803" name="vanilla18803" src="//www.djangobooks.com/forum/index.php?p=/&amp;remote=http%3A%2F%2Fshoppingcart.djangobooks.com%2Fforum&amp;locale=" scrolling="no" frameborder="0" width="100%" style="width: 100%; border: 0px; display: block; height: 2004px; " height="0"></iframe>

  • meshugymeshugy Musician/Hacker ✭✭
    edited December 2013

    I removed the :80 from the embed link and am still having the same problem with the links opening in another window. The embed link I'm using is:

    <script type="text/javascript" src="http://www.djangobooks.com/forum/js/embed.js"></script>
    

    The config file is set like this:

    $Configuration['Plugins']['EmbedVanilla']['RemoteUrl'] = 'http://shoppingcart.djangobooks.com/forum';
    $Configuration['Plugins']['EmbedVanilla']['ForceRemoteUrl'] = FALSE;
    $Configuration['Plugins']['EmbedVanilla']['EmbedDashboard'] = FALSE;
    
    $Configuration['Themes']['EmbedFriendly']['SingleColumn'] = FALSE;
    
    $Configuration['Garden']['Theme'] = 'EmbedFriendly';
    
    $Configuration['Garden']['Embed']['Allow'] = TRUE;
    $Configuration['Garden']['Embed']['RemoteUrl'] = 'http://www.shoppingcart.djangobooks.com/forum/';
    $Configuration['Garden']['Embed']['ForceDashboard'] = FALSE;
    $Configuration['Garden']['Embed']['ForceForum'] = FALSE;
    
  • peregrineperegrine MVP
    edited December 2013

    I have to go - but will check back later.

    post the versions and names of plugins and links to where you got them to embed.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • meshugymeshugy Musician/Hacker ✭✭

    @vrijvlinder said:
    That is the weirdness I saw in your embed code.

    However the link problem happens even if you use iframe. Try using this code extracted from your js see what happens, I still think it is a theme thing for the most part

    <iframe id="vanilla18803" name="vanilla18803" src="//www.djangobooks.com/forum/index.php?p=/&amp;remote=http%3A%2F%2Fshoppingcart.djangobooks.com%2Fforum&amp;locale=" scrolling="no" frameborder="0" width="100%" style="width: 100%; border: 0px; display: block; height: 2004px; " height="0"></iframe>

    OK, i added that. I'm still having the same problem so we'll have to try something else.

  • meshugymeshugy Musician/Hacker ✭✭

    @peregrine said:
    I have to go - but will check back later.

    post the versions and names of plugins and links to where you got them to embed.

    You want a list of every plugin I'm using right now?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    ok I found which file is adding the target blank, line 147

    embed_local.js

    // hijack all anchors to see if they should go to "top" or be within the 
          // embed (ie. are they in Vanilla or not?)
          $('a').live('click', function() {
             var href = $(this).attr('href');
             if (!href)
                return;
    
             var isHttp = href.substr(0, 7) == 'http://' || href.substr(0,8) == 'https://',
                noTop = $(this).hasClass('SignOut') || $(this).hasClass('NoTop');
    
             if (isHttp && href.substr(0, webroot.length) != webroot) {
                $(this).attr('target', '_blank');
             } else if (isEmbeddedComments) {
    

    The problem may be several issues. Your forum is in www and the embed is in shoppingcart . something is forcing it to go to the webroot .

  • meshugymeshugy Musician/Hacker ✭✭

    @meshugy said:
    You want a list of every plugin I'm using right now?

  • meshugymeshugy Musician/Hacker ✭✭

    @vrijvlinder said:
    ok I found which file is adding the target blank, line 147

    I changed

    $(this).attr('target', '_blank');
    

    to

    $(this).attr('target', '_self');
    

    Now it works! thank you, thank you!

    However, there is still this other weird problem. When I do I open the link it takes me there for a few seconds, but then flashes and brings me back to the main page. Any ideas what the problem is?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    yea that is weird, lol must be something else in there that needs to be looked at hmmm...

  • meshugymeshugy Musician/Hacker ✭✭

    It doesn't happen on my blog, so it's specific to the store. See:

    http://www.djangobooks.com/blog/discussions-2/

  • meshugymeshugy Musician/Hacker ✭✭
    edited December 2013

    Perhaps it has something to do with the ajax used for the shopping cart? Or maybe something in the .htaccess of the store?


  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes I see, it used also happen in the blog about the target blank being added but that no longer happens after changing the embed local js ? right ?

    And your blog is in www.django which may be why it is working there and not in

    shoppingcart.django because that is a subdomain. My theory is that something needs to change in the htaccess to point to the embed in the new subdomain.

    I had asked you before why not install the forum in the shoppingcart subdomain.
    To see if the sam thing happens.

    It should not happen in my opinion. I have embedded entire websites and they all open the links in the iframe. So it has to do with something like jquery
    or a theme that is interfering.

    I should be able to see the remote.js and the local.js on the list of files being called for the forum and they are not.All I see is the embed.js ...

    Try to refresh the page on the discussion you click as soon as it loads. Before it goes back to the index. If you try to reach that url again it gives a 404 error.

    This pretty much confirms the htaccess problem.

    http://shoppingcart.djangobooks.com/discussion/12546/bridge-weight-and-dimensions

  • meshugymeshugy Musician/Hacker ✭✭
    edited December 2013

    Definitely something in the htacces. I removed everything except:

    ###
    ### ClickCartPro 8 Rewrite Rules
    ###
    RewriteRule ^index.php - [L,PT]
    RewriteRule ^$ index.php?COREseourl=/ [L,PT]
    RewriteRule ^/$ index.php?COREseourl=/ [L,PT]
    RewriteRule ^sitemap\.xml utilities/sitemap.xml [L,PT]
    RewriteRule ^googlebase\.xml utilities/googlebase.xml [L,PT]
    RewriteRule ^rss\.xml utilities/rss.xml [L,PT]
    RewriteCond %{REQUEST_URI} ^/
    RewriteCond %{REQUEST_URI} !\.(xml|css|js|gif|jpg|jpeg|png|pdf)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*) index.php?COREseourl=/$1 [L,PT]
    ###
    ### End
    ###
    
    

    Problem gone! ;)

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    So to summarize, you changed the js to target self and the htaccess file ?

  • meshugymeshugy Musician/Hacker ✭✭

    @vrijvlinder said:
    So to summarize, you changed the js to target self and the htaccess file ?

    That is correct. Now everything seems to work but still testing. Thanks for your help!

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    you are very Welcome ! hope it stays working :)

  • peregrineperegrine MVP
    edited December 2013

    the thing you want to do is find out the values. if you want to actually know what is going on.

    what href.substr(0, webroot.length) is equal to 
    and what webroot is equal to
    

    something like this...

      if (isHttp && href.substr(0, webroot.length) != webroot) {
           var subwebroot =   href.substr(0, webroot.length)
      console.log(subwebroot);
     console.log(webroot);
     or alert (subwebroot)
          alert(webroot)
    
    
    changing to self alters the behavior of everything i would think.
    worst case I would just rem the line out.
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes I agree, I think commenting the line out is the most neutral thing to do.

    I wonder if something would need to change in the Vanilla htaccess as well.

    All my doms are back up and running again . I wonder how I can find out exactly what happened. The techs at my host were not very clear or specific. Good to know they fixed it though....

  • meshugymeshugy Musician/Hacker ✭✭
    edited December 2013

    It worked briefly but now is having the same problem, regardless of how the .htaccess file is configured. The forum embed works perfectly when viewed in Explorer. Firefox and Safari still open the discussion links into a new window.

    Do you have any other ideas?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    If you have force remote url TRUE , try FALSE or vice versa

    Do not force embed the dashboard. Try peregrine's suggestions about getting to the root of the problem.

    Try the other theme again.

Sign In or Register to comment.