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

How do I add a chat application?

Discussion in 'Styling and Customization Questions' started by ineedhelp, Sep 3, 2011.

  1. ineedhelp

    ineedhelp Well-Known Member

    Hi - can someone help me please with the following....

    <!-- mytab -->
    <li class="navTab PopupClosed"><a href="http://tinychat.com/xxxxxxxxx"class="navLink">Chatroom</a></li>
    I entered the code into the Templates > Navigation tab

    But it takes me off my site and directs to the LINK - I dont want this to happen... I want the link to open within my site, within the xenforo default template i am using and for the chatroom to be EMBEDDED into the template. So all xenforo template headers, footers, and menus remain intact.

    The link also currently displays to Guests allowing them to go to the Link........ I want them to be able to see the Link BUT I dont want them to be accessing the page without logging in or signing up.

    And why is it better to use xen:link and xen:phrase. rather any other way?

    If someone can give me the xenlink and xen:phrase method, that would be ideal...... Please also tell me the coding and how and where to enter this coding....

    Please will someone help and guide me by providing the correct coding so I can copy/paste it into the correct place.

    I'm learning as I go along, so thank u for helping me in advance.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Embed the URL in a XenForo Page using an iframe.

    Set the permissions for the page to disallow guests from accessing the Page.

    Phrases are useful if they are used throughout the code; you only need to update the phrase and it will update all templates which use it.
    The also allow for translations to be used.
  3. ineedhelp

    ineedhelp Well-Known Member

    If you see click on the tiny chat link above - I only want to embed the actual Chatroom.... not all of the tiny chat page...... can you tell me how I can achieve this please?

    How and where would i set the permissions?

    Do you I need to use Phrases? Where do i enter it and what would the phase be?
  4. Brogan

    Brogan XenForo Moderator Staff Member

    I'm not familar with that software, you will have to confirm whether just the chat window can be embedded using an iframe (it should be possible).

    Permissions are set in the ACP for users, user groups and nodes.

    It's up to you whether you use phrases or hard coded text.
    Phrases are created in the ACP; you decide what title the phrase should have, and the content.
  5. James

    James Well-Known Member

    <object type="application/x-shockwave-flash" id="tinyembed" align="top" width="100%" height="730" data="http://tinychat.com/tinychat.swf">
    <param name="quality" value="high">
    <param name="scale" value="noscale">
    <param name="allowFullScreen" value="true">
    <param name="wmode" value="transparent">
    <param name="allowScriptAccess" value="always">
    <param name="menu" value="false">
    <param name="salign" value="t">
    <param name="flashvars" value="roomVar=halfasleepguy&amp;embedMode=true&amp;pageVar=http://tinychat.com/halfasleepguy&amp;askJoin=auto&amp;apiVar=list&amp;extDomain=tinychat.com&amp;langVar=en">
    That should work.
  6. ineedhelp

    ineedhelp Well-Known Member

    That's almost perfect, thanks, couple of things wrong with it.... it displayed 2 big allows on the left side?

    And also, how to imbed it into a Tab page using iFrame.


    If I pm you my side along with a temp member registration login and password, can u check it for me, that way you will understand what i'm exactly saying?
  7. James

    James Well-Known Member

    To change its width/height, just edit the width and height attributes on the <object /> element.

    You don't need to embed it into a page, just use the code I pasted inside a XenForo Page.
  8. ineedhelp

    ineedhelp Well-Known Member

    Yes, the embedding is ok......

    But how do I embed inside a Xenforo Page? I entered the code and it pasted the chatroom onto the homepage of the forums.

    I've created a Tab called Chatroom - i want it linked and imbed in that...... I've only created a Tab, not a page

    Can you tell me how to link a tab to a page for this chatroom pls.
  9. James

    James Well-Known Member

  10. ragtek

    ragtek Guest

    To get the right url use:
    XenForo_Link::buildPublicLink('pages', array('node_name' => 'yourpagename'))
  11. ineedhelp

    ineedhelp Well-Known Member

  12. ineedhelp

    ineedhelp Well-Known Member

    Where do i enter this?
  13. James

    James Well-Known Member

    Have you created a XenForo Page to use it with?

    Admin CP -> Applications -> Create New Page

    Once you've done that, enter chatroom in the URL Portion field and change your tab to link to http://www.barfilounge.com/pages/chatroom
  14. ragtek

    ragtek Guest

    I thought you're using the event listener system...

    <li class="navTab PopupClosed"><a href="{xen:link 'pages', {xen:array 'node_name=xxx'}}........................
    should work
  15. James

    James Well-Known Member

    {xen:link pages/chatroom} worked fine :p
  16. ineedhelp

    ineedhelp Well-Known Member

    James - Thank you so much, really pleased with the outcome.

    And thank you to everyone else who took time to help.
  17. ragtek

    ragtek Guest

    This could make problems with add-ons which are changing the page routes..
    I know, most users doesn't have this, but once you install a add-on doing this, have fun searching for the problem:p
  18. James

    James Well-Known Member

    With that logic I shouldn't use {xen:link members, $user} or {xen:link forums, $forum} or {xen:link help/smilies} just in case I decide to install an add-on that changes the route ;)
  19. ragtek

    ragtek Guest

    They all use using the xenforo link builder & the route for this.
    And xen:link pages/chatroom isn't using it....
  20. ragtek

    ragtek Guest

    Easy to test:

    Open: XenForo_Route_Prefix_Pages

    public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
    return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'node_name');

    public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)

    echo 'using page link builder ' . $originalPrefix . ' - ' . print_r($data) ."\n";
    return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'node_name');

    and include

    {xen:link pages/chatroom}
    {xen:link 'pages', {xen:array 'node_name=xxx'}}

    into a template and check the output...
    James likes this.

Share This Page