Welcome, Guest. Please Login or Register.
May 19, 2024, 07:19:44 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Tutorial: Adding a new menu button « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Tutorial: Adding a new menu button  (Read 1527 times)
Shaun
Wannabe Mod Writer
Sr. Member
****
Posts: 361


YaBB SE Rules.

Tutorial: Adding a new menu button
« on: December 29, 2001, 07:27:28 PM »
Reply with quote

Here's what I did to add a button named "chat".  I dunno if it's the best way 'cause I don't know PHP.  In the first <replace> step, make sure you replace "http://www.your url.com" with the url to your chat script.  Go to http://www.nextcelica.net/yabbse to see the "chat" button on the top menu.  My button does not link to a chat script because my server doesn't allow them.  Go ahead and save the chat button if you wanna use it.  If any of you guys who really know PHP know how to make it better, please do and I will update this mod.

<edit file>
Sources/Subs.php
</edit file>

<search for>
$yymenu = "<a href=\"$scripturl\">$img[home]</a>$menusep<a href=\"$helpfile\" target=_blank>$img[help]</a>$menusep<a href=\"$cgi;action=search\">$img[search]</a>;
</search for>
 
<replace>
$yymenu = "<a href=\"$scripturl\">$img[home]</a>$menusep<a href=\"$helpfile\" target=_blank>$img[help]</a>$menusep<a href=\"$cgi;action=search\">$img[search]</a>$menusep<a href=\"http://www.your url.com\">$img[chat]</a>";
</replace>

<edit file>
english.lng
</edit file>

<search for>
$txt[749] = "The 'number of posts' box can only contain digits.";
</search for>

<add after>
$txt[chat] = "Chat";
</add after>

<search for>
   $img[website_sm] = "<img src=\"$imagesdir/www_sm.gif\" alt=\"$txt[515]\" border=\"0\">";
</search for>

<add after>
  $img[chat] = "<img src=\"$imagesdir/chat.gif\" alt=\"$txt[chat]\" border=\"0\">";
</add after>




« Last Edit: December 29, 2001, 09:00:25 PM by Shaun » Logged

This guy uses objects like women man!
scx
Full Member
***
Posts: 218


Re:Tutorial: Adding a new menu button
« Reply #1 on: December 29, 2001, 08:29:40 PM »
Reply with quote

Good work! ;D

Well, in first search for tag you should add ; after </a>, since you add it in replace by tag.
Logged
sydney078
Sr. Member
****
Posts: 279


WWW
Re:Tutorial: Adding a new menu button
« Reply #2 on: December 29, 2001, 09:15:18 PM »
Reply with quote

Just to be save than sorry- what line would I get rid of if I just want it to say chat as a text and not image?

Thnx
Logged

scx
Full Member
***
Posts: 218


Re:Tutorial: Adding a new menu button
« Reply #3 on: December 29, 2001, 09:33:35 PM »
Reply with quote

Sydney: Just replace $img[chat] by $txt[chat] in Subs.pl.
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Tutorial: Adding a new menu button « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.041 seconds with 20 queries.