This is just a reference for those interested in knowing the four ways to organize links.
order by bid desc
order by title
order by hits desc
order by rating desc
This is just a reference for those interested in knowing the four ways to organize links.
order by bid desc
order by title
order by hits desc
order by rating desc
Four ways including
order by rating desc
ty shop. I forgot about that one.
I'm glad you posted this because I just noticed that my links seem to be listed "randomly" at this point and I'd love to have them listed "order by hits desc" -- which would have the highest hit links at the top, etc. right?
How do I go about that?
Thanks.
Josh
http://actorpoint.com - Real Actors Building A Real Community.
Hi
You need to go to the browse.php file
just under
// show links
you will find:
$links_obj->query = "select......
change this to:
$links_obj->query = "select * from idx_link where category_id = '$cat' order by hits desc";
Regards
what about in the search results? i would like to list my searches by rating maybe...
thanks in advance.
I do not have anything below //show links/ SHould i add something or is this referencing an older version of indexu? I really want to be able to sort my listings differently. Also, is it possible to have sorted by say rating first, then by bid second?
Originally Posted by Shophere
Last edited by brickholius; 11-25-2004 at 01:48 AM.
Hi
Yes it is from an older version
I have not moved to the current version but look under the "// show links" area and "by order" - looks like there are a number of options - so unless some use can help I would test and find which one works
Regards
Here is the code from 3.2
I tried one of the variables above but it did not work. The code we need to switch is: sp_cat_order asc to either rank by hits, bid, or rating. any ideas. Seems like there should be a simple solution.Code:// show links // exclude featured link $query = " select link_id from idx_link where category_id = '$cat' and suspended = 0 and sp_cat = 1 and now() < sp_cat_date_limit order by sp_cat_order asc";
Last edited by brickholius; 11-25-2004 at 03:42 AM.
hopefully, you have SOMETHING after that or you are missing about 150 lines of code and your browse page will not work.Originally Posted by brickholius
![]()
Assuming you are not missing any code, search for the word select. There are three instances.
look at the lines that follow each instance and find one that reads:
//$links_obj->query .= " order by bid desc";
this is the line to change. Remove the //
there is also a SORT mod done last summer - 2003
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."
.
Yes, i was confused but in the next message (above) i put what code I had and found what needs to be changed i just dont know the code.Originally Posted by esm
And removing the "//" does what?Originally Posted by esm
Here is all my code:
Code:// show links // exclude featured link $query = " select link_id from idx_link where category_id = '$cat' and suspended = 0 and sp_cat = 1 and now() < sp_cat_date_limit order by sp_cat_order asc"; $result = $conn->Execute($query); $total = $result->RecordCount(); $i=0; while($i<$total) { $result->Move($i); $lid[] = $result->Fields(link_id); $i++; } $links_obj = new clsLink; $links_obj->InitDB($dbServer,$dbHostname,$dbUsername,$dbPassword,$dbName); $links_obj->query = " select * from idx_link where (category_id = '$cat' or cat1 = '$cat' or cat2 = '$cat') and suspended = 0"; $i=0; while($i<count($lid)) { $lid2 = $lid[$i]; $links_obj->query .= " and link_id <> $lid2"; $i++; } //$links_obj->query .= " order by bid desc"; $links_obj->query; $links_obj->table_name = "idx_link"; $links_obj->category_table_name = "idx_category"; $links_obj->user_table_name = "idx_users"; $links_obj->editor_table_name = "idx_editor"; $links_obj->template_file = $theme_path."rows.html"; $links_obj->date_format = $msg["10014"]; $links_obj->rating_image_path = "themes/".$theme_name."/images/rating/"; $links_obj->rev_rating_image_path = "themes/".$theme_name."/images/review/"; $links_obj->header = $msg["10013"]; $links_obj->paging = true; $links_obj->pg_size = $max_rows; $links_obj->cp_size = $max_pages; $links_obj->cp_more = $max_chapters; $links_obj->href = "browse.php"; //$links_obj->more_param = "&cat=$cat"; $links_obj->more_param = "$cat"; $links_obj->category_file = "browse.php"; $links_obj->category_separator = $category_separator; $links_obj->page_file = "browse"; // for mod rewrite $links_obj->page_title = strtolower($category_obj->GetCategoryName($cat)); // for mod rewrite //$links_obj->cache_time = $cache_time; //$links_obj->enable_cache = $use_cache_status; $link = $links_obj->Display(); $pagination = $links_obj->pagination;
I want to know what i change to be able to change the order to either bid, rating, or hits. I am also interested if there is a way to say sort A, then B. So sort rating, then hits etc.
brick
Last edited by brickholius; 11-25-2004 at 12:41 PM.
hmmmm....Might I suggest a book on PHP...Originally Posted by brickholius
and many have a section on mySQL which will help with the sort clause (ORDER BY)...
The // turns the line from executable PHP code to a remark, which the PHP processor will ignore.
I still hope there is a bunch more after that...Here is all my code:
.
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."
.
I would like to sort by a custom field... any luck at creating this?
it's a price column
maybe give the visitor the option of ascending or descending
Allen
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."
.
Thanks Saint,
As usuall you are the great knowledge guru....
The real question will it work with custom database fields like for instance I have a price field?
Then the visitor could sort by price or any other field I may have that's not a "standard" part of the link database.
Thanks again,
Allen