Please Log in to join the conversation.
if ( ( $variables['var2'] !== 'cbactivity' ) || ( ! $variables['var4'] ) || ( ! isset( $variables['var4']['action'] ) ) ) {
return;
}
// Check if the URL contains an action and that it is an activity URL
$queryAction = ( $variables['var4']['action'] ?? '' );
if ( $queryAction !== 'activity' ) {
return;
}
// Check if the URL contains a function and if not default to show function
$queryFunc = ( $variables['var4']['func'] ?? 'show' );
if ( $queryFunc !== 'show' ) {
return;
}
// Check if the URL contains an ID
$queryId = (int) ( $variables['var4']['id'] ?? 0 );
if ( ! $queryId ) {
return;
}
// LOAD ACTIVITY OBJECT HERE BASED OFF $queryId
// IF NOT FOUND RETURN HERE TO ABORT REWRITE
// IF FOUND CHECK IF IT HAS WHATEVER DATA YOU WANT IN THE URL
// IF SAID DATA IS MISSING RETURN HERE TO ABORT REWRITE
// NOW BUILD THE URL SEGMENTS HERE LIKE THE FOLLOWING EXAMPLE
$variables['var3'][] = $queryAction;
$variables['var3'][] = $queryFunc;
$variables['var3'][] = $queryId;
// Remove the old query parameters above since we're converting this to segments
unset( $variables['var4']['action'] );
unset( $variables['var4']['func'] );
unset( $variables['var4']['id'] );
Please Log in to join the conversation.
Please Log in to join the conversation.
We'll reach out to the Joomla team and see what's going on. Did you receive an error of any kind?Edit:
Tried to post a new review on JED, but it won't allow me to...
Please Log in to join the conversation.
Please Log in to join the conversation.