MyBB Community Forums

Full Version: New thread to re-direct for some forums
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've got a problem with players reporting other players and admins for abuse of the rules or powers. I've been trying to get them to use a template, but a lot of users aren't used to forums or don't care to use templates.

So basically I wanted to know if there's anyway I can re-direct someone when they click 'new topic" to this form I use to generate reports.
so on specific forums you want that new thread link should not work and it should redirect to a form link
it requires template conditionals plugin and you have to modify forumdisplay_newthread template code
change code like below
<a href="newthread.php?fid={$fid}"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>

to this
<if in_array($fid, array('x', 'y', 'z')) then>
<a href="your-form-link"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>
<else>
<a href="newthread.php?fid={$fid}"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>
</if> 
where x, y, z are the forum IDs (can be any number) for which you want the redirect
I know it's solved and .m.'s solution is good for you, but I also recommend to take a look at XThreads: http://mybbhacks.zingaburga.com/showthre...88&page=72

With it you are able to put a form in the newthread instead of redirecting users to another place.
Like this:
[Image: xc7x8m.jpg][Image: 2v2igq8.jpg]
[Image: 33w8go1.jpg]

Here tutorial for the example on screens: http://mybbhacks.zingaburga.com/showthread.php?tid=289
(2013-07-01, 01:04 PM).m. Wrote: [ -> ]so on specific forums you want that new thread link should not work and it should redirect to a form link
it requires template conditionals plugin and you have to modify forumdisplay_newthread template code
change code like below
<a href="newthread.php?fid={$fid}"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>

to this
<if in_array($fid, array('x', 'y', 'z')) then>
<a href="your-form-link"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>
<else>
<a href="newthread.php?fid={$fid}"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>
</if> 
where x, y, z are the forum IDs (can be any number) for which you want the redirect

<if in_array($fid, array('10')) then>
<a href="http://clanmn.net/forms.php?fid=7"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>
<else>
</if>
<if in_array($fid, array('22')) then>
<a href="http://clanmn.net/forms.php?fid=8"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>
<else>
<a href="newthread.php?fid={$fid}"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>
</if>
<if in_array($fid, array('59')) then>
<a href="http://clanmn.net/forms.php?fid=9"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>
<else>
</if>

Okay, I actually have multiple forms for multiple sections. This produces several buttons due to all the elses, etc. How would I go about the multiple forms?
Thank you guys, I was also looking for this!
I fixed it, I remember it was just simple php.

<if in_array($fid, array('10')) then>
<a href="http://clanmn.net/forms.php?fid=7"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>
<elseif in_array($fid, array('22')) then>
<a href="http://clanmn.net/forms.php?fid=8"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>
<elseif in_array($fid, array('59')) then>
<a href="http://clanmn.net/forms.php?fid=9"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>
<else>
<a href="newthread.php?fid={$fid}"><img src="{$theme['imglangdir']}/newthread.gif" alt="{$lang->post_thread}" title="{$lang->post_thread}" /></a>
</if>

Simply needed to use elseif