|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
Modification Name: Php Style Author(s): AllenAyres Description: Creates a vars_style.inc.php file in whch you can include your forum styles/header/footer/etc into any php page. Demo: none Requirements: ubb.classicâ„¢ 6.7 Download Link: https://www.ubbdev.com/ubb/upload/00000494/php_style.zip Credits: Burak for lots of assistance and Charles Capps for pointers Rather easy to install and run. It's of beta quality only because I didn't include any visual info (html) that the file actually did what it was supposed to. You modify cp.cgi and upload the the included .cgi file and access it via your forum's /cp.cgi?ubb=styles_php. It runs and writes the vars_style.inc.php file, giving you all the styles data you could need to use in any php page in your site. Require the file into your .php file (example: index.php) and call the variables ($Header, $Footer, $TableTop, $TableColorStrip, $FontFace, etc. etc. etc.) - for a full list, check the included file for what variables are written.
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
Here is suggested code for an index.php page: <?PHP
/* ubb.php index */ // ----------------- EDIT ---------------------- // Path to vars_config.inc.php $varspath = "your/ubb/vars/path"; // --------------------------------------------- // load required files $Header = addslashes($Header); require "{$varspath}/vars_config.inc.php"; require "{$varspath}/vars_style.inc.php";
echo <<<UBBPRINT <html><head>
$HeaderInsert
</head> <body bgcolor="$BGColor" text="$TextColor" link="$LinkColor" vlink="$VisitedLinkColor" alink = "$ActiveLinkColor"> <!--begin header-->
$Header
<!--end header--> <!--begin footer-->
$Footer UBBPRINT; ?> <!--end footer-->
</body></html>
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
Allen, in the next version could you make it so it updates the file if it already exists? You have it so if it already exists, it does nothing, but a lot of people change their styles
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
Allen, I have to say I love this mod. I've been constantly editing my main page so it matched any changed I made to my forums, but with a little editing of your mod, I have it adding my copyright notice, my ubb version, the main buttons line, and $show_logout
The $TableTop and $TableBottom variables are really saving me some constant typing compared to adding in $TBT by hand Thanks to this mod, I'm finally converting my main page over to entirely PHP
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
glad it's working for you
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 449
Joined: February 2008
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|