Results 1 to 14 of 14

Thread: Top 10 Bidding Block

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

    Default Top 10 Bidding Block

    I'd like to create a Top 10 Bidding Block. The block would be located on the main page ( index ) and would be in the body of the site, not in a left or right sidebar.

    I'm imaging that the block would be similar to Hot Listings or something similar, but I'm not really sure where to start with it. I know Hot Listing is based upon how many hits a link gets, but this will need to be based on the highest amount of bids.

    Can someone point me in the right place to get it started?
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

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

    Default

    This was done previously by someone. I just have to remember where it was.

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

    Default

    <%block_random_listing title="Highest Bids" max_item="10" listing_type="bid"%> <- perhaps that's it?

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

    Default

    Thanks for digging that up Bruce! I'll report back soon to let you know
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

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

    Default

    Bruce...

    I haven't tried it yet ( and maybe I should be before even posting it )... BUT

    I just looked in block.random_listing.php :

    PHP Code:
    function block_random_listing($params) {
      global 
    $dbConn$theme_name$theme_path$msg;

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

      if (!
    $params['template_rows']) {
        
    $params['template_rows'] = 'block.random_listing_rows.html';
      }

      if (!
    $params['max_item']) {
        
    $params['max_item'] = '10';
      }

      if (!
    $params['listing_type']) {
        
    $params['listing_type'] = 'all';
      }

      
    $tpl = new Template;
      
      if (
    $params['listing_type'] == 'all') {
        
    $query "select * from idx_link
                  where suspended = 0
                  order by rand() limit $params[max_item]"
    ;
      }
      elseif (
    $params['listing_type'] == 'sponsored_premium') {
        
    $query "select idx_link.*
                 from idx_link
                      left join idx_paid_listing on (idx_link.link_id = idx_paid_listing.link_id)
                 where suspended = 0 and 
                      (if (isnull(premium) || expire < now() || paid != 1, 0, premium) = 1 or 
                       if (isnull(sponsored) || expire < now() || paid != 1, 0, sponsored) = 1)
                 order by rand() limit $params[max_item]"
    ;
      }
      elseif (
    $params['listing_type'] == 'sponsored') {
        
    $query "select idx_link.*
                 from idx_link
                      left join idx_paid_listing on (idx_link.link_id = idx_paid_listing.link_id)
                 where suspended = 0 and 
                       if (isnull(sponsored) || expire < now() || paid != 1, 0, sponsored) = 1
                 order by rand() limit $params[max_item]"
    ;
      }
      elseif (
    $params['listing_type'] == 'premium') {
        
    $query "select idx_link.*
                 from idx_link
                      left join idx_paid_listing on (idx_link.link_id = idx_paid_listing.link_id)
                 where suspended = 0 and 
                       if (isnull(premium) || expire < now() || paid != 1, 0, premium) = 1
                 order by rand() limit $params[max_item]"
    ;
      } 
    It would seem to me that there would need to be an additional " elseif " statement with a listing type of =='bidding' in order for it to work.

    If that is the case... I'll need help building that... I think it should be like this:

    PHP Code:
    if ($params['listing_type'] == 'bidding') {
        
    $query "select * from idx_link
                  where suspended = 0
                  order by rand() limit $params[max_item]"

    If this is correct... I dont want the order to be random... I want the order to be from highest first, and smallest bid last. Unfortunately, I'm not sure how that would be written.
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

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

    Default

    I don't have the bidding mod installed or setup on any site. But you'd look in the database and would set order by VALUE

    VALUE would be however the bid is set or called in the database, if that's just by the BID field then you would order by bid

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

    Default

    Well, I tried adding this :

    PHP Code:
    if ($params['listing_type'] == 'bidding') { 
        
    $query "select * from idx_link 
                  where suspended = 0 
                  order by bid() limit $params[max_item]"

    and I'm getting this :

    Fatal error: Call to a member function RecordCount() on a non-object in /home/w4bids/public_html/lib/link.class.php on line 731
    I'm assuming thats because "order by bid()" isn't correct. Bruce, I did look in the DB and saw that "bid" is the value being used for bids.

    Anyone have any suggestions???
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

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

    Default

    I have one in dodyweb.com, see the left side menu, it's top bidders.
    Actually it's a top listing block with modification on query.

    Code:
      $query = "select * from idx_link
                where suspended = 0 and bid != '' and bid > 0
                order by bid desc limit $params[max_item]";
    Are you looking for something like this?

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

    Default

    Yep... Thats it Dody!!!

    Would you be able to help me with something else too?? I noticed on your block you have a ">>" next to each listing. Do you know how I could number the listings 1 through 10?? I'm not sure what the equation would be?!?!?!
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

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

    Default

    just use

    <ol>
    <!-- here is the template loop -->
    <li> item </li>
    <!-- end of loop -->
    </ol>

    in the template.
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

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

    Default

    Ok... Here's how I'm calling the block :

    PHP Code:
    <%block_bidding_listing title="Top 5 Links" max_item="5" listing_type="bidding" template_rows="block.bid_listing_details.html"%> 
    Here is block.bid_listing_details.html:


    PHP Code:
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <
    br>
                  <
    tr>
                    <
    td width="5%" valign="top" align="center">
                        <
    table width="30" height="30" bgcolor="000080">
                            <
    tr>
                                <
    td><font color="FFFFFF"><%$item%></font></td>
                            </
    tr>
                        </
    table>
                    </
    td>
                    <
    td width="2%">
                    &
    nbsp;
                    </
    td>
                    <
    td width="50%" valign="top">
                    <
    a href="<%$site_url%>/<%$detail_page_url%>" title="<%$title%>"><font size="3" color="#4F9CEE"><b><u><%$title%></u></b></font></a><br><br>
                    <%
    $description%><br><br>
                    
    Current Bid Amount : <font color="#B22222">$<%$bid%>.00</font>&nbsp;&nbsp;<a href="<%$site_url%>/upgrade.php?pflag=retrieve&id=<%$link_id%>">Place Another Bid</a>
                    </
    td>
                    <
    td width="2%">
                    &
    nbsp;
                    </
    td>
                    <
    td width="40%" valign="top" align="center">
                    <%
    block_seo_stats link_id=$link_id autoupdate="yes"%>
                    </
    td>
                    </
    tr>
                    </
    table>
                    <
    br>
    <
    div class="line">&nbsp;</div>
    <
    br
    I've tried using:

    <%$item%> and just "item" and neither work... How do I need to set this?
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

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

    Default

    Anyone got an idea on this???
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

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

    Default

    i agree with inspireme, just use <ol> instead of <ul>

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

    Default

    Instead of using <%$item%> in the code above, I changed it to <%$number%> and that worked!

    Thanks for the help guys!
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

Similar Threads

  1. Bidding using Nightly Build
    By FSGDAG in forum v5.x
    Replies: 7
    Last Post: 01-27-2008, 09:06 PM
  2. Bidding directory mod
    By dody in forum Blocks and Modification
    Replies: 26
    Last Post: 01-18-2008, 04:54 PM
  3. I'm working on bidding directory mod
    By dody in forum Blocks and Modification
    Replies: 5
    Last Post: 06-21-2007, 07:45 PM
  4. Trying to set up a new block
    By angie in forum v5.x
    Replies: 7
    Last Post: 09-25-2006, 07:36 AM
  5. Bidding doesn't work
    By Geert81 in forum v5.x
    Replies: 3
    Last Post: 09-03-2004, 06:04 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
  •