Pixelpost Forum

Pixelpost Forum (http://www.pixelpost.org/forum/index.php)
-   Hacks and Modifications (http://www.pixelpost.org/forum/forumdisplay.php?f=16)
-   -   format <BROWSE_CATEGORIES> (http://www.pixelpost.org/forum/showthread.php?t=107)

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 = "&lt;select size='$categorienumb' name='browse' onChange='self.location.href=this.options[this.selectedIndex].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:
Code:

$lang_CatAll                = "alle Bilder";
c) in the browse-template:
Code:

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...&amp;category=

Connie

blinking8s 11-02-2004 06:07 PM

very cool...


All times are GMT. The time now is 04:40 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.