Resource icon

Contact Thread 2.0.0

No permission to download
  • Thread starter Thread starter ragtek
  • Start date Start date
Doesn't this defeat the purpose of a contact form?
No:p

I'm not always online in all my boards... ( to be honest, 50% of my boards i'm only visiting to check if they're working and to do some admin works..)
Because you can't have more e-mail recivers for the contact formular like in vB, i would get ALL messages, even the uninteressting, which can be handeled by my team...

So we're posting all the stuff to a intern team(staff) forum, where the mods can handle the message and contact me if necessary...

Also it's a nice way to track & share with the team, instead of having only 1 recipient
 
Ah, well I suppose that could be useful.
Haha, if I installed this we would have some pretty weird threads being made :P
 
We've used this resource previously and as I tend to miss emails etc it's def a good one and will be installing it :).
 
ragtek, this is perfect.

I have modified it for my own site so that there is a drop down list on the contact form where each option relates to a thread prefix and allows us to categorise our different contact types.

I can share the code for this if anyone wants, but I'd classify it as a bit of a "hack" rather than anything of a decent quality.
 
ragtek, this is perfect.

I have modified it for my own site so that there is a drop down list on the contact form where each option relates to a thread prefix and allows us to categorise our different contact types.

I can share the code for this if anyone wants, but I'd classify it as a bit of a "hack" rather than anything of a decent quality.
you're welcome to post it:)


something similar was already requested, but because i never needed this, i didn't implement it
 
  • Create the thread prefixes as normal with the relevant permissions
  • Once created, you will need the prefix IDs. You can find these from the URLs in the Admin CP. e.g.
    • /admin.php?thread-prefixes/news.2/edit
    • /admin.php?thread-prefixes/suggestions.3/edit
(Where 2 is the ID for the News prefix and 3 is the ID for the Suggestions prefix)
  • Edit the "contact" template.
AFTER
PHP:
<xen:include template="helper_captcha_unit" />
INSERT
PHP:
<dl class="ctrlUnit">
        <dt><label for="prefix">Contact Type:</label></dt>
        <dd><select name="prefix">
        <option value="2">News</option>
        <option value="3">Suggestions</option>
        <option value="4">Admins</option>
        <option value="5">Other</option>
        </select></dd>
    </dl>

The important things here are the <select name="prefix"> as we call that later and the value parameter within the <option> tags. The value has to match the thread prefix ID you noted earlier. The text within the <option> tags is just how you want each option to appear in the list.

Once your contact template is complete, it's time to make a small adjustment to one of ragtek's files:

Locate: /library/Ragtek/ContactThread/ControllerPublic/Misc.php

FIND:

PHP:
            $input = $this->_input->filter(array(
                'subject' => XenForo_Input::STRING,
                'message' => XenForo_Input::STRING
            ));

REPLACE WITH:

PHP:
            $input = $this->_input->filter(array(
                'subject' => XenForo_Input::STRING,
                'message' => XenForo_Input::STRING,
                'prefix' => XenForo_Input::UINT
            ));

Remember I said this was a bit hacky?

I've been a bit lazy. You will notice this section:

PHP:
            if (XenForo_Application::get('options')->ragtek_contactthread_usePrefix) {
                $forumData = $writer->getForumCacheItem($nodeId);
 
                $writer->set('prefix_id', $forumData['default_prefix_id']);
            }

This works with the Default Thread Prefix option in the add-on Basic Board Information settings.

What I've done is change this line:

PHP:
                $writer->set('prefix_id', $forumData['default_prefix_id']);

To this:

PHP:
                $writer->set('prefix_id', $input['prefix']);


Finally in the admin CP go to Home > Options > Basic Board Information and click "Use Default Forum Prefix".


This achieves contacts being created as threads using thread prefixes.
 
Hello,


I have it implemented in my 1.2.4 installation, and it works GREAT. As we say in Germany "second best, after sliced bread!" You do not have to check your mailbox, you just see it in a forum you define to catch the contact forms. Great!


Georg
 
Back
Top Bottom