4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: mYrAn on September 30, 2006, 07:35:34 AM
-
Hi everyone! Time to realease my first mod! Iam not very good in english ( iam just 14 ) so ask later if you dont understad!
Files to modify:
None
Were just gonna do a new file in the root of your 4images folder. I named my page_1.php
Ad this code into the file:
<?php
$main_template = 'xxxxxx';
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));
include(ROOT_PATH.'includes/page_footer.php');
}
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
$clickstream .= $main_template;
//--- Print Out ---------------------------------------
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>
Where xxxxx are, youre gonna replace with what you are gonna name your templatefile for this file.
Now create a new html file named what you put were xxxxx is. Put the html file in the template folder of the template your using. Now just edit the html file and wolia!
Hope you understand! This code is free to modify! If you come up with a cool add, please post!
-
Thanks, I'm going to give this a try.
Best wishes,
Kimmy
-
Friend of mine is using it and it works great, he is using version 1.7
I'm using version 1.7.1 and did the same mod toghether....and it doesn't work with 1.7.1
what can be the reason? does something have to be changed on the php code ?
To bad i don't understand php...
can it be fixed for working with 1.7.1 please ? i think it is a great mod that allows us to expand our sites to our own wishes.....
-
I tried it in 1.7.2 and it didn't work.
Best wishes,
Kimmy
-
Any updates for this, so that it would work for newer versions (1.7.1, 1.7.2 & 1.7.3)?
Thanks,
Kimmy
-
I mixed some php things together and made this :)
It works for me.... (1.7.1) i could add a new page and change the name of the page and clickstream....
Note that i use dynamic page title... just uncomment if not applicable...
Change the name of main template to the name of your new created html page, also in clickstream.
Hope it works for you guys
<?php
$main_template = 'name of your new html page';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');
//-----------------------------------------------------
//---Clickstream---------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$lang['name of your new html page']."</span>";
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"page_title" => $page_title, // MOD: Dynamic page title
"lang_category" => $lang['category'],
"lang_added_by" => $lang['added_by'],
"lang_description" => $lang['description'],
"lang_keywords" => $lang['keywords'],
"lang_date" => $lang['date'],
"lang_hits" => $lang['hits'],
"lang_downloads" => $lang['downloads'],
"lang_rating" => $lang['rating'],
"lang_votes" => $lang['votes'],
"lang_author" => $lang['author'],
"lang_comment" => $lang['comment'],
"lang_prev_image" => $lang['prev_image'],
"lang_next_image" => $lang['next_image'],
"lang_file_size" => $lang['file_size']
));
// MOD: Dynamic page title BLOCK BEGIN
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
$header = $site_template->parse_template("header");
$footer = $site_template->parse_template("footer");
$site_template->register_vars(array(
"header" => $header,
"footer" => $footer
));
unset($header);
unset($footer);
}
// MOD: Dynamic page title BLOCK END
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>
-
when you will make a custom site copy the error.html and name it for example faq.html and save it in the template folder...
replace this with your own content...
<br />
<b class="title">{lang_error}</b>
<hr size="1" />
<p>{error_msg}</p>
now you can call /index.php?template=faq in your browser and then you will see your custom site...
-
I know this is an old topic but it was what I found related to what I have done and want to do.
I added custom pages by simply copying the error.html page, added my content and renamed it as suggested in the last post.
My ? is can I make this new html page visable to registered members only, I dont want guests to see it, again I dont have a php page/file for these new custom html pages. I did find a post about adding some code to the php page but like I mentioned, I didnt make php pages to match my html pages.
Im using version 1.7.2
Thanks for any help on the matter and sorry again for waking this thread,
Mike