Page 1 of 1

Edit input options for gbook

Posted: Sat Mar 14, 2009 10:13 pm
by myworldplz
Script URL:http://www.imobz.info/gbook/gbook.php
Version of script: Latest 1.6
Hosting company: Liquid Web
URL of phpinfo.php: http://www.imobz.info/gbook/phpinfo.php
URL of session_test.php:http://www.imobz.info/gbook/session_test.php
What terms did you try when SEARCHING for a solution:
gbook form edit
gbook form

Write your message below:

How can I edit the input forms for Gbook to just have a single form to input to the guestbook.
---

iMob Code:

---
Oh and if possible have the form input max be 11. Thanks!

If you need to have the user name field then that's fine but its just going to be so people can post up their codes for a fun game.

Any help would be greatly appreciated!

Posted: Sun Mar 15, 2009 8:58 am
by Henrie
Yes this is possible.

To display only name and comments
Open gbook.php and edit:
Find lines 965-985

Code: Select all

if ($from)
{
    echo $lang['t18'].' '.$from.'<br />';
}
if ($settings['use_url'] && $url)
{
    $target = $settings['url_blank'] ? 'target="_blank"' : '';
    echo $lang['t19'].' <a href="go.php?url='.$url.'" class="smaller" '.$target.'>'.$url.'</a><br />';
}
if ($email)
{
    if ($settings['hide_emails'])
    {
        echo $lang['t20'].' <a href="gbook.php?a=viewEmail&num='.$i.'" class="smaller">'.$lang['t27'].'</a>';
    }
    else
    {
        echo $lang['t20'].' <a href="mailto:'.$email.'" class="smaller">'.$email.'</a>';
    }
}
and remove it.

To have only possibility to add name and comments
Edit gbook.php some more:
Find lines 840-872 (line numbers after removing lines 965-985):

Code: Select all

<tr>
<td><?php echo $lang['t51']; ?></td>
<td><input type="text" name="from" size="30" maxlength="30" value="<?php echo $from; ?>" /></td>
</tr>
<?php
if ($settings['use_url'])
{
    echo '
    <tr>
    <td>'.$lang['t53'].'</td>
    <td><p><input type="text" name="url" value="'.$url.'" size="40" maxlength="80" /></p></td>
    </tr>
    ';
}
?>
<tr>
<td valign="top"><?php echo $lang['t52']; ?></td>
<td><input type="text" name="email" size="30" maxlength="50" value="<?php echo $email; ?>" />
<?php
if ($settings['hide_emails']) {
?>
    <br /><i><?php echo $lang['t66']; ?></i>
<?php
}
?>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><b><?php echo $lang['t16']; ?></b></td>
</tr>
and remove it.

To make text saying "Post only iMob code (max. 11 characters)"
(or other desired text):
Change in gbook.php file line:

Code: Select all

<td><i><?php echo $lang['t54']; ?></i></td>
to

Code: Select all

<td colspan="2"><i><?php echo $lang['t54']; ?></i></td>
Change in language.inc.php file line

Code: Select all

$lang['t54']='Please do not enter URL addresses';
to

Code: Select all

$lang['t54']='Post only iMob code (max. 11 characters)';
To limit input text in comments area to maximum of 11 characters Change (line number 844 after all the previous changes):

Code: Select all

<textarea name="<?php echo $myfield['cmnt']; ?>" rows="9" cols="50" id="cmnt"><?php echo $comments; ?></textarea>
to

Code: Select all

<input type="text" name="<?php echo $myfield['cmnt']; ?>" size="30" maxlength="11" id="cmnt" value="<?php echo $comments; ?>" />

To remove possibility for smileys and private posts
Set in settings.php file (like you have already done):

Code: Select all

$settings['use_private']=0;
and

Code: Select all

$settings['smileys']=0;
And if you don't want the security nummer, set

Code: Select all

$settings['autosubmit']=0;
(but you knew that already).

Greetings,
Henrie

THANKS! Your the best!

Posted: Sun Mar 15, 2009 6:20 pm
by myworldplz
Wow, thank you so much, your a big help :)