News:

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

Main Menu

Java on forum

Started by Don Houston, August 27, 2016, 10:14:27 PM

Previous topic - Next topic

Don Houston

Yes I am starting a business and I need to know if I can put a java script on the board.  The script is to follow:

Quote<!-- mibew button --><a id="mibew-agent-button" href="/chat/chat?locale=en" target="_blank" onclick="Mibew.Objects.ChatPopups['57c248c84fb94c0d'].open();return false;"><img src="/chat/b?i=mibew&amp;lang=en" border="0" alt="" /></a><script type="text/javascript" src="/chat/js/compiled/chat_popup.js"></script><script type="text/javascript">Mibew.ChatPopup.init({"id":"57c248c84fb94c0d","url":"\/chat\/chat?locale=en","preferIFrame":true,"modSecurity":false,"width":640,"height":480,"resizable":true,"styleLoader":"\/chat\/chat\/style\/popup"});</script><div id="mibew-invitation"></div><script type="text/javascript" src="/chat/js/compiled/widget.js"></script><script type="text/javascript">Mibew.Widget.init({"inviteStyle":"\/chat\/styles\/invitations\/default\/invite.css","requestTimeout":10000,"requestURL":"\/chat\/widget","locale":"en","visitorCookieName":"MIBEW_VisitorID"})</script><!-- / mibew button -->

Thanks for the help

Kindred

Well, it CAN be added... You would have to add it in index.template.php for every theme
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Don Houston

I am not good at php is there a way I can send the file over and have someone add it.  I imagine it won't take that long

Illori

you have not even told us where you want it, so no one would know where to add the code if you did provide the file.

Don Houston

Sorry, I want it at the top of the forum.  Maybe where the news goes?  Somewhere at the top

Don Houston


Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters


Sir Osis of Liver

Depends where you want it.  Without the css and image, can only approximate it, but you can try this for starters -

index.template.php



function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '
<div id="fwidth">';

if ($context['user']['is_logged'] && $context['in_maintenance'] && $context['user']['is_admin'])
echo '
<div id="fnotice" class="themepadding">' , $txt['maintain_mode_on'] , '</div>';

echo '
<div id="ftop">
<div id="fheader"><div class="bwgrid">
<div class="bwcell6"><div class="themepadding">
<a href="' , $scripturl , '"><img src="' , !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'].'/theme/logo.png' , '" style="max-width: 100%;" alt="*" /></a>
' , !empty($settings['site_slogan']) ? '<div class="subtitle">' . $settings['site_slogan'] . '</div>' : '' , '
</div></div>

<div style = "float: right;">
<!-- mibew button -->

<a id="mibew-agent-button" href="/chat/chat?locale=en" target="_blank" onclick="Mibew.Objects.ChatPopups[\'57c248c84fb94c0d\'].open();return false;"><img src="/chat/b?i=mibew&amp;lang=en" border="0" alt="" /></a>

<script type="text/javascript" src="/chat/js/compiled/chat_popup.js"></script>

<script type="text/javascript">Mibew.ChatPopup.init(\{"id":"57c248c84fb94c0d","url":"\/chat\/chat?locale=en","preferIFrame":true,"modSecurity":false,"width":640,"height":480,"resizable":true,"styleLoader":"\/chat\/chat\/style\/popup"});</script><div id="mibew-invitation"></div><script type="text/javascript" src="/chat/js/compiled/widget.js"></script><script type="text/javascript">Mibew.Widget.init({"inviteStyle":"\/chat\/styles\/invitations\/default\/invite.css","requestTimeout":10000,"requestURL":"\/chat\/widget","locale":"en","visitorCookieName":"MIBEW_VisitorID"\})</script>
<!-- / mibew button -->
</div>

<div class="bwcell10"><div class="themepadding">
<div id="qsearch" class="bwfloatright">
<form id="search_form" class="floatright" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input type="text" name="search" value="" id="qsearch_search" class="input_text" />
<input type="hidden" name="advanced" value="0" />';

// Search within current topic?



Places it far right over search widget.

Don't forget to add backslashes here, to escape single quotes -



Mibew.Objects.ChatPopups[\'57c248c84fb94c0d\'].


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Don Houston

Can I send you the file so you can do it?  I am not good with php coding and I do not want to mess it up.  I can pm you the file.  I would like it in the top right corner of the forum

Sir Osis of Liver

Can't really do much with it without the accompanying css and button image, there's more to it than just that code block.  Backup the file and try inserting the code where indicated.  Search for the code just above it and copy the js just below it.  Without the rest of the package, I get a broken image and a bad link.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Don Houston

would it help if I gave you access to the site and make you an admin so you could get to the code.  I can give you FTP access to

Sir Osis of Liver

Not really.  I'll d/l the Mibew package and see if I can get it running on a test install.  Are you using 2.1.2?

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Don Houston


Sir Osis of Liver

    This requires an involved installation, including it's own database.  If you attach your index.template.php from Shelflife theme, I'll insert the code and you can tinker with the formatting from there.  Make a backup of the file.

2.1.2 is current version of Mibew Messenger.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Don Houston

OK give me a moment and I will do just that

Don Houston

How do I upload the file? 

Don Houston

Here is the attachment

Sir Osis of Liver

Ok, try this.  I ballparked the location, you can adjust the formatting.  Search the template for 'mibew button' to find the code.  Going off shortly, if you can't get it, I'll be on again for a while tomorrow night.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Don Houston

Thank you it works perfectly

Advertisement: