Re: Customize link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan,

thanks for the reply.....this is the code that shows/lists the categories

<?php	
$cats = $download_taxonomies- >get_parent_cats();
								
	                            if (!empty($cats)) {
	                                foreach ( $cats as $c ) {
echo '<li><label for="category_'. $c->id.'"><input type="checkbox" name="category_'.$c->id.'" id="category_'.$c->id.'" '; if (isset($_POST['category_'.$c->id])) echo 'checked="checked"';
										echo ' /> '.$c->id.' - '.$c->name.'</label>';
										
										// Do Children
										if (!function_exists('cat_form_output_children')) {
											function cat_form_output_children($child) {
												global $download_taxonomies;
												if ($child) {
echo '<li><label for="category_'.$child->id.'"><input type="checkbox" name="category_'.$child->id.'" id="category_'.$child- >id.'" '; if (isset($_POST['category_'.$child->id])) echo 'checked="checked"';
													echo ' /> '.$child->id.' - '.$child->name.'</label>';
													
													echo '<ul class="children">';
$download_taxonomies- >do_something_to_cat_children($child->id, 'cat_form_output_children', 'cat_form_output_no_children');
													echo '</ul>';
													
													echo '</li>';
												}
											}
											function cat_form_output_no_children() {
												echo '<li></li>';
											}
										}
										
										echo '<ul class="children">';
$download_taxonomies->do_something_to_cat_children($c->id, 'cat_form_output_children', 'cat_form_output_no_children');
										echo '</ul>';
										
										echo '</li>';
	                                }
	                            }
	                        ?>

i can see the categories ids and i just want to get a custom link for each category and essentially hide this section from my memebers....

Thanks


On May 6, 2011, at 1:28 AM, Daniel Brown wrote:

<?php

$cat_ids = array(1,3,5,7,13,15,24,36,81,92);

echo '<select name="categories">'.PHP_EOL;
foreach ($cat_ids as $cid) {

   echo '  <option value="'.$cid.'"';

   if (isset($_GET['cat_id']) && $_GET['cat_id'] == $cid) {
       echo ' selected="selected"';
   }

   echo '">'.$cid.'</option>'.PHP_EOL;
}
echo '</select>'.PHP_EOL;

?>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux