News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Adding a Chat Button?

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

Previous topic - Next topic

randomdood


schattendieb

I tried to get a net Link Button. I inserted ervery Line like the examples. But now i get some errors:


Notice: Use of undefined constant homepage - assumed 'homepage' in /home/www/web78/html/llc/forum/Sources/Load.php(1702) : eval()'d code on line 4


Here are the Code of the modification.language.php

<?php
// Version: 1.1 RC3; Modifications

$txt[homepage] = 'homepage';

?>


Have somebody a solution?

bloc

Change
<?php
// Version: 1.1 RC3; Modifications

$txt[homepage] = 'homepage';

?>

to
<?php
// Version: 1.1 RC3; Modifications

$txt['homepage'] = 'homepage';

?>


..and remember to use $txt['homepage'] in the template as well.

SoulSeekerUSA

#43
Wow, why have they not just added a way in the software to simply add a button?  This post is a mess of jumbled code.  Obviously this is a major issue for many people so why not fix it and be done with it already?

Here is a simple explanation on how to change the home button into a link to your main website page.  Look for the code below in this file Themes/default/index.template.php or whatever theme you are using:

// Show the [home] button.
   echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '">' , $txt[103] , '</a>
            </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

------------------------------------
Change the part of the code that says:
-- <a href="', $scripturl, '"> -- into this: -- <a href="hxxp:www.yourwebsite.com [nonactive]"> --
change only that short part of the code nothing more and the home button will go to your main area of your site(as it should anyway).

-Rob-

bloc

Well, in some themes you CAN add buttons through the software..but its just for those themes only.

Alan Connor

Okay, so - This is perfect.

// How about the [chat] button?
   
      echo '
            <a href="http://www.yourdomain.net/index.php?action=chat [nofollow]">', ($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'];

Is there anyway i can make it look like my theme buttons? (Well they are just orange text...) Also, how i can allign it with the other buttons rather than sit on top of them?

Thanks

kriskd

I found the URL of your board in another thread, checked the source and you have a different class defined to "Chat" than you do the rest of your text buttons.  For Chat you are using maintab_back and for the others you are using mainNav.  Once you choose one of the other, they should be consistent.  :)
SMF 2.0.2

grafxncals

#47
How do I go about adding a Chat to the menu bar?



Or is it not possible?

adrianclerical

I too would love to be able to easily add a "CHATROOM" button to my main index page. I'm using 1.1.2 with the Babylon theme. The url of my chatroom is http://www.mysite.com/chat.html and I would like it to open in a new page.
Is there a facility within this them to automatically add this button please?
I'm not very good at all editing files and nearly always make a mess of it...... ideally I'd like to add the new button immediately before the "LOGOUT" button. I've read most of the above posts and to be honest, the coding changes needed scare me to death and look far to advanced for my abilities.....
Hope some kind soul out there can rescue me please?

grafxncals

No one wants to help?  What kind of support place is this?  ::)

adrianclerical

I emailed the creator of the Website Button mod and he very kindly created the mod to add a Chat Button for me. He's uploaded it and just as soon as it's been checked/approved it'll be available for downloading.
It's fantastic - does all I wanted - and for that I'm very grateful to him for all his hard work  :) :) :) :)

grafxncals

Care to share where this info can be found?

adrianclerical

The best thing is to email the creator and ask if he'll send it to you. I know he's submitted it for inclusion on the MODS board. All I can say is it's brilliant and does exactly what I wanted. He's called Jake and his email is [email protected]

jake1981

#53
Hi Adrian.

Yes, logged on users can already download it from http://custom.simplemachines.org/mods/index.php?mod=827

Page says that it's waiting for approval but yes, it can be downloaded from there..

Also, if someone's interested, I made a similar MOD that features also a full chat, similar to integrated chat, as mine also uses IRC networks, but this one is MUCH faster as applet is not so heavy and also this doesn't add a commercial to your forum and is very nice and customizable in many ways, it has not been approved yet either, moderators propably have a lot of work in approving of MODs as I have lately uploaded already many pretty complicated new MODs so it will take time, but check my mkpchat MOD also if you are interested in adding a chat to your site.

It can be found from http://custom.simplemachines.org/mods/index.php?mod=841

Un-approved MODs propably are shown ONLY to logged on users.. afaik..

EDIT:
Sorry, I was mistaken, it was not allowed for download of members of this community until it's approved, but anyway, it's approval has now been success and it's there if anyone still needing it. It's v1.01 because there was a small issue with uninstallation in first version, 1.0 accidentally removed english icons used by websiteButton MOD on themes default and babylon.. or was it classic..? Well anyway, bugs been fixed for v1.01

MKPChat is still waiting it's approval..
I no longer provide support or updates to any of my MODs nor I provide any new themes or MODs in anywhere else expect on my own site (and yes, there's nothing in there) expect for those MODs that I already sent to here that have not yet been approved and if approval requires any changes, I won't provide them no more.

FreeSporePrints

Hello people :)
firstly i want to say that IMO there are too much generic names topics that can confuse the new users(like me) that don't understand a line of PHP. It could be better that there are more topics but with more detailed names. For me it's a must for a community! :) I know it's a mess but i suggest to rename the topics names. It's a mess i really know but in future people will find what they need more easier. I suggest too to discourage cancelling the posts of  the users that post generic topics, undetailed ones, asking to them to repost the post re-writing it better. Consider these just suggestion to run a better and functional forum. I have also to say that without SMF community and support i really cannot be able to run the community i manage about growing mushrooms.

Every user in his little MUST make the possible for the community.

I quote a part of the Rob's post.
Quote// Show the [home] button.
   echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '">' , $txt[103] , '</a>
            </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

------------------------------------
Change the part of the code that says:
-- <a href="', $scripturl, '"> -- into this: -- <a href="http://www.yourwebsite.com"> --
change only that short part of the code nothing more and the home button will go to your main area of your site(as it should anyway).

I really don't know anything about php! So here my question, i'm using SMF 1.1.3, with a custom theme, based on the default "Core Theme". The structure is that the colours are different. However i'm trying to add a new button editing the index.template.php of my custom theme. I use Mozilla Firefox 2.0.0.5 but i believe this isn't important.

I want to add a button to the maintab that points to another website home and that will be opened in a new page. It must appear to guest and registered users.

I add this code and it works, but the button appears always selected:



// the [Not Edibles] list button
if ($context['allow_memberlist'])
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
               <a href="http://www.fsre.nl" target="blank">' , $txt[116] , '</a>
            </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// the [Not Edibles] list button
if ($context['user']['is_guest'])
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
               <a href="http://www.fsre.nl" target="blank">' , $txt[116] , '</a>
            </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


The problem should be the variable $current_action == 'home', because, i'm supposing, PHP interpretate that variable like it's in the home, so will highlight also the butto i added. What can i do? Have i to create another action? Where..and how?!

Thak you all mates,
F.

Advertisement: