English EN Thread Prefix
 
#1
user avatar
Hasan
Kurucu Offline
tarih Dün, 12:37 PM
With XThreads, we can create thread prefix. More than that, we can filter the threads based on their prefix.

Here is a simple way to do that:

1. Create a Custom Thread Fields with this settings:
  • Title: Prefix
  • Key: prefix
  • Applicable Forums: 'select a forum that we want the prefix to be applied'
  • Input Field Type: Listbox
  • Field Input Height: 1
    If we want multi prefix for a single thread, fill the Field Input Height with a value that greater than 1.
  • Values List:
    Kod:
    Prefix 1
    Prefix 2
    Prefix 3
    Name it as our need.
  • Editable by / Required Field?: Everyone (Required)
  • Allow Filtering: Yes
  • Display Format:
    Kod:
    [{VALUE}]
    If we want multi prefix, this will be the "main" display format.
  • Allow multiple values for this field: No
    If we want multi prefix for a single threads, choose Yes
  • Multiple Value Delimiter:
    Kod:
    ,
    The Multiple Value Delimiter setting will be displayed if we choose Yes in Allow multiple values for this field setting. This is separator for each prefix.
  • Display Item Format:
    Kod:
    {VALUE}
    The Display Item Format setting will be displayed if we choose Yes in Allow multiple values for this field setting. This is the display format for each prefix.
  • Formatting Map List:
    Kod:
    Prefix 1{|}<a href="{$forumurl?}filtertf_prefix=Prefix 1"><span style="color: red;">Prefix 1</span></a>
    Prefix 2{|}<a href="{$forumurl?}filtertf_prefix=Prefix 2"><span style="color: green;">Prefix 2</span></a>
    Prefix 3{|}<a href="{$forumurl?}filtertf_prefix=Prefix 3"><span style="color: blue;">Prefix 3</span></a>

2. We need to edit our forumdisplay_thread template. The basic concept for this edit process is, adding {$GLOBALS['threadfields']['prefix']} variable into the forumdisplay_thread template. The prefix will be displayed wherever we put the variable in the template.

In this example, we will put the prefix before Thread Subject:
We can find this code in our forumdisplay_thread template (based on the default template):
Kod:

<span>{$prefix} {$gotounread}<a href="{$thread['threadlink']}" class="{$inline_edit_class} {$new_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a>{$thread['multipage']}</span>

Then, add the {$GLOBALS['threadfields']['prefix']} variable. So, the code will be like this:
Kod:

{$GLOBALS['threadfields']['prefix']} <span>{$prefix} {$gotounread}<a href="{$thread['threadlink']}" class="{$inline_edit_class} {$new_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a>{$thread['multipage']}</span>


Additional info:
  • The filtering url has a general structure:
    Alıntı:{$forumurl?}filtertf_Key_for_the_field=Name of each prefix
    In the example above:
    Key_for_the_field = prefix
    Name of each prefix = Prefix1, Prefix 2, and Prefix 3.

    So, the filtering URL will be like this:
    Alıntı:{$forumurl?}filtertf_prefix=Prefix 1
    {$forumurl?}filtertf_prefix=Prefix 2
    {$forumurl?}filtertf_prefix=Prefix 3
  • We can do some experiment with these three settings if we want multi prefix: Display Format, Multiple Value Delimiter and Display Item Format.

    Example 1:
    Display Format = [{VALUE}]
    Multiple Value Delimiter = , (plus one space)
    Display Item Format = {VALUE}
    Result:
    Alıntı:[Prefix 1, Prefix 2, Prefix 3] Thread Title

    Example 2:
    Display Format = {VALUE}
    Multiple Value Delimiter = one space
    Display Item Format = [{VALUE}]
    Result:
    Alıntı:[Prefix 1] [Prefix 2] [Prefix 3] Thread Title

    Example 3:
    Display Format = {VALUE}
    Multiple Value Delimiter = one space|one space
    Display Item Format = {VALUE}
    Result:
    Alıntı:Prefix 1 | Prefix 2 | Prefix 3 Thread Title
  • We can use image for the output of each prefix.
    Display Format = {VALUE}
    Multiple Value Delimiter = one space
    Display Item Format = {VALUE}
    Formatting Map List:
    Kod:
    Prefix 1{|}<a href="{$forumurl?}filtertf_prefix=Prefix 1"><img src="image_url_for_prefix_1" alt="Prefix 1" title="Display Prefix 1 Only" /></a>
    Prefix 2{|}<a href="{$forumurl?}filtertf_prefix=Prefix 2"><img src="image_url_for_prefix_2" alt="Prefix 2" title="Display Prefix 2 Only" /></a>
    Prefix 3{|}<a href="{$forumurl?}filtertf_prefix=Prefix 3"><img src="image_url_for_prefix_3" alt="Prefix 3" title="Display Prefix 3 Only" /></a>
  • We can use the Prefix Filtering system as category for our XThreads application.

imza çizgisi
[Resim: dimza.gif]





Konuyu Okuyanlar: 1 Ziyaretçi

 
Dikkat Edelim
Kurallar


Reklam
Reklam


Yasal Uyarı
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.



Türkçe Çeviri: MyBB, Yazılım: MyBB 1.6.x, © 2002-2025 MyBB Group.
Copyright ©2024 - 2025 Gidenler®. All rights reserved.
GM v1.0.20 theme designed for MyBB
Basit Sürüm