Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Navigation
Latest Addons
AD Gallery 60
SyntaxHighlighte... 51
Newsletters v4.03 112
Facebook Like Box 130
Newsletters v4.02 58
Metro 165
Facebook Connect 171
Shoutbox Panel 128
Redactor for PHP... 107
MI Floating Side... 109
Facebook Login/R... 154
Avatar Studio v2.03 180
Relationship Sta... 98
Sexual Orientati... 116
Fisherman 143
Popular Addons
iTheme2 5806
Arise 5791
User Control v1.23 4622
Event Calendar 4052
Photowidget panel 3888
Radio-Theme red2... 3358
Highslide Gallery 3315
CSS/JavaScript D... 3231
Facebook Connect... 2986
Dynamic Menu 2894
Slideshow Lightb... 2723
L-AMANT 2659
Enigma 2636
2Dark 2607
Black 2580
View Thread
Who is here? 1 guest(s)
 Print Thread
New Page Creation
Vyper69
I take no credit in this except for how I edited it. My reason behind this was because I wanted a custom page, but a main page. So instead of creating a standard custom page I decided to edit 2 pages and create one with it's own name. So now my main page is /home.php.

I used the news.php to start with and deleted all the code except this.

Download source  Code
require_once "maincore.php";
require_once THEMES."templates/header.php";

require_once THEMES."templates/footer.php";




Then I took this code from craigs awesome fp_tabs_panel.php and placed it between the header.php and footer.php.

Download source  Code
if (!defined("IN_FUSION")) { die("Access Denied"); }

$fp_tabs_panel_check = dbquery("SELECT * FROM ".DB_ADMIN. " WHERE admin_title='FP Tabs Panel'");
if (dbrows($fp_tabs_panel_check) > 0) {

if (file_exists(INFUSIONS."fp_tabs_panel/locale/".$settings['locale'].".php")) {
    include INFUSIONS."fp_tabs_panel/locale/".$settings['locale'].".php";
} else {
    include INFUSIONS."fp_tabs_panel/locale/English.php";
}

include INFUSIONS."fp_tabs_panel/infusion_db.php";

$fptabssettings = dbarray(dbquery("SELECT * FROM ".DB_FP_TABS.""));

include INFUSIONS."fp_tabs_panel/includes/fp_tabs_panel_styles.php";

global $settings;

if (function_exists("add_to_footer")) {
 add_to_footer( '<script type="text/javascript">
      $(document).ready(function(){
        var active = 0;
        $("#tab_container div:eq("+active+")").show();
        tab_action(0);
       
        $("#the_tabs span").click(function(){
          var index = $("#the_tabs span").index(this);
          if(active != index)
          {
            $("#tab_container div:eq("+active+")").hide();
            active = index;
            tab_action(active);
            $("#tab_container div:eq("+active+")").fadeIn("fast");
          }
        });
      });
      function tab_action(index)
      {
        $("#the_tabs span").css("background-color","#'.stripinput($fptabssettings["tabs_bg"]).'").css("color","#'.stripinput($fptabssettings["tabs_text"]).'");
        $("#the_tabs span:eq("+index+")").css("background-color","#'.stripinput($fptabssettings["tabs_activebg"]).'").css("color","#'.stripinput($fptabssettings["tabs_activetext"]).'");
      }
    </script>');
   }
   
   
   opentable($locale['fpt_056'].$settings['sitename']);
   
    if ($fptabssettings['tab1_enable'] == "1" || $fptabssettings['tab2_enable'] == "1" || $fptabssettings['tab3_enable'] == "1" || $fptabssettings['tab4_enable'] == "1" || $fptabssettings['tab5_enable'] == "1") {
   echo "<div id='tab'>\n
    <div id='the_tabs'>\n";
   if ($fptabssettings['tab1_enable'] == "1" && $fptabssettings['tab1_content'] !== "" && $fptabssettings['tab1_name'] !== "") {
   echo"<span>".stripslashes($fptabssettings['tab1_name'])."</span>";
   }
   if ($fptabssettings['tab2_enable'] == "1" && $fptabssettings['tab2_content'] !== "" && $fptabssettings['tab2_name'] !== "") {
    echo"<span>".stripslashes($fptabssettings['tab2_name'])."</span>";
   }
   if ($fptabssettings['tab3_enable'] == "1" && $fptabssettings['tab3_content'] !== "" && $fptabssettings['tab3_name'] !== "") {
   echo"<span>".stripslashes($fptabssettings['tab3_name'])."</span>";
   }
   if ($fptabssettings['tab4_enable'] == "1" && $fptabssettings['tab4_content'] !== "" && $fptabssettings['tab4_name'] !== "") {
   echo"<span>".stripslashes($fptabssettings['tab4_name'])."</span>";
   }
   if ($fptabssettings['tab5_enable'] == "1" && $fptabssettings['tab5_content'] !== "" && $fptabssettings['tab5_name'] !== "") {
   echo"<span>".stripslashes($fptabssettings['tab5_name'])."</span>";
   }
    echo"</div>\n";
   
    echo"<div id='tab_container'>";
    if ($fptabssettings['tab1_enable'] == "1" && $fptabssettings['tab1_content'] !== "" && $fptabssettings['tab1_name'] !== "") {
    echo "<div class='tab_content'>";
    echo stripslashes($fptabssettings['tab1_content']);
    echo "</div>\n";
   }
   if ($fptabssettings['tab2_enable'] == "1" && $fptabssettings['tab2_content'] !== "" && $fptabssettings['tab2_name'] !== "") {
    echo "<div class='tab_content'>";
    echo stripslashes($fptabssettings['tab2_content']);
    echo "</div>\n";
   }
   if ($fptabssettings['tab3_enable'] == "1" && $fptabssettings['tab3_content'] !== "" && $fptabssettings['tab3_name'] !== "") {
    echo "<div class='tab_content'>";
    echo stripslashes($fptabssettings['tab3_content']);
    echo "</div>\n";
   }
   if ($fptabssettings['tab4_enable'] == "1" && $fptabssettings['tab4_content'] !== "" && $fptabssettings['tab4_name'] !== "") {
    echo "<div class='tab_content'>";
    echo stripslashes($fptabssettings['tab4_content']);
    echo "</div>\n";

   }
   if ($fptabssettings['tab5_enable'] == "1" && $fptabssettings['tab5_content'] !== "" && $fptabssettings['tab5_name'] !== "") {
    echo "<div class='tab_content'>";
    echo stripslashes($fptabssettings['tab5_content']);
    echo "</div>\n";
   }
    echo "</div>\n</div>\n";
   }else{
   echo"<div style='text-align: center;'>".$locale['fpt_031']."</div>\n";
   }

   // COPYRIGHT DO NOT REMOVE
   echo"<div class='side small' style='padding-top:5px; text-align:right; color:#000;'>".$locale['copyrightFPTABS']."</div>\n";
     
  closetable();
   }




then saved it as home.php uploaded it to my ftp deleted the fp_tabs_panel.php, and now I have my custom main page which is http://oilregionb...m/home.php

Everything is still controlled by the infusion that Craig created. All I did was make a home page out of it.

Merged on Jul 20 2012 at 19:20:23:
I want to upload this as a modified version to craig's original, but i was unsure of required information so i stopped the upload process. Can i get some help with this please.
Edited by Vyper69 on 21-07-2012 00:20
 
http://elink2biz.com
Craig
What do you need help with?

Why would you make it a page when it can already be on a page as a panel?

Also the next time you need help with any of my addons please use my own site for support. Good
 
http://www.fusiontube.co.uk/
Vyper69
Yes I know I can use it as a panel, but it is attached to a page. news.php, articles.php, weblinks.php. I am using the scrolling news panel. So I don't want it setup, on the news.php page, and my weblinks page has over 100 categories, so not there. Yes I could have left it just like it was without moving the code to fp_tabs_panel.php and just created a blank page like this:

Download source  Code
require_once "maincore.php";
require_once THEMES."templates/header.php";

require_once THEMES."templates/footer.php";




As it is now it is my main page so now I can use whatever panels I want with it, I can pick what I want to use. Plus I was playing around, seeing if I moved code around if I could make something work, without having the page crash. I am in the learning process, and i am going to mess around with things. As long as I don't crash my server I am happy.
 
http://elink2biz.com
Craig
Look man you do not need to edit anything if you read my Tutorial here carefully you will understand why I am wondering why you want to add code to pages when it can essentially be done via the panels admin and include exclude on pages.

Anyway read my tutorial here...

http://www.php-fu...ost_162956
 
http://www.fusiontube.co.uk/
Vyper69
Understandable, but the include and exclude go if I want it to or don't want it to show up on a specific page or pages. I could have created a custom page, and used the custom page as my main page so it would have shown up something like this oilregionbusiness.com/viewpage.php?page_id=15, but why would I do that if i could have oilregionbusiness.com/home.php which looks better and alot more friendly. Yes I could have just used the code from news.php to create a blank page called home.php. But like I said I was messing around to see if I could make something work. A learning process of what I can and can't do. The page still carries all copyrights, and all the original coders, on it. I just added edited by.
 
http://elink2biz.com
Craig
My tutorial is for a home.php custom page not viewpage.php custom pages. Like i said read my tutorial carefully and you will see what I mean.

Unless I am missing something here?
 
http://www.fusiontube.co.uk/
Vyper69
fixed
 
http://elink2biz.com
Jump to Forum:
Similar Threads
Thread Forum Replies Last Post
How to change displaying my home page from news.php to index.php? General Discussion 19 14-05-2013 09:24
Forum attachments - page Panels and Infusions 3 12-05-2013 21:33
Profile Scaner - page Panels and Infusions 1 05-05-2013 14:18
Number of news on the main page 7.02.06 System Administration 3 28-04-2013 02:29
Change text in downloads page Ideas for Modifications and Requests 5 23-04-2013 16:31
Official Home of PHP-Fusion uses cookies. Some may already have been set. Read more about our Cookies here.
Please click the button I Consent Cookies to hide this bar and accept our cookies. If you continue to use the site with no action taken, we'll assume that you consent our cookies anyway.
Cookiebar Panel byVenue