Welcome, Guest. Please Login or Register.
July 18, 2025, 03:35:17 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  English User Help  |  English Help  |  Reading variables in template.php « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Reading variables in template.php  (Read 794 times)
DVS
Noobie
*
Posts: 28


WWW
Reading variables in template.php
« on: August 28, 2003, 06:03:48 PM »
Reply with quote

YaBB SE Version:
PHP Version:
MySQL Version:
Server Platform:
Link to Forum:

Problem Description:
Is there a way to read certain variables within the template.php file?

What I want to do is change certain image headers according to what board they are in.  The custom templates function only displays the default template within a subboard message index.

So, I'd like to be able to read the $currentboard or $boardname varibales.

Any help is appreciated!

A
Logged

Digital Vision Syndicate - www.dvsyndicate.com
Detroit Electronic Expo - www.detroitelectronic.com
Detroit Entertainment - www.detroitentertainment.tv
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Reading variables in template.php
« Reply #1 on: August 28, 2003, 07:29:05 PM »
Reply with quote

There is a mod to use different templates per boards.

You can use session variables too..

-[Unknown]
Logged
DVS
Noobie
*
Posts: 28


WWW
Re:Reading variables in template.php
« Reply #2 on: August 28, 2003, 09:10:09 PM »
Reply with quote

Quote
There is a mod to use different templates per boards.

I have that, but for some reason, it doesn't use the assigned template within the sub-board board listing.  Only in the board topic listing.  Just for clarification:

Forums
 +--Category   (1)
      +--Board  (2)
            +--Topic Listings  (3)

(1) I want to show the custom template here
(2) But it only shows up in here
(3) And in here

I assigned the custom template to the Category, but it uses the default template.

Quote
You can use session variables too..

This is what I was looking into as a fix...using "if/elseif" conditions to place the proper header images on top.  I just don't know the names for the session variables.

Any thoughts?

Thanks!   ;D
Logged

Digital Vision Syndicate - www.dvsyndicate.com
Detroit Electronic Expo - www.detroitelectronic.com
Detroit Entertainment - www.detroitentertainment.tv
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Reading variables in template.php
« Reply #3 on: August 29, 2003, 08:16:50 PM »
Reply with quote

There is just one session variable: $_SESSION.  It's an array.  Anything you put in there can be considered as "global" for the entire server on that user.

So, you could say $_SESSION['cool'] = true; and then, in style.css (which you would have to make parsed by php, maybe even style.css.php...) you would say:
<?php
// Start the session so you can use the array.
session_start();
// Check if they are cool.
if ($_SESSION['cool'])
  echo 'font-color: blue;';
?>

-[Unknown]
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  English User Help  |  English Help  |  Reading variables in template.php « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.038 seconds with 21 queries.