I'm hoping someone might know how I could strip the output of related down to just the name of the Related Category? The output prints out "Shadows_of_Amn/Item_List/Library"
I'm not very good with my regex...would someone be able to give me a idea on how I could strip the full line:
"Shadows_of_Amn/Item_List/Library"
down to:
"Library"
This is the code that would be affected:
$get_related = $LINKDB->prepare ("CUT TO FIT");
$get_related->execute($OUT{category_id});
$OUT{related} = '';
while (($name) = $get_related->fetchrow_array) {
$OUT{related} .= qq|<a href="$LINKS{build_root_url}/|;
$OUT{related} .= &build_clean_name ($name);
$OUT{related} .= qq|/$LINKS build_index}">|;
$OUT{related} .= qq|$name</a>\n|;
}Or maybe I should create a sub strip_to_name_only($value) in DB_Utils so it can be re-used in other functions?
I'm not very good with my regex...would someone be able to give me a idea on how I could strip the full line:
"Shadows_of_Amn/Item_List/Library"
down to:
"Library"
This is the code that would be affected:
Code:
# Calculate the related entries and put in a <LI> list. $get_related = $LINKDB->prepare ("CUT TO FIT");
$get_related->execute($OUT{category_id});
$OUT{related} = '';
while (($name) = $get_related->fetchrow_array) {
$OUT{related} .= qq|<a href="$LINKS{build_root_url}/|;
$OUT{related} .= &build_clean_name ($name);
$OUT{related} .= qq|/$LINKS build_index}">|;
$OUT{related} .= qq|$name</a>\n|;
}