Help Needed

Termy

New Member
Hi guys, I need help with this problem I have.

I am using the Easy Forms mod, but would like the New Thread button to redirect to the form instead of the standard editor.

I have some code that apparently works, but I have no idea how to make the plugin or use the code.

PHP:
if (in_array($forumid, array(1,2,3)))
{ 
header( 'Location: http://www.your-site.com/forum/misc.php?do=form&fid=1' ) ; 
}

And it also says - "Change 1,2,3 for appropriate forumids"

Could anyone possibly help me with this... I need this done quite urgently if possible.

Many thanks... Termy.
 
To create a new plugin, you just need to go to admincp/Product & Plugin/add new plugin

Product vbulletin
Hook Location global_start
Title newthread_start
Execution Order 5
Plugin PHP Code

Code:
if (in_array($forumid, array(1,2,3)))
{
header( 'Location: http://www.your-site.com/forum/misc.php?do=form&fid=1' ) ;
}

You will need to change what forum or forums you want to have the start thread redirected to the form. You can find that by doing a mouseover the forum and getting the forumid from the status bar.

I don't know anything about easy forms but this is at least part of your answer. How to create the plugin.

HTH
 
bluescorpion said:
To create a new plugin, you just need to go to admincp/Product & Plugin/add new plugin

Product vbulletin
Hook Location global_start
Title newthread_start
Execution Order 5
Plugin PHP Code

Code:
if (in_array($forumid, array(1,2,3)))
{
header( 'Location: http://www.your-site.com/forum/misc.php?do=form&fid=1' ) ;
}
You will need to change what forum or forums you want to have the start thread redirected to the form. You can find that by doing a mouseover the forum and getting the forumid from the status bar.

I don't know anything about easy forms but this is at least part of your answer. How to create the plugin.

HTH
Thanks you very much for the information m8... and yes it is certainly a start for me, lol.

I am assuming that I will need to add a new plug in for each form and section too ??

Sorry, I am not too good with things like this really, lol.

Many thanks... Termy.
 
You could make that plugin "multifunctional" by changing the condition a little bit to accomodate multiple forms once you figure out what the names of the variables that are used in the easy forms mod.
 
Ok, I have sorted the plugin out as above... but still no further on.

If anyone does have any more ideas I would be grateful.

Many thanks... Termy.
 
saram1805 said:
So you want to redirect EVERY attempt to create a new thread on any forum to instead open a form?
Hi m8, what I am after doing is to link a new thread button in certain sections to pre made Forms that have been created in Easy Forms. Below is an example -

section 1 new thread button takes me to Easy Form 1.

But I only need it to do this in certain forums... not all of them.

I hope you understand what I mean, lol.

Many thanks... Termy.

Oh, and yes I need it to do it every time the new thread button is pressed in that particular forum.
 
I got a better plugin definition for you:

Product vbulletin
Hook Location newthread_start
Title newthread_start
Execution Order 5
Plugin PHP Code
Code:

HTML:
if (in_array($forumid, array(1,2,3)))
{
header( 'Location: [url]http://www.your-site.com/forum/misc.php?do=form&fid=1[/url]' ) ;
}

The hook I gave you in the last one was generic ...

When newthread.php loads, the hook newthread_start gets eval'd and this plugin gets loaded.

All you need to do now is change the forumid to the forum(s) you want to use that form and add the formid so it know which one to grab.

HTH
 
Thanks for all you efforts m8... I really appreciate this.

However, I have tried that code and it doesnt work. Or do I need to sort something else out for it to work ?

Sorry, I have no idea on this side of vBulletin, lol.

Many thanks... Termy.
 
Termy said:
Hi m8, what I am after doing is to link a new thread button in certain sections to pre made Forms that have been created in Easy Forms. Below is an example
Ok, this is impossible if you don't know basic code, as you need to know where to place the html within the templates, but anyway, this is how you do it:

Get the forum IDs of the forums you want to display the link it. You can do this the links from your forum homepage; it will link to http://yoursite.com/forum/forumdisplay.php?f=100 If you have VBSEO installed it will hide the forum IDs - you then have to get them from the forum manager in the admin control panel.

Anyway, in that example, 100 would be the forum ID. Get the IDs you want, and the URL you want each link to go to.

Go into your admin control panel and open the FORUMDISPLAY template of the style you use. Find a location in the code where you want the link to display. I assume beside the "New Thread" buttons are pretty good.

So for each forum you want to display a link in, you'd put this code where you want the link to show:

<if condition="$forumid == x">
<a href="linktoyourform.php">Create a Form</a>
</if>

You'd repeat that in the template, replacing x with the forum IDs you got earlier, linktoyourform.php to whatever the link is, and Create a Form for whatever you want the anchor text to display.

You may want to display it in multiple locations in your FORUMDISPLAY template so you'd just repeat the process for each location.

If you want to display it in the thread view too, the code is:

<if condition="$thread[forumid] == x">
<a href="linktoyourform.php">Create a Form</a>
</if>
 
saram1805 said:
Ok, this is impossible if you don't know basic code, as you need to know where to place the html within the templates, but anyway, this is how you do it:

Get the forum IDs of the forums you want to display the link it. You can do this the links from your forum homepage; it will link to http://yoursite.com/forum/forumdisplay.php?f=100 If you have VBSEO installed it will hide the forum IDs - you then have to get them from the forum manager in the admin control panel.

Anyway, in that example, 100 would be the forum ID. Get the IDs you want, and the URL you want each link to go to.

Go into your admin control panel and open the FORUMDISPLAY template of the style you use. Find a location in the code where you want the link to display. I assume beside the "New Thread" buttons are pretty good.

So for each forum you want to display a link in, you'd put this code where you want the link to show:

<if condition="$forumid == x">
<a href="linktoyourform.php">Create a Form</a>
</if>

You'd repeat that in the template, replacing x with the forum IDs you got earlier, linktoyourform.php to whatever the link is, and Create a Form for whatever you want the anchor text to display.

You may want to display it in multiple locations in your FORUMDISPLAY template so you'd just repeat the process for each location.

If you want to display it in the thread view too, the code is:

<if condition="$thread[forumid] == x">
<a href="linktoyourform.php">Create a Form</a>
</if>
Thanks for that m8.. but this doesnt link a pre-defined form that has already been made up to the new thread button that is already there.

This will just put a new link close to that new thread button... and this is not what I want to do.

I know this can be done as we previously had someone link them up for us on a different forum... but they have let us down this time and cannot get in touch with them.

Many thanks for all the help though m8... much appreciated.
 
Termy said:
Thanks for all you efforts m8... I really appreciate this.

However, I have tried that code and it doesnt work. Or do I need to sort something else out for it to work ?

Sorry, I have no idea on this side of vBulletin, lol.

Many thanks... Termy.

Let's see the plugin code that you tried and didn't work...

Edit: I have just tested that code and it works for me?
 
Then you'd just move your your new thread button into the conditional too if you only want to display new form OR new thread.

Code:
<if condition="$forumid == x">
[color=Red]html for the new form button[/color]
<else />
[color=Red]html for the new thread button[/color]
</if>

If you want to use the new thread button for both, then you'd just wrap the href part in the conditional. I'm not sure how the new thread button is linked in your skin, but the syntax for modifying its href based on forum ID would be something like:

Code:
<a href="<if condition="$forumid == [color=Red]x[/color]">[color=Red]form_url[/color]<else />[color=Red]new thread url[/color]</if>"><img src="[color=Red]newthreadbutton[/color]" /></a>
 
Ok, thanks to all... esp bluescorpion I now have this fully working and all the forms linked to their respective new thread buttons.

Many thanks guys... much appreciated.
 
Back
Top