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?

Theme change class in forum

Asked Modified Viewed 2,212 times
D
DAS
D
DAS 10
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
asked
Newbie

Hello!

How to change css class at opentable when the curent page is forum?
This is what i tride...

$pagc = $_SERVER["SCRIPT_NAME"];
if ($pagc =='/forum/index.php' || $pagc =='/forum/viewforum.php' || $pagc =='/forum/viewthread.php' || $pagc =='/forum/post.php' || $pagc =='/forum/postedit.php' || $pagc =='/forum/postify.php' || $pagc =='/forum/postnewtread.php' || $pagc =='/forum/postreply.php') { echo "class1"; }
else { echo "class2"; }

It's anyone who know a easy mod?
0 replies

2 posts

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

Base code
if (strpos(TRUE_PHP_SELF, '/forum/') !== FALSE) {
 // code here, we are in forum
}

then to make it reusable you can do
$in_forum = FALSE;
if (strpos(TRUE_PHP_SELF, '/forum/') !== FALSE) {
 $in_forum = TRUE;
}

define("IN_FORUM", $in_forum);

this code can be placed in maincore.php and use it like
if (IN_FORUM) {
 echo "We are in Forum";
}

or for one line code
echo (IN_FORUM ? "We are in Forum" : "We are NOT in Forum");
0 replies
D
DAS
D
DAS 10
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

Thanks! :G
0 replies

Category Forum

Themes Support

Labels

None yet

Statistics

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

2 participants

J
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
D
D
DAS 10
  • Newbie, joined since
  • Contributed 2 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