Results 1 to 10 of 10

Thread: Custom block.new_and_updated_listing

  1. #1
    Join Date
    Jun 2004
    Location
    Belgium
    Posts
    42

    Default Custom block.new_and_updated_listing

    Hi,

    I really need a help here.
    On the main page for new & updt links I want to display:

    - Company logo;
    - Category; (found here: http://nicecoder.com/svn/index.php?act=changeset&id=153) thanks
    - Learn more - link on detail page

    Current code:

    Code:
    <a href='go.php?id=<%$new_links[i].link_id%>'
    	                        target=_blank
    	                        onmouseout="window.status=''; return true;"
    	                        onmouseover="window.status='<%$new_links[i].url%>'; return true;">
                          <b><%$new_links[i].title%></b></a>
                          <br>
                <%$new_links[i].description%>
    How to modify that?

    Thanks,
    NAt
    Last edited by marengo; 04-05-2006 at 08:28 AM.

  2. #2
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    With 5.1.0

    I assume, logo is custom field with 'image' type

    Code:
                <table width="433" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="23" align="center" background="<%$tpl_base%>/images/template_26.gif" bgcolor="#ededed" class="head"><strong>&nbsp;Latest
                        New Additions and Updates </strong></td>
                  </tr>
                  <tr>
                    <td class="head">
    
                    <%* new links *%>
                    <%section name=i loop=$new_links%>
                    <table width="100%" border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td width=45 align="center" valign="top" class="font-1">
    
                          <%if $new_links[i].updated%>
                          <img src="<%$tpl_base%>/images/updated.gif" alt="Updated">
                          <%elseif $new_links[i].new%>
                          <img src="<%$tpl_base%>/images/new.gif" alt="New">
                          <%/if%>
                          
    					  </td>
                        <td>
    
                          <img src=<%$new_links[i].logo%>>
    
                          <a href="<%$new_links[i].url%>" id="link_<%$new_links[i].link_id%>">
                          <b><%$new_links[i].title%></b></a>
                          <br><%$new_links[i].description%>
    					  <br>Category: <%$new_links[i].category_path_with_link%>
                        </td>
                      </tr>
                    </table>
                    <%/section%>
    
                    <div align="right">
                      <a href="<%$site_url%>/rss.php?type=latest_new"><img src="<%$tpl_base%>/images/rss.gif" border="0" align="absmiddle"></a>
                      <br>
                    </div>
    
                    </td>
                  </tr>
                </table>

  3. #3
    Join Date
    Jun 2004
    Location
    Belgium
    Posts
    42

    Default

    dody, thanks. And how to add this to db? If I just put this code it doesn't work.

    I think I need something like here:
    http://nicecoder.com/svn/index.php?act=changeset&id=153

  4. #4
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    No need to change the codes, it's included in 5.1.0.

    You need to create a custom field called logo. Go to admin panel -> database tables -> alter -> add custom field. Make sure it has 'image' type

  5. #5
    Join Date
    Jan 2005
    Posts
    164

    Default and if there is no logo

    Any ideas for what we can do if there is no logo for some of the listings, so we don't get the x image symbol? I imagine having the database refer to a default image would work, but I don't see default as an option.
    Last edited by lexpression; 04-06-2006 at 07:25 PM.

  6. #6
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    You can use if clase
    Code:
    <%if $new_links[i].logo%>
    <img src=<%$new_links[i].logo%>><%/if%>
    Please refer to smarty website for detail http://smarty.php.net

  7. #7
    Join Date
    Jun 2004
    Location
    Belgium
    Posts
    42

    Default

    Image is working just fine! Thanks Dody!

    Code:
     <%* new links *%>
          <%section name=i loop=$new_links%>
          <table width="100%" border="0" cellspacing="0" cellpadding="5">
                      <tr>                 
                                
              <td valign="top" class="list1"> <%if $new_links[i].mylogo%><div id="Layer1" class="demo" style="position:relative; z-index:1"><img src=<%$new_links[i].mylogo%> ></div><%/if%>
                <%if $new_links[i].updated%>
                <font color="#006600" size="1">Updated</font> 
                <%elseif $new_links[i].new%>
                <font color="#CC3300" size="1">New</font> 
                <%/if%>
                <a class="link" href='go.php?id=<%$new_links[i].link_id%>'
    	                        target=_blank
    	                        onmouseout="window.status=''; return true;"
    	                        onmouseover="window.status='<%$new_links[i].url%>'; return true;"> 
                
                <%$new_links[i].title%>
                </a> <br>
                <%$new_links[i].description%>
              </td>
                      </tr> <tr> 
                <td valign="top" class="list2"><div align="right">
    Category: <%$new_links[i].category_path_with_link%>
                  <img src="images/tr.gif" alt="" width="20" height="8"><a class="top" href="<%$new_links[i].detail_page_url%>" ><strong>Learn more</strong></a> 
    			  <img src="images/ics1.gif" alt="" width="11" height="11"><img src="images/tr.gif" alt="" width="20" height="8"><a href="go.php?id=<%$new_links[i].link_id%>" target="_blank" class="top"><strong>Visit this site</strong></a>
    			  <img src="images/ics2.gif" width="10" height="10"></div></td>
              </tr> </table><br><br> <%/section%>

    But "Category" and "detail page" don't work
    Also Indexu version is 5.0.1 May be this is a problem.

  8. #8
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Yes, you should use 5.1.0

  9. #9
    Join Date
    Jun 2004
    Location
    Belgium
    Posts
    42

    Default

    oops. OK, thanks, I'll tell that to my friend (I'm making a skin for him )
    Must he pay for the newest version, or update is free?


    Regards,
    Nathalie

  10. #10
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    The new version is available for free. You can download in client area

Similar Threads

  1. Add custom block
    By snoezel in forum Tutorials, Hints & Tips
    Replies: 6
    Last Post: 01-17-2006, 02:39 AM
  2. Replies: 1
    Last Post: 06-24-2002, 06:23 PM
  3. How to block automatic submit?
    By ahmad in forum v5.x
    Replies: 3
    Last Post: 04-10-2002, 04:16 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
  •