HTML Logo by World Wide Web Consortium ( 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 for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.

Another issue with nested sites

Login / Search

 [ Join | More ]
 Add topic 
#56361 (In Topic #12256)

Fan in action

As I mentioned before, I have two sites, one on a subdomain using the users table from the main site, otherwise independent.
When I go to its admin zone and try to add a user group, I get this error:


Unfortunately a query has failed [SELECT id,path FROM ocbg_theme_images WHERE path<>'themes/default/images/blank.gif' AND (theme='default' OR theme='default') AND id LIKE 'ocf_rank_images%' ORDER BY path] [Table 'osdreams_en.ocbg_theme_images' doesn't exist] (version: 4.2.2, PHP version: 4.4.8, URL: /adminzone/index.php?page=admin_ocf_groups&type=ad)

where ocbg_ is the table prefix for the site, while osdreams_en is the DB for the parent site - basically, it's looking for the table in the wrong DB.
Back to the top

In sources/themes2.php please change:


$rows=$db->query('SELECT id,path FROM '.get_table_prefix().'theme_images WHERE '.db_string_not_equal_to('path','themes/default/images/blank.gif').' AND ('.db_string_equal_to('theme',$GLOBALS['FORUM_DRIVER']->get_theme()).' OR '.db_string_equal_to('theme','default').') AND id LIKE \''.db_escape_string(db_encode_like($type.'%')).'\' ORDER BY path');


   $rows=$db->query('SELECT id,path FROM '.$db->get_table_prefix().'theme_images WHERE '.db_string_not_equal_to('path','themes/default/images/blank.gif').' AND ('.db_string_equal_to('theme',$GLOBALS['FORUM_DRIVER']->get_theme()).' OR '.db_string_equal_to('theme','default').') AND id LIKE \''.db_escape_string(db_encode_like($type.'%')).'\' ORDER BY path');

(it's about line 559)

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
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: