Welcome, Guest. Please Login or Register.
November 24, 2024, 11:41:45 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Graphics and Templates  |  add a link/button to menu? « previous next »
Pages: [1] Reply Ignore Print
Author Topic: add a link/button to menu?  (Read 4175 times)
curious
Full Member
***
Posts: 178


WWW
add a link/button to menu?
« on: December 29, 2001, 03:54:27 PM »
Reply with quote

I want to add a new button to the menu bar that leads to ... say a chat.

I tried to edit subs.php but didn't succeed. At line 130 you can find the following:
   $yymenu = "<a href=\"$scripturl\">$img[home]</a>$menusep<a href=\"$helpfile\" target=_blank>$img[help]</a>$menusep<a href="http://mysite.com/cgi-bin/chat.pl" target=_blank><img src="http://mysite.com/chat.gif"></a>$menusep<a href=\"$cgi;action=search\">$img[search]</a>";
   if($settings[7] == 'Administrator') { $yymenu = $yymenu.$menusep."<a href=\"$cgi;action=admin\">$img[admin]</a>"; }
   if($username == "Guest") { $yymenu .= $menusep."<a href=\"$cgi;action=login\">$img[login]</a>$menusep<a href=\"$cgi;action=register\">$img[register]</a>";
   } else {
      $yymenu .= "$menusep<a href=\"$cgi;action=profile;user=$username\">$img[profile]</a>";
      if($enable_notification) { $yymenu .= "$menusep<a href=\"$cgi;action=shownotify\">$img[notification]</a>"; }
      $yymenu .= "$menusep<a href=\"$cgi;action=logout\">$img[logout]</a>";
   }
As you can see, I added a hyperlink and image right to the "home" button, but this is the error message I receive:
Parse error: parse error in /home/www/mysite/html/yabbse/Sources/Subs.php on line 130

Fatal error: Call to undefined function: clicklog() in /home/www/mysite/html/yabbse/index.php on line 52

I defined the .gif in english.lng, but that didn't change a thing.
Line 52 in index.php isClickLog();

Can somebody help me?
« Last Edit: December 29, 2001, 07:29:29 PM by Shaun » Logged
Shaun
Wannabe Mod Writer
Sr. Member
****
Posts: 361


YaBB SE Rules.

Re:add icon/link to menu bar - how to?
« Reply #1 on: December 29, 2001, 07:23:22 PM »
Reply with quote

Here's what I did.  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.  Go ahead and save the chat button if you wanna use it.

<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>




Logged

This guy uses objects like women man!
curious
Full Member
***
Posts: 178


WWW
Re:add a link/button to menu?
« Reply #2 on: December 30, 2001, 04:36:11 PM »
Reply with quote

Thx Shaun!

This was exactly what I did by myself.
the language file, no matter if I used english.lng or german-rel100.lng, screwed up my board ("parse error" and no text in forums).

The problem is the definition of the tooltip/Alt-text.
When adding i.E. $txt[chat] or $txt[750] I get an parse error two lines below and everything screws up.
If I abandon the ALT text everything works fine.

I can live without a tooltip on my chat button, but this strange.


5 minutes later:
I modified the german.lng again and all of a sudden it works. :D
I have edited german.lng a hundred times before and was sure there was no mistake like a missing semicolon or the like. I was looking very thoroughly thru the 3 lines I had changed and they were ok!

How can this be then?
Logged
Jeff Lewis
Global Moderator
YaBB God
*****
Posts: 10149


I'm a llama!

WWW
Re:add a link/button to menu?
« Reply #3 on: December 30, 2001, 04:38:54 PM »
Reply with quote

Curious, you also needed to add a \ before each " in the new link you made as well as the image tag.
Logged

curious
Full Member
***
Posts: 178


WWW
Re:add a link/button to menu?
« Reply #4 on: December 30, 2001, 04:57:17 PM »
Reply with quote

thx Jeff,
but I had already realized.

I have here a modified .lng which didn't work before and now does. ???
This strange thing costed me a couple of hours and could have been finished in minutes. :-\
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Graphics and Templates  |  add a link/button to menu? « 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.057 seconds with 21 queries.