Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #781  
Old 24 Jul 2008, 20:04
Sergio68's Avatar
Sergio68 Sergio68 is offline
 
Join Date: Nov 2001
Originally Posted by Stryker412 View Post
How can you get your page to auto adapt to the current theme a user is running (ie. font and panel colors)?
Be careful, this is not the correct and safe way to do it, but if you build your test.php page like this :


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You just need one page, you can also include part of header template and footer template
Reply With Quote
  #782  
Old 25 Jul 2008, 00:49
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Real name: Mark Daniel Martinez
Originally Posted by Sergio68 View Post
Be careful, this is not the correct and safe way to do it, but if you build your test.php page like this :


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You just need one page, you can also include part of header template and footer template
All you really need to do is make a template for each respective style on your forum, using this same tutorial.
__________________
Reply With Quote
  #783  
Old 25 Jul 2008, 16:16
Sergio68's Avatar
Sergio68 Sergio68 is offline
 
Join Date: Nov 2001
Originally Posted by Digital Jedi View Post
All you really need to do is make a template for each respective style on your forum, using this same tutorial.
Ok, and how to include and execute PHP code into the template?
Reply With Quote
  #784  
Old 25 Jul 2008, 18:17
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Real name: Mark Daniel Martinez
No idea. I'm just responding the to the question about how to have a users style show up on that page. In fact, if you have multiple styles, you have to make a template for each style, otherwise you get a blank page.
__________________
Reply With Quote
  #785  
Old 26 Jul 2008, 08:57
amcd amcd is offline
 
Join Date: Oct 2004
If you have multiple styles, ideally they should be in a heirarchy. Just add the template to the top level and it will be inherited by child styles.

The question of how to execute php from templates is being asked frequently. The answer is that you cannot. It is not supposed to be that way. The primary objective of templating is to separate logic (php) from presentation (templates).

Search for my posts in this thread. I have explained the whole thing with code examples.
__________________
eXBii.com - Indian community
no XB no fun know XB know fun !
Reply With Quote
  #786  
Old 26 Jul 2008, 13:57
Sergio68's Avatar
Sergio68 Sergio68 is offline
 
Join Date: Nov 2001
Originally Posted by amcd View Post
If you have multiple styles, ideally they should be in a heirarchy. Just add the template to the top level and it will be inherited by child styles.

The question of how to execute php from templates is being asked frequently. The answer is that you cannot. It is not supposed to be that way. The primary objective of templating is to separate logic (php) from presentation (templates).

Search for my posts in this thread. I have explained the whole thing with code examples.
I knew, it was a rhetorical question, this is why I was looking for shortcuts.
By the way, you can execute code in a plugin but it's a p.i.t.a.
Reply With Quote
  #787  
Old 27 Jul 2008, 08:54
Goomzee Goomzee is offline
 
Join Date: Apr 2008
Real name: Tariq Rathore
this is my php file code

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'mk1'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'MK1',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################

chdir('/home/username/public_html/content/mkgames/mk1/');
require_once('./global.php');


// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'MK1';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEST') . '");');

?>
__________________
a

and this my Template Code

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat"><center>Mortal Kombat Shaolin Monks Play Station2 Guide</center>
</td>
</tr>
</table>
<p><strong>Unlock Mortal Kombat II</strong><br>

$footer
</body>
</html>
Templaet Naem is MK1

but nothing working since 4 month
__________________
Mortal Kombat Nexus Mortal Kombat X MKWallpapers MK Komics
Mortal Kombat Winamp skins, Animations, Movies, Dragon Renders on your 1 click
Pakistan 1st and Largest Mortal Kombat Gaming website
Reply With Quote
  #788  
Old 27 Jul 2008, 09:06
amcd amcd is offline
 
Join Date: Oct 2004

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

change this to


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
eXBii.com - Indian community
no XB no fun know XB know fun !
Reply With Quote
  #789  
Old 28 Jul 2008, 05:31
Goomzee Goomzee is offline
 
Join Date: Apr 2008
Real name: Tariq Rathore
i did but not working
__________________
Mortal Kombat Nexus Mortal Kombat X MKWallpapers MK Komics
Mortal Kombat Winamp skins, Animations, Movies, Dragon Renders on your 1 click
Pakistan 1st and Largest Mortal Kombat Gaming website
Reply With Quote
  #790  
Old 28 Jul 2008, 06:37
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Real name: Mark Daniel Martinez
Originally Posted by Goomzee View Post
this is my php file code




and this my Template Code



Templaet Naem is MK1

but nothing working since 4 month

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You never changed TEST on this line to your template name.
__________________
Reply With Quote
  #791  
Old 28 Jul 2008, 07:02
amcd amcd is offline
 
Join Date: Oct 2004
Originally Posted by Digital Jedi View Post
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You never changed TEST on this line to your template name.
What's what I told him, too. But he said it doesn't work.
__________________
eXBii.com - Indian community
no XB no fun know XB know fun !
Reply With Quote
  #792  
Old 28 Jul 2008, 07:11
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Real name: Mark Daniel Martinez
Originally Posted by amcd View Post
What's what I told him, too. But he said it doesn't work.
Yes, but for some reason you also told him to change


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Which is likely why it didn't work.

Originally Posted by amcd View Post
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

change this to


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
__________________
Reply With Quote
  #793  
Old 28 Jul 2008, 14:16
Goomzee Goomzee is offline
 
Join Date: Apr 2008
Real name: Tariq Rathore
i don;t understand why it's not working where as file is still there
__________________
Mortal Kombat Nexus Mortal Kombat X MKWallpapers MK Komics
Mortal Kombat Winamp skins, Animations, Movies, Dragon Renders on your 1 click
Pakistan 1st and Largest Mortal Kombat Gaming website
Reply With Quote
  #794  
Old 28 Jul 2008, 15:14
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Real name: Mark Daniel Martinez
In chdir('/home/username/public_html/content/mkgames/mk1/');, did you actually put in your username, or did you just leave it like this?
__________________
Reply With Quote
  #795  
Old 28 Jul 2008, 19:27
amcd amcd is offline
 
Join Date: Oct 2004
Originally Posted by Goomzee View Post
i don;t understand why it's not working where as file is still there
A completely blank page usually means php error. See the php error log.
__________________
eXBii.com - Indian community
no XB no fun know XB know fun !
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 13:43.

Layout Options | Width: Wide Color: