Everything is for free!
Shop is closed.
Due to health issues support is very limited
Shop is closed.
Due to health issues support is very limited
- Forum
- Support and Discussion
- Dynamic Menu Links
- error: Deprecated: The each() function is deprecated
error: Deprecated: The each() function is deprecated
- carsten888
- Offline
Less
More
- Posts: 4792
3 years 1 month ago #10966
by carsten888
Replied by carsten888 on topic error: Deprecated: The each() function is deprecated
Oh, I see.
on line 313:replace with
will make a new update this morning.
on line 313:
//make clean array
$groups_array = array();
for($n = 0; $n < count($groups); $n++){
$row = each($groups);
$groups_array[] = $row['value'];
}
//make clean array
foreach($groups as $k => $v){
$groups_array[] = $v;
}
will make a new update this morning.
Please Log in or Create an account to join the conversation.
- carsten888
- Offline
Less
More
- Posts: 4792
3 years 1 month ago #10967
by carsten888
Replied by carsten888 on topic error: Deprecated: The each() function is deprecated
just released this in an update.
Please Log in or Create an account to join the conversation.
- giles_taylor
- Offline
Less
More
- Posts: 6
3 years 1 month ago #10968
by giles_taylor
Replied by giles_taylor on topic error: Deprecated: The each() function is deprecated
I've downloaded the new version but I receive this url when I click the link:
<br%20/>
<br%20/>
Please Log in or Create an account to join the conversation.
- carsten888
- Offline
Less
More
- Posts: 4792
3 years 1 month ago - 3 years 1 month ago #10969
by carsten888
Replied by carsten888 on topic error: Deprecated: The each() function is deprecated
are you sure you gotaround the code?
and your version is 1.1.3?
if($user_id){
}
and your version is 1.1.3?
Last edit: 3 years 1 month ago by carsten888.
Please Log in or Create an account to join the conversation.
- giles_taylor
- Offline
Less
More
- Posts: 6
3 years 1 month ago - 3 years 1 month ago #10971
by giles_taylor
Replied by giles_taylor on topic error: Deprecated: The each() function is deprecated
Yes version 1.1.3
Here's the code:
if($user_id){
if($group==10){
$message = 'welcome client';
$message_type = 'info';
$redirect_url = $current_url;
}else if($group==11){
$message = 'welcome client 2';
$message_type = 'info';
$redirect_url = $current_url;
}
}
Here's the code:
if($user_id){
if($group==10){
$message = 'welcome client';
$message_type = 'info';
$redirect_url = $current_url;
}else if($group==11){
$message = 'welcome client 2';
$message_type = 'info';
$redirect_url = $current_url;
}
}
Last edit: 3 years 1 month ago by giles_taylor. Reason: Client names appeared in code
Please Log in or Create an account to join the conversation.
- carsten888
- Offline
Less
More
- Posts: 4792
3 years 1 month ago #10979
by carsten888
Replied by carsten888 on topic error: Deprecated: The each() function is deprecated
$group is not defined.
this will work only if you are absolutely sure the user is assigned to only 1 group:
Thsi code will work also when a user is assigned to more then one usergroup
(so this is the saver option in case in a few years some admin adds users to groups when this is long forgotten about)In the above example, the code for group 11 overrides the code for group 10. So by changing the order of the codes, you can set which group-redirect would be used when a user is assigned to both groups.
this will work only if you are absolutely sure the user is assigned to only 1 group:
if($user_id){
$group = $usergroups[0];
if($group==10){
$message = 'welcome client';
$message_type = 'info';
$redirect_url = $current_url;
}else if($group==11){
$message = 'welcome client 2';
$message_type = 'info';
$redirect_url = $current_url;
}
}
Thsi code will work also when a user is assigned to more then one usergroup
(so this is the saver option in case in a few years some admin adds users to groups when this is long forgotten about)
if($user_id){
if (in_array('10', $usergroups)){
$message = 'Thanks for logging in client name';
$message_type = 'info';
$redirect_menuitem_id = 152;
}
if (in_array('11', $usergroups)){
$message = 'Thanks for logging in client name';
$message_type = 'info';
$redirect_menuitem_id = 140;
}
}
Please Log in or Create an account to join the conversation.
- Forum
- Support and Discussion
- Dynamic Menu Links
- error: Deprecated: The each() function is deprecated
Time to create page: 0.102 seconds