News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Adding a Chat Button?

Started by Zippo, March 20, 2004, 08:44:00 AM

Previous topic - Next topic

Owdy

<a href="http://www.sadevuo.net/chat" target="blank_">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/chat.gif" alt="' . $txt[801] . '" style="margin: 2px 0;" border="0" />' : $txt[801]), '</a>', $context['menu_separator'];
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Villesa

Thank you again :D I have totally forget about my HTML skills
You'll get the idea

I'm all ok.

jaypix

#22
I am very new to php so bear with me

after a bit of searching on the forum this subject answers my question exactley but I just wanted to know what the varable txt is for ? and what the number means

also if I add the code below :

// How about the [gallery] button?

echo '
<a href="', $scripturl, '?action=gallery" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/gallery.gif" alt="' . $txt[801] . '" border="0" />' : $txt[801]), '</a>', $context['menu_separator'];



where would I define the action=gallery

[Unknown]

The variable $txt is for internationalization; it makes it possible to show "ja" in German but "yes" in English.

The number or string referenced inside the [] refers to which phrase/word/string is being used.

-[Unknown]

dunx

I need help with making a button so users can click off the main menu, to the paid subscription.

I have looked over the code and it baffles me completely can anyone help me?

The button URL would be

http://www.sellyourholiday.com/forum/index.php?action=profile;sa=subscriptions

I will make a small custom button but its the code to put it into my website which confuses the hell out of me..


dunx

// Show the [home] and [help] buttons.

This code is not in index.template.php so where do i put my code?

anyone know?

kriskd

Quote from: Owdy on March 20, 2004, 12:31:53 PM
in Themes/default/Languages/Modifications.english.php

search for:
?>

add before:
$txt[chat] = 'chat';

I want to add a Who's Online button to my template which is based off the YaBB classic theme and there is no Modifications.english.php file with that theme.  Do I have to do this step on a different file or is it not necessary?  I am using version 1.1 RC2

Quotein Themes/default/index.template.php

search for:
// Show the [home] and [help] buttons.
echo '
<a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];


add after:
// How about the [chat] button?

echo '
<a href="http://www.yourdomain.net/index.php?action=chat">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/chat.gif" alt="' . $txt[chat] . '" border="0" />' : $txt[chat]), '</a>', $context['menu_separator'];


After that, upload your button to images/english or what ever language you use. :)

Is this information all still correct?  I did try something similar to this and got a big ol' template error.  :(
SMF 2.0.2

kriskd

Quote from: Owdy on March 20, 2004, 12:31:53 PM
Quote from: Zippo on March 20, 2004, 11:13:47 AM
Quote from: babylonking on March 20, 2004, 10:06:41 AM
http://www.simplemachines.org/community/index.php?topic=5720.msg56852#msg56852

Off limits to a mere mortal as I ;)



in Themes/default/Languages/Modifications.english.php

search for:
?>

add before:
$txt[chat] = 'chat';


I really need help with this piece of the code.  My theme is based on the YaBB theme and I don't have a Modification.english.php file.  Pardon me if I'm not using the correct terminology, but I just slapped in the 2nd part of this code (not quoted) and since $txt[chat] isn't defined my error log is filling with errors.  Can someone tell me how where I define (if that's the right word) $txt[chat]?

Thanks.
SMF 2.0.2

kriskd

Okay, in default/languages I found ModSettings.english.php that appeared to have a bunch of these constant defined, so I added the above there (except "chat" is now "who" as I'm trying to add a who's online button (less the apostrophe of course) instead of a chat button and I'm still getting an error log full of errors.  All the errors are pointing to where I call the Who's Online in index.template.php.  Here's my code:

      echo '
            <a href="http://www.sprechereast.com/forum/index.php?action=who">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/who.gif" alt="' . $txt['who'] . '" border="0" />' : $txt['who']), '</a>', $context['menu_separator'];


And here is my definition in ModSettings.english.php (if that's even the right place to define it):

$txt['who'] = 'Whos Online';

Any help is appreciated!  I'm at the end of my rope with this one!
SMF 2.0.2

kriskd

I think I figured it out.  The constant needed to be defined in index.english.php.  That one just about killed me... time to go to bed.
SMF 2.0.2

RobinSlig

Ok, I followed the directions, and I still don't have a chat button. using Smf 1.07 put the chat image in english file, chmoded the folder, still no button. placed the code after the home settings.

// Show the [home] and [help] buttons.
   echo '
            <a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
            <a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 2px 0;" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];


Is this right? I am new to code, so any help appreciated!
// How about the [chat] button?
   
      echo '
            <a href="http://www.karl-urban.com/index.php?action=chat">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/chat.gif" alt="' . $txt[chat] . '" border="0" />' : $txt[chat]), '</a>', $context['menu_separator'];

RobinSlig

#31
ok I got this to work, now to go back and move the button up a bit. Thank you for the tutorial!  :D

ok, still can't move the button and now when they log in, it makes you re enter your log in details. Any ideas on what I did wrong?   :(

Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

randomdood

i have this
// How about the [Shop] button?

echo '
<a href="http://switchfoot.cknetworx.com/smf/index.php?action=shop">', ($settings['use_image_buttons'] ? '<img src="' . $settings['/'] . '/' . $context['user']['language'] . '/shop.gif" alt="' . $txt[Shop] . '" border="0" />' : $txt[Shop]), '</a>', $context['menu_separator'];


yet the image qon't show all that is coming up is text.
http://switchfoot.cknetworx.com/smf/index.php

randomdood


randomdood


Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

randomdood

i've tried 3 image url's (all leading to the image)

Owdy

#38
Quote from: randomdood on June 16, 2006, 10:41:04 PM
i've tried 3 image url's (all leading to the image)
If you right click that missing image and watch properties, you see what i mean. Code is wrong. Try this:

// How about the [Shop] button?

echo '
<a href="http://switchfoot.cknetworx.com/smf/index.php?action=shop">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/shop.gif" alt="' . $txt[Shop] . '" border="0" />' : $txt[Shop]), '</a>', $context['menu_separator'];
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

randomdood

have to wait for my hosts ftp server to come online again

Advertisement: