PDA

View Full Version : format <BROWSE_CATEGORIES>


Connie
11-02-2004, 05:14 PM
Hi!

As I wanted to format this item to an "open listbox", I had to do the following changes:

a) index.php:


// 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 = "&lt;select size='$categorienumb' name='browse' onChange='self.location.href=this.options[this.sel ectedIndex].value;'>&lt;option value='?x=browse&amp;amp;category='>$lang_CatAll&lt;/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 .= "&lt;option value='?x=browse&amp;amp;category=$id'>$name&lt;/option>";
}
$browse_select .= "&lt;/select>";

b) a new variable in the language-file:
$lang_CatAll = "alle Bilder";

c) in the browse-template:
Kategorien:
&lt;form>&lt;BROWSE_CATEGORIES>&lt;/form>

I hope this tweak can be helpful, you can see it at
http://www.photografitti.de/pp/index.php?x=browse&amp;category=

Connie

blinking8s
11-02-2004, 06:07 PM
very cool...