PDA

View Full Version : Confirm Correct Forum Before New Thread (AJAX)


ChurchMedia
04-01-2006, 10:00 PM
There is a better version here:
https://vborg.vbsupport.ru/showthread.php?threadid=114388

NOTE: To use this mod you have to disable the WYSIWYG editor option. Go to vBulletin Options > Message Posting Interface Options and set Full Editor to "Enable Standard Controls".

This product will ask the user if they are sure that they are in the correct forum before posting a new thread. If they click "Yes" then the New Thread box will appear immediately (via AJAX).

If they are not in the correct forum, they will be able to choose a different forum from a drop-down box (similar to forum jump). When they choose a different forum it automatically takes them to a new thread in that forum, where they are asked to confirm again.

This should save a lot of headaches with people posting in the wrong forums. It reduces thread-moves.


1) Install the product

2)Find in newthread:
$navbar

BELOW Add:
<div id='thread_confirm' align="center"><br />
<table class="tborder" cellpadding="0" cellspacing="0" border="0" width="100%" style="border-width: 1px">
<tr class="tcat"><td><div align="left">&nbsp<img id="pi_4" title="Exclamation" onclick="rb_iconid_4.click()" alt="Exclamation" src="images/icons/icon4.gif"><b>&nbsp Confirm Forum</b></div></td></tr>
<tr>

<td class="alt1">
<div align="center"><br />You are about to post a new thread in the <u><b>$foruminfo[title]</b></u>
forum.<br />
<i><b>Please make sure this is the correct forum for your topic.</b></i>
<br /><br />
<input type='button' class='button' value='YES, $foruminfo[title] is the correct forum!' onclick='cm_NewThread(this)' /><hr>
No, I need to post in a different forum:<br>
$forumjump2
<br />
</td>

</tr>
</table>
</div>

<script type='text/javascript'>
<!--

function cm_NewThread(cButton)
{
document.getElementById('new_thread').style.displa y = 'block'
document.getElementById('thread_confirm').style.di splay = 'none'
}

-->
</script>


3) Find (still in newthread):
<form action="newthread.php" method="post" name="vbform"<if condition="!is_browser('webtv')"> onsubmit="return vB_Editor['$editorid'].prepare_submit(this.subject.value, $vboptions[postminchars])"</if>>

Add ABOVE:
<div id='new_thread' style='display:none'>

4) Find (still in newthread):
$footer

Add ABOVE:
</div>

Bellinis
04-02-2006, 10:17 PM
Very nice!

Could this be restricted to certain groups or only for people who are about to make their first post? (or first x posts)

KTBleeding
04-02-2006, 10:23 PM
Install this HERE at .org!!

ChurchMedia
04-02-2006, 10:34 PM
Very nice!

Could this be restricted to certain groups or only for people who are about to make their first post? (or first x posts)

That should be easy with an 'if' statement before the code. Good idea!

hotwheels
04-02-2006, 11:19 PM
great job man...........

COBRAws
04-03-2006, 03:15 AM
That should be easy with an 'if' statement before the code. Good idea!
im happy you took my advice on making it AJAX! =D thank you!!

* COBRAws installs

ChurchMedia
04-03-2006, 04:13 AM
Glad to help! I've been really getting tired of moving threads on my site. :)

I think I've worked out all of the bugs. Let me know if there is something I missed.

Thanks!

thedvs
04-03-2006, 11:04 AM
very nice, this might also help stop those lamer spam attack board apps too

OndaReal
04-03-2006, 11:51 AM
very nice, installed :)

Barakat
04-03-2006, 12:17 PM
installed thanks

mat64
04-03-2006, 01:51 PM
Great work :)

treasureman
04-03-2006, 02:43 PM
This still does not work in the lastest Mozilla browser 1.7.12. I don't know about Firebox but I think it is supposed to share the workings of Mozilla.

When you click on 'yes' to post to the forum the box for the message is "grayed out" and does not allow you to put your curser in it and post anything.

I just downloaded and installed the latest xml file and made the template changes as per above. Had to uninstall it.

ChurchMedia
04-03-2006, 09:06 PM
This still does not work in the lastest Mozilla browser 1.7.12. I don't know about Firebox but I think it is supposed to share the workings of Mozilla.

When you click on 'yes' to post to the forum the box for the message is "grayed out" and does not allow you to put your curser in it and post anything.

I just downloaded and installed the latest xml file and made the template changes as per above. Had to uninstall it.

I just downloaded Mozilla and the hack works fine. Double-check all of your code.

treasureman
04-03-2006, 09:25 PM
I just downloaded Mozilla and the hack works fine. Double-check all of your code.


Okay I will install it for the 3rd time and let you know.

I installed it yesterday, and it didn't work. I noticed later that you stated that it didn't work in Firefox. So I uninstalled.

Today I noticed that you said the Firefox problems had been fixed. So I re-downloaded the XML file and installed the product as well as re-edited the templates. Didn't work, that's when I posted my message.

So I will try it all again and let you know later how it comes out. Perhaps the XML file I downloaded had not been updated?

Freesteyelz
04-03-2006, 10:12 PM
The issue regarding Firefox is both valid and invalid. At least for Firefox, if the editor interface is "basic" or "standard" the script will work. However, if the interface is "Enhanced" it won't work. This issue seems to be quite common as I noticed other hacks have had the problem.

I'm looking into the "vbulletin_textedit.js" file for the Frame and ID bits...

Nathan2006
04-03-2006, 10:28 PM
Thank you Tim

Install;)

treasureman
04-03-2006, 11:09 PM
The issue regarding Firefox is both valid and invalid. At least for Firefox, if the editor interface is "basic" or "standard" the script will work. However, if the interface is "Enhanced" it won't work. This issue seems to be quite common as I noticed other hacks have had the problem.

I'm looking into the "vbulletin_textedit.js" file for the Frame and ID bits...

Aha, that explains it. I always use the "advanced" posting window so I will have the advanced editing tools available.

Guess I will wait until this issue gets fixed before I try installing this again.

ChurchMedia
04-04-2006, 12:45 AM
The issue regarding Firefox is both valid and invalid. At least for Firefox, if the editor interface is "basic" or "standard" the script will work. However, if the interface is "Enhanced" it won't work. This issue seems to be quite common as I noticed other hacks have had the problem.

I'm looking into the "vbulletin_textedit.js" file for the Frame and ID bits...

Arrrr... You're right. The advanced editor doesn't work in Firefox with this hack. It works in IE. I have no idea what the problem is. On my board, I just disabled the WYSIWYG editor -- but that's not the best solution, obviously.