Results 1 to 15 of 15

Thread: New block error

  1. #1
    Join Date
    Jul 2007
    Posts
    41

    Default New block error

    hi. i have created a new left block from an original block file and getting this error:

    Code:
    Warning: Smarty error: [in /xxx/xxx/themes/kosmos/index.html line 16]: syntax error: custom function 'block_front_menu' is not implemented (Smarty_Compiler.class.php, line 794) in \www\xxx\lib\smarty\Smarty.class.php on line 1088
    here is the code for the block:

    Code:
    <table width="197" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td style="background-image: url(<%$tpl_base%>/images/template_23.gif);" class="head">&nbsp;Menu</td>
                    <td width="31"><img src="<%$tpl_base%>/images/template_24.gif" alt="" /></td>
                  </tr>
                </table>
                <table width="197" border="0" cellpadding="5" cellspacing="0" class="panel-bg">
                  <tr>
                    <td>        
                      <ul>
    <li><a href="<%$site_url%>/new.php" title="New Listings">New Listings</a></li>
    <li><a href="<%$site_url%>/hot.php" title="Hot Listings">Hot Listings</a></li>
    <li><a href="<%$site_url%>/top_rated.php" title="Top Rated">Top Rated</a></li>
    <li><a href="<%$site_url%>/pick.php" title="Register">Editors Pick</a></li>
    <li><a href="<%$site_url%>/add.php" title="Add Listing">Add Listing</a></li>	
    <li><a href="<%$site_url%>/modify.php" title="Update Listing">Update Listing</a></li>
    <li><a href="<%$site_url%>/get_rated.php" title="Get Rated">Get Rated</a></li>
    <li><a href="<%$site_url%>/upgrade.php" title="Upgrade Listing">Upgrade Listing</a></li>
    </ul>
                      
                    </td>
                  </tr>
                </table>
    here is how i am calling the block:

    Code:
    <%block_front_menu%>
    Version: 5.3

    i am trying to create left menu. obviously something i have done wrong. I have cleared the cache and template_c driectories, but not sure if i have to build block somewhere. i have substituted site with xxx. Thank you.
    Last edited by ploppy; 07-25-2007 at 02:15 PM. Reason: forgot to add entry

  2. #2
    Join Date
    Jul 2007
    Posts
    41

    Default

    sorted the prob. thanks anyway.

  3. #3
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Can you explain how you fixed it so that others might be able to know, when they run into the same problem?

  4. #4
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    For blocks to work they need to be in two places.

    1) root/blocks
    2) root/themes/yourtheme/blocks

    The block in root/blocks must contain the correct filename of the block in the theme directory. For example below is a block for Google ads called "ads"

    function block_ads($params) {

    if (!$params['template']) {
    $params['template'] = 'block.ads.html';

    Then you call the block by the name in the first line "block_ads". Don't forget to CHMOD the block in the themes dir to 666 (or 777) to make it writeable.

  5. #5
    Join Date
    Jul 2007
    Posts
    41

    Default

    FSGDAG. yeh sorry, should have posted it. actually got excited that i managed to sort something out on my own :-) It was actually as Bruceper stated in his reply. worked like a charm. sorry once again.

  6. #6
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    I'm having a problem getting my Adsense block to work inside of the Cleaner template...

    Inside of the header.html file I have the following

    Code:
       <div id="block_right">
          <%block_hot_listing title="Top 10" max_item="10"%>
    
          <%block_adsense%>
    Inside of /theme/cleaner/blocks I have the following

    Code:
                <div class="block_small_title_02">+ Sponsors</div>
                <img src="<%$tpl_base%>/images/spacer.gif" width="1" height="4" alt="" /><br />
                <div class="block_small_content_03">
                  <div class="block_small_content_text">
                     <script type="text/javascript"><!--
    google_ad_client = "XXXXXXXXXXXXXXXXXXXX";
    google_ad_width = 160;
    google_ad_height = 600;
    google_ad_format = "160x600_as";
    google_ad_type = "text";
    //2007-05-26: XXXXX - XXXXX
    google_ad_channel = "9386212018";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "000000";
    google_color_text = "000000";
    google_color_url = "CCCCCC";
    //-->
    </script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
                    </div>
                  </div>
                </div>
                <img src="<%$tpl_base%>/images/spacer.gif" width="1" height="4" alt="" /><br />
    Inside of my <root>/blocks/block.asense.php I have

    Code:
    <?php
    
    /**
     *
     * INDEXU
     * Copyright(C), Nicecoder, 2000-2006, All Rights Reserved.
     *
     * INDEXU(tm) is protected by Indonesia and International copyright laws.
     * Unauthorized use or distribution of INDEXU(tm) is strictly prohibited,
     * violators will be prosecuted. To obtain a license for using INDEXU(tm),
     * please register at Nicecoder home page at http://www.nicecoder.com
     *
     * Author:
     *    Dody Rachmat Wicaksono (dody@nicecoder.com)
     *    M. Zuber (zubby@nicecoder.com)
     *
     */
    
    function block_adsense($params) {
      
      if (!$params['template']) {
        $params['template'] = 'block.adsense.html';
    }
      }
    ?>
    The problem is, NOTHING is displaying... I'm not getting any errors, but the block is also NOT showing at all... Any ideas???

  7. #7
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    easiest thing is not to use a block, just paste :

    Code:
      <div class="block_small_title_02">+ Sponsors</div>
                <img src="<%$tpl_base%>/images/spacer.gif" width="1" height="4" alt="" /><br />
                <div class="block_small_content_03">
                  <div class="block_small_content_text">
                     <script type="text/javascript"><!--
    google_ad_client = "XXXXXXXXXXXXXXXXXXXX";
    google_ad_width = 160;
    google_ad_height = 600;
    google_ad_format = "160x600_as";
    google_ad_type = "text";
    //2007-05-26: XXXXX - XXXXX
    google_ad_channel = "9386212018";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "000000";
    google_color_text = "000000";
    google_color_url = "CCCCCC";
    //-->
    </script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
                    </div>
                  </div>
                </div>
                <img src="<%$tpl_base%>/images/spacer.gif" width="1" height="4" alt="" /><br />
    where you want the adsence to display

    also check you have cleared page cache! ... also check the google T&C to see if your allowed to write "sponsors" on the top of the adverts, they are a little picky about what you call them.
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  8. #8
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Thanks Inspireme....

    I'm using Adsense on another one of my IndexU sites in a block and works fine. I've also titled that "Sponsor" too, and seems to work fine... I'm within my limit of how many ads I can display on one page, so I dont think that is an issue too...

    I'm thinking its a block issue because the title "Sponsors" doesn't even show. Its not that the Google Ads aren't showing, its that the entire block isn't displaying.

    The difference between this site and my other one that is working, is that I'm using Cleandex on the one that is working, and Cleaner on the one that isn't. I notice that the Cleaner theme uses a different method than the Cleandex for blocks.

    Any other suggestions???

  9. #9
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    my point was you dont really need to have a block, just paste the ad code, instead of running a php script that calls a html page with the code in it.

    I got a email from adwords to change my link text a few months back, i think i used "site sponsors" they told me to change it, im not sure if "sponsors" is ok...
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  10. #10
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Here's my adsense block from a site running v5.4.0. It shouldn't be much different for 5.3.0. Remember you MUST chmod block.ads.html to 777.

    Also, last I heard Google finds the word "Sponsors" to be acceptable, although they prefer something like "Advertisements".

    To call this block in your directory just use <%block_ads%>


    Here is block.ads.php

    Code:
    <?php
    
    function block_ads($params) {
    
      if (!$params['template']) {
        $params['template'] = 'block.ads.html';
      }
    
      $tpl = new Template;
    
      $tpl->display("blocks/" . $params['template']);
    }
    
    ?>
    You may notice you missed the last two lines of code in your block. I'm sure that's where your issue is coming from.

    Here is block.ads.html (I use the Cleandex theme on this site)

    Code:
                <div class="block_small_title">Sponsors</div>
                <div class="block_small_content">
                  <div align="center">
    
    <script type="text/javascript"><!--
    google_ad_client = "yourcodegoeshere";
    google_ad_width = 120;
    google_ad_height = 240;
    google_ad_format = "120x240_as";
    google_ad_type = "text_image";
    google_ad_channel = "";
    //-->
    </script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>				
    
                    <div class="clear_both"></div>
    
    <br />
                  </div>
                </div>
    If you want me to take a look at your site just let me know. Blocks make life SO much easier. Of course you can edit your code anywhere, but in a block you know all you are editing is just that simple block and not a whole page such as index or browse or details.

  11. #11
    Join Date
    Aug 2007
    Posts
    63

    Default

    Bruce,
    I tried using the code for a google block as you have above but it doesn't display the bottom part of the block border for some reason. I'm trying to play with it but with no luck yet.
    Michel
    As soon as everything's idiot-proof, God creates better idiots...
    Michel White
    http://www.vitisearch.com

  12. #12
    Join Date
    Aug 2007
    Posts
    63

    Default

    I figured it out!
    I had to add
    <div class="block_small_content_text">
    right after your line that has
    <div class="block_small_content">
    ----------------------
    I only figured it out by comparing the block with some of the other functioning blocks and
    noticed this line was the only difference....

    I'm so happy to be learning this stuff finally from the great examples you've posted at these forums! Thanks for having the patience to show newbies like me!
    As soon as everything's idiot-proof, God creates better idiots...
    Michel White
    http://www.vitisearch.com

  13. #13
    Join Date
    Aug 2007
    Posts
    63

    Default

    Oh and one more BERRRY important thing!
    Do not forget to add the additional </div> to make up for adding the
    <div class="block_small_content_text">
    or your footer will get all messed up and you'll have a panic attack like I did
    before I figured it out.
    Picky, Picky, Picky!~
    As soon as everything's idiot-proof, God creates better idiots...
    Michel White
    http://www.vitisearch.com

  14. #14
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Quote Originally Posted by Vitis View Post
    or your footer will get all messed up and you'll have a panic attack like I did
    before I figured it out.
    Picky, Picky, Picky!~
    ROFL!!! IndexU should come complete with a perscription of Xanex for newbies!!! HAHAHAHAHAH

    Hey, at the very least, it would be a GREAT selling point! LOL

  15. #15
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Good selling feature yes, but...

    Anyways, the issue Vitis is talking about with the additional </div> isn't really an IndexU issue rather than an HTML issue.

    A browser can only display what it is told, and if that code is "broken" or missing a tag then it need to interpret the code somehow. Typically this is done by showing users a really messed up page.

    I just wanted to point that out, as this could happen on any website you make with or without IndexU.

Similar Threads

  1. Block for banner ads?
    By cheetahtraffic in forum v5.x
    Replies: 1
    Last Post: 03-26-2007, 02:24 AM
  2. Custom block.How can I do that.
    By trungvan in forum Blocks and Modification
    Replies: 1
    Last Post: 02-08-2007, 05:07 PM
  3. Trying to set up a new block
    By angie in forum v5.x
    Replies: 7
    Last Post: 09-25-2006, 07:36 AM
  4. block and variables
    By inspireme in forum v5.x
    Replies: 1
    Last Post: 04-17-2006, 03:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •