إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...

انضم الينا
استراحات زايد الصفحة الرئيسية


 
 
LinkBack أدوات الموضوع انواع عرض الموضوع
  #1  
قديم 01-05-2010, 07:30 AM
عضو ماسي
بيانات محروم.كوم
 رقم العضوية : 503
 تاريخ التسجيل : Dec 2007
الجنس : female
علم الدوله :
 المشاركات : 2,100,670
عدد الـنقاط :3341
 تقييم المستوى : 2140

I have a script that runs, for the most part, independent from the forums but it is integrated with the forum's users and styles. Since the upgrade to 4.0, fetch_template is no longer used. I need to convert the old code to the new variables so the script will work again.

This is what the old code looks like... partial code that refers to the templates.

OLD: Part 1 near the top of the main page of the script:
PHP Code:
$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array();

define('THIS_SCRIPT', 'TEST');
require_once(
'./global.php');
$pagetitle = "Test Page"; //Changes the page title
$navbits = array();
$navbits[$parent] = 'TestArea';
$navbits = construct_navbits($navbits);
eval(
'$navbar = "' . fetch_template('navbar') . '";');

NEW: I changed Part 1 to this:
PHP Code:
error_reporting(E_ALL & ~E_NOTICE);
define('THIS_SCRIPT', 'TEST');
define('CSRF_PROTECTION', true);
$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array();
$actiontemplates = array();

require_once(
'./global.php');

$navbits = construct_navbits(array('' => 'TestArea'));
$navbar = render_navbar_template($navbits);
$pagetitle = "My page Title";

OLD: Part 2 near the end on the page:
PHP Code:
eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');

NEW: And I changed part 2 to this:
PHP Code:
$templater = vB_Template::create('GENERIC_SHELL');
$templater->register_page_templates();

$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());

There a nice article at vbulletin.org but for the life of me, I have not been successful making the page work. I can get the header / footer to work, but no content from the page will display. I know I'm missing something, but I don't know what it is.

Any help will be much appreciated
__DEFINE_LIKE_SHARE__
رد مع اقتباس
 

مواقع النشر (المفضلة)


تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة
Trackbacks are متاحة
Pingbacks are متاحة
Refbacks are متاحة


المواضيع المتشابهه
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
Forum fetch_template warning محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 07-19-2010 03:30 AM
Forum Removed all plugins and still a fetch_template problem - please help if you can محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 02-19-2010 04:50 AM
Forum Warning: fetch_template محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 02-18-2010 03:30 AM
Forum Warning: fetch_template() calls .... محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 12-28-2009 03:50 PM
Forum Warning: fetch_template() calls .... محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 12-28-2009 12:20 PM


الساعة الآن 12:21 PM


Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2 TranZ By Almuhajir

RSS RSS 2.0 XML MAP HTML