SMF SSI farklı folderda çekme

Started by lostmode, May 16, 2021, 08:16:47 AM

Previous topic - Next topic

lostmode

Merhaba ssi kullanarak farklı folder içinde header ve footer çekmeye çalışıyorum. Lakin css ler gözükmüyor yani tema düzgün değil. ana dizinde çektiğimde bir sıkıntı yok lakin /klasor/test.php den çekince sıkıntı oluyor.

<?php 
global $sourcedir;
$sourcedir $_SERVER['DOCUMENT_ROOT'];
require_once(
$sourcedir '/SSI.php');
$context['page_title_html_safe'] = 'Deneme Sayfasi'
template_header();
echo
'
Test dosyası'
;

template_footer(); 
?>


lostmode

Konsoldan baktığım zaman temayı /klasör/themes/

Olarak çekmeye çalışıyor bunu nasıl düzeltebilirim ?

gecitli

sorun
template_header();

template_footer();

bu sorgular neyi çekecek?

yani

if(!empty($settings['template_heade']))
echo'
<div class="css olucak kodlar">
  heade kodlari?
</div>';
        echo'

http://www.webtiryaki.com
webmaster forumu
Free & Premium Responsive Themes for SMF.

lostmode

Quote from: gecitli on May 16, 2021, 12:50:05 PM
sorun
template_header();

template_footer();

bu sorgular neyi çekecek?

yani

if(!empty($settings['template_heade']))
echo'
<div class="css olucak kodlar">
  heade kodlari?
</div>';
        echo'



Test dosyasını ana dizinde çalıştırdığım zaman üstte header altta footer ortada test yazısı gözüküyor bunda bir problemim yok ben onu anadizin/klasor/ içinde çalıştırmak istiyorum

Antes

<?php

require("../smf2/SSI.php");

template_header();

?>


yazdım, ve her şeyi doğru yükledi... siz neden global'e $sourcedir koyup, sonra onu tanımladınız ? ana dizin içerisinde ssi_examples.php içerisinde zaten size <?php require("C:\\xampp\\htdocs\\smf2\\SSI.php"); ?> tarzı bi dizin veriyor, onu kullanın.

lostmode

Quote from: Antes on May 16, 2021, 01:47:32 PM
<?php

require("../smf2/SSI.php");

template_header();

?>


yazdım, ve her şeyi doğru yükledi... siz neden global'e $sourcedir koyup, sonra onu tanımladınız ? ana dizin içerisinde ssi_examples.php içerisinde zaten size <?php require("C:\\xampp\\htdocs\\smf2\\SSI.php"); ?> tarzı bi dizin veriyor, onu kullanın.


<?php 
require_once('../SSI.php');
$context['page_title_html_safe'] = 'Deneme Sayfasi'
template_header();
echo
'
Test dosyası'
;

template_footer(); 
?>


Ekte belirttim. Klasörün içinde olunca temayı /klasor/themes diye çekmeye çalışıyor benim sıkıntım da bu.

cee山

Bu gibi konuları ingilizce açabilirsek https://www.simplemachines.org/community/index.php?board=60.0 daha etkili olabilir.Geliştirici ekibide yazabilir.

Normal kullandığınız bu mantığı ana dizinde header_ssi.php footer_ssi.php ile istediğiniz sayfada çekerek yapabilirsiniz.

Diğer bir yol direk Sayfa eklentileri mevcut https://custom.simplemachines.org/mods/index.php?mod=1347 Örnek. Daha ayrıntı https://custom.simplemachines.org/mods/index.php?action=search;basic_search=pages

Diğer bir konu @snrj usta bu konuları güzel kullanıyor. Temanızın index.template.php function template_init()
içine $settings['catch_action'] = array('layers' => array('html','body','extra'));  yazın daha sonra

template_maint_warning_below Sonrasına

function template_extra_above()
{
global $context, $settings, $options, $scripturl, $txt,$sourcedir,$modSettings;

if(isset($_GET['action']))
$ne=$_GET['action'];

if(file_exists($settings['theme_dir'] . '/extra/' . $ne. '.template.php'))
{
loadtemplate('extra/'.$ne.'');
}
else
loadtemplate('extra/yok');
}
function template_extra_below()
{

}

Kullandığınız/Eklediğiniz kod tema kısmında extra folder açın ve Örnek ?action=merhaba ise  merhaba.template.php oluşturun

<?php
function template_main(){
  echo
'
Test dosyası'
;
}


Başarılar

lostmode

Quote from: CeeMoo on May 17, 2021, 11:39:40 AM
Bu gibi konuları ingilizce açabilirsek https://www.simplemachines.org/community/index.php?board=60.0 daha etkili olabilir.Geliştirici ekibide yazabilir.

Normal kullandığınız bu mantığı ana dizinde header_ssi.php footer_ssi.php ile istediğiniz sayfada çekerek yapabilirsiniz.

Diğer bir yol direk Sayfa eklentileri mevcut https://custom.simplemachines.org/mods/index.php?mod=1347 Örnek. Daha ayrıntı https://custom.simplemachines.org/mods/index.php?action=search;basic_search=pages

Diğer bir konu @snrj usta bu konuları güzel kullanıyor. Temanızın index.template.php function template_init()
içine $settings['catch_action'] = array('layers' => array('html','body','extra'));  yazın daha sonra

template_maint_warning_below Sonrasına

function template_extra_above()
{
global $context, $settings, $options, $scripturl, $txt,$sourcedir,$modSettings;

if(isset($_GET['action']))
$ne=$_GET['action'];

if(file_exists($settings['theme_dir'] . '/extra/' . $ne. '.template.php'))
{
loadtemplate('extra/'.$ne.'');
}
else
loadtemplate('extra/yok');
}
function template_extra_below()
{

}

Kullandığınız/Eklediğiniz kod tema kısmında extra folder açın ve Örnek ?action=merhaba ise  merhaba.template.php oluşturun

<?php
function template_main(){
  echo
'
Test dosyası'
;
}


Başarılar

Çok teşekkürler. Peki bu yolla nasıl subaction oluşturabilirim ?

cee山


Antes


Advertisement: