Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Panel Restriction

Asked Modified Viewed 12,359 times
D
dayzign
D
  • Newbie, joined since
  • Contributed 3 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
asked
Newbie

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 18:17,
0 replies

20 posts

H
Hal Ricard
H
Hal Ricard
  • Member, joined since
  • Contributed 95 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

-

Quote

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.

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
if (is_array($exclude_list)) {

if ( (isset($_GET['readmore'])) && (isnum($_GET['readmore'])) ) {

if ($side == "right"wink { return false; }

} else {

$script_url = explode("/", $_SERVER['PHP_SELF']);
$url_count = count($script_url);
$base_url_count = substr_count(BASEDIR, "/"wink+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 : ""wink, $exclude_list)) {
return true;
} else {
return false;
}

}

} else {
return true;
}

[/syntaxhighlighter]

PS. Remember to change the parameter "right" to the side you want to delete. smile

-
Edited by Hal Ricard on 10-07-2012 19:20,
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Hi there,

Go and install FP News Panel...

http://www.php-fusion.co.uk/infusions/addondb/view.php?addon_id=352

Then read this....

http://www.php-fusion.co.uk/forum/viewthread.php?forum_id=85&thread_id=29584&pid=162956#post_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! ;)
0 replies
H
Hal Ricard
H
Hal Ricard
  • Member, joined since
  • Contributed 95 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

Quote

Fangree_Craig wrote:

Hi there,

Go and install FP News Panel...

http://www.php-fusion.co.uk/infusions/addondb/view.php?addon_id=352

Then read this....

http://www.php-fusion.co.uk/forum/viewthread.php?forum_id=85&thread_id=29584&pid=162956#post_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! wink


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"wink,
but when any news is read ("?readmore"wink, the left or right is automatically hidden.

Quote

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:

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
if ( (isset($_GET['readmore'])) && (isnum($_GET['readmore'])) ) {
if ($side == "right"wink { return false; }
}
[/syntaxhighlighter]

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. smile

-
Edited by Hal Ricard on 11-07-2012 02:19,
0 replies
D
dayzign
D
  • Newbie, joined since
  • Contributed 3 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

Quote



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.

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
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;
}

[/syntaxhighlighter]

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 :
if ($side == "right") { return false; }
, isnt it?
0 replies
H
Hal Ricard
H
Hal Ricard
  • Member, joined since
  • Contributed 95 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

-

Quote

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?

if ($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. :)

-
Hal Ricard attached the following file:
theme_functions_include.zip [No information available / 462 Downloads]
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Please don't make it complicated :x

Why don't you simply Add the Site Opening Page (e.g /news.php) into Admin Panel --> Settings --> Main --> Exclude Right Panels ! Simple ! :G
0 replies
D
dayzign
D
  • Newbie, joined since
  • Contributed 3 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

@Ankur : Hallison said :

Quote

dayzign want the three columns on the first page ("news.php"wink,
but when any news is read ("?readmore"wink, 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

Quote

If there is any news reading (a url with a parameter called "?readmore"wink 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. smile

-
0 replies
H
Hal Ricard
H
Hal Ricard
  • Member, joined since
  • Contributed 95 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

-

Quote

Ankur wrote:

Please don't make it complicated :x

Why don't you simply Add the Site Opening Page (e.g /news.php) into Admin Panel --> Settings --> Main --> Exclude Right Panels ! Simple ! :G


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. :)

Quote

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! :G

-
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Quote

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. smile

-


Oh ! My bad ! Sorry
www.php-fusion.co.uk/images/smiley/frown.gif


But IMO, the Code :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]if (!in_array($match_url, $exclude_list) && !in_array($match_url.(FUSION_QUERY ? "?".FUSION_QUERY : ""wink, $exclude_list)) {
return true;
} else {
return false;
}[/syntaxhighlighter]
works for both /news.php and /news.php?readmore=1. Tested !
www.php-fusion.co.uk/images/smiley/cool.gif
0 replies
H
Hal Ricard
H
Hal Ricard
  • Member, joined since
  • Contributed 95 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

-

Quote

Ankur wrote:

But IMO, the Code :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]if (!in_array($match_url, $exclude_list) && !in_array($match_url.(FUSION_QUERY ? "?".FUSION_QUERY : ""), $exclude_list)) {
return true;
} else {
return false;
}[/syntaxhighlighter]
works for both /news.php and /news.php?readmore=1. Tested !
www.php-fusion.co.uk/images/smiley/cool.gif



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 17:14,
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

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.
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Quote

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?
-


Quote

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 B)
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

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?
0 replies
H
Hal Ricard
H
Hal Ricard
  • Member, joined since
  • Contributed 95 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

-

@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 Hal Ricard on 12-07-2012 17:36,
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

I understand fully what he wants to do thanks. My first language is English. :)
0 replies
H
Hal Ricard
H
Hal Ricard
  • Member, joined since
  • Contributed 95 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

-

Quote

Fangree_Craig wrote:

I understand fully what he wants to do thanks. My first language is English. :)


Of course. I understand this as a joke! :P

-
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

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. ;)
0 replies
H
Hal Ricard
H
Hal Ricard
  • Member, joined since
  • Contributed 95 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

-

Quote

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 Hal Ricard on 12-07-2012 17:57,
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

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!
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 20 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
H
H
Hal Ricard
  • Member, joined since
  • Contributed 95 posts on the community forums.
  • Started 12 threads in the forums
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
D
D
  • Newbie, joined since
  • Contributed 3 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet