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.
Sign In
Not a member yet? Click here to register.

Panel Restriction

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

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

-
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! ;)

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

-

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 :
CodeDownload  
if ($side == "right") { return false; }

, isnt it?
-

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?

CodeDownload  
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 [3.17kB / 435 Downloads]
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 : 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

-
-

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

-

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
-

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,

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

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

@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,

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

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

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

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.


-
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!
Thread Information
Author
Replies
21 posts
Views
11,168 times
Last Post
Last updated on 8 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Craig, Hal Ricard, Ankur, dayzign