Results 1 to 7 of 7

Thread: Random Listing

  1. #1
    Join Date
    Apr 2006
    Posts
    447

    Default Random Listing

    I wonder if someone might help me with the code necessary for only displaying listings that have a description in the 'random listings' -- if it's something simple, that is. My php skills are poor.

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

    Default

    Here is, edit blocks/block.random_listing.php line 32
    Code:
        $query = "select * from idx_link
                  where suspended = 0 and description like '%random listings%'
                  order by rand() limit $params[max_item]";

  3. #3
    Join Date
    Apr 2006
    Posts
    447

    Default

    Sorry, Dody, I should have specified my version: 1.21

    This is all the Kosmos theme contains for block.random_listing.php:

    <table width="433" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td height="23" align="center" style="background-image: url(<%$tpl_base%>/images/template_26.gif);" bgcolor="#ededed" class="head">
    <b>&nbsp;<%$title%></b></td>
    </tr>
    <tr>
    <td>

    <%$link%>

    <div align="right">
    <a href="<%$site_url%>/rss.php?type=random"><img src="<%$tpl_base%>/images/rss.gif" align="middle" border="0" alt="" /></a>
    <br />
    </div>

    </td>
    </tr>
    </table>

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

    Default

    It seems you open wrong file. I mean this file: /blocks/block.random_listing.php
    not the one in template file (.html)

  5. #5
    Join Date
    Apr 2006
    Posts
    447

    Default

    Sorry. Placed in correct file. Unfortunately, no links show.

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

    Default

    I didn't read your posting clearly. Here is to show random listing only for links with description

    Code:
        $query = "select * from idx_link
                  where suspended = 0 and description <> ''
                  order by rand() limit $params[max_item]";

  7. #7
    Join Date
    Apr 2006
    Posts
    447

    Default

    thanks!

Similar Threads

  1. How to list the random listing block horizontally
    By Mitchell in forum Blocks and Modification
    Replies: 14
    Last Post: 04-22-2008, 08:32 AM
  2. Random Site of The Day
    By echo@ in forum Blocks and Modification
    Replies: 6
    Last Post: 11-24-2007, 10:46 PM
  3. Random Rss Feed With Keyword Tag
    By Antony in forum v5.x
    Replies: 4
    Last Post: 08-24-2007, 12:39 PM
  4. Random link MOD
    By esm in forum v3.2
    Replies: 0
    Last Post: 08-04-2004, 04:29 AM
  5. random link ?
    By dbmg in forum v5.x
    Replies: 6
    Last Post: 03-28-2003, 02:07 AM

Posting Permissions

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