|
Panel Restriction
|
| dayzign |
Posted on 10-07-2012 16:15
|

Newbie

Posts: 3
Joined: 04/07/2012
|
Hi guys, i got situation here...
my front page has 3 columns page (default php-fusion interface), so how is it possible if i want to make it only 2 columns (let say left panel and center panel, no right panel), just right after i click on any news link in the first page (which is has 3 columns).... is there something to do with panel restriction? (exclude or include).....
Thx in advance.....
Edited by dayzign on 10-07-2012 17:17
|
| |
|
|
| Halisson Ricardo |
Posted on 10-07-2012 18:11
|

Member

Posts: 71
Joined: 31/05/2008
|
-
dayzign wrote:
Hi guys, i got situation here...
my front page has 3 columns page (default php-fusion interface), so how is it possible if i want to make it only 2 columns (let say left panel and center panel, no right panel), just right after i click on any news link in the first page (which is has 3 columns).... is there something to do with panel restriction? (exclude or include).....
Thx in advance.....
If you do not find a solution within the administrative panel interface, you can make a small modification in the file: \includes\theme_functions_include.php
find a function called "check_panel_status", and make a change from line 44.
if (is_array($exclude_list)) {
if ( (isset($_GET['readmore'])) && (isnum($_GET['readmore'])) ) {
if ($side == "right") { return false; }
} else {
$script_url = explode("/", $_SERVER['PHP_SELF']);
$url_count = count($script_url);
$base_url_count = substr_count(BASEDIR, "/")+1;
$match_url = "";
while ($base_url_count != 0) {
$current = $url_count - $base_url_count;
$match_url .= "/".$script_url[$current];
$base_url_count--;
}
if (!in_array($match_url, $exclude_list) && !in_array($match_url.(FUSION_QUERY ? "?".FUSION_QUERY : ""), $exclude_list)) {
return true;
} else {
return false;
}
}
} else {
return true;
}
PS. Remember to change the parameter "right" to the side you want to delete. :)
-
Edited by Halisson Ricardo on 10-07-2012 18:20
Halisson Ricardo
V8 PromoCom Team Leader
NSS Brazil Admin Leader
©
|
| |
|
|
| Craig |
Posted on 10-07-2012 22:33
|

Fusioneer

Posts: 3980
Joined: 27/09/2005
|
Hi there,
Go and install FP News Panel...
http://www.php-fu...don_id=352
Then read this....
http://www.php-fu...ost_162956
That should help you out.
Also Admin >>> Settings >>> Main if you want to exclude right panels on news.php just enter /news.php in the textbox and save.
Good Luck!
|
| |
|
|
| Halisson Ricardo |
Posted on 11-07-2012 01:09
|

Member

Posts: 71
Joined: 31/05/2008
|
Craig, I think this is not the solution.
The admin panel provides the functionality to hide panels, but does not solve the problem.
dayzign want the three columns on the first page ("news.php"),
but when any news is read ("?readmore"), the left or right is automatically hidden.
dayzign wrote:
just right after i click on any news link in the first page (which is has 3 columns)...
So, a workaround is to make a slight modification:
if ( (isset($_GET['readmore'])) && (isnum($_GET['readmore'])) ) {
if ($side == "right") { return false; }
}
All sides are displayed normally. but when any news is read, one side will be hidden.
If I understand the doubt, I think this is the answer. :)
-
Edited by Halisson Ricardo on 11-07-2012 01:19
Halisson Ricardo
V8 PromoCom Team Leader
NSS Brazil Admin Leader
©
|
| |
|
|
| dayzign |
Posted on 11-07-2012 06:32
|

Newbie

Posts: 3
Joined: 04/07/2012
|
If you do not find a solution within the administrative panel interface, you can make a small modification in the file: \includes\theme_functions_include.php
find a function called " check_panel_status", and make a change from line 44.
if (is_array($exclude_list)) {
if ( (isset($_GET['readmore'])) && (isnum($_GET['readmore'])) ) {
if ($side == "right") { return false; }
} else {
$script_url = explode("/", $_SERVER['PHP_SELF']);
$url_count = count($script_url);
$base_url_count = substr_count(BASEDIR, "/")+1;
$match_url = "";
while ($base_url_count != 0) {
$current = $url_count - $base_url_count;
$match_url .= "/".$script_url[$current];
$base_url_count--;
}
if (!in_array($match_url, $exclude_list) && !in_array($match_url.(FUSION_QUERY ? "?".FUSION_QUERY : ""), $exclude_list)) {
return true;
} else {
return false;
}
}
} else {
return true;
}
PS. Remember to change the parameter "right" to the side you want to delete. :)
-
Hello halisson, i already made change from the script you gave, but the next page still shows 3 columns after click.... did i miss something here?
PS. Remember to change the parameter "right" to the side you want to delete. :) ----> it means :
Codeif ($side == "right") { return false; }
, isnt it? |
| |
|
|
| Halisson Ricardo |
Posted on 11-07-2012 12:49
|

