TinyPortal

Development => Support => Topic started by: americangothic on March 21, 2009, 04:55:54 AM

Title: Adding a custom block holder... thing - Azure Theme
Post by: americangothic on March 21, 2009, 04:55:54 AM
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?
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: ZarPrime on March 21, 2009, 12:46:54 PM
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
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: 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.


Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: Ken. on March 21, 2009, 04:16:26 PM
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.
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: ZarPrime on March 21, 2009, 04:18:52 PM
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
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: americangothic on March 21, 2009, 04:23:13 PM
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.
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: Renegd98 on March 21, 2009, 04:32:19 PM
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.
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: ZarPrime on March 21, 2009, 04:37:26 PM
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
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: americangothic on March 21, 2009, 04:38:03 PM
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)
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: americangothic on March 21, 2009, 04:41:20 PM
Also, don't move this to the premium theme boards, I don't have access to them.
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: 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.
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: americangothic on March 21, 2009, 04:49:57 PM
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
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: IchBin on March 21, 2009, 05:02:05 PM
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;
{
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: americangothic on March 21, 2009, 07:30:13 PM
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.
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: G6Cad on March 21, 2009, 09:46:10 PM
20 lines before and after your code so we can see the whole part
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: IchBin on March 21, 2009, 09:49:02 PM
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?
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: americangothic on March 21, 2009, 10:59:52 PM
Yeah, I get the same error:

syntax error, unexpected T_STRING, expecting ',' or ';'
Title: Re: Adding a custom block holder... thing - Azure Theme
Post by: americangothic on March 25, 2009, 12:17:14 AM
Nothing?