Skip to Content Skip to Menu

Please help with cb query

13 years 10 months ago #149544 by Silvareiel
Please help with cb query was created by Silvareiel
Hi :)

I’m using CB to create a database of characters from a book and wanted a different Joomla template (not the CB template) for each race, when people see the profile page (so, not logged in users) In fact no one will log in on my site, except me.
So, after searching a lot, I found a component (Metatemplate) that does exactly that, and uses php query to do it. The problem is the query part…

I’ve asked the help of the developers of Metatemplate and we arrived at something like this:

if ($option == "com_comprofiler" and JRequest::getVar("task") == "userProfile" ) {
$userid = JRequest::getInt('userid',0);
if ( $userid > 0 ) {
$query = "select cb_raa from jos_comprofiler where user_id = '$userid' and approved = 1"; // where cb_raa is the race field
$db->setQuery( $query );
$result = $db->loadResult();
if ($result == "foo" ) return "araphel"; // for race "foo", use Template Araphel
}
}


But no luck. :(

I know that

if ($option == "com_comprofiler" and JRequest::getVar("task") == "userProfile" ) return "araphel"

works, changing the joomla template off all profiles. So the problem is with the query part. And yes, I’m terrible at php :pinch:

I’ve read enough forum posts to know you guys don’t give support to 3rd party plugins but still I had to try.
If someone has the time to look at this I’d be really thankfull.

Thank you in advanced,

Marta C.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
13 years 10 months ago #149584 by krileon
Replied by krileon on topic Re:Please help with cb query
Not really something we can help with, that's not a database query it's just PHP usage. Don't really understand what you're trying to do, you stated it works so what exactly are you needing help with?

We don't provide support for 3rd party extensions. The developers of your extension should provide you with support. If they do not then we certainly won't as we didn't develop the extension. Yes it does involve CB usage, but it's CB usage on their end. It's like users requesting help and to fix issues with say Kunena just because CB has a usaecase with Kunena, that does not make us its developers nor are we going to fix or provide support for it.

Sorry for the inconvenience, but not much we can help with. As per your post title if you need help understanding or writing a database query to CBs database tables then please provide more details on what you're needing and we certainly can assist with that aspect.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum