Gbook Skinning?

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Guest

Gbook Skinning?

Post by Guest »

Hi there, i was wondering if anyone could help me.

I'm a proud user and tinkerer of your lovely Gbook script. What i was wondering was if anyone knew some code for allowing the guestbook to be skinnable?

I'm working on creating some interesting MODs for the guestbook - just added an IP Logger - and i've decided that i skinning feature could be quite nice!

I had a drop down menu with a few skins - taken from css stylesheets.

Does anyone know how to do this? As the tutorials online seem to want you to create 3 or 4 different pages, while i just need it for the one gbook.php page.

Thanks, my email is:

cosmosys @ gmail.com
Guest

Post by Guest »

What is your url ?
Guest

Post by Guest »

do you mean something like this ?

Press the letters at top of page

http://www.fgps.com/keith/GBook/gbook.php

:!:
Guest

Post by Guest »

yes yes yes yes yes!!!!
Guest

Post by Guest »

could you post the code for that? thanks very much
Guest

the code

Post by Guest »

firstly you need this javascript file

http://www.fgps.com/keith/GBook/skinner.js

place it within the same folder as gbook.php !


secondly, find this inside gbook.php

<html>
<head>
<title>$settings[gbook_title]</title>
<meta content=\"text/html; charset=windows-1250\">
<link href=\"style.css\" type=\"text/css\" rel=\"stylesheet\">
</head>

and replace with

<html>
<head>
<title>$settings[gbook_title]</title>
<meta content=\"text/html; charset=windows-1250\">
<link href=\"style.css\" type=\"text/css\" rel=\"stylesheet\">
<script type=\"text/javascript\" src=\"Skinner.js\"></script>
<link rel=\" stylesheet\" type=\"text/css\" href=\"S1.css\" title=\"F1\">
<link rel=\"alternate stylesheet\" type=\"text/css\" href=\"S2.css\" title=\"F2\">
<link rel=\"alternate stylesheet\" type=\"text/css\" href=\"S3.css\" title=\"F3\">
<link rel=\"alternate stylesheet\" type=\"text/css\" href=\"S4.css\" title=\"F4\">
<link rel=\"alternate stylesheet\" type=\"text/css\" href=\"S5.css\" title=\"F5\">
</head>

assuming you've done this, now put this inside your header.txt file.

<table width="120" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="24"><div align="center"><a href="#" onClick="setActiveStyleSheet('F1'); return false;">A</a></div></td>
<td width="24"><div align="center"><a href="#" onClick="setActiveStyleSheet('F2'); return false;">B</a></div></td>
<td width="24"><div align="center"><a href="#" onClick="setActiveStyleSheet('F3'); return false;">C</a></div></td>
<td width="24"><div align="center"><a href="#" onClick="setActiveStyleSheet('F4'); return false;">D</a></div></td>
<td width="24"><div align="center"><a href="#" onClick="setActiveStyleSheet('F5'); return false;">E</a></div></td>
</tr>
</table>

and last but not least,

copy your style.css 5 times and rename them s1.css, s2.css, s3.css, s4.css, s5.css( now play around with the colourings etc etc within each one, remember to leave the original one intact incase of any errors)

voila, now you have the basis to play around with, that above is exactly what makes mine do what you viewed.
http://www.fgps.com/keith/gbook/

dont forget to ftp them all

http://www.fgps.com/keith/
Guest

bit more

Post by Guest »

this is a cookie based javscript file, it creates a cookie,so it will remember what colour settings you chose, and display them next time you visit.(unless of course you empty your cookie pot and internet folders etc)
Guest

Post by Guest »

excellent thanks!

G
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Nice, didn't even know there was a "alternate stylesheet" :oops:

We learn all the time :D
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Guest

Best thing

Post by Guest »

Nice, didn't even know there was a "alternate stylesheet"
If this is true - its the best thing ever! :D
Post Reply