• Welcome to Simple Machines Community Forum. Please login or sign up.
December 06, 2021, 09:23:45 AM

News:

Wondering if this will always be free?  See why free is better.


Integrating the forum into your site...

Started by [Unknown], November 09, 2004, 11:18:05 PM

Previous topic - Next topic

LuminousSpecter

August 26, 2006, 11:12:55 PM #160 Last Edit: August 27, 2006, 01:35:28 PM by LuminousSpecter
hxxp:waldenfans.com/movies/how/header.php [nonactive]
hxxp:waldenfans.com/footer.php [nonactive]

I'm having trouble understanding the tutorials.  They seem to be written for those with more than just a slight understanding of php, which I have very little.  However, I'm learning, when it comes to this site.

hxxp:www.waldenfans.com/forums/ [nonactive]

I'd love to be able to fully integrate this forum into the site, in the same way that I have the gallery integrated.  This looks like the way to do it, but I can't understand the method.  I just don't know if it's clear enough or what, but there seem to be a few missing steps on the listing.  Any help?

Nevermind, I got it figured out.  However, I do have a suggestion.
QuoteYou may notice that there's a lot of stuff in the header of the index template. 
This would probably be more helpful, with the following:
QuoteYou may notice that there's a lot of stuff in the header of the index template (found in Themes/THEMENAME/index.template.php). 

AdventureWriter

I am integrating SMF into my site, which has a side navigation bar that I'd like to include. I have been able to get myfooter.php file to work just fine. But for some reason, I can't get the navmain_list.php to work (which has my side navigation for the rest of my site). Both php files are in the root folder of the forums section of my site, so it would seem that if the myfooter.php can be found, the navmain_list.php should be found as well.

I am not getting any php errors, I am just getting nothing at all in the area where I expect to see the side navigation bar. I used coding that A.M.A. provided to a poster (osckar) earlier in this thread, but to no avail. I suspect it's something really BASIC that I am missing, but after several days of focusing on this, I am just going around in circles at this point. ::) Perhaps someone can help me? Here is the code I have in index.template.php:


// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="93%" cellpadding="0" cellspacing="0" border="0" align="center"><tr>
      <td width="7%">';

include('navmain_list.php');

   echo '
      </td>
      <td id="bodyarea" width="100%" style="padding: 1ex 10px 2ex 10px;">';

}

function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

echo '</td>
</tr></table>';


Thanks for any assistance possible!  :)

AdventureWriter

MeRcChRiS

If someone can pm me about what i should do and things about the footer.php and header.php, what should be in it, and if i should be editing the forums files or the templates files, i have no clue. So please pm me tell me here on how i am supposed to get this complete, Thanks.

AdventureWriter

I am still struggling with the problem I posted on the 15th about using an include to integrate my side navigation bar into my forum (go two posts above this one). I hope it is OK to bump this to try and get a response.  :-[

Thanks to anyone who might be able to direct me in the right direction!

AdventureWriter

Asher Black

* Any idea what I'd change in index.template.php (or would it be there) to use the calendar button, but have a link for my google calendar (which we already use) instead?

// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' : $txt['calendar24']), '</a>', $context['menu_separator'];


* Can I add a button that looks like the others (home/help/search, etc.) for "Store" and link it to our online store? If so, how?

Asher Black

This is a screenshot of the part of our forum that comes after our custom header include, and before the actual forum content, followed by our code that generates it. Any suggestions for cleaning it up, so the menu is centered and the searchbar is to the right of, and parallel to, the login info? I tried placing these items in table cells, but it kept giving me parse errors.




// Show the menu here, according to the menu sub template.
template_menu();


echo '

<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td>
';


// Search box.
echo '
<form action="', $scripturl, '?action=search2" method="post" style="margin: 0; margin-top: 7px;"><b>', $txt[182], ': </b><input type="text" name="search" value="" style="width: 190px;" />&nbsp;<input type="submit" name="submit" value="', $txt[182], '" style="width: 8ex;" />&nbsp;<a href="', $scripturl, '?action=search;advanced">', $txt['smf298'], '</a><input type="hidden" name="advanced" value="0" />';
// If we're on a certain board, limit it to this board ;).
if (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
echo '
</form>';
';


</td><td>


';
// Login header.
echo '
';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
', $txt['hello_member'], ' <b>', $context['user']['name'], '</b>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo ', ', $txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
echo '.';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br />
<b>', $txt[616], '</b>';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '<br />
', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=regcenter">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'];

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
<br />', $txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
}

echo '<br />
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
', $context['current_time'];
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />

';
}

echo '
</div>';


';

</td></tr></table>




</div>';

MeRcChRiS

October 09, 2006, 12:39:08 AM #166 Last Edit: October 11, 2006, 12:44:59 AM by MeRcChRiS
can someone tell me what i should be including in my header.php and my footer.php? and where i should put it etc.



Please help me, im not sure what to do!


EliTe_ThuT

I included the forum very well to my website...I have my left menu and banner and all of this... but I have one problem.

In my footer, I have a © somewhere... but it displays as a ♦

Someone know what's the problem...well I know what is the problem...it's the charset...but I tried to change it but it doesn't work...

Daniel15

Quotecan someone tell me what i should be including in my header.php and my footer.php? and where i should put it etc.
In header.php, put whatever you'd like to put at the top of the page, on top of the forum. Likewise, put everything you want to appear at the bottom of the forum in footer.php.

QuoteIn my footer, I have a © somewhere... but it displays as a ♦

Someone know what's the problem...well I know what is the problem...it's the charset...but I tried to change it but it doesn't work...
Try using &copy; instead ;)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

rhesusv

Can someone tell me what i did wrong here ? i'm trying to include my WP header as my forum header . I did follow the instruction as stated at the 1st post. But still the header from the WP is not showing. wat did i do wrong?? hmm...

here's the part where i edited in my index.templete.php
1.
<html><head>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
// --></script>
<title>', $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />';

if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />
', $context['html_headers'], '
</head>
<body>';
include('header.php');



2. For the footer

// The following will be used to let the user know that some AJAX process is running
include('footer.php');
echo '
<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>
</body></html>';
}


The footer.hp & the header.php are those from the default WP theme.

MeRcChRiS

where do i need to put the header and footer part? on the index.template.php? or what?

Martje

October 31, 2006, 09:00:57 AM #172 Last Edit: November 04, 2006, 05:36:30 PM by maime
No, you make a custom header and footer file and you upload them to the sources dir :) at least if that is your question

else you put your custom made header  and footer in the index.template.php file, if you wait for a moment i put up an example.

allright I used this topic as  a manual http://www.simplemachines.org/community/index.php?topic=19638.msg158669#msg158669

here is the code i made to get it working in 1.1RC3, when upgrading from 1.09 my old template did not seem to work anymore, so I am not sure if i did it the right way but it works :)

so after following the instructions of unknown the template looks like the one i  attached in this topic.

the main confusion i see seems to be related to the header and footer part so i will concentrate on that.

in the index.template.php file you will find near the bottom this code

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
</head>
<body>';

include('headerHostelsBanner.php');
}

function template_site_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

include('hostelsBasicFooter.php');

echo '
</body></html>';
}
?>


you have to replace the headerHostelsBanner.php and the hostelsBasicFooter.php

with your own custom made header and footer file.

just make a new header file and name it for example myHeader.php, do the same with you footer and call it for example myFooter.php

in those files you can put any html you want.
To get a top side and bottom for example you can use
in the myHeader.php
<!--//table layout header -->
<table width="100%">
  <tr>
    <td colspan="2">here come you logo and stuff </td>
  </tr>
  <tr>
    <td width="27%">this is a sidebar </td>
    <td width="73%">
<!--// here ends the header -->


and in the myFooter.php
<!--//here starts the footer --> </td>
  </tr>
  <tr>
    <td colspan="2">this is the footer </td>
  </tr>
</table>
<!--//here starts the footer -->

of course you can add css to all of it, just play around with it :)

then you upload the my Header.php and myFooter.php into your Sources dir

now the only thing left to do is follow this info from [unknown]

Now, if you did this, and went to your forum, it'd look REALLY CRAPPY.  There's one last vital thing that needs to be done for it to work.  And to do that, we need the id of the theme we're working with.

To find this id (which, if you've only created one theme, will be 3) you will need to check the link to "preview" it in your profile.  You'll see it say "theme=xyz".  The number (I put xyz but it should be a number) is the id.  Once you have that, you want to write the following query in phpMyAdmin - go to your database and pick the SQL tab, and type in the box:




REPLACE INTO yourprefix_themes
   (ID_THEME, variable, value)
VALUES (that number, 'theme_layers', 'site,main');


(where yourprefix_ is your prefix, often 'smf_' and that number is the theme id we found.)

thats all, if you follow this you get something which looks like this....
http://www.hostelsamsterdam.com/forum/

well more ore less ;D

I used the classic theme for it

good luck

martijn


MeRcChRiS

ok thanks alot for the help, now i jsut have to find a nice simple web template to use and then edit it a little, the only hard thing is the phpmyadmin part, with the sql and stuff, but ill get back to you if i need any more help.

Martje

November 03, 2006, 03:45:50 AM #174 Last Edit: November 03, 2006, 03:56:36 AM by maime
Quote from: MeRcChRiS on November 01, 2006, 07:36:50 PM
ok thanks alot for the help, now i jsut have to find a nice simple web template to use and then edit it a little, the only hard thing is the phpmyadmin part, with the sql and stuff, but ill get back to you if i need any more help.

Yeah i always wondered about that... there are many themes but i have never find an empty template, which you could edit. I think there should be a standard integration theme which you could edit easaly if you don't no nothing about php.

the only thing you needed for that is
1 theme in the themedirectory,
1 customheader.php and one customfooter.php in the Sources dir
and the explanation how to put the code
REPLACE INTO yourprefix_themes
   (ID_THEME, variable, value)
VALUES (that number, 'theme_layers', 'site,main');

into your database with phpmyadmin.....
Although i can imagen that a coder could write a script for the whole lot and put it in a package.

personaly I think it should be a standard thing like the classic theme and the babylon theme, it would save a lot of posts from people who are new to php and simplemachines, because I think that there are a lot of people want to integrate their forum into their site.


I think this could be is something for the developement team to think about  ;) after all
since this topic exists there are on this moment 45758 views from nov 2004, that is about let me see.... 63, something views a day. I wish i had that score on one of my boards for one topic :P
but seriously why not a standard integration theme? editing the custom header and footer should not be that hard for most people... :)

MeRcChRiS

Quotein the template file you will find near the bottom this code

what would be the template file? my webpage or the index.template.php?

i got confused lol

Xaneth

November 04, 2006, 04:20:10 PM #176 Last Edit: November 04, 2006, 04:25:19 PM by Xaneth
When I modify my style.css and save changes, it has no effect!

I am running 1.1 RC3, so I can see the changes as I'm making them, in the preview.  I created a copy of default to edit.  I make the changes to style.css, under "modify themes", and they keep in the preview, but they won't affect the site once I click on save changes.  I'm doing all of this on a test forum I have installed at www.mirrorstonemusic.com/test/index.php.  Another thing I tried was renaming style.css in the Themes/default folder and copying my modified one there, since I know it draws on the default theme.  At that point it finally took some of the changes, but it still didn't take the changes to:

/* This is used for categories, page indexes, and several other areas in the forum.
.catbg and .catbg2 is for boardindex, while .catbg3 is for messageindex and display headers*/
.catbg , tr.catbg td , .catbg3 , tr.catbg3 td
{
   background: url(images/catbg.jpg) #357e38 repeat-x;
   color: #ffffff;
   padding-left: 10px;
   padding-right: 10px;


Or to:

/* These are used primarily for titles, but also for headers (the row that says what everything in the table is.) */
.titlebg, tr.titlebg th, tr.titlebg td, .titlebg2, tr.titlebg2 th, tr.titlebg2 td
{
   color: black;
   font-style: normal;
   background: url(images/titlebg.jpg) #3367bd repeat-x;
   border-bottom: solid 1px #3367bd;
   border-top: solid 1px #FFFFFF;
   padding-left: 10px;
   padding-right: 10px;
}


How do I make changes to style.css and have them take effect globally?  I have also gone in to "manage and install" and reset the overall forum default as well as reset everone to, back and forth between SMF Default theme and my custom theme (named it mirrorstone).  And nothing is working as it should!  I refresh the page as well, very wierd!  I've tried it with both Firefox and IE, same thing!

I'm beginning to think that I just need to follow the direction a little more closely in the first post of this topic. 
QuoteThere are comments in the file, but the main ones to worry about are titlebg (blue), windowbg and windowbg2 (shades of gray), and bordercolor/tborder. (backgrounds for tables, grid lines, etc.)

Xaneth

Figured it out, it wasn't changing because of the image files.  Learning, slowly but surely.

Martje

November 04, 2006, 05:32:28 PM #178 Last Edit: November 04, 2006, 05:41:31 PM by maime
Quotewhat would be the template file? my webpage or the index.template.php?
sorry its the index.template.php
you can download the index.template.php a couple of post back,
then replace the include('headerHostelsBanner.php');
}

function template_site_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

include('hostelsBasicFooter.php');


with your own custom made header and footer files :)

don't forget to upload those files to the sources dir and dont forget to do the phpmyadmin thing as descibed a couple of post back.
then everything will be fine  :)

MeRcChRiS

ok, so i did what you said and i added stuff to my header.php and footer.php into the sources dir. tell me if this is how its supposed to look like so far without the theme id etc.

http://gfximpulse.blankcolors.com/forum/

Advertisement: