Home>>Forum>>General>>General discussion>> New Post
  • Blocks not show in all pages
  • 2016-08-01 02:30:45
The block visibility setting is not working properly.
I have checked the same issue on this site - inoideas.org

It works fine for normal URLs
http://inoideas.org/content.php?mode=2&content_id=605&content_type_id=1

but does not work for alias urls
http://inoideas.org/content/MRP-Error
issue with json.basics.php file. use the below function (I will commit to github tonight)


function get_showFlag_from_visibilityOption($block_visibility, $visibility_option, $url) {
if ($visibility_option != 3) {
if (strpos($block_visibility, ',') !== false) {
$block_visibility_a = explode(',', $block_visibility);
} else {
$block_visibility_a = explode(chr(10), $block_visibility);
}
$ulr_vars = explode("/", $url);
$show_block_flag = 0;
if(strpos($url, '?')){
$ulr_vars_s = end($ulr_vars);
}else{
$ulr_vars_s = array_slice($url, -2, 1, true);;
}

$ulr_vars_s = empty($ulr_vars_s) ? 'index' : $ulr_vars_s;

if (empty($visibility_option)) {
$show_block_flag = 1;
}


if ($visibility_option == 1) {
if (empty($block_visibility)) {
$show_block_flag = 1;
} else if (count($block_visibility_a) == 1 && $block_visibility_a[0] == chr(10)) {
$show_block_flag = 1;
} else if (block_check($block_visibility_a, $ulr_vars_s)) {
$show_block_flag = 1;
} elseif (!empty($url) && !empty($block_visibility) && (block_check($block_visibility_a, $ulr_vars_s))) {
$show_block_flag = 1;
} else {
$show_block_flag = 0;
}
}

if ($visibility_option == 2) {
if (empty(trim($block_visibility, chr(10)))) {
$show_block_flag = 0;
} if (block_check($block_visibility_a, $ulr_vars_s)) {
$show_block_flag = 0;
} elseif (!empty($url) && !empty($block_visibility) && (block_check($block_visibility_a, $ulr_vars_s))) {
$show_block_flag = 0;
} else {
$show_block_flag = 1;
}
}
}

if ($visibility_option == 3) {
try {
$vis_val = ino_eval($block_visibility);
} catch (Exception $e) {
echo "
Wrong php expression in visibility option" . $e->getMessage();
}
$show_block_flag = ($vis_val == 1) ? true : false;
}
return $show_block_flag;
}

Reply
I never realized this even after working for over 2 years on inoERP :-)
Reply
  • Anonymous
  • 2016-08-02 01:27:56
thnx....looks perfect nowReply
  • Anonymous
  • 2019-01-17 08:36:04
I am impressed by the information that you have on this blog. It shows how well you understand this subject. website link building servicesReply
  • Anonymous
  • 2019-01-23 08:03:34
The blog and data is excellent and informative as well anodes australiaReply
  • Anonymous
  • 2019-02-24 07:10:54
This is a splendid website! I"m extremely content with the remarks!. what is backlinkReply
  • Anonymous
  • 2019-04-02 06:18:25
This was among the best posts and episode from your team it let me learn many new things. BackpacksReply
  • Anonymous
  • 2019-04-04 09:59:43
I need to to thank you for this very good read!! I definitely loved every little bit of it. I have you bookmarked to check out new things you post… blouse back neck designsReply
  • Anonymous
  • 2019-04-07 07:50:25
Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming. best sites that accept guest posting on various topics Reply
 Per Page
  •   Select File
  • Reply as
  •   Subscribe

All inoERP code is Copyright by the Original Authors as mentioned on COPYRIGHT.txt file.
inoERP is an open Source software; you can redistribute it and/or modify it under the terms of the Mozilla Public License Version 2.0