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 Selection (rely on forum) works ?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#1570 (In Topic #369)
Avatar

Fan in training

Theme Selection (rely on forum) works ?

If i select rely in forum
i get this Notice: Undefined index: x_z in f:\ocportal\sources\forum\phpbb.php on line 463
(x_z is my theme name)

Does it happen 2 anyone 2 ?
Back to the top
 
Posted
Rating:
#1571
Avatar

Fan in training

Originally posted by Joao@Jun 23 2004, 10:48 AM
 If i select rely in forum
i get this Notice: Undefined index: x_z in f:\ocportal\sources\forum\phpbb.php on line 463
(x_z is my theme name)

Does it happen 2 anyone 2 ?
Found the problem , it relys on my /themes/map.ini file … Fixed :) No Bug at all :P
Back to the top
 
Posted
Rating:
#1573
Avatar

Fan in training

Hmm ok 4 those who use that option (relying on forum and the forum is phpbb) ;
When a guest enters the portal, the default theme is selected by these order (i think) [see phpbb.php] :

  • the theme according to our site name;
    if not found then:
  • the theme from the  "select from php themes table where id = 1 (first theme)" (in my case subsilver)
    if not found then:
  • hardcoded to default;

well in these last one, if u want, u can do this (in file sources\forum\phpbb.php) :
instead:

Code

      $def="default";
u can do this

Code

      $def=$map["default"];

This allows u to configure in map.ini the default theme u wanna!
(setting default = your_default_theme)
Back to the top
 
Posted
Rating:
#1604
Avatar

Fan in training

I set my theme to 'Rely on Forum' (phpBB) and nothing changed, even after I changed all the colors in my forum (I'm still using the same subSilver template, which I copied, modified color-wise, and renamed as a new theme).

Is this the way OCP is supposed to work (i.e. it only maps the template style, not the color-scheme)?
Back to the top
 
Posted
Rating:
#1606
Avatar

Community saint

The way it works, it by linking your forum theme to an installed ocp theme.  for example, you can link subsilver to the default ocp theme. I have dustygreen on my forum, linked to gusblue on ocp, as the colour schemes are the same, it does not actually use the forum theme on the portal. if you want to use the same colour schemes, you can add your own themes to ocp, to match your forum themes, then link them. ill show you exactly how when i have a bit more time.
Back to the top
 
Posted
Rating:
#1607
Avatar

Community saint

ok, found some time :D

Code

default = default

# ipb
1 = default

# phpBB
Norm = gusblue
DustyGreen = gusblue
subSilver = default
bluetabs = alien

# vb
Default = default

# xmb
AventureMedia = default

# OpenBB
OpenBB = default

In this example i have four themes on my forum (Norm, DustyGreen, subSilver, and bluetabs) and they are linked to the ocp themes gusblue, default, and alien.  

If you create, or add a new theme to your forum, then you have to edit the map.ini file in the ocp themes folder to link your forum theme to one you have on ocp. if you dont, it will use the default theme for users who select the new (unlinked) theme.

Hope this helps, if not, pm, email, or catch me on msn
Back to the top
 
Posted
Rating:
#1608
Avatar

Fan in training

i had to comment this code at sources/forum/phpbb.php
because this code runs before trying the ini file …notice that this code selects
the phpbb theme (id = 1) [most of the times subSilver] .

Code

/*
   // Hmm, just the very-default then
   if ((!(strlen($def)>0)) || (!file_exists(get_file_base()."/themes/".$def)))
   {
      $phpbb=get_query_value("SELECT style_name FROM "._get_table_prefix()."themes
                                  WHERE themes_id='1'",get_db_forums());
      $def=$map[$phpbb];
   }
   **/

If in your case doesnt work comment that code or remove the #1 phpbb theme
Back to the top
 
Posted
Rating:
#1610
Avatar

Community saint

i dont quite understand whay you mean… Does that part of the code look in the ocp themes folder for a theme with the same name as your forum theme, and if it cannot find, it uses the map.ini file to map the appropriat theme?  Or does that code just hardcode the default theme?  :blink:

Im kinda new to php, but im learning all the time, so please be patient with me  :D
Back to the top
 
Posted
Rating:
#1611
Avatar

Fan in training

Hmmm lets see …

Code

/*
  // Hmm, just the very-default then
  if ((!(strlen($def)>0)) || (!file_exists(get_file_base()."/themes/".$def)))
  {
     $phpbb=get_query_value("SELECT style_name FROM "._get_table_prefix()."themes
                                 WHERE themes_id='1'",get_db_forums());
     $def=$map[$phpbb];
  }  **/

this code (that ived comment) selects the #1 (id) theme name from phpbb_themes table and uses the result (example: subSilver) as the index to find the correspondent ocp_theme at ini file ($def=$map[$phpbb]; i. e. $def=$map['subSilver'];)
If these runs ok then the next condition :

Code

 // Default then!
   if ((!(strlen($def)>0)) || (!file_exists(get_file_base()."/themes/".$def)))
      $def=$map["default"]; //"default";

will not "run" !(strlen($def)>0) ….

I did this cause i want to have a default skin for guests … when a guest enters the site it always returns me subSilver theme not my default theme at ini file ….

Im sorry this could be confusing, cause my english…. if u dont understand tell me and ill try to be more explicit. (im watching tv. so im a little distracted) :D
Back to the top
 
Posted
Rating:
#1612
Avatar

Community saint

oh i think i get it. As guests do not have a forum theme for ocp to rely on, it will load the theme that correstponds to the forums default them (subsilver in this case) and load ocp's matching theme.
Back to the top
 
Posted
Rating:
#1613
Avatar

Fan in training

Yep … :) thats it …. dont know if it is usefull for u …. but im learning 2  B)
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: