Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
software:sphpblog [2008/06/06 23:39] cyril created |
software:sphpblog [2013/09/19 16:40] (current) |
||
|---|---|---|---|
| Line 18: | Line 18: | ||
| * Added links to RSS Feeds for each category and comments in themes/ | * Added links to RSS Feeds for each category and comments in themes/ | ||
| * Removed the '' | * Removed the '' | ||
| + | * Add categories in title | ||
| + | <code php> | ||
| + | themes/ | ||
| + | +// Display CATEGORIES | ||
| + | +// This is an array. There can be multiple categories per entry. | ||
| + | +if ( array_key_exists( " | ||
| + | + $blog_content | ||
| + | + for ( $i = 0; $i < count( $entry_array[ ' | ||
| + | + $cat_id = $entry_array[ ' | ||
| + | + if ( $i > 0 ) | ||
| + | + { | ||
| + | + if (intval($prev_id/ | ||
| + | + $blog_content .= ' | '; | ||
| + | + else | ||
| + | + $blog_content .= ', '; | ||
| + | + } | ||
| + | + $prev_id = $cat_id; | ||
| + | + $blog_content .= '<a href=" | ||
| + | + $entry_array[ ' | ||
| + | + } | ||
| + | + $blog_content .= ' | ||
| + | +} | ||
| + | </ | ||
| Some changes in the core too: | Some changes in the core too: | ||
| * Changed '' | * Changed '' | ||
| - | * Changed some code at scripts/ | + | * Changed some code in order to allow to display sets of categories ('' |
| <code php> | <code php> | ||
| - | // new code: | + | scripts/sb_display.php:116 |
| - | $cats = split( ',', | + | -$cat_sub_arr = get_sub_categories($category); |
| - | $cat_sub_arr = array(); | + | -array_push( $cat_sub_arr, |
| - | for ($i = 0; $i < count($cats); | + | |
| - | { | + | |
| - | $subcats = get_sub_categories($cats[$i]); | + | |
| - | for ($j = 0; $j < count($subcats); | + | |
| - | array_push($cat_sub_arr, | + | |
| - | array_push($cat_sub_arr, | + | |
| - | } | + | |
| - | + | ||
| - | // old code: | + | |
| - | // | + | |
| - | // | + | |
| + | +$cats = split( ',', | ||
| + | +$cat_sub_arr = array(); | ||
| + | +for ($i = 0; $i < count($cats); | ||
| + | +{ | ||
| + | + $subcats = get_sub_categories($cats[$i]); | ||
| + | + for ($j = 0; $j < count($subcats); | ||
| + | + array_push($cat_sub_arr, | ||
| + | + array_push($cat_sub_arr, | ||
| + | +} | ||
| </ | </ | ||
| + | * Create URL link for comment posters | ||
| + | <code php> | ||
| + | scripts/ | ||
| + | | ||
| + | +$entry_array[ ' | ||
| + | } | ||
| + | </ | ||
| + | |||
