I am trying to add a custom "block" to the forum right afrer the body tag starts that will contain a java script news headline scroller.
I copied code form an existing block and got it to this point:
// TEST BLOCK
global $txt,$context,$boarddir;
{
echo '<br />';
}
// TEST BLOCK END
I am aware that any content within that block will need to go between ' ' marks as indicated by my break tag. However, when I paste the Google generated code for my news scroller:
<!-- ++Begin Dynamic Feed Wizard Generated Code++ -->
<!--
// Created with a Google AJAX Search and Feed Wizard
// http://code.google.com/apis/ajaxsearch/wizards.html
-->
<!--
// The Following div element will end up holding the actual feed control.
// You can place this anywhere on your page.
-->
<div id="feed-control">
<span style="color:#676767;font-size:11px;margin:10px;padding:4px;">Loading...</span>
</div>
<!-- Google Ajax Api
-->
<script src="http://www.google.com/jsapi?key=notsupplied-wizard"
type="text/javascript"></script>
<!-- Dynamic Feed Control and Stylesheet -->
<script src="http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.js"
type="text/javascript"></script>
<style type="text/css">
@import url("http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css");
</style>
<script type="text/javascript">
function LoadDynamicFeedControl() {
var feeds = [
{title: 'Worldnet Daily',
url: 'http://feeds.huffingtonpost.com/huffingtonpost/raw_feed'
}];
var options = {
stacked : false,
horizontal : true,
title : ""
}
new GFdynamicFeedControl(feeds, 'feed-control', options);
}
// Load the feeds API and set the onload callback.
google.load('feeds', '1');
google.setOnLoadCallback(LoadDynamicFeedControl);
</script>
<!-- ++End Dynamic Feed Control Wizard Generated Code++ -->
it breaks the site with this error:
syntax error, unexpected T_STRING, expecting ',' or ';'
I tried removing all of the extraneous comments and rem's out of the Google code but it just won't work.
What's the trick to getting custom content to show?
americangothic,
The second block of code, by itself, works fine in a scriptbox, without the php code in the top code block you posted. It's kind of wide so it would work best in something like a lower panel block (script block, not php).
ZarPrime
Not really sure what a scriptbox is, never heard of it.
This is a block of code I am trying to get to show up within the SMF forum itself, not into any TP module or the like (I use MKPortal).
Sort of like how the Advanced Shout Box from nneonneo is done.
Quote from: americangothic on March 21, 2009, 03:20:40 PM
Not really sure what a scriptbox is, never heard of it.
This is a block of code I am trying to get to show up within the SMF forum itself, not into any TP module or the like (I use MKPortal).
Sort of like how the Advanced Shout Box from nneonneo is done.
You will likely have better luck asking at the SMF or MKPortal forums, our code snippets are written to work in TinyPortal blocks and as a general rule we only support TinyPortal.
Oh, I see. Well, if you used TinyPortal then you would indeed know what a scriptbox is. I suggest you seek help on the MKPortal Forums because I kinow nothing about that.
If you ever decide to install TP, feel free to come back and seek our help here.
ZarPrime
Edit: Hmmm, yeah, what Ken said. :P
This has nothing to do with the portal though.
This is about adding a custom place-holder block within Azure itself.
Again, this has nothing to do with the portal whatsoever.
If you are indeed trying ot add this to SMF and not the uhmmm... portal then you need to ask over at SMF for help in adding this to their code.
If this is for use with the Azure theme then perhaps we need to move this to the Azure board. However, you will probably get more help about how to add it to the SMF Forum at Simple Machines, or from the person you got the code from. All I know is that it works fine in a TinyPortal block because I tried it. That is the best I can do to help you with this.
I assume you have already got it to work with the SMF default theme, correct? If you haven't then you need to get it working with that first before trying to get it to work with a custom theme.
ZarPrime
This is what they're going to say:
SMF: what theme are you trying to add a block to?
Me: Azure, from TP.net.
SMF: go there for support.
And why would I want to add this to a, uhmmmm... portal, that makes no sense...
I want to add it to where the yellow line is in this pic:
(right above the shout box)
Also, don't move this to the premium theme boards, I don't have access to them.
Post your code. Not just the code that you want to put in. Post the part you are trying to put it into so we can show you what you're doing wrong.
This is right after the body tag: <body>';
// TEST BLOCK
global $txt,$context,$boarddir;
{
echo '<!-- ++Begin Dynamic Feed Wizard Generated Code++ -->
<!--
// Created with a Google AJAX Search and Feed Wizard
// http://code.google.com/apis/ajaxsearch/wizards.html
-->
<!--
// The Following div element will end up holding the actual feed control.
// You can place this anywhere on your page.
-->
<div id="feed-control">
<span style="color:#676767;font-size:11px;margin:10px;padding:4px;">Loading...</span>
</div>
<!-- Google Ajax Api
-->
<script src="http://www.google.com/jsapi?key=notsupplied-wizard"
type="text/javascript"></script>
<!-- Dynamic Feed Control and Stylesheet -->
<script src="http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.js"
type="text/javascript"></script>
<style type="text/css">
@import url("http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css");
</style>
<script type="text/javascript">
function LoadDynamicFeedControl() {
var feeds = [
{title: 'Worldnet Daily',
url: 'http://feeds.huffingtonpost.com/huffingtonpost/raw_feed'
}];
var options = {
stacked : false,
horizontal : true,
title : ""
}
new GFdynamicFeedControl(feeds, 'feed-control', options);
}
// Load the feeds API and set the onload callback.
google.load('feeds', '1');
google.setOnLoadCallback(LoadDynamicFeedControl);
</script>
<!-- ++End Dynamic Feed Control Wizard Generated Code++ -->';
}
// TEST BLOCK END
Well, since you won't post the code I asked, I'm going to have to take a guess. You don't need this first part from the looks of it.
global $txt,$context,$boarddir;
{
What code are you asking for then?
You want me to post the whole index.template.php?
This is going into Azure index.template.php right after the body tag.
20 lines before and after your code so we can see the whole part
Quote from: americangothic on March 21, 2009, 07:30:13 PM
What code are you asking for then?
Quote from: IchBinâ„¢ on March 21, 2009, 04:45:43 PM
Post your code. Not just the code that you want to put in. Post the part you are trying to put it into so we can show you what you're doing wrong.
What G6 said is fine as well. I asked you to post the code you're trying to put it into. So I can see if there is something wrong with the code where you are putting your code into it.
Did you try my suggestion though?
Yeah, I get the same error:
syntax error, unexpected T_STRING, expecting ',' or ';'
Nothing?