English EN Using XThreads Parser
 
#1
user avatar
Hasan
Kurucu Offline
tarih Dün, 12:55 PM
We will use XThreads to add our custom script like javascript and CSS style per thread basis. And, we will use it to add some HTML code in postbit.

Here is a simple example for it:

Custom Thread Fields Setting:
  1. Multiline Textbox for Script For Header:
    Create a Custom Thread Fields with this settings:
    • Title: Script For Header
    • Key: cshscr
    • Applicable Forums: 'select forum'
    • Input Field Type: Multiline Textbox
    • Editable by / Required Field?: Administrator
    • Display Parsing: No parsing (dangerous!!)

      Variable in template for displaying this field is: {$GLOBALS['threadfields']['cshscr']}.
      Please remember that we need to set the Editable by / Required Field? setting to Administrator. So, only Admin can use this field.
      We can use this field to put some custom script in our header tag <head>......</head> via the {$GLOBALS['threadfields']['cshscr']} variable, like javascript and custom CSS style. Put the {$GLOBALS['threadfields']['cshscr']} variable in our showthread template, inside the header tag <head>......</head>.

      Example (based on MyBB default showthread template):
      Line #10:
      Kod:

      <head>
      <title>{$thread['subject']}</title>
      {$headerinclude}
      <script type="text/javascript">
      <!--
      var quickdelete_confirm = "{$lang->quickdelete_confirm}";
      // -->
      </script>
      <script type="text/javascript" src="jscripts/thread.js?ver=1400"></script>
      {$GLOBALS['threadfields']['cshscr']}
      </head>

  2. Multiline Textbox for Script For Body:
    Create a Custom Thread Fields with this settings:
    • Title: Script For Body
    • Key: csbscr
    • Applicable Forums: 'select a forum above'
    • Input Field Type: Multiline Textbox
    • Editable by / Required Field?: Administrator
    • Display Parsing: Use MyBB Parser
    • MyBB Parser Options: Check All Options

      Variable in template for displaying this field is: {$GLOBALS['threadfields']['csbscr']}.
      We can use this field to put some HTML code inside postbit. Again, please remember that we need to set the Editable by / Required Field? setting to Administrator, so, only Admin can use this field - can add HTML code in the postbit. Just put the {$GLOBALS['threadfields']['csbscr']} variable in postbit and postbit_classic template.

      Example:
      Kod:

      <div class="post_body" id="pid_{$post['pid']}">
      {$post['message']}
      {$GLOBALS['threadfields']['csbscr']}
      </div>
Now, we can use HTML in the first post, and we can use some custom javascript and / or CSS style per thread basis.
With this way we can create "unlimited" HTML page directly from our forum. And of course we can edit, approve / unapprove each "page", because it is threads.

Live Demo:

This demo uses stylesheet link in header, and HTML in body.
Yeah, I grab a free template and put it there for the demo :D
http://www.14.mynie.co.cc/showthread.php?tid=54

This demo uses javascript link and custom style in header. HTML in body.
Using Frogjs v1.1 for this demo.
http://www.14.mynie.co.cc/showthread.php?tid=55

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