Hello,
How am I able to enable Javascript when my theme hasn't the Random News line feature?
If a theme supports the random news line, javascript is enabled throughout the forum.
So I'd like to know how I can enable it using the same theme.
Thanks in advance,
Propa
bump
I don't really understand what you're asking.
Lainaus käyttäjältä: Oldiesmann - helmikuu 13, 2009, 11:03:07 AP
I don't really understand what you're asking.
I'm sorry.
I'm using some kind of hack, gwBBCode. It adds a lot of BBC and when parsed it creates an icon. If you hover on the icon something has to appear. The hovering is called by javascript, which is enabled when the Random News Line is present. But my theme doesn't feature the news line, so the java call is stuck ' in the news section '.
I didn't get any support on gwBBCode's site. But I did notice someone writing this:
LainaaI fixed it by making the calls to the java script files cause they weren't being called in the templates themselves.
Unfortunately, it's a guest so he's untraceable..
Maybe this is a clue for fixing it?
Attach a copy of your index.template.php file and I'll see what I can do.
Thanks a lot!
Maybe gwbbcode/header.php and gwbbcode/body.php are also required as they are being called in an include function in index.template.php. I attached them anyway.
~Propa
Ok. I actually need BoardIndex.template.php - for some reason I was thinking that the code for the news fader was in index.template.php
Here you go.
~
I really don't see what the issue is here. The files will be included regardless of whether or not the news fader is enabled.
The files are included but javascript isn't enabled (because of the news line not present) for the hovering to work?
It looks like you're adding the code as a news item. You need to add that code directly to the template file rather than as a news item.
I just tried out several things. Here are my results:
If I add the code for the random news line (slightly modified to fit in) somewhere in index.template.php, the hovering does work:
Lainaa// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
[<a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] , ' ', $txt['ap_po'], '</a> ]';
echo '<br />', $context['current_time'], '';
}
else
echo sprintf($txt['welcome_guest'], $txt['guest_title']);
echo '
</div>';
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<div id="random_news"><h3>', $txt['news'], ':</h3><p>', $context['random_news_line'], '</p></div>';
echo '
<a href="'.$scripturl.'" title=""><span id="logo"> </span></a>';
echo '
</div>
</div>
</div><br style="clear:both;"/>
<div id="toolbar">
',template_menu(),'
</div>
<div id="bdy-l">
<div id="bdy-r">
<div id="bodyarea">';
But when I try to delete
<h3>', $txt['news'], ':</h3><p>', $context['random_news_line'], '</p> in the code so no news will appear, the hovering doesn't work anymore. After several other attempts, I found out that
', $context['random_news_line'], ' is vital for the hovering to work.
So if you could help me hiding the output of
', $context['random_news_line'], ' but still having it functional, my problem's solved :)
bump
I take it that was written for a php-nuke styled software, you'll need to alter to work with SMF. I see it's calling a defined('NUKE_FILE') and /common.inc.php files which just aren't present in SMF.