News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF help

Started by MicrosoftOCR, June 19, 2006, 08:43:42 AM

Previous topic - Next topic

MicrosoftOCR

Hi

I need some help adding a chat button to the smf theme Babylon. Could someone tell me what I need to write in to add the button?

I am using smf 1.1 RC2.

Thanks in advance.  :)

Rudolf

Sorry, I mixed two replies that I was writing in the same time.
So as I was saying: look at the template_menu() function in the index.template.php.
You might have to create a image for your button and do the html link stuff.
If you can't make it post the link you want to insert and I'll be able to be more specific.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

MicrosoftOCR

Hi

Here are my boardindex and index file for the babylon theme;
http://www.yousendit.com/transfer.php?action=download&ufid=05716E2C5092E658 [nofollow]

and the button is already uploaded where I want it;
http://www.zealoushost.net/forum/Themes/babylon/images/english/chat.gif [nofollow]

and I am trying to put it next to the search button.

thanks for your help son far.  :)

Rudolf

Find in the index.template.php (template_menu() function):

// How about the [search] button?
if ($context['allow_search'])
echo '
<a href="', $scripturl, '?action=search">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/search.gif" alt="' . $txt[182] . '" style="margin: 2px 0;" border="0" />' : $txt[182]), '</a>', $context['menu_separator'];


Add after

// [Chat] button
echo '
<a href="', $scripturl, '?action=xxxchatxxx">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/chat.gif" alt="' . $txt['chat'] . '" style="margin: 2px 0;" border="0" />' : $txt[182]), '</a>', $context['menu_separator'];


Note that you have to set the 'action' for the chat where yousee xxxchatxxx, and you will have to add in your index.english.php file
$txt['chat'] = 'Chat';
Finally, you will have to put the chat button you posted in the correct folder (seems like you did already).
Everything should work just fine.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

MicrosoftOCR

Hi

Thanks very much, I have added the button and thats working great but I connot find any index.english.php file.  ???

MicrosoftOCR

I have found it but I can't add the code, when I do it comes up with an error. Where do I add it in the file and will it goto http://www.zealoushost.net/chat/ [nofollow]:)

Rudolf

The index.english.php is in the default folder.
Add the line right before the end tag

$txt['chat'] = 'Chat';

?>


In that case you will have to set your button like this:

// [Chat] button
echo '
<a href="http://www.zealoushost.net/chat">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/chat.gif" alt="' . $txt['chat'] . '" style="margin: 2px 0;" border="0" />' : $txt[182]), '</a>', $context['menu_separator'];

*updated the href
®
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

MicrosoftOCR

Thanks, works perfectally.  :)

MicrosoftOCR

I don't suppose anyone knows how to get the chat to open in a new window?  :)

Rudolf


// [Chat] button
echo '
<a href="http://www.zealoushost.net/chat" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/chat.gif" alt="' . $txt['chat'] . '" style="margin: 2px 0;" border="0" />' : $txt[182]), '</a>', $context['menu_separator'];
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

MicrosoftOCR

Thanks, your the best.

Advertisement: