Custom Blocks

Post any general problems, information or issues on ModphpBB3 in here.
Post Reply
User avatar
LDM
Site Admin
Site Admin
Posts: 1786
Joined: Thu May 29, 2008 6:51 pm

Re: Custom Blocks

Post by LDM »

Sorry Martin, just opened this thread to see I missed a post of yours before that one.

As far as adding blocks, you can add anything you can't do in ACP via opening the index file for the portal. You will see the code in three different sections, right, middle and left. It is easy to add the code of whatever block you are adding in that file.

Most template files if not all, should at least be 644 permissions.

Be careful adding too many resource hungry blocks. I did get a slight load page lag on your test site which I think could be a mix of the call to youtubes and the weather block.
I really like that youtube block you done, looks good!
User avatar
uk_martin
Forum Member
Forum Member
Posts: 85
Joined: Fri Jan 30, 2009 2:49 pm

Re: Custom Blocks

Post by uk_martin »

I'm going to give the situation the benefit of a night's sleep and a fresh pair of eyes in the morning.

The lag isn't anything specific to the portal as such. The web host is having a bad hair day. The FTP and mail service is even slower!

Thanks about the YouTube Block comment. It's a breeze to do. I used the built-in Custom Block and just added in this code, obtained from the YouTube developers site:

Code: Select all

<!-- ++Begin Video Bar Wizard Generated Code++ -->
   <div align="center">
  <div id="videoBar-bar">
    <span style="color:#676767;font-size:11px;margin:10px;padding:4px;">Loading...</span>
  </div>
 
  <!-- Ajax Search Api and Stylesheet
  // Note: If you are already using the AJAX Search API, then do not include it
  //       or its stylesheet again
  -->
  <script src="http://www.google.com/uds/api?file=uds.js&v=1.0&source=uds-vbw"
    type="text/javascript"></script>
  <style type="text/css">
    @import url("http://www.google.com/uds/css/gsearch.css");
  </style>
 
  <!-- Video Bar Code and Stylesheet -->
  <script type="text/javascript">
    window._uds_vbw_donotrepair = true;
  </script>
  <script src="http://www.google.com/uds/solutions/videobar/gsvideobar.js?mode=new"
    type="text/javascript"></script>
  <style type="text/css">
    @import url("http://www.brummiesfans.com/gsvideobar.css");
  </style>
 
  <style type="text/css">
    .playerInnerBox_gsvb .player_gsvb {
      width : 320px;
      height : 260px;
    }
  </style>
  <script type="text/javascript">
    function LoadVideoBar() {
 
    var videoBar;
    var options = {
        largeResultSet : !false,
        horizontal : false,
        autoExecuteList : {
          cycleTime : GSvideoBar.CYCLE_TIME_MEDIUM,
          cycleMode : GSvideoBar.CYCLE_MODE_LINEAR,
          executeList : ["ytchannel:brummiesfans"]
        }
      }
 
    videoBar = new GSvideoBar(document.getElementById("videoBar-bar"),
                              GSvideoBar.PLAYER_ROOT_FLOATING,
                              options);
    }
    // arrange for this function to be called during body.onload
    // event processing
    GSearch.setOnLoadCallback(LoadVideoBar);
  </script>
</div>
<!-- ++End Video Bar Wizard Generated Code++ -->
Ahhh, the delights of copy & paste.

Cheers

Martin
Post Reply