Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Add contact information on new threard
W1ck3D Offline
Junior Member
**
Posts: 1
Joined: Sep 2010
Post: #1
Add contact information on new threard
Hi all
I want to make a field that requires your contact information when you post a new threard. Can you help me? I tried with XThreards, but I could not make it work. Thanks
09-19-2010 09:52 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: Add contact information on new threard
You can use textbox input field type:

Create a custom thread fields:
Admin CP -> Configuration -> Custom Thread Fields -> Add Thread Field, or see this post for screenshot:
http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php?tid=291&pid=31

Setting for the custom thread field:
  • Title: Contact Information
  • Key: contact_info
  • Description: Your Contact Information - Required
    Modify it as your needs. The description will appear bellow the Contact Information textbox.
  • Applicable Forums : 'Choose a forum where we want the Contact Information applied
  • Input Field Type : Textbox
  • Editable by / Required Field? : Everyone (required)
  • Display Format :

    HTML Code
    <div>Contact Information: {VALUE}</div>

    Modify it as our needs. This is how the Contact Information will be displayed later in our template.


Now, when a user create a new thread or edit their thread, they will see a contact information textbox:
   

If user didn't fill their contact information, the error message will be displayed:
   

Now, we need to put the contact information to our template. Depends on where we want to display it.
For example, if we want to put it in postbit template, we need to edit our postbit and postbit_classic template.
The variable we need to put to display the Contact Information is:

Code:
{$GLOBALS['threadfields']['contact_info']}


Lets say that we want to display it above the post message.
Find this code in our postbit and postbit_classic template:

Code:
{$post['message']}


Then, add the {$GLOBALS['threadfields']['contact_info']} variable above the {$post['message']} vairiable. Something like this:

Code:
{$GLOBALS['threadfields']['contact_info']}
{$post['message']}


The result will be like this (horizontal and classic):
       


(This post was last modified: 09-20-2010 03:31 AM by RateU.)
09-20-2010 03:04 AM
Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #3
RE: Add contact information on new threard
Brilliant Smile

Thank You RateU !

[Image: logo.png]

[Image: twitter.png]
09-20-2010 04:51 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: