We will try to create a simple trading forum with XThreads.
Here is an example for it:
Edit/create a forum. XThreads settings:
Template Prefix: trdf_
Thread Grouping: 2
Show first post on every showthread page:Yes
Enable XThreads' Inline Forum Search:Yes
Settings Overrides:
Setting: Show Thread Options -> Post Layout
Value: horizontal
Kod:
postlayout=horizontal
Allow Blank Post Message:Yes
Hide Forum:Yes
We need to put this forum url manually in our templates (e.g: header template).
Custom WOL Text:
Forum Display: Viewing Trading Forum
New Thread: Create A New Trade
New Reply: Responding <a href="{1}">{2}</a> Trade
Show Thread: Viewing <a href="{1}">{2}</a> Trade
Forum settings:
We will use the forum rules as our Trading Forum "Index" page. Because we can use HTML in the forum rules, so, we can style it with HTML. Just use our creativity for it.
Additional Forum Settings:
Forum Rules: Display rules for this forum on the thread listing
Title: Welcome To Our Trading Forum
Rules: Type whatever we want here.
Custom Thread Fields Setting:
Listbox for Buy / Sell:
Create a Custom Thread Fields with this settings:
Title: Need To
Key: trdftnt
Applicable Forums:'select our trading forum'
Input Field Type: Listbox
Field Input Width: 10
Field Input Height: 1
Values List:
Kod:
Buy
Sell
Editable by / Required Field?: Everyone (required)
Display Order: 1
Allow Filtering:Yes
Hide Input Field:Yes
Listbox for Minimum Or Maximum Value For Price:
Create a Custom Thread Fields with this settings:
Title: Minimum Or Maximum Value
Key: trdfminmax
Applicable Forums:'select our trading forum'
Input Field Type: Listbox
Field Input Width: 15
Field Input Height: 1
Values List:
Kod:
Minimum
Maximum
Editable by / Required Field?: Everyone (required)
Display Order: 2
Hide Input Field:Yes
Textbox for Price:
Create a Custom Thread Fields with this settings:
Title: Price
Key: trdfprice
Applicable Forums:'select our trading forum'
Field Input Width: 10
Editable by / Required Field?: Everyone (required)
Display Order: 3
Display Format:
Kod:
<?=number_format({VALUE},2)?>
Text Mask Filter:
Kod:
^\d+(\.\d{2})?$
Hide Input Field:Yes
Variable in template for displaying this field is: {$GLOBALS['threadfields']['trdfprice']}.
Listbox for Product Condition:
Create a Custom Thread Fields with this settings:
Title: Condition
Key: trdfcond
Applicable Forums:'select our trading forum'
Input Field Type: Listbox
Field Input Width: 10
Field Input Height: 1
Values List:
Kod:
New
Used
Editable by / Required Field?: Everyone (required)
Display Order: 4
Allow Filtering:Yes
Hide Input Field:Yes
Listbox for Trading Status:
Create a Custom Thread Fields with this settings:
Title: Status
Key: trdfstatus
Applicable Forums:'select our trading forum'
Input Field Type: Listbox
Field Input Width: 15
Field Input Height: 1
Values List:
Kod:
Open
Closed
Editable by / Required Field?: Everyone (required)
Display Order: 5
Allow Filtering:Yes
Hide Input Field:Yes
Textbox for quantity of product user wants to sell/buy:
Create a Custom Thread Fields with this settings:
Title: Quantity
Key: trdfquantity
Applicable Forums:'select our trading forum'
Maximum Text Length: 3
Max quantity: 999
Field Input Width: 3
Editable by / Required Field?: Everyone (required)
Display Order: 6
Default Value: 1
Text Mask Filter:
Kod:
^([1-9]|[1-9][0-9]|[1-9][0-9][0-9])$
Hide Input Field:Yes
Variable in template for displaying this field is: {$GLOBALS['threadfields']['trdfquantity']}.
Listbox for choosing whether the min/max price is for total or for each, related to the product quantity:
Create a Custom Thread Fields with this settings:
Title: Each Or Total
Key: trdfet
Applicable Forums:'select our trading forum'
Input Field Type: Listbox
Field Input Width: 10
Field Input Height: 1
Values List:
Kod:
Total
Each
Editable by / Required Field?: Everyone (required)
Display Order: 7
Hide Input Field:Yes
Listbox for product category:
Create a Custom Thread Fields with this settings:
Title: Category
Key: trdfcat
Applicable Forums:'select our trading forum'
Input Field Type: Listbox
Field Input Width: 15
Modify it as our needs. Depends on the long of the line in value list.
Field Input Height: 1
Values List:
Kod:
Hardware
Software
Other
Modify it as our needs.
Editable by / Required Field?: Everyone (required)
Display Order: 8
Allow Filtering:Yes
Hide Input Field:Yes
File Input for Product Image:
Create a Custom Thread Fields with this settings:
Title: Product Image
Key: trdfimg
Applicable Forums:'select our trading forum'
Input Field Type: File
Valid File Extensions: gif|png|jpg|jpeg
Modify it as our needs. It is the extensions of image that can be uploaded.
Maximum File Size: 102400
Modify it as our needs. It is a maximum file size (in bytes) that can be uploaded.
Editable by / Required Field?: Everyone
Display Order: 9
Only accept uploaded images:Yes
Minimum Image Dimensions: 160x120
Modify it as our needs. It is the minimum images dimension that user can upload.
Maximum Image Dimensions: 1024x768
Modify it as our needs. It is the maximum images dimension that user can upload.
Image Thumbnail Generation: 80x60|120x90|160x120|320x240
Modify it as our needs. Depends on what thumbnails dimension we want to display for the image.
Blank Replacement Value:
Kod:
<img src="images/no_image.gif" alt="" title="" />
Because this field is not required, so we need to use a "default" image. Modify it as our needs, depends on which image we want to use.
Display Format:
Kod:
<img src="{URL}/thumb160x120" alt="" title="" />
Hide Input Field:Yes
Please remember that we put the description manually in newthread and edit_post_first template. So, if we change the settings, maybe we need to change the template too.
Checkboxes for Payment Method:
Create a Custom Thread Fields with this settings:
Title: Payment Method
Key: trdfpayment
Applicable Forums:'select our trading forum'
Input Field Type: Checkboxes
Values List:
Kod:
PayPal
AlertPay
Wire Transfer
Modify it as our needs.
Editable by / Required Field?: Everyone (required)
Display Order: 10
Allow Filtering:Yes
Multiple Value Delimiter:
Kod:
,
Hide Input Field:Yes
Maybe it is better if we use images....
Now, we need to create new templates in Global Template.
Admin CP -> Templates & Style -> Templates -> Global Templates:
Template Name: trdf_editpost_first
Kod:
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->edit_post}</title>
{$headerinclude}
<script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
</head>
<body>
{$header}
{$preview}
{$post_errors}
{$attacherror}
<form action="editpost.php?pid={$pid}&processed=1" method="post" enctype="multipart/form-data" name="input">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr><td class="thead" colspan="2"><strong>Edit Trade</strong></td></tr>
<tr><td class="tcat" colspan="2"><strong>Required Information</strong></td></tr>
<tr>
<td class="trow_sep" colspan="2">
<div class="float_left">Need To:</div>
<div class="float_left" style="margin-left: 9px;">{$tfinput['trdftnt']}</div>
<div class="float_left" style="margin-left: 19px;">Category:</div>
<div class="float_left" style="margin-left: 9px;">{$tfinput['trdfcat']}</div>
<div class="float_left" style="margin-left: 19px;">Product Name:</div>
<div class="float_left" style="margin-left: 9px;"><input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></div>
</td>
</tr>
<tr>
<td class="trow1 smalltext" colspan="2">
Please set whether you want to buy or sell a product. Choose a category of the product, and type the name of the product.
</td>
</tr>
<tr>
<td class="trow_sep" colspan="2">
<div class="float_left">Quantity:</div>
<div class="float_left" style="margin-left: 9px;">{$tfinput['trdfquantity']}</div>
<div class="float_left" style="margin-left: 19px;">Price:</div>
<div class="float_left" style="margin-left: 9px;">{$tfinput['trdfminmax']} USD {$tfinput['trdfprice']} for {$tfinput['trdfet']}</div>
<div class="float_left" style="margin-left: 19px;">Condition:</div>
<div class="float_left" style="margin-left: 9px;">{$tfinput['trdfcond']}</div>
<div class="float_left" style="margin-left: 19px;">Status:</div>
<div class="float_left" style="margin-left: 9px;">{$tfinput['trdfstatus']}</div>
</td>
</tr>
<tr>
<td class="trow1 smalltext" colspan="2">
You need to set the quantity of the product you want to buy/sell. You can set the minimum or maximum price for it. You need to set whether the price is for each product or it is a total price related to the quantity. Price format: x or x.xx You need to set whether the product you want to buy/sell is a new product or a used product. You can set whether the trading still available or not by set the status setting.
</td>
</tr>
<tr><td class="tcat" colspan="2"><strong>Additional Information</strong></td></tr>
<tr>
<td class="trow2" width="1">
<textarea name="message" id="message" rows="7" cols="60" tabindex="3">{$message}</textarea>
</td>
<td class="trow2 smalltext" valign="top">
If you have additional info about this trading, you can type it in the text area on the left.
<br class="clear" /><br />
If you have an image related to the product, you can upload it via the image uploader bellow. File format: jpeg or jpg or gif or png. Maximum file size: 100 kb. Maximum dimension: 1024 x 768 pixel. Minimum dimension: 320 x 240 pixel.
<br class="clear" />
<div align="center">{$tfinput['trdfimg']}</div>
</td>
</tr>
{$extra_threadfields}
<tr><td class="tcat" colspan="2"><strong>Miscellaneous</strong></td></tr>
<tr><td class="trow_sep" colspan="2"><strong>Payment Method</strong></td></tr>
<tr>
<td class="trow2 smalltext" valign="top" colspan="2">
You need to set what payment method you want to use for this trade. You can choose more than one payment method.
<br class="clear" />
<div>{$tfinput['trdfpayment']}</div>
</td>
</tr>
{$subscriptionmethod}
</table>
{$attachbox}
<br />
<div align="center"><input type="submit" class="button" name="submit" value="{$lang->update_post}" tabindex="3" /> <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="4" /></div>
<input type="hidden" name="action" value="do_editpost" />
<input type="hidden" name="posthash" value="{$posthash}" />
<input type="hidden" name="attachmentaid" value="" />
<input type="hidden" name="attachmentact" value="" />
</form>
<br />
<form action="editpost.php" method="post" name="editpost">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="3"><strong>{$lang->delete_post}</strong></td>
</tr>
<tr>
<td class="trow1" style="white-space: nowrap"><input type="checkbox" class="checkbox" name="delete" value="1" tabindex="9" /> <strong>{$lang->delete_q}</strong></td>
<td class="trow1" width="100%">{$lang->delete_1}<br /><span class="smalltext">{$lang->delete_2}</span></td>
<td class="trow1"><input type="submit" class="button" name="submit" value="{$lang->delete_now}" tabindex="10" /></td>
</tr>
</table>
<input type="hidden" name="action" value="deletepost" />
<input type="hidden" name="pid" value="{$pid}" />
</form>
{$footer}
</body>
</html>
Well, we can see that the title and description for our custom thread fields typed manually in this template. Modify it as our needs.
All filtering URL laid here. If we changed the value list, maybe we need to change this template too. And we put the forum rule variable in this template.
<html>
<head>
<title>{$lang->newthread_in}</title>
{$headerinclude}
<script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
</head>
<body>
{$header}
{$preview}
{$thread_errors}
{$attacherror}
<form action="newthread.php?fid={$fid}&processed=1" method="post" enctype="multipart/form-data" name="input">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr><td class="thead" colspan="2"><strong>New Trade</strong></td></tr>
<tr><td class="tcat" colspan="2"><strong>Required Information</strong></td></tr>
<tr>
<td class="trow_sep" colspan="2">
<div class="float_left">Need To:</div>
<div class="float_left" style="margin-left: 9px;">{$tfinput['trdftnt']}</div>
<div class="float_left" style="margin-left: 19px;">Category:</div>
<div class="float_left" style="margin-left: 9px;">{$tfinput['trdfcat']}</div>
<div class="float_left" style="margin-left: 19px;">Product Name:</div>
<div class="float_left" style="margin-left: 9px;"><input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></div>
</td>
</tr>
<tr>
<td class="trow1 smalltext" colspan="2">
Please set whether you want to buy or sell a product. Choose a category of the product, and type the name of the product.
</td>
</tr>
<tr>
<td class="trow_sep" colspan="2">
<div class="float_left">Quantity:</div>
<div class="float_left" style="margin-left: 9px;">{$tfinput['trdfquantity']}</div>
<div class="float_left" style="margin-left: 19px;">Price:</div>
<div class="float_left" style="margin-left: 9px;">{$tfinput['trdfminmax']} USD {$tfinput['trdfprice']} for {$tfinput['trdfet']}</div>
<div class="float_left" style="margin-left: 19px;">Condition:</div>
<div class="float_left" style="margin-left: 9px;">{$tfinput['trdfcond']}</div>
<div class="float_left" style="margin-left: 19px;">Status:</div>
<div class="float_left" style="margin-left: 9px;">{$tfinput['trdfstatus']}</div>
</td>
</tr>
<tr>
<td class="trow1 smalltext" colspan="2">
You need to set the quantity of the product you want to buy/sell. You can set the minimum or maximum price for it. You need to set whether the price is for each product or it is a total price related to the quantity. Price format: x or x.xx You need to set whether the product you want to buy/sell is a new product or a used product. You can set whether the trading still available or not by set the status setting.
</td>
</tr>
<tr><td class="tcat" colspan="2"><strong>Additional Information</strong></td></tr>
<tr>
<td class="trow2" width="1">
<textarea name="message" id="message" rows="7" cols="60" tabindex="2">{$message}</textarea>
</td>
<td class="trow2 smalltext" valign="top">
If you have additional info about this trading, you can type it in the text area on the left.
<br class="clear" /><br />
If you have an image related to the product, you can upload it via the image uploader bellow. File format: jpeg or jpg or gif or png. Maximum file size: 100 kb. Maximum dimension: 1024 x 768 pixel. Minimum dimension: 320 x 240 pixel.
<br class="clear" />
<div align="center">{$tfinput['trdfimg']}</div>
</td>
</tr>
{$extra_threadfields}
<tr><td class="tcat" colspan="2"><strong>Miscellaneous</strong></td></tr>
<tr><td class="trow_sep" colspan="2"><strong>Payment Method</strong></td></tr>
<tr>
<td class="trow2 smalltext" valign="top" colspan="2">
You need to set what payment method you want to use for this trade. You can choose more than one payment method.
<br class="clear" />
<div>{$tfinput['trdfpayment']}</div>
</td>
</tr>
{$subscriptionmethod}
{$modoptions}
{$captcha}
</table>
<br />
<div style="text-align:center"><input type="submit" class="button" name="submit" value="{$lang->post_thread}" tabindex="4" accesskey="s" /> <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="5" />{$savedraftbutton}</div>
<input type="hidden" name="action" value="do_newthread" />
<input type="hidden" name="posthash" value="{$posthash}" />
<input type="hidden" name="attachmentaid" value="" />
<input type="hidden" name="attachmentact" value="" />
<input type="hidden" name="quoted_ids" value="{$quoted_ids}" />
<input type="hidden" name="tid" value="{$tid}" />
{$editdraftpid}
</form>
{$forumrules}
{$footer}
</body>
</html>
Again, we put the title and description for fields manually in this template. If we change the fields, maybe we need to edit this template too.
<tr><td class="trow_sep" colspan="2">Trade Subscription</td></tr>
<tr>
<td class="trow1 smalltext" colspan="2">
Your customer will respond to your trade by replying this thread directly. This feature will make you easier to notice if there is a new respond to your trade.<br /><br />
<label><input type="radio" name="postoptions[subscriptionmethod]" {$postoptions_subscriptionmethod_dont} value="" style="vertical-align: middle;" /> {$lang->no_subscribe}. You will not receive any notification if there is a respond to this trade.</label><br />
<label><input type="radio" name="postoptions[subscriptionmethod]" {$postoptions_subscriptionmethod_none} value="none" style="vertical-align: middle;" /> {$lang->no_email_subscribe}. You can check if there is a new respond to this trade by clicking the View New Subscribed Posts link in the header. You can manage your subscription trade in your User CP.</label><br />
<label><input type="radio" name="postoptions[subscriptionmethod]" {$postoptions_subscriptionmethod_instant} value="instant" style="vertical-align: middle;" /> {$lang->instant_email_subscribe}. If you choose this option, you will receive email notification if there is a new respond to this trade. You can check if there is a new respond to this trade by clicking the View New Subscribed Posts link in the header too. You can manage your subscription trade in your User CP.</label><br />
</td>
</tr>
We add additional description here. I'm using View New Subscribed Posts plugin from Yumi. So, maybe some description has a relationship with that plugin (link in header). Modify it as our needs.
Gidenler.Me, hukuka, yasalara, telif haklarına ve kişilik haklarına saygılı olmayı amaç edinmiştir. Gidenler.Me, 5651 Sayılı İnternet Ortamında Yapılan Yayınların Düzenlenmesi ve Bu Yayınlar Yoluyla İşlenen Suçlara Mücadele Edilmesi Hakkında Kanunda tanımlanan -Yer Sağlayıcı- olarak hizmet vermektedir. İlgili yasaya göre, Gidenler.Me yönetiminin hukuka aykırı içerikleri kontrol etme yükümlülüğü yoktur. Bu sebeple, Gidenler.Me -Uyar ve Kaldır- prensibini benimsemiştir. Telif hakkına konu olan eserlerin yasal olmayan bir biçimde paylaşıldığını ve yasal haklarının çiğnendiğini düşünen hak sahipleri veya meslek birlikleri, hgidenler@gmail.com mail adresinden bize ulaşabilirler. Buraya ulaşan talep ve şikayetler incelenerek ihlal olduğu belirlenen içerikler Gidenler.Me 'den kaldırılacaktır. Ayrıca, mahkemelerden talep gelmesi halinde hukuka aykırı içerik üreten ve hukuka aykırı paylaşımda bulunan üyelerin tespiti için gerekli teknik veriler sağlanacaktır.