Almost Got A Good Hack For Guestbook!!!

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Infect The System
Posts: 45
Joined: Mon 13. Mar 2006, 03:19
Contact:

Almost Got A Good Hack For Guestbook!!!

Post by Infect The System »

So as the title says, i almost got a good hack working for the guestbook system.

After searching the forums, and having my own need, i started trying to find a way to hide the Add A Comment box on the guestbook system.
I came across some good ideas on some websites and began to put together a way to hide the Add A Comment box.

*!* Note. I am not a programmer and im sure the following work will show you that. And obviously the reason why i cant get this going myself.

I started with this as a basic idea on how to make this work.
http://www.dynamicdrive.com/dynamicinde ... ontent.htm

And started to add it to the /phpwcms_template/inc_cntpart/guestbook/ file and came up with this..(click on the Leave A Comment link....duh)
http://www.jo-s.com/phpwcms_template/in ... fault.html

But the problem is, it doesnt work when a guestbook is added to an article. You can see what i mean here. And it also hides the comment that is already there...
http://www.jo-s.com/forever.phtml

So can anyone figure out what the problems are, and we can start to put together a proper easy hack for this issue.

I'm Using wCMS 1.2.6.

Thanks,

-ITS
User avatar
Oliver Georgi
Site Admin
Posts: 9934
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Post by Oliver Georgi »

This can be done by using simple CSS and a little JavaScript.

All you have to do is wrapping the form in some <div>:

The default should look like this:

Code: Select all

<!--FORM_START//-->
<table border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#F5F5F5" style="margin-bottom:10px;">
......
</table>
<!--FORM_END//-->
Then do this:

Code: Select all

<!--FORM_START//-->
<div id="showgbform"><a href="#" onclick="document.getElementById('showgbform').style.display='none';document.getElementById('gbForm').style.display='block';">Add your comment</a></div>
<div id="gbForm" style="display:none;">
<table border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#F5F5F5" style="margin-bottom:10px;">
......
</table>
</div>
<!--FORM_END//-->
And here is some sample code - put it in a new file and test it in your bowser - and you will understand.

Code: Select all

<html>
<body>
<div id="showgbform"><a href="#" onclick="document.getElementById('showgbform').style.display='none';document.getElementById('gbForm').style.display='block';">Add your comment</a></div>
<div id="gbForm" style="display:none;background-color:#cccccc;width:300px;height:100px;">
xvxcvxcvcv
<br>
<br>
<a href="#" onclick="document.getElementById('showgbform').style.display='block';document.getElementById('gbForm').style.display='none';">Close</a>
</div>
</body>
</html>
This can be extended by suing a JavaScript function and some CSS classes and so on...

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
Post Reply