View Full Version : How to change 'Select Category' on the Browse page...
fureddo
07-23-2007, 07:58 PM
You know in the dropdown menu, it says 'Select Category' by default, then underneath that is says 'All'. How would one change that so that it says 'All' by default and then when you drop down, the rest of your categories. Because the page brings up all images by default anyway. So on my page fureddo.com, at the moment, I want it to say 'All' and nothing else. (I haven't setup any other categories yet). Any ideas?
Dkozikowski
07-24-2007, 10:45 AM
This is a bit more complicated then you think as the category box defaults to "Select Category" every time you browse a category.
So, for example, you have a category named "Nature".
If you simply renamed "Select Category" to "All", when you view "Nature", the page will re-load and the category drop-down list will say "All" which is not true because we are viewing "Nature".
Do you get what I'm trying to say here?
I'll look into this for you but I just wanted to point out that this is going to require "hacking" the core Pixelpost files. So, just remember, if you apply my solution, you will have to do so each and every time you upgrade Pixelpost.
Dkozikowski
07-24-2007, 11:02 AM
Ok, try the following.
Also, make note, I have not tested this with the any addons that modify the browse page like the paged archive addon, etc.
Steps:
[1] - Open includes/functions_browse.php
[2] - Find the following code:
// build browse menu
// $browse_select = "<select name='browse' onchange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>$lang_browse_select_category</option><option value='?x=browse&category='>$lang_browse_all</option>";
$browse_select = "<select name='browse' onchange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>$lang_browse_select_category</option><option value='index.php?x=browse&category='>$lang_browse_all</option>";
$query = mysql_query("SELECT * FROM ".$pixelpost_db_prefix."categories ORDER BY name");
while(list($id,$name, $alt_name) = mysql_fetch_row($query))
{
if ($language_abr == $default_language_abr)
{
$name = pullout($name);
}
else
{
$name = pullout($alt_name);
}
// $browse_select .= "<option value='?x=browse&category=$id'>$name</option>";
$browse_select .= "<option value='index.php?x=browse&category=$id'>$name</option>";
}
$browse_select .= "</select>";
[3] - Replace with the following code:
// build browse menu
// $browse_select = "<select name='browse' onchange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>$lang_browse_select_category</option><option value='?x=browse&category='>$lang_browse_all</option>";
$browse_select = "
<select name='browse' onchange='self.location.href=this.options[this.selectedIndex].value;'>
<!--<option value=''>$lang_browse_select_category</option>-->
<option value='index.php?x=browse&category='>$lang_browse_all</option>";
$query = mysql_query("SELECT * FROM ".$pixelpost_db_prefix."categories ORDER BY name");
while(list($id,$name, $alt_name) = mysql_fetch_row($query))
{
if($language_abr == $default_language_abr) {
$name = pullout($name);
}else{
$name = pullout($alt_name);
}
if(isset($_GET['category']) && $_GET['category'] == "$id"){
$browse_select .= "<option value='index.php?x=browse&category=$id' selected='selected'>$name</option>";
}elseif(isset($_GET['category']) && $_GET['category'] != "$id"){
$browse_select .= "<option value='index.php?x=browse&category=$id'>$name</option>";
}else{
$browse_select .= "<option value='index.php?x=browse&category=$id'>$name</option>";
}
}
$browse_select .= "</select>";
fureddo
07-25-2007, 12:11 AM
I see what you're saying. Thanks for help though. I appreciate it. This one may be best left alone. 'Select Category', aint that much of an eyesore. Thanks again.
I will play with this locally and see what happens.
Dkozikowski
07-25-2007, 01:09 AM
The code I posted above is the perfect fix so play locally and decide what you like better.
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.