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.


Theme changer

Login / Search

 [ Join | More ]
 Add topic 
Posted
Item has a rating of 5 (Liked by Jean)  
Rating:
#83005 (In Topic #17281)
Avatar

Community saint

needs a little work but so far so good

I was trying to figure out how to put a theme changer in the footer of my site, was more than a little weird seeing as I'm so terrible with coding but 'google' is your friend as they say.

Once I had it working okay I wondered why OCPortal doesn't have one already, seems like it should to me, but I aint no coder and I have no idea to make it automatically add new links as and when new theme get installed on the site. Presently I have to add new themes manually, not a big deal for me but if anything for OCPortal should ideally function automatically.

Thought I would toss it in the pot for others to consider, perhaps the dev's could consider it too.

Any way, this is my hack attempt at making a theme changer, no laughing, I know it's crude but I am quite pleased with it myself.

Code

<div>
    <script type="text/javascript">
        function goToSelected()
        {
            window.location = document.getElementById('pmenu').value;
        }
    </script>
    <select name="PDropdown Menu" id="pmenu">
        <option selected="selected" value="">Select</option>
        <option value="index.php?keep_theme=Rock_Babe">Rock Babe</option>
        <option value="index.php?keep_theme=default">Default</option>
    </select>

    <input type="submit" value="Change Theme" id="button" onclick="goToSelected();" />
</div>


You can see it on my site, it only sends you to the default theme at the moment, I haven't added the code to the default theme as I don't want to change anything there for upgrade purposes, but it works!

Metal IS Forever & We WILL Rock You 'til You Choke! Rock Babe
Back to the top
 
Posted
Rating:
#83015
Avatar

Community saint

Thanks for sharing this code, Petrikuhr!

It works great!
I see your point though, about the inconvenience of having it hard coded for each new theme.

I was trying to find how ocPortal does it with the theme changer in the "Edit profile", but I can't find its template and the "Show template edit links" does not seem to work on that page.
This might be a good source to look for.

Love how you keep pursuing interesting angles!:thumbs:
Jean
Back to the top
 
Posted
Rating:
#83020
Avatar

Community saint

Heya Jean,
oddly I cannot find a theme selector in the edit profile, not here or on my own site, I have looked for a setting I must have missed but haven't found anything!

Metal IS Forever & We WILL Rock You 'til You Choke! Rock Babe
Back to the top
 
Posted
Rating:
#83032
Avatar

Community saint

Petrikuhr said

Heya Jean,
oddly I cannot find a theme selector in the edit profile, not here or on my own site, I have looked for a setting I must have missed but haven't found anything!


Ah yes, it is not there by default…I forgot about that!;)

To activate this feature, do the following:

Admin Zone » Structure » Zones » Choose » Edit zone (do this for the zones where you want to allow members to change themes)

For the Theme options: Select "Respect member settings"

Note: The viewing member must have access to view these themes (by default any new theme does have full access)

Jean
Back to the top
 
Posted
Rating:
#83043
Avatar

Community saint

Ah-ha, now that helps immensely, reckon I found the template, FORM_SCREEN_FIELD.tpl, now I just got to figure out how it works!

~~~~~~~~~~~~ edited ~~~~~~~~~~~~~~~~~~~~~

Hmmmmmm, seems I am jumping the gun a little here, my search results say I need to be looking in one of these:
    » default/templates/CHAT_SET_EFFECTS_SETTING_BLOCK.tpl
    » default/templates/FORM_SCREEN_FIELD.tpl
    » default/templates/FORM_SCREEN_INPUT_HUGE.tpl
    » default/templates/FORM_SCREEN_INPUT_HUGE_COMCODE.tpl
    » default/templates/FORM_SCREEN_INPUT_HUGE_LIST.tpl

I'm looking in them now and it might as well be written in Martian for all I care, I have no idea what these templates are going on about!

~~~~~~~~~~~ edited ~~~~~~~~~~~~~~~~~~~~~~~~~~~

Okay, further deduction, FORM_SCREEN_INPUT_HUGE_LIST.tpl is the one that has a 'select' thingie going on so I am going to go with that one for now, just wish I had a clue what it was saying is all! :(

Not liking your silence Chris, I bet you knew straight away which template we had to find huh!


~~~~~~~~~~~~~~~ edited ~~~~~~~~~~~~~~~

Right then, so it doesn't seem to be any of those listed above, I don't have a clue now!


Last edit: by Petrikuhr

Metal IS Forever & We WILL Rock You 'til You Choke! Rock Babe
Back to the top
 
Posted
Rating:
#83045
Avatar

To be honest I don't think there is a way to do this without PHP code. The PHP code for profile editing feeds a template with a list of themes, but that data is not available for a template to ask for.


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:
#83049
Avatar

Community saint

Ahhhh, hence the silence from you then Chris, was wondering if you were seeing how close we got before you did the "tut-tut, it's this template dopey".

Well that really is me scuppered, php is a no go for me, it all just looks like a load of nonesnse to me. Oh well, guess I'll be sticking to manual imput, no biggie for me to be honest.

I'll just slide off and play some more in photoshop. ;)

Metal IS Forever & We WILL Rock You 'til You Choke! Rock Babe
Back to the top
 
Posted
Rating:
#83052
Avatar

I'm afraid nowadays lack of time means I tend to have to home in on a few keywords, to find stuff which are clearly bug reports. General questions, I don't tend to even think about them actually. Wish I could, but not really something I can fit in.

The other thing is I just found out today I have to get glasses, I've been suffering really bad eye strain for months which has left me feeling like I had flu for 1-2 days a week over the last half year :sick:. Turns out one eye is short-sighted and the other long-sighted, and combined with my big shiny mac screen, was really giving me severe ocular problems. Hopefully going forward I'll be back to my old self ;).


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:
#83056
Avatar

Community saint

well you are not the only one I"am afraid….. I have no big monitor, but it helped to get new glasses…  ;)


http://digiflash.nl Photo community  (dutch)
Back to the top
 
Posted
Rating:
#83061
Avatar

Yeah. I realise now how ordinary it is, but because I always had perfect vision (still have better than 20-20 vision), it's not something I've ever had cause to think about. I just thought I had a weakened immune system somehow, so I was doing exercises, looking at my diet, etc. Never crossed my mind it would be an eye thing, could have saved myself a lot of pain if I had!


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:
#83063
Avatar

Community saint

Glad you had it attended to. I'm surprised you didn't get horrendous headaches with the concurrent near-sighted/far-sighted bit. It'a amazing how well the brain tries to compensate for these factors but it so often leads to nasty headaches.

Bob
Back to the top
 
Posted
Item has a rating of 5 (Liked by Chris Graham)  
Rating:
#83078
Avatar

Community saint

Chris Graham said

Turns out one eye is short-sighted and the other long-sighted
Take care of those eyes, Chris.

I suffer the exact same nearsighted in one eye and farsighted in the other. My eye doc says very few people are both Myopia and Hyperopia. I also suffer from astigmatism and a cataract.

Steve
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: