Yes unluckily a lot of our business contacts simply use the url to copy paste in an old fashioned way...Or do you mean they're just copying the URL from browser address bar to share?
BUILDING
// $plugin = $variables['var2'];
// $segments = $variables['var3'];
// $query = $variables['var4'];
if ( ( $variables['var2'] !== 'cbactivity' ) || ( ! $variables['var4'] ) || ( ! isset( $variables['var4']['action'] ) ) || ($variables['var4']['action'] !== 'activity') ) {
return;
}
if ( isset( $variables['var4']['func'] ) && ( $variables['var4']['func'] !== 'show' ) ) {
$variables['var3'][] = $variables['var4']['action'];
unset( $variables['var4']['action'] );
$variables['var3'][] = $variables['var4']['func'];
unset( $variables['var4']['func'] );
if ( isset( $variables['var4']['id'] ) ) {
//build activity object and retrieve params activ if exists
$activity = new \CB\Plugin\Activity\Table\ActivityTable();
$activity->load( (int) $variables['var4']['id'] );
if ( ! $activity->getInt( 'id', 0 ) ) {
return;
}
$params = $activity->params() ;
$title = !empty($params['activ']) ? urlencode(str_replace(' ', '-', strtolower($params['activ'].'-'))) : null;
$variables['var3'][] = $title.$variables['var4']['id'];
unset( $variables['var4']['id'] );
}
}
if ( (!( $variables['var4']['func'] ) || ( $variables['var4']['func'] == 'show' ) ) && isset( $variables['var4']['id'] ) ) {
//build activity object and retrieve params activ if exists
$activity = new \CB\Plugin\Activity\Table\ActivityTable();
$activity->load( (int) $variables['var4']['id'] );
if ( ! $activity->getInt( 'id', 0 ) ) {
return;
}
//func=show not displayed
unset( $variables['var4']['action'] );
unset( $variables['var4']['func'] );
$variables['var3'][] = null;
$params = $activity->params() ;
//todo : trouver une meilleure fonction pour encoder l'url sans chiffres pour la parser
$title = !empty($params['activ']) ? urlencode(str_replace(' ', '-', strtolower($params['activ'].'-'))) : null;
$variables['var3'][] = $title.$variables['var4']['id'];
unset( $variables['var4']['id'] );
}
PARSING
// $plugin = $variables['var2'];
// $segments = $variables['var3'];
// $vars = $variables['var4'];
if ( ( $variables['var2'] !== 'cbactivity' ) || ( ! $variables['var3'] ) ) {
return;
}
if ( isset( $variables['var3'][0]) && ($variables['var3'][0] === 'activity')) {
$variables['var4']['action'] = $variables['var3'][0];
if ( isset( $variables['var3'][1] ) ) {
$variables['var4']['func'] = $variables['var3'][1];
if ( isset( $variables['var3'][2] ) ) {
$variables['var4']['id'] = $variables['var3'][2];
}
}
}
if ( isset( $variables['var3'][0]) && ($variables['var3'][0] !== 'activity')) {
$variables['var4']['option'] = 'com_comprofiler';
$variables['var4']['view'] = 'pluginclass';
$variables['var4']['plugin'] = 'cbactivity';
$variables['var4']['action'] = 'activity';
//$variables['var4']['func'] = 'show';
//todo trouver une meilleure fonction pour récupérer les ids :-)
$variables['var4']['id'] = preg_replace('/[^0-9]/', '', $variables['var3'][0]);
}
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
// $plugin = $variables['var2'];
// $segments = $variables['var3'];
// $vars = $variables['var4'];
if ( ( $variables['var2'] !== 'cbactivity' ) || ( ! $variables['var3'] ) ) {
return;
}
if ( isset( $variables['var3'][0]) && ($variables['var3'][0] === 'activity')) {
$variables['var4']['action'] = $variables['var3'][0];
if ( isset( $variables['var3'][1] ) ) {
$variables['var4']['func'] = $variables['var3'][1];
if ( isset( $variables['var3'][2] ) ) {
$variables['var4']['id'] = $variables['var3'][2];
}
}
}
if ( isset( $variables['var3'][0]) && ($variables['var3'][0] !== 'activity')) {
$variables['var4']['option'] = 'com_comprofiler';
$variables['var4']['view'] = 'pluginclass';
$variables['var4']['plugin'] = 'cbactivity';
$variables['var4']['action'] = 'activity';
$variables['var4']['func'] = 'show';
//récupération des ids
$variables_chaine = explode("-", $variables['var3'][0]);
$variables['var4']['id']=$variables_chaine[count($variables_chaine)+1];
}
Please Log in to join the conversation.
Please Log in to join the conversation.
if ( isset( $variables['var3'][0]) && ($variables['var3'][0] !== 'activity')) {
// $variables['var4']['option'] = 'com_comprofiler';
// $variables['var4']['view'] = 'pluginclass';
// $variables['var4']['plugin'] = 'cbactivity';
// $variables['var4']['action'] = 'activity';
// $variables['var4']['func'] = 'show';
//récupération des ids
$variables_chaine = explode("-", $variables['var3'][0]);
$variables['var4']['id']=$variables_chaine[count($variables_chaine)+1];
}
Please Log in to join the conversation.