Previous Thread
Next Thread
Print Thread
Rate Thread
#202068 01/01/2004 9:30 PM
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 thumbsup 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.


- Allen wavey
- What Drives You?
Sponsored Links
#202069 01/02/2004 12:34 PM
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:

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


- Allen wavey
- What Drives You?
#202070 02/11/2004 3:29 PM
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
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

#202071 02/11/2004 6:26 PM
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
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

#202072 02/11/2004 7:47 PM
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 smile


- Allen wavey
- What Drives You?
Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)