Author Topic: How to make my include php can show  (Read 8454 times)

0 Members and 1 Guest are viewing this topic.

Offline mantra

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
    • DREAM WITH MANTRA
How to make my include php can show
« on: January 13, 2003, 02:49:08 AM »
How to make my include.php can show the content  in my other template.
I try search this topic but only in ducht

 :wink:  :wink:

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
How to make my include php can show
« Reply #1 on: January 13, 2003, 10:21:40 AM »
Sorry? Can you explain it again, please.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: How to make my include php can show
« Reply #2 on: January 13, 2003, 02:10:08 PM »
Quote from: mantra
How to make my include.php can show the content  in my other template.

Try to be specific and give as much detail as you can.  I didn't understand your question either.

Offline mantra

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
    • DREAM WITH MANTRA
Sorry
« Reply #3 on: January 14, 2003, 05:05:10 AM »
I try make news system on my web.
I copy index.php in directory of 4images and I include  news.php in those
index.php  then I rename it to mynews.php


now it look like this


<?php
$templates_used = 'mynews,category_bit,whos_online,thumbnail_bit';
$main_template = 'mynews';
define('GET_CACHES', 1);
define('ROOT_PATH', "./");
define('GET_USER_ONLINE', 1);
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();

if (isset($HTTP_GET_VARS['template']) || isset($HTTP_POST_VARS['template'])) {
$template = (isset($HTTP_GET_VARS['template'])) ? stripslashes(trim($HTTP_GET_VARS['template'])) : stripslashes(trim($HTTP_POST_VARS['template']));
if (!file_exists(TEMPLATE_PATH."/".$template.".".$site_template->template_extension)) {
$template = "";
}
else {
$main_template = $template;
}
}
else {
$template = "";
}
include(ROOT_PATH.'includes/page_header.php');

if (!empty($template)) {
$clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator'].str_replace("_", " ", ucfirst($template));
$site_template->register_vars("clickstream", $clickstream);
$site_template->print_template($site_template->parse_template($main_template));


}

//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
$categories = get_categories(0);
if (!$categories) {
$categories = $lang['no_categories'];
}
$site_template->register_vars("categories", $categories);
unset($categories);

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream
));

$site_template->print_template($site_template->parse_template($main_template));
include("news/news.php");
include("news/foot.php");
?>
----------------------------------------------

so far this my news work only in mynews.html  template

My question is how to make this news can have own  tag in template

like {random_image},{new_images}

so I can put in in every template page

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
How to make my include php can show
« Reply #4 on: January 14, 2003, 05:40:08 PM »
Code: [Select]
$site_template->register_vars("example_tag", $example_tag);
This will will the tag {example_tag} with the contents of $example_tag.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline mantra

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
    • DREAM WITH MANTRA
thanks
« Reply #5 on: January 15, 2003, 12:42:02 AM »
thanks Jan :? :D  :D

Offline sorestar

  • Newbie
  • *
  • Posts: 17
    • View Profile
How to make my include php can show
« Reply #6 on: January 31, 2003, 03:58:47 PM »
it would be possible if you use 4image template and intergrate your site content in 4images by using the home.html  in the templates/default/home.html and then redesign the site to your needs but still able to use all those {$example_tag} in your site. but you won't be able to use *.php those.