1 (edited by Frank H 2003-08-16 22:42)

Topic: help.php minor fixes

Well I've been thinking of this a while, and I haven't still installed 1.0 stable but I tested some on this installation ... and it seems like alot of the help.php file is more or less just text, so if one adds more smilies the help.php isn't updated automatically, or click the helplinks on the left of where you write the message I'd love to see small <a name> tags, as if you click on smilies and have a small screen, you need to scroll down to see the smilies, so you really don't get what you click for.

It's not much, and can be made as an mod, but I guess more people might need it than they think, as I've had a couple of requests in a limited crowd (2 of 10 asked where to find info about the smilies)

also the little script that's needed to display all currently 'installed' smilies would probably be best generated, instead of people having to manually edit the help.php. And if people write them in the order so that they write all different smilie codes that uses the same image grouped together, it's easy to get the ' AND ' text between multiple smilie codes ...

These things aren't probably the most needed items, nor high priority items ... just some things that have been in my head for a while smile

Re: help.php minor fixes

First, I agree with everything you say. Linking directly to a named anchor in the help file is something I will fix immediately.

The thing with avatars in the help file is bit trickier. I agree that the list of currently installed avatars should be auto generated. However, doing that will involve moving the avatar arrays in do_smilies() out of that function and positioning their declaration somewhere else. Where that would be, I have no idea.

Frank H wrote:

And if people write them in the order so that they write all different smilie codes that uses the same image grouped together, it's easy to get the ' AND ' text between multiple smilie codes ...

I don't quite understand what you mean by this.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: help.php minor fixes

well lets say you have :smilie: and :smiles: and :smiley: to use the image.gif smile icon, you have to write these together in the arrys, not to let any other smilies com inbetween

the smile array (':smile:',':other:',':smiles:',':smiley:')

the image array ('image.gif','other.gif','image.gif','image.gif')

it would result in first one decleration, then the other, then the last two with an AND inbetween them, although they use the same image as the first one...

But if one is limited to put them like this

the smile array (':smile:',':smiles:',':smiley:',':other:')

the image array ('image.gif','image.gif','image.gif','other.gif')

then it should be fairly easy to generate the text with AND as long as the filename doesn't change...


bad explanation ... but hopefully you get what I mean smile

Re: help.php minor fixes

Ah, of course. I had forgotten the fact that some smileys have double text representations. I will have a look at this later tonight.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: help.php minor fixes

I've fixed the named anchors. It will be included in 1.0.1.

I've also fiddled with the help script and it now generates the smiley set automatically. I moved the smiley arrays to the top of parser.php and added the following code to help.php:

// Display the smiley set
require $pun_root.'include/parser.php';

$num_smilies = count($smiley_text);
for ($i = 0; $i < $num_smilies; $i++)
{
    // Is there a smiley at the current index?
    if (!isset($smiley_text[$i]))
        continue;

    print "\t\t\t\t".'    '.$smiley_text[$i];

    // Save the current text and image
    $cur_img = $smiley_img[$i];
    $cur_text = $smiley_text[$i];

    // Loop through the rest of the array and see if there are any duplicate images
    // (more than one text representation for one image)
    for ($next = $i + 1; $next < $num_smilies; $next++)
    {
        // Did we find a dupe?
        if ($smiley_img[$i] == $smiley_img[$next])
        {
            print ' '.$lang_common['and'].' '.$smiley_text[$next];

            // Remove the dupe so we won't display it twice
            unset($smiley_text[$next]);
            unset($smiley_img[$next]);
        }
    }
    
    print ' '.$lang_help['produces'].' <img src="img/smilies/'.$cur_img.'" width="15" height="15" alt="'.$cur_text.'"><br>'."\n";
}

It doesn't even require that the smilies with identical images are in sequence in the array. I doubt I will add these changes to 1.0.1 though. They feel more like an added feature than a bugfix.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: help.php minor fixes

thanks smile

yeah, the listing isn't anything more than a feature request ... so implement it when and if you want big_smile

works for me in RC2 also btw... after moving out the $img and $text and renaming them smile


hmm... you got me in the mood for coding ... smile

7

Re: help.php minor fixes

wish I had seen this thread earlier (added more than 30 smilies manually to help.php) sad

Re: help.php minor fixes

Hehehe :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

9

Re: help.php minor fixes

hrm, can't get it to work sad
I've inserted the code into help (inside <? and ?> tags)
but cannot get the hang of how and what you moved in parser.php

Re: help.php minor fixes

You have to change some things in parser.php as well. Can you wait for 1.1 or do you want instructions? :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

11

Re: help.php minor fixes

I'd love instructions, especially since I forgot to copy my code to help.php when I upgraded...
btw. when is 1.1 due? I mean, I _can_ wait wink