Member

Posts: 71
Joined: 31/05/2008
|
-
dayzign wrote:
Hello halisson, i already made change from the script you gave, but the next page still shows 3 columns after click.... did i miss something here?
Codeif ($side == "right") { return false; }
, isnt it?
If there is any news reading (a url with a parameter called "?readmore") all panels that are specified on the side (right or left) will be hidden.
.../news.php -> Without MOD. All sides are displayed normally (of course, the panels are hidden, if they are configured as hidden in admin panel).
.../news.php?readmore=... -> The MOD works by making a reading of $ _GET. If there is the "readmore", it returns "false", and hides all the specified side panels.
The changed file is attached. Replace the original file. Good Luck. :)
-
Halisson Ricardo
V8 PromoCom Team Leader
NSS Brazil Admin Leader
©
|
| |
|
|
| Ankur |
Posted on 11-07-2012 15:53
|

Admin

Posts: 1291
Joined: 02/11/2010
|
Please don't make it complicated 
Why don't you simply Add the Site Opening Page (e.g /news.php) into Admin Panel --> Settings --> Main --> Exclude Right Panels ! Simple !
|
| |
|
|
| dayzign |
Posted on 11-07-2012 16:56
|

Newbie

Posts: 3
Joined: 04/07/2012
|
@Ankur : Hallison said :
dayzign want the three columns on the first page ("news.php"),
but when any news is read ("?readmore"), the left or right is automatically hidden.
@Hallison : still show 3 columns after click, mate, maybe because a lot of changes i made on the code, but at least you showed me which part of the code that i have to handle with, thanks anyway
If there is any news reading (a url with a parameter called "?readmore") all panels that are specified on the side (right or left) will be hidden.
.../news.php -> Without MOD. All sides are displayed normally (of course, the panels are hidden, if they are configured as hidden in admin panel).
.../news.php?readmore=... -> The MOD works by making a reading of $ _GET. If there is the "readmore", it returns "false", and hides all the specified side panels.
The changed file is attached. Replace the original file. Good Luck. :)
- |
| |
|
|
| Halisson Ricardo |
Posted on 11-07-2012 18:21
|

Member

Posts: 71
Joined: 31/05/2008
|
-
Ankur wrote:
Please don't make it complicated
Why don't you simply Add the Site Opening Page (e.g /news.php) into Admin Panel --> Settings --> Main --> Exclude Right Panels ! Simple ! 
Ankur, If you do not understand the question, the feature of the administrative panel is not enough to solve. But if you really be saying that the request for aid from dayzign is invalid, then not get me wrong, you have worked hard for the growth of PHPFUSION, but if the PHPFUSION is a project of open source, this implies one of the reasons for their existence: The possibility of change. And that's one thing That has to be done democratically. 
dayzign wrote:
@Hallison : still show 3 columns after click, mate, maybe because a lot of changes i made on the code, but at least you showed me which part of the code that i have to handle with, thanks anyway...
You're welcome. Good luck! 
-
Halisson Ricardo
V8 PromoCom Team Leader
NSS Brazil Admin Leader
©
|
| |
|
|
| Ankur |
Posted on 12-07-2012 08:03
|

Admin

Posts: 1291
Joined: 02/11/2010
|
halisson wrote:
Ankur, If you do not understand the question, the feature of the administrative panel is not enough to solve. But if you really be saying that the request for aid from dayzign is invalid, then not get me wrong, you have worked hard for the growth of PHPFUSION, but if the PHPFUSION is a project of open source, this implies one of the reasons for their existence: The possibility of change. And that's one thing That has to be done democratically. :)
-
Oh ! My bad ! Sorry 
But IMO, the Code :
if (!in_array($match_url, $exclude_list) && !in_array($match_url.(FUSION_QUERY ? "?".FUSION_QUERY : ""), $exclude_list)) {
return true;
} else {
return false;
}
works for both /news.php and /news.php?readmore=1. Tested !
|
| |
|
|
| Halisson Ricardo |
Posted on 12-07-2012 15:54
|

Member

