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:
i
f ($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.