Results 1 to 7 of 7

Thread: Last 5 added

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

    Default Last 5 added

    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
    , $most_recent;
    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 order by date 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
    hmmm...instead of date maybe it should be last_updated. What say you, dody???

    change the following:
    Code:
    // mod for $top_links_by_hits
      DisplayTemplate($theme_path."index.html",
    	  "\$category,\$new_links, \$top_links_by_hits, 
    \$most_recent,\$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:
    <%$most_recent%>



    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; 08-14-2003 at 11:48 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
    May 2003
    Location
    Tokyo, Japan
    Posts
    1

    Default

    I've tried this mod but no matter how carefully I cut and paste the code, I get the following error message: "Fatal error: Call to a member function on a non-object in /home/computer/public_html/index.php on line 95"

    Any ideas?

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

    Default

    what is line 95?

    you might want to show us that entire section of code.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

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

    Default

    also, if you don't mind giving up the original version of the new links, check out what gspinney did

    http://www.nicecoder.com/community/s...&threadid=1482
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

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

    Default

    corrected the SELECT statement. it had an un-needed "where" clause
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

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

    Default

    what is the different with "Latest new listing"?

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

    Default

    differnt format...

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

    this is a slightly different format with a 1,2,3 listing.

    gspinney i think just modified the original to do the same thing.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

Similar Threads

  1. Linkhunter Mod - No. Added Links toplist
    By Mortekai in forum Help Wanted/Job Request
    Replies: 1
    Last Post: 07-20-2004, 10:26 PM
  2. Added Data
    By ezykiwi in forum v3.2
    Replies: 1
    Last Post: 06-11-2004, 06:25 PM
  3. Newly Added
    By P.Jackson in forum v5.x
    Replies: 0
    Last Post: 06-04-2004, 01:35 PM
  4. Replies: 3
    Last Post: 04-01-2004, 12:51 PM
  5. Replies: 5
    Last Post: 11-18-2001, 08:14 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
  •