Posts: 71
Joined: 31/05/2008
|
-
Ankur wrote:
But IMO, the Code :
if (!in_array($match_url, $exclude_list) && !in_array($match_url.(FUSION_QUERY ? "?".FUSION_QUERY : "" , $exclude_list)) {
return true;
} else {
return false;
}
works for both /news.php and /news.php?readmore=1. Tested !
This seems to be a good alternative. 
But specifically to the page of the news, I think that is not the solution.
If I understand your code, any url that contain parameters, the system will hide one side,
no matter if it is a page of news, am I right?
Regards,
-
Edited by Ankur on 12-07-2012 16:14
Halisson Ricardo
V8 PromoCom Team Leader
NSS Brazil Admin Leader
©
|
| |
|
|
| Craig |
Posted on 12-07-2012 15:59
|

Fusioneer

Posts: 3980
Joined: 27/09/2005
|
Stick ankurs code in a upper center panel and enable for /news.php only then it will only do as it on news.php like you want.
|
| |
|
|
| Ankur |
Posted on 12-07-2012 16:13
|

Admin

Posts: 1291
Joined: 02/11/2010
|
halisson wrote:
This seems to be a good alternative. 
But specifically to the page of the news, I think that is not the solution.
If I understand your code, any url that contain parameters, the system will hide one side,
no matter if it is a page of news, am I right?
-
Fangree_Craig wrote:
Stick ankurs code in a upper center panel and enable for /news.php only then it will only do as it on news.php like you want.
This is not my Code... Its the function check_panel_status() in includes/theme_functions_include.php. It works normally as it should even when there are any QUERY Parameters in the URL
|
| |
|
|
| Craig |
Posted on 12-07-2012 16:15
|

Fusioneer

Posts: 3980
Joined: 27/09/2005
|
So that code is not for putting in a panel rather than moding core files?
Well there must be solution to do it in a panel without moding the themes functions include files.
If there is a function then surly that function can be used?
|
| |
|
|
| Halisson Ricardo |
Posted on 12-07-2012 16:34
|

Member

Posts: 71
Joined: 31/05/2008
|
-
@Ankur and @Fangree_Craig,
I still think you two did not understand well the question of dayzign.
The doubt the dayzign consist of two steps:
First: The main page has to display all panels.
(Except, of course, if a panel was configured as hidden in admin panel).
Second: When anyone read any news (parameter: ?readmore), one of the panels are hidden automatically.
Is there a native solution for this? I think not. What can we
is to hide one side when a particular page is displayed,
but we can not use two different situations for the same page.
Therefore, I proposed a slight change in the core.
But let him decide for yourself if the answers provided here in the topic are sufficient. 
Regards,
-
Edited by Halisson Ricardo on 12-07-2012 16:36
Halisson Ricardo
V8 PromoCom Team Leader
NSS Brazil Admin Leader
©
|
| |
|
|
| Craig |
Posted on 12-07-2012 16:36
|

Fusioneer

Posts: 3980
Joined: 27/09/2005
|
I understand fully what he wants to do thanks. My first language is English.
|
| |
|
|
| Halisson Ricardo |
Posted on 12-07-2012 16:38
|

Member

Posts: 71
Joined: 31/05/2008
|
-
Of course. I understand this as a joke! 
-
Halisson Ricardo
V8 PromoCom Team Leader
NSS Brazil Admin Leader
©
|
| |
|
|
| Craig |
Posted on 12-07-2012 16:43
|

Fusioneer

Posts: 3980
Joined: 27/09/2005
|
NO, I am not joking I fully understand what the guy is trying to do. Why would I joke about that?
You have too much to say, tone it down a bit.
|
| |
|
|
| Halisson Ricardo |
Posted on 12-07-2012 16:52
|

Member

Posts: 71
Joined: 31/05/2008
|
-
Fangree_Craig wrote:
NO, I am not joking I fully understand what the guy is trying to do. Why would I joke about that?
You have too much to say, tone it down a bit. 
You said you Understood the question of the topic because his first language is English.
Obviously, you just needed to say: "I had understood". the second part of the sentence
I Understood That was a joke. let's forget it. 
PS. I think it's my bad English that causes all this confusion in my answers.
Had problems with this some time ago here on the forum.
-
Edited by Halisson Ricardo on 12-07-2012 16:57
Halisson Ricardo
V8 PromoCom Team Leader
NSS Brazil Admin Leader
©
|
| |
|
|
| Craig |
Posted on 12-07-2012 16:56
|

Fusioneer

Posts: 3980
Joined: 27/09/2005
|
Let me propose a challenge to you.
Lets see who out of you and me can do this for him without moding the themes function include or any other core files.
I believe there's a way to do this by simply adding some code into a center panel however I have still yet to find this code but I will keep at it until I do. hehe!!
Good Luck!
|
| |
|