News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

adding an smf theme to my other web pages

Started by glennmckenna, November 10, 2012, 08:12:09 AM

Previous topic - Next topic

glennmckenna

i'm trying to add my forums theme to my other web page which I've done using the SSI.php and i get this
http://usaulnaynatation.site90.com/new/test2.php
but i would like to remove the  the forum / content part so in other words all i want is the top blue bar and whats in the blue bar
is that possible ?

I'm currently running:
smf 2.0.2
with the theme:
bluez

Kindred

nearly anything is possible... you just have to know how to code it.

In your case, it is not possible using existing/standard functions, because the blue bar is only PART of the header that SMF uses.
You would have to code the display like it is in index.php.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

glennmckenna

i've so got this far
<?php

/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines http://www.simplemachines.org
 * @copyright 2011 Simple Machines
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.0.2
 */

/* This, as you have probably guessed, is the crux on which SMF functions.
Everything should start here, so all the setup and security is done
properly.  The most interesting part of this file is the action array in
the smf_main() function.  It is formatted as so:

'action-in-url' => array('Source-File.php', 'FunctionToCall'),

Then, you can access the FunctionToCall() function from Source-File.php
with the URL index.php?action=action-in-url.  Relatively simple, no?
*/



// Get everything started up...
define('SMF'1);
if (
function_exists('set_magic_quotes_runtime'))
@set_magic_quotes_runtime(0);
error_reporting(defined('E_STRICT') ? E_ALL E_STRICT E_ALL);
$time_start microtime();

// This makes it so headers can be sent!
ob_start();

// Do some cleaning, just in case.
foreach (array('db_character_set''cachedir') as $variable)
if (isset($GLOBALS[$variable]))
unset($GLOBALS[$variable], $GLOBALS[$variable]);

// Load the settings...
require_once(dirname(__FILE__) . '/Settings.php');

// Make absolutely sure the cache directory is defined.
if ((empty($cachedir) || !file_exists($cachedir)) && file_exists($boarddir '/cache'))
$cachedir $boarddir '/cache';

// And important includes.
require_once($sourcedir '/QueryString.php');
require_once(
$sourcedir '/Subs.php');
require_once(
$sourcedir '/Errors.php');
require_once(
$sourcedir '/Load.php');
require_once(
$sourcedir '/Security.php');

// Using an pre-PHP 5.1 version?
if (@version_compare(PHP_VERSION'5.1') == -1)
require_once($sourcedir '/Subs-Compat.php');


// Create a variable to store some SMF specific functions in.
$smcFunc = array();

// Initate the database connection and define some database functions to use.
loadDatabase();

// Load the settings from the settings table, and perform operations like optimizing.
reloadSettings();
// Clean the request variables, add slashes, etc.
cleanRequest();
$context = array();

// Seed the random generator.
if (empty($modSettings['rand_seed']) || mt_rand(1250) == 69)
smf_seed_generator();

// Before we get carried away, are we doing a scheduled task? If so save CPU cycles by jumping out!
if (isset($_GET['scheduled']))
{
require_once($sourcedir '/ScheduledTasks.php');
AutoTask();
}

// Check if compressed output is enabled, supported, and not already being done.
if (!empty($modSettings['enableCompressedOutput']) && !headers_sent())
{
// If zlib is being used, turn off output compression.
if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') == 'ob_gzhandler' || @version_compare(PHP_VERSION'4.2.0') == -1)
$modSettings['enableCompressedOutput'] = '0';
else
{
ob_end_clean();
ob_start('ob_gzhandler');
}
}

// Register an error handler.
set_error_handler('error_handler');

// Start the session. (assuming it hasn't already been.)
loadSession();



if (!
defined('WIRELESS'))
define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']));


// What function shall we execute? (done like this for memory's sake.)
call_user_func(smf_main());

// Call obExit specially; we're coming from the main area ;).
obExit(nullnulltrue);

// The main controlling function.
function smf_main()
{
// Load the user's cookie (or set as guest) and load their settings.
loadUserSettings();

// Attachments don't require the entire theme to be loaded.
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest']))
detectBrowser();
// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
loadTheme();
}

?>

and the page looks like this :
http://usaulnaynatation.site90.com/new/forum/new-2.php
what else should i do?

Kindred

No. That was copied from index.php. You would copy stuff from index.template.pho, not index.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

glennmckenna

Quote from: Kindred on November 10, 2012, 07:30:18 PM
No. That was copied from index.php. You would copy stuff from index.template.pho, not index.php
ah ok so in other words i've got to create my own theme

Kindred

not completely... you only want part of the theme.

If you would accept the whole header, you could just use SSI + one or two function calls.
Because you only want PART of the header, you need to basically build your own header.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

glennmckenna

Quote from: Kindred on November 11, 2012, 07:29:50 AM
not completely... you only want part of the theme.

If you would accept the whole header, you could just use SSI + one or two function calls.
Because you only want PART of the header, you need to basically build your own header.
and do you think that it would be possible to do it with out the ssi.php ?

Kindred

Well, you still need to include ssi, if you are not building the page under SMF actions array.
But then you can include parts, bits and bobbles from the SMF code.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

glennmckenna

Quote from: Kindred on November 11, 2012, 03:42:43 PM
Well, you still need to include ssi, if you are not building the page under SMF actions array.
But then you can include parts, bits and bobbles from the SMF code.
well this is what it looks like at the moment
http://usaulnaynatation.site90.com/new/forum/index.php
what i want to do is add another menu in between the forums menu and the logo that will be the web sites menu and have the top blue bar on every web page

so if i understand correctly i have to create my own theme (modify the current) one then install it and then use the SSI.php on the other page to fetch the theme

Kindred

if you want the theme to be used in the forum and out... then yes.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

glennmckenna

Quote from: Kindred on November 17, 2012, 07:19:45 AM
if you want the theme to be used in the forum and out... then yes.
no i just want that theme to used on the other pages of the web site

also is the a way to do it with out the SSI and creating another theme?

Kindred

again...   why are you trying to avoid SSI?

If you create a theme, the you would want to use SSI and call that theme.

Do you even understand how SSI works?

once you include SSI, you can use SMF global variables and call SMF functions...

like so

<?php
 
require_once('SSI.php');
 
template_html_above();
  
template_body_above();
  
 echo 
'
   <hr />
   This would be the content section of the page
   <hr />
   '
;
  
   
template_body_below();
  
template_html_below();
 
?>

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Hj Ahmad Rasyid Hj Ismail

Quote from: glennmckenna on November 18, 2012, 06:43:05 AM
also is the a way to do it with out the SSI and creating another theme?
Without SSI , you shall need to create a theme for that page that is similar to your forum. Or you can create page using portal mod(s) or page mod. But the latter is creating a page inside the forum.

glennmckenna

right I've got that part working now thanks

but i would now like to know (this may sound a bit stupid)how do i change the name of the page
here is the like to the page
http://usaulnaynatation.site90.com/new/home.php

Hj Ahmad Rasyid Hj Ismail

Fill something in here:    <title></title>

Colin

Do you mean the HTML Meta tag title or the actual file name?
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Kindred

#16
actually, aharis, if he's using SSI and the templates that much, he should probably continue and use $context['html_headers']['title'] $context['page_title']
(ummm... I *THINK* that's the name of the variable)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Hj Ahmad Rasyid Hj Ismail


glennmckenna

Quote from: ahrasis on December 29, 2012, 08:24:32 PM
Fill something in here:    <title></title>
tried that and it didn't work

Quote from: Kindred on December 29, 2012, 11:56:20 PM
actually, aharis, if he's using SSI and the templates that much, he should probably continue and use $context['html_headers']['title'] $context['page_title']
(ummm... I *THINK* that's the name of the variable)
gave that a go to

here is the current pages code as it is
<?php

$ssi_theme 
4;
 require_once(
'forum/SSI.php');
 
template_html_above();
  
template_body_above();
$page_name "home";
$context['home'];
  
 echo 
'
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
<title>home</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<link href="main.css" rel="stylesheet" type="text/css">

</head>

<body>
<a class="twitter-timeline"  href="https://twitter.com/aulnaynatation" data-widget-id="282847438883135488">Tweets de @aulnaynatation</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

<div class="menu-right">
<div class="menu-header" style="width: 300px"><strong>who are we</strong>
<div style="margin-bottom:10px; width: 300px;" class="menu-body">
summer swimming club affiliated<br>to the French Swimming 
Federation.<br>We have many activities some including all the 
family we welcome swimmers of all levels from<br>beginners to 
competitive including<br>non swimmers as these lessons are<br>
also provided form six years plus,<br>we are a part of the 
French National swimming school discover all the benefits, 
enjoyment, fitness, discipline, for everyone of swimming.
</div>
</div>
<div class="menu-header" style="margin-top:15px"><strong>weather<strong>
<div class="menu-body">
<center>
<div id="c_c12b608b55173f57f58a42ecbafb8113" class="alto">
<h2 style="color: #000000; margin: 0 0 3px; padding: 2px; font: bold 13px/1.2 Verdana; text-align: center;"><a href="http://www.meteorama.fr/m%C3%A9t%C3%A9o-aulnay.html" style="color: #000000; text-decoration: none;">meteo a Aulnay</a></h2></div><script type="text/javascript" src="http://www.meteorama.fr/widget/widget_loader/c12b608b55173f57f58a42ecbafb8113"></script>
</center>
</div>
</div>
</div>
<div style="margin:25px 10px" align="center">
<a target="_blank" href="http://charente-maritime.fr/CG17/jcms/j_5/accueil">
<img src="../images/CG 17.jpg" alt="charente marentime" class="logo"/></a>
<a target="_blank" href="http://www.cnds.info/">
<img src="../images/Etat CNDS.JPG" alt="cnds" class="logo"/></a>
<a target="_blank" href="http://www.cdc-aulnay.fr/">
<img src="../images/logo cdc.jpg" alt="conton de aulnay" class="logo"/></a>
<a target="_blank" href="http://www.ffnatation.fr/webffn/index.php">
<img src="../images/logo_ffn.png" alt="ffn" class="logo"/></a>
<a target="_blank" href="http://www.poitou-charentes.fr/accueil.html;jsessionid=853A0918DE3F77AA12AB64DCC193FA02">
<img src="../images/logo-rpc-espritequip.JPG" alt="" class="logo"/></a>
<a target="_blank" href="http://charentemaritime.ffnatation.fr/script/index.php">
<img src="../images/logo FFN issi.gif" alt="logo FFN charente maritime" class="logo" /></a>
<a target="_blank" href="http://poitoucharentes.ffnatation.fr/script/index.php">
<img src="../images/logo ffn poitou charente.jpg" alt="logo ffn poitou charente" class="logo" /></a>
</div>
<div aligin="center" class="copyright">Copyright © 2011-2013 US aulnay natation All Rights Reserved</div>

</body>

</html>
'
;
  
   
template_body_below();
  
template_html_below();
 
?>


Kindred

no....  use the combination of what aharis and I said...

echo '<title>'. $context['page_title'] . '</title>';

you don't replace page_title with home... you use the words page_title because that is the variable.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: