HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


How to set a custom theme as the default theme?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#16619 (In Topic #3939)

Fan in action

I hope this is in the right forum… In any case, I have taken the time to apply the instructions found in this post but have ran into an odd problem…

Defender said

Is it possible to make a custom theme the default theme for all zones without disabling the option for members to use another theme thru ocForums. ?

I want to make all zones use my 'classic' theme, but I want my members to still have the ability to switch to other themes I'm working on…. :S

I would prefer to not have to edit the ocportal default theme, if possible… :S

At the moment, if I "force" a zone to use a theme, the "rely on forum driver" isn't selected… so my members would be forced to stick with my theme :(

Chris said

No.

However, this is an oversight, so I have just made a way to do this for you. In sources/forum/ocf.php change the _get_theme function to…

Code

      $member=get_member();
      if ($member!=$this->get_guest_id())
      {
         $theme=$this->get_member_row_field($member,'m_theme');
      } else $theme='';
      if ($theme=='')
      {
         $theme=preg_replace('#[^\w\d_]#','_',get_site_name());
         if (file_exists(get_file_base().'/themes/'.$theme)) return $theme;
      }
      return $theme;
and name your theme: "Defender_s_Website".

Zone's should be set to "rely on the forum driver" for theme detection.

I've modified the ocf.php file, but when I try to rename my theme from "classic" to "Defender_s_Website" , I get a file permission error for ocf.css in templates_cached:
Cannot write to /home/httpd/vhosts/jediarchives.ca/httpdocs/themes/Defender_
s_Website/templates_cached/EN/ocf.css. File permissions for it have not been set correctly.
However, this is not the real problem here… When I access my website's ftp to manually edit the chmod for that file, I receive a message saying I'm not allowed to do that.
550 ocf.css: Operation not permitted
How should I proceed from this point?

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
Posted
Rating:
#16621
Avatar

If you have access to a hosting control panel, try deleting the file using the file manager from that. In my experience these tools are more flexible as they're designed for web environment permissions.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#16623

Fan in action

Odd. The file has been deleted and It doesn't show up in the file manager, but the error message is still the same… ocf.css doesn't have the right permissions  O_o

I also tried changing the permissions of ocf.css thru the filemanager, and got this error:
Unable to change permissions for file /httpdocs/themes/classic/templates_cached/EN/ocf.css: filemng failed: chmod: changing permissions of `/home/httpd/vhosts/jediarchives.ca/httpdocs/themes/classic/
templates_cached/EN/ocf.css': Operation not permitted filemng: Error occured during /bin/chmod command.

 :dry:

Where did the reply button go? O_o

Anyways. lol. I tried to rename the folder manually thru this file manager thing, and it worked :lol:

Not sure what's up with ocf.css though  :dry:

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
Posted
Rating:
#16624
Avatar

So, where do we stand now? Is the problem solved, or is there still a sticking point?


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#16625

Fan in action

We're done here :) Thanks for the help and keep up the good work :)

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: