Code for VB conversion.

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'] == 8 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.
 
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?

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>

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?

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>

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

PHP:
if ($userinfo['usergroupid'] == 8 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?

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.

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

You shouldn't need it.
 
Right I'm nearly good to go! Yay!!
biggrin.png


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.
 
Top Bottom