1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress?

Discussion in 'Off Topic' started by jauburn, Nov 24, 2013.

  1. jauburn

    jauburn Well-Known Member

    Has anyone cobbled together a site with WordPress and Xenforo? I'm not talking necessarily about a bridge, although that might be interesting, but simply choosing the two because they're the platforms you like the best. If so, how do you integrate the blog posts in some way into your forum, or do you? RSS? How would you manage multiauthor blogs from users of your forum?
     
  2. LPH

    LPH Well-Known Member

    There are several options and a search in this forum with the keyword "WordPress" will bring up discussions. The key is your willingness to modify your WordPress theme as well as the XenForo one.

    A highly customized version of XenScripts is on my site. Some of the new code and customization is posted on my site or available via PM. I also have much cleaner code on a test environment which may be uploaded onto my site later today (uses more OOP in the plugin and makes room for more features to be added in the future).

    The add-on XF-WordPress Bridge is on version 1.2.1 and available. There are also generic scripts.

    I know of one individual who tried XenScripts and finally went to using RSS feeds. He prefers using Google+ for comments.

    http://www.racedepartment.com/ is a nice site with a tight integration. There are many others and maybe a nice showcase would be appropriate.

    Hope this helps.
     
    jauburn likes this.
  3. MikeMpls

    MikeMpls Well-Known Member

    I have JavaScript that can be inserted at the end of a WP post (you have to do your own hosting to be able to use JavaScript in WP) to direct comments to XenForo:

    HTML:
    <div style="text-align: center"><a id="XXXXX" onclick="ConnectXenDiscussion(this.id);" href="javascript:return;">&raquo; Join the Discussion
    </a></div>
    <p>&nbsp;</p>
    Where XXXXX =your thread number.

    There's another piece of JavaScript that must be inserted into one of your WP templates somewhere. I'll try to look for that & post it tonight.

    No mods are required to XenForo, but it helps (a lot!) if both the WP blog & XF site have responsive styles.
     
    LPH and jauburn like this.
  4. LPH

    LPH Well-Known Member

    This looks interesting. Is this automated or the thread chosen some way?
     
  5. MikeMpls

    MikeMpls Well-Known Member

    You have to replace the XXXXX with a specific thread number.

    Sorry I forgot to find the other piece of JavaScript last night, hopefully will get to it to night.
     
  6. MikeMpls

    MikeMpls Well-Known Member

    Here is the other piece of the JavaScript, which I placed in a separate file (xenwp.js) and changed a WP template to always load that file:


    HTML:
    function ToggleXenDiscussion(ElementID)
    {
      anchorNode = document.getElementById(ElementID);
      outerDiv = anchorNode.parentNode;
      ifID = "if" + ElementID;
      ifNode = document.getElementById(ifID);
      if (ifNode.style.display == 'none')
      {
        outerDiv.style = "position:absolute; left:0; right:0; text-align: center;";
        ifNode.style.display = 'block';
        anchorNode.innerHTML = "&laquo; Join the Discussion";
      }
      else
      {
        outerDiv.style = "text-align: center;";
        ifNode.style.display = 'none';
        anchorNode.innerHTML = "&raquo; Join the Discussion";
      }
    }
    function ConnectXenDiscussion(ElementID)
    {
      anchorNode = document.getElementById(ElementID);
      outerDiv = anchorNode.parentNode;
      outerDiv.style = "position:absolute; left:0; right:0; text-align: center;";
      ifDiv = document.createElement("DIV");
      outerDiv.appendChild(ifDiv);
      ifDiv.id = "if" + ElementID;
      ifDiv.innerHTML = "<iframe src=\"http://www.yoursite.com/index.php?threads/" +
      ElementID + "/\" height=\"784\" width=\"1024\" scrolling=\"yes\"></iframe>";
      anchorNode.innerHTML = "&laquo; Join the Discussion";
      anchorNode.onclick = function () {ToggleXenDiscussion(this.id);}
    }
    
    There were no mods needed to XF to get this work.
     
    Vitor Dos Reis likes this.

Share This Page