Page 1 of 1

Methods for changing and styling default labels?

Posted: Sat Feb 07, 2009 7:23 pm
by dstx
How do I change and/or style . . .

...change "Submitted by" (no colon) to "From:"?
and "Comments:" to "Comment:"?

...change "View guestbook" to "VIEW", and "Sign Guestbook" to "SIGN"?

...change font-size of "View..." and "Number of..." labels without affecting font size of Submitted by or Comments guest entries?

...change "Powered by PHP guestbook 1.6 from PHPJunkyard - Free PHP scripts" to "Powered by PHP guestbook 1.6"?

...change: "Number of entries:" to "Entries:", and "Number of Pages:" to "Pages:"?
and style these to "font-style: italic"?

...change email readout from "Contact" to "CONTACT"?

In "Submitted by", how do I remove or style to "font-style: italic", labels for "Name", "From", "Email"?

In "Comments" how do I remove "Added:" so only date displays?

On Sign guestbook form page, how do I enlarge font-size of :
Your name:
Where are you from?
Your e-mail:
Comments: Please do not enter URL addresses
(these are tiny compared to other text)


Gbook forum search terms used for help are too numerous to mention; see progress made in customization at: http://texanatrailslodge.com/reservations/guestbook/

NOTE: delete.gif, reply.gif, and ip.gif images were replaced with blank gifs, but mouseover still reveals links.
In future versions of Gbook, it would be great to have an admin cpanel for these functions rather than buttons on every comment that are accessible to everyone.

Posted: Sun Feb 08, 2009 4:39 am
by Henrie
How do I change and/or style . . .
...change "Submitted by" (no colon) to "From:"?
and "Comments:" to "Comment:"?
Find the text in file language.inc.php and change it.
...change "View guestbook" to "VIEW", and "Sign Guestbook" to "SIGN"?
Find the text in file language.inc.php and change it.
...change font-size of "View..." and "Number of..." labels without affecting font size of Submitted by or Comments guest entries?
Open file gbook.php and search for

Code: Select all

echo '<p>'.sprintf($lang['t01'],$total,$pages).'<br />';
and change it to

Code: Select all

echo '<p style="font-size:120%;">'.sprintf($lang['t01'],$total,$pages).'<br />';
I am not sure what you mean with "View...", but i guess the links above the "Number of..." labels. To do that, change

Code: Select all

<p style="text-align:center; font-size:120%;"><a href="'.$settings['website_url'].'">'.$lang['t61'].' '.$settings['website_title'].'</a>
to

Code: Select all

<p style="text-align:center"><a href="'.$settings['website_url'].'">'.$lang['t61'].' '.$settings['website_title'].'</a>
...change "Powered by PHP guestbook 1.6 from PHPJunkyard - Free PHP scripts" to "Powered by PHP guestbook 1.6"?
The copyright notice may not be changed or removed without purchasing a Copyright removal license.
...change: "Number of entries:" to "Entries:", and "Number of Pages:" to "Pages:"?
Find the text in file language.inc.php and change it.
and style these to "font-style: italic"?
Open file gbook.php and search for

Code: Select all

echo '<p>'.sprintf($lang['t01'],$total,$pages).'<br />';
and change it to

Code: Select all

echo '<p style="font-style:italic;">'.sprintf($lang['t01'],$total,$pages).'<br />';
...change email readout from "Contact" to "CONTACT"?
Find the text in file language.inc.php and change it.
In "Submitted by", how do I remove or style to "font-style: italic", labels for "Name", "From", "Email"?
Open gbook.php and search for

Code: Select all

<td valign="top" style="width:35%">'.$lang['t17'].' <b>'.$name.'</b><br />
';
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 change it to

Code: Select all

<td valign="top" style="width:35%"><span style="font-style:italic;">'.$lang['t17'].'</span> <b>'.$name.'</b><br />
';
if ($from)
{
    echo '<span style="font-style:italic;">'.$lang['t18'].'</span> '.$from.'<br />';
}
if ($settings['use_url'] && $url)
{
    $target = $settings['url_blank'] ? 'target="_blank"' : '';
    echo '<span style="font-style:italic;">'.$lang['t19'].'</span> <a href="go.php?url='.$url.'" class="smaller" '.$target.'>'.$url.'</a><br />';
}
if ($email)
{
    if ($settings['hide_emails'])
    {
        echo '<span style="font-style:italic;">'.$lang['t20'].'</span> <a href="gbook.php?a=viewEmail&num='.$i.'" class="smaller">'.$lang['t27'].'</a>';
    }
    else
    {
        echo '<span style="font-style:italic;">'.$lang['t20'].'</span> <a href="mailto:'.$email.'" class="smaller">'.$email.'</a>';
    }
}

In "Comments" how do I remove "Added:" so only date displays?
Find the text in file language.inc.php and change it.
On Sign guestbook form page, how do I enlarge font-size of :
Your name:
In language.inc.php file find

Code: Select all

$lang['t50']='Your name:';
and change it to

Code: Select all

$lang['t50']='<span style="font-size:150%">Your name:</span>';
Where are you from?
In language.inc.php file find

Code: Select all

$lang['t51']='Where are you from?';
and change it similar to Your name:
Your e-mail:
In language.inc.php file find

Code: Select all

$lang['t52']='Your e-mail:';
and change it similar to Your name:
Comments:
Open gbook.php and find

Code: Select all

<td><b><?php echo $lang['t16']; ?></b></td>
and change it to

Code: Select all

<td><span style="font-size:120%;"><b><?php echo $lang['t16']; ?></b></span></td>

Please do not enter URL addresses
(these are tiny compared to other text)
In language.inc.php file find

Code: Select all

$lang['t54']='Please do not enter URL addresses';
and change it similar to Your name:

Greetings,
Henrie

Posted: Mon Feb 09, 2009 7:09 pm
by dstx
Henrie,
Thanks for explaining how/where to style language items.
I realized later it's better to create classes and add those to code instead of styles, so I went back and made changes again.
I searched gbook.php code for language items (t01, etc.) and experimented until I got what I wanted; even moved date and added Cancel link to Sign Guestbook form so I could eliminate View Guestbook link.
(See URL in previous post.)

Now everything looks great except for a couple of items:

1) How is email address styled that appears after entering password and clicking View Private Comment? I was able to style name, where from, comment, etc., but cannot style email that appears, even after adding .email class and applying it to language item t27

2) Where is font-style:italic being applied to items t30 (Admin Reply:) and t58 (Private Post, click to view), and to text for the Admin Reply to comment?
I've applied CSS class to these items, but italic font-style seems to be default, and I cannot override it with font-style:normal.

Posted: Mon Feb 09, 2009 10:27 pm
by Henrie
1) How is email address styled that appears after entering password and clicking View Private Comment? I was able to style name, where from, comment, etc., but cannot style email that appears, even after adding .email class and applying it to language item t27
The text e-mail is language item t20, not t27. The display of the e-mail address itself is found in gbook.php file, line 539

Code: Select all

echo $lang['t20'].' <a href="mailto:'.$email.'" class="smaller">'.$email.'</a>';
change class="smaller" to for example class="email"
2) Where is font-style:italic being applied to items t30 (Admin Reply:) and t58 (Private Post, click to view), and to text for the Admin Reply to comment?
Open gbook.php file and search for $lang['t30'] (found 2 times, lines 548 and 1007) and for $lang['t58'] (found 1 time, line 1000). You will find <i> and </i> tags in those lines. Remove those to remove italic style.

Greetings,
Henrie