|
New Page Creation
|
| Vyper69 |
Posted on 21-07-2012 00:06
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
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.
Coderequire_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.
Codeif (!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
|
| |
|
|
| Craig |
Posted on 21-07-2012 00:56
|

Fusioneer

Posts: 3980
Joined: 27/09/2005
|
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.
|
| |
|
|
| Vyper69 |
Posted on 21-07-2012 01:13
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
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:
Coderequire_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. |
| |
|
|
| Craig |
Posted on 21-07-2012 01:17
|

Fusioneer

Posts: 3980
Joined: 27/09/2005
|
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
|
| |
|
|
| Vyper69 |
Posted on 21-07-2012 01:33
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
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. |
| |
|
|
| Craig |
Posted on 21-07-2012 01:57
|

Fusioneer

Posts: 3980
Joined: 27/09/2005
|
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?
|
| |
|
|
| Vyper69 |
Posted on 21-07-2012 04:03
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
fixed |
| |
|