| Connie |
11-02-2004 05:14 PM |
format <BROWSE_CATEGORIES>
Hi!
As I wanted to format this item to an "open listbox", I had to do the following changes:
a) index.php:
Code:
// build browse menu
// Get number of categories in database
$categorienumb = mysql_query("select count(*) as count from ".$pixelpost_db_prefix."categories");
$rowcat = mysql_fetch_array($categorienumb);
$categorienumb = $rowcat['count']+1;
$browse_select = "<select size='$categorienumb' name='browse' onChange='self.location.href=this.options[this.selectedIndex].value;'><option value='?x=browse&amp;category='>$lang_CatAll</option>";
$query = mysql_query("select * from ".$pixelpost_db_prefix."categories order by name");
while(list($id,$name) = mysql_fetch_row($query)) {
$name = pullout($name);
$browse_select .= "<option value='?x=browse&amp;category=$id'>$name</option>";
}
$browse_select .= "</select>";
b) a new variable in the language-file:
Code:
$lang_CatAll = "alle Bilder";
c) in the browse-template:
Code:
Kategorien:
<form><BROWSE_CATEGORIES></form>
I hope this tweak can be helpful, you can see it at
http://www.photografitti.de/pp/index...&category=
Connie
|