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

Code for VB conversion.

Discussion in 'XenForo Questions and Support' started by akia, Feb 5, 2011.

  1. akia

    akia Well-Known Member

    I'm looking to convert my forum but theres various bits of add ons that I have with vbulletin that I'll stilll need to use with XF and was hoping someone could help me with the following bits:

    Firstly is my stats trackign code in the footer template in vb its:

    Code:
    <vb:if condition="$show['member']">
    <script type="text/javascript">
      var clicky_custom = {};
      clicky_custom.session = {
        username: "{vb:raw bbuserinfo.username}",
      };
    </script></vb:if>
    What would be the equivalent code for XF?

    Secondly I've got the following code in the modifyprofile template to stop people being able to add a home page link unless they are in a certain usergroup.

    HTML:
    <label for="tb_homepage">{vb:rawphrase home_page_url}:</label><vb:if condition="is_member_of($bbuserinfo, 22, 6, 5)">
                    <input type="text" class="primary textbox" name="homepage" id="tb_homepage" value="{vb:raw bbuserinfo.homepage}" maxlength="200" dir="ltr" tabindex="1" />
                    <p class="description">
                        {vb:rawphrase let_other_visitors_know_url}<vb:else />
    <p>This field is only available to actively participating members.</p>
    
    </vb:if>
    What would be the equivalent code for XF? and what template would I need to add it in?

    I also use various plug ins to hide member profiles. I've got two plugins with the following code:

    PHP:
    if ($userinfo['usergroupid'] == AND $vbulletin->userinfo['usergroupid'] <> 6)
    {
     
    print_no_permission();
    }
    and the Hook Location is member_execute_start,

    Is this possible in XF and how would I do this?

    Also a lot of my javasctipts are wrapped around a <vb:literal></vb:literal> tag, is this needed in XF?

    Lots of questions from me but hopefully someone can help me with this and then finally I can start the transfer process.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Use this:

    Code:
    <xen:if is="{$visitor.user_id}">
    <script type="text/javascript">
      var clicky_custom = {};
      clicky_custom.session = {
        username: "{$visitor.username}",
      };
    </script></xen:if>
    Edit this template:

    Admin CP -> Appearance -> Templates -> account_personal details

    Find this code:

    Code:
    		<dl class="ctrlUnit">
    			<dt><label for="ctrl_homepage">{xen:phrase home_page}:</label></dt>
    			<dd><input type="url" name="homepage" value="{$visitor.homepage}" id="ctrl_homepage" class="textCtrl" /></dd>
    		</dl>
    
    Wrap in condition like so:

    Code:
    		<xen:if is="{xen:helper ismemberof, $visitor, 22} OR {xen:helper ismemberof, $visitor, 6} OR {xen:helper ismemberof, $visitor, 5}">
    		<dl class="ctrlUnit">
    			<dt><label for="ctrl_homepage">{xen:phrase home_page}:</label></dt>
    			<dd><input type="url" name="homepage" value="{$visitor.homepage}" id="ctrl_homepage" class="textCtrl" /></dd>
    		</dl>
    		</xen:if>
    
    The "plugin" system in xF is different. I don't have quick code for that. I recommend you post in the Development Questions forum for help with this.

    You shouldn't need it.
     
    HydraulicJack and akia like this.
  3. akia

    akia Well-Known Member

    Thank you, I think I may make the move today.
     
    1 person likes this.
  4. akia

    akia Well-Known Member

    Right I'm nearly good to go! Yay!! [​IMG]

    I'm just needing help with one last thing that anyone can help me with.

    I've been runnign vb in the route of my domain and I've now put xf in a fodler called /forum/

    I was using the CMS, groups, blogs etc with vb, and was using the advanced seo friendly urls so I need to redirect all the pages from these to xf. I want it so that if any one visits one of old pages they are redirected to the xf homepage.

    Can anyone help with the .htaccess redirect I'd need to do this.
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

Share This Page