vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Forms Hack - goto form when making new thread per forum (https://vborg.vbsupport.ru/showthread.php?t=147206)

flup 05-13-2007 10:00 PM

Forms Hack - goto form when making new thread per forum
 
Information:
This little template modification allows you to enter a specific form per forum to go to after clicking the 'new thread' link. For example:

You have a forum called 'Introduce Yourself'.. this forum needs a specific layout and specific fields to be posted in a new thread to keep things uniform. To allow the 'Form Hack' to post in this forum the userlevels still have to be set on 'Allow user to post new threads'. So what can we do about users wanting to post new threads and keep the standard? Exactly! Link to the form instead of making a new thread.

This is very simple to do:

Go to your AdminCP -> Style Manager -> Edit Templates
Search the template FORUMDISPLAY

In this template look for the code:
Quote:

<if condition="$show['newthreadlink']"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else />&nbsp;</if>
Replace this with:
Quote:

<if condition="$show['newthreadlink']"><if condition="$foruminfo[forumid] == forumid"><a href="newthread.php?$session[sessionurl]do=formname" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else />
<a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a>
</if><else />&nbsp;</if>
and ofcourse don't forget to replace forumid with the forumid you want the link to change (this is the same forumid as the value of $formforumid is set to in the FormHack Hook Preferences) and the formname to the name of the form which is used to insert the information.

This is an example for only 1 forum, ofcourse you can add as many forums as you want.

Deepdog009 05-14-2007 11:19 PM

nice 1 Flup...

tested on backup server and 3.5 O-Taa;)

3.6 O-Taa???

flup 05-15-2007 10:51 AM

I noticed that he made a plugin to do this, this is more usefull as you can simple add the link to the forummanager edit options:

https://vborg.vbsupport.ru/showthread.php?t=102923

StagKill 06-22-2010 01:42 PM

Can you please provide this code for vB 4.0?


All times are GMT. The time now is 02:36 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01258 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete