Results 1 to 3 of 3

Thread: top 5 by hits on index page

  1. #1
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default top 5 by hits on index page

    in the function ShowMainPage of the index.php file:

    change the following:
    Code:
      // mod for $top_links_by_hits
      global $category,$new_links,$hot_links,$login_box,$rec_links,$recomended_listing,
    	  $total_link,$total_hits,$total_category,$total_member,$total_milis,$top_links_by_hits;
    then after the line "$new_links = $new_links_obj->Display();" insert the following:
    Code:
    // mod for top5 by hits
      $query = "select link_id, title, url from idx_link where hits > 0 order by hits desc";
      $result = $conn->Execute($query);
      $total = $result->RecordCount();
    	$number=$i=0;
    	while($i<5 && $i<$total) {
    	  	$result->move($i);
    	  	$lid = $result->Fields("link_id");
    		$title = $result->Fields("title");
    		$url = $result->Fields("url");
    		$number++;
    		$top_links_by_hits .= "$number. <a href=detail.php?id=$lid>$title</a><br>";
    		$i++;
        }
    // mod end
    change the following:
    Code:
    // mod for $top_links_by_hits
      DisplayTemplate($theme_path."index.html",
    	  "\$category,\$new_links,\$top_links_by_hits,\$hot_links,\$login_box,".
    		"\$rec_links,\$recomended_listing,".
    		"\$total_online,\$members_online,\$guess_online,\$username_online,".
    		"\$total_link,\$total_hits,\$total_category,\$total_member,\$total_milis");
    then in index.html of the themes/default folder, add the following where you want it to print out:
    <%top_links_by_hits%>



    Anyone know how to stop vB from inserting extra lines into the code or from wapping the line in the middle of a word???
    I love vB! I love vB! I love vB!
    Last edited by esm; 07-11-2003 at 03:32 AM.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

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

    Default

    what is the different with TOP 10 listing in index.php
    You can set how many list in admin cp -> setup -> Main Hot Link Limit

  3. #3
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    hey, this was 5 days ago. How do you expect me to remember that far back.

    I did it in response to http://www.nicecoder.com/community/s...&threadid=1482

    it may be a duplicate
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

Similar Threads

  1. Replies: 7
    Last Post: 01-04-2004, 08:19 AM
  2. Q: Full screen size for index page ?
    By althahabi in forum v5.x
    Replies: 3
    Last Post: 09-03-2003, 08:57 AM
  3. editors pick on index page
    By esm in forum v3.2
    Replies: 5
    Last Post: 08-18-2003, 01:59 PM
  4. Changing font on main index page
    By jmbishop in forum v5.x
    Replies: 1
    Last Post: 09-20-2002, 11:04 AM
  5. What is this on the original index page?
    By pcoskat in forum v5.x
    Replies: 1
    Last Post: 06-08-2002, 09: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
  •