Author Topic: [Mod] Page Creator / Custom Pages  (Read 9296 times)

0 Members and 1 Guest are viewing this topic.

Offline mYrAn

  • Newbie
  • *
  • Posts: 22
    • View Profile
[Mod] Page Creator / Custom Pages
« 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:
Code: [Select]

<?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!

Offline KimmyMarie

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Mod] Page Creator / Custom Pages
« Reply #1 on: October 12, 2006, 04:01:37 PM »
Thanks, I'm going to give this a try.





Best wishes,
Kimmy

Offline djith

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [Mod] Page Creator / Custom Pages
« Reply #2 on: October 13, 2006, 11:34:54 AM »
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.....

Offline KimmyMarie

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Mod] Page Creator / Custom Pages
« Reply #3 on: October 17, 2006, 06:03:49 PM »
I tried it in 1.7.2 and it didn't work.





Best wishes,
Kimmy

Offline KimmyMarie

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Mod] Page Creator / Custom Pages
« Reply #4 on: October 22, 2006, 06:24:30 PM »
Any updates for this, so that it would work for newer versions (1.7.1, 1.7.2 & 1.7.3)?




Thanks,
Kimmy

Offline djith

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [Mod] Page Creator / Custom Pages
« Reply #5 on: November 03, 2006, 07:29:21 PM »
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

Code: [Select]
<?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');
?>

« Last Edit: November 03, 2006, 08:43:28 PM by Nicky »

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [Mod] Page Creator / Custom Pages
« Reply #6 on: November 04, 2006, 09:57:52 AM »
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...
Code: [Select]
<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...

Offline tippy

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: [Mod] Page Creator / Custom Pages
« Reply #7 on: May 03, 2007, 05:58:04 PM »
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