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?

Different style if in administration

Asked Modified Viewed 3,217 times
K
Kevin Maschke
K
<3 PHP-Fusion
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 25 threads in the forums
  • Started this discussions
asked
Member

Hi, I'm currently working on a new theme and I would like to know if it is possible to make that the side panel when in administration uses a different design than in rest of the website.

I tried with:

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
if (!isset($_GET['administration']))
{
// CODE IF NOT IN ADMINISTRATION
}
else
{
// CODE IF IN ADMINISTRATION
}
[/syntaxhighlighter]

But using this the desing is the same when being in administration. what's wrong?

I used the same for news and readmore, and it works perfectly.

Any help is appreciated.

Merged on Nov 15 2011 at 20:00:05:
Anyone? I really don't know if the "administration" part is right. But I thougt it would be correct because for readmore "readmore" is used...
Edited by Kevin Maschke on 15-11-2011 21:00,
0 replies

6 posts

K
Kevin Maschke
K
<3 PHP-Fusion
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 25 threads in the forums
  • Started this discussions
answered
Member

You got it :P

Hehehe
0 replies
J
JoiNNN
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
answered
Veteran Member

Us two ? :) Oh, me and myself :D. You're welcome.
0 replies
K
Kevin Maschke
K
<3 PHP-Fusion
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 25 threads in the forums
  • Started this discussions
answered
Member

Quote

JoiNNN wrote:

Here you go.

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]$url = $_SERVER['REQUEST_URI'];

if (strpos($url, '/forum/') !== false) {
echo 'CODE TO SHOW IN FORUM';
} elseif (strpos($url, '/administration/') !== false) {
echo 'CODE TO SHOW IN ADMINISTRATION';
} else {
echo 'CODE TO SHOW IN ANY OTHER PAGES';
}[/syntaxhighlighter]





OH THANKS A LOT!!! YOU Two are amazing! Thanks a lot for your help!
0 replies
J
JoiNNN
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
answered
Veteran Member

Here you go.

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]$url = $_SERVER['REQUEST_URI'];

if (strpos($url, '/forum/'wink !== false) {
echo 'CODE TO SHOW IN FORUM';
} elseif (strpos($url, '/administration/'wink !== false) {
echo 'CODE TO SHOW IN ADMINISTRATION';
} else {
echo 'CODE TO SHOW IN ANY OTHER PAGES';
}[/syntaxhighlighter]
0 replies
K
Kevin Maschke
K
<3 PHP-Fusion
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 25 threads in the forums
  • Started this discussions
answered
Member

Quote

JoiNNN wrote:

Try this:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]if (!isset($_GET['aid']))
{
// CODE IF NOT IN ADMINISTRATION
} else {
// CODE IF IN ADMINISTRATION
}[/syntaxhighlighter]just check the url for the correct query string.


Thanks a lot! Worked great!

Merged on Nov 17 2011 at 21:01:16:
Hi again!

Just a question about the same issue. Would it also be possible to use this function with forum?

I tried:

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
if (!isset($_GET['forum']))
{
// CODE IF NOT IN FORUM
} else {
// CODE IF IN FORUM
}
[/syntaxhighlighter]


But this does not work. Is there a way?


I'll explain my case so could be you can help me a little bit more...

What I need is that on Administration panel and forum the theme should use different designs that on the rest of the page.

Example:

If in admin use CODEA and if in forum use CODEB, all other pages, use CODEC.

Any idea?
Edited by Kevin Maschke on 17-11-2011 22:13,
0 replies
J
JoiNNN
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
answered
Veteran Member

Try this:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]if (!isset($_GET['aid']))
{
// CODE IF NOT IN ADMINISTRATION
} else {
// CODE IF IN ADMINISTRATION
}[/syntaxhighlighter]just check the url for the correct query string.
Edited by JoiNNN on 15-11-2011 22:03,
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 6 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

K
K
<3 PHP-Fusion
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 25 threads in the forums
  • Started this discussions
J
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet