embedded on website

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
tijmenamsing
Posts: 4
Joined: Tue Jun 28, 2011 6:26 pm

embedded on website

Post by tijmenamsing »

Version of script: 1.7

Write your message below:

Hello,
In the first place a big 'wow' for you script!


I'm making my first website and want your guestbook embedded on it.
So far I succeeded quite well.. The only problem is that my container does not size with the length of the guestbookpage; the guestbook expands the container. I read a few threads about it on this forum but I can't find what's causing it.

To embed your guestbook on my page I just copy/pasted gbook.php in an already excisting template by me. I also tried using header.txt and footer.txt which you provided. But that results in the same container problem.
On another page with the same template, but without your script, the container does size with it's content, so my guess is that your style.css and the CSS of my template are somehow conflicting.

I already spend quite some time, so now my question to you is if you could find what's causing it.
Since my website is not yet online I uploaded the part of my website containing the guestbook.
Dropbox download link: http://dl.dropbox.com/u/5454389/gbook.rar

I hope you can find some time to help me!
thanks!

*edit
I gave the container a height of 1000px for you to see what the container looks like.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: embedded on website

Post by Henrie »

Hallo Tijmen,

This is normally out of the scope of the support given here, but because I liked to do some puzzling tonight I will point you in the right direction.

And I think it is also good to show it here because I have seen many times that people want to add code to the <head> ... </head> section of the page but do not know where to place it. They mostly put it in the header.txt file, which is wrong. It should be placed in the overall_header.php file which can be found in the template folder.

First of all, you have havily modified the file gbook.php. You should restore the original file. Your modifications should be made in other files which are placed in the gbook root folder, you named it gastenboek (for all non dutch speaking people, gastenboek is dutch for guestbook) and in your templates\amsing folder.

I will try to give clear guideline.

1. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
You have added this in the gbook.php file. This should be defined in your language.inc.php file.
So open your file nederlands.inc.php and change $lang['enc']='windows-1250'; to $lang['enc']='utf-8';

2. Using your own template folder, make sure you copy all files
Because of the extend of your modifications, it is good that you have created your own template folder. Make sure you copy all the files from the default template. In the archive you provided, the overall_footer.php file is missing.

3. Code added in the <head> ... </head> section should be added to the file overall_header.php
This file can be found in your templates\amsing folder.
The following code that you have added to the gbook.php file should be added just before the </head> tag in the overall_header.php file.

Code: Select all

<link rel="shortcut icon" href="../klaverblad.ico">

<style type="text/css">
<!--
body {
	font: 80%/1.4 Verdana, Arial, Helvetica, sans-serif;
	margin: 0;
	padding: 0;
	color: #2F363E;
	background-color: #2F363E;
}

/* ~~ Element/tag selectors ~~ */
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
	padding: 0;
	margin: 0;
}

h2, h3, h4, h5, h6, p {
	margin-top: 0;	 /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
	padding-right: 0px;
	padding-left: 0px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
}

h1 {
	font-size: 36px;
}

a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
	border: none;
}

/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
a:link {
	color: #2F363E;
	text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
}
a:visited {
	color: #4B5663;
	text-decoration: underline;
}
a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
	text-decoration: none;
}

/* ~~this fixed width container surrounds the other divs~~ */
.container {
	-webkit-box-shadow:0 0 20px #B5B6BD;
	-moz-box-shadow:0 0 20px #B5B6BD;
	box-shadow:0 0 20px #B5B6BD;
	width: 1024px;
	border: 3px solid #455268;
	margin: 20px auto 50px auto; /* the auto value on the sides, coupled with the width, centers the layout */
	background-image: url(../Images/bggradient1500dl.png);
	background-repeat: repeat;
	background-color: #a4e666;
	/* height: 1000px; */

}

/* ~~ the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo ~~ */
.header {
	border-bottom: 2px solid #455268;
	height: 120px;
}

/* ~~ These are the columns for the layout. ~~ 

1) Padding is only placed on the top and/or bottom of the divs. The elements within these divs have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.

2) No margin has been given to the columns since they are all floated. If you must add margin, avoid placing it on the side you're floating toward (for example: a right margin on a div set to float right). Many times, padding can be used instead. For divs where this rule must be broken, you should add a "display:inline" declaration to the div's rule to tame a bug where some versions of Internet Explorer double the margin.

3) Since classes can be used multiple times in a document (and an element can also have multiple classes applied), the columns have been assigned class names instead of IDs. For example, two sidebar divs could be stacked if necessary. These can very easily be changed to IDs if that's your preference, as long as you'll only be using them once per document.

4) If you prefer your nav on the right instead of the left, simply float these columns the opposite direction (all right instead of all left) and they'll render in reverse order. There's no need to move the divs around in the HTML source.

*/
.navigation {
	width: auto;
	height: 26px;
	padding: 2px;
	padding-right: 8px;
}

.sidebar {
	float: left;
	width: 180px;
	padding-top: 85px;
}

.content {
	padding: 10px 0;
	width: 832px;
	float: left;
	border: 1px solid #455268;
	background-color: #F4F5F7;
	text-align: left;

}

/* ~~ This grouped selector gives the lists in the .content area space ~~ */
.content ul, .content ol { 
	padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */
}

/* ~~ The footer ~~ */
.footer {
	padding: 10px 0;
	position: relative;/* this gives IE6 hasLayout to properly clear */
	clear: both;
}

/* ~~ miscellaneous float/clear classes ~~ */
.fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
	float: right;
	margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
	float: left;
	margin-right: 8px;
}
.clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */
	clear:both;
	height:0;
	font-size: 1px;
	line-height: 0px;
}

.breadcrumbs {
	float: left;
	padding: 2px;
}

#loguitbutton {
	float: right;
}

.menu,
.menu ul {
	margin:0;
	padding:0;
	list-style:none;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}

.menu { /* geheel menu */
	width:175px;
}

.menu li { /* ondergeschikte blokken */
	margin:0;
	padding:0;
	margin-bottom:1px;
}

.menu a {
	display:block;
	padding:8px 10px;
	color:#A4E666;
	text-decoration:none;
	margin-bottom:1px;
	background-color: #434E5A;
}

.menu a:hover {
	background:#2F363E;
}

.menu ul a {
	padding-left:10px;
}

.menu li {
	padding-left:25px;
}

.menu ul a {
	background-color: #535F6C;
}

.hidden {
	display:none;
}

-->
</style>

  <script type="text/javascript">
  function fLoguit() {
  var loguit=window.confirm('Weet u zeker dat u uit wilt loggen?');
  if (loguit==true) {
  window.location="handlelogout.php";
  }
  else {
  return;
  }
  }
  </script>
You can now close the overall_header.php file.
In case you have not noted, in the style fo .container { I have commented out the height: 1000px; style. You could also delete it. This is needed so that the container wraps around the guestbook.

4. Code added in the top of the <body> ... </body> section should be added to the file header.txt
This file can be found in the gbook root folder.
The following code that you have added to the gbook.php file should be placed in the header.txt file.

Code: Select all

<div class="container">
<div class="header"><img src="../Images/banner.png" width="1024" height="120" alt="banner" /><!-- end .header --></div>
<div class="sidebar">
    <ul class="menu">
      <li><a href="#">#</a> </li>
      <li><a href="#">#</a> </li>
      <li><a href="#">#</a>
        <ul>
          <li><a href="#">#</a></li>
          <li><a href="#">#</a></li>
        </ul>
      </li>
      <li><a href="#">#</a>
        <ul>
          <li><a href="#">#</a></li>
          <li><a href="#">#</a></li>
        </ul>
      </li>
    </ul>
    <!-- end .sidebar1 -->
</div>
<div class="navigation">
  <div class="breadcrumbs"> > Gastenboek </div>
    <div id="loguitbutton">
      <input name="log uit" type="button" onclick="fLoguit()" value="log uit" />
    </div>
    <!-- end navigation -->
  </div>
  <div class="content">
You can now close the header.txt file.

5. Code added in the bottom of the <body> ... </body> section should be added to the file footer.txt
This file can be found in the gbook root folder.
The following code that you have added to the gbook.php file should be placed in the header.txt file.

Code: Select all

        </div>
        <div class="footer">
    <h6 align="right"><em>© Tijmen Amsing 2011&nbsp;&nbsp;&nbsp;&nbsp;</em></h6>
<!-- end .footer --></div>
<!-- end .container --></div>
You can now close the footer.txt file.

And that is all.
I hope this was clear enough. Now that I read it back, it does not look as hard to do as I thought it would, but if you still have problems feel free to ask.

Groeten,
Henrie
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
tijmenamsing
Posts: 4
Joined: Tue Jun 28, 2011 6:26 pm

Re: embedded on website

Post by tijmenamsing »

Wow great and quick help, nice!

the container indeed works properly now thanks to you.

One minor problem: as you might see in my footer there should be a © char but it is not displayed. It's replaced by a "?". Obviously other special characters like "é" don't display either.
I changed the charset in nederlands.inc.php to utf-8 and in gbook.php it's stated as well.

Any idea how to fix this?

thanks again!
Last edited by tijmenamsing on Tue Feb 25, 2014 2:07 pm, edited 1 time in total.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: embedded on website

Post by Henrie »

When you define pages to be utf-8 , make sure the pages are really encoded in utf-8.

The safest way is to use the code &copy; to display © . That is what I do, it works independent of the codepage that is defined.

Greetings,
Henrie
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
tijmenamsing
Posts: 4
Joined: Tue Jun 28, 2011 6:26 pm

Re: embedded on website

Post by tijmenamsing »

I don't fully understand why but utf-8 just won't work..
When i define other charsets (like windows-1250 you used) it does work, and even when i delete the whole line containing the defining of the charset it works :|

anyhow, thanks for all your work!


something else.. do you have or know a script of a simple and free (birthday)event calendar which I can embed as well?
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: embedded on website

Post by Henrie »

To see what is the encoding of your paga you could open it in notepadd++ and see what it sees is the document charset encoding.
But to be honest, I also find it hard to understand sometimes

As for an event calender I have used in the past http://www.hscripts.com/scripts/php/event-calendar.php but it did not fullfill all my wishes.
I am now using PHP Event Calendar on my site for Scouting Volkel but it is not maintained anymore and you need to read the forums to fix some issues and it is not very user friendly.

There are many to choose from, but I can not give you a link to the perfect one.

Greetings,
Henrie
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
tijmenamsing
Posts: 4
Joined: Tue Jun 28, 2011 6:26 pm

Re: embedded on website

Post by tijmenamsing »

That calendar you use on your website works exactly the way I want it!
All other calendar I've seen show the events in the calendar itself..
I hope I can figure out how it works :)
Post Reply