help on making a cb module

17 years 7 months ago #21307 by nant
Replied by nant on topic Re:help on making a cb module
You need to pack the code snipplet as a module (many articles over at joomla.org about developing modules), install the module and make it registered only.

Or you can of course check if $my->id == 0 and just return nothing in your code.

Please Log in to join the conversation.

17 years 7 months ago #21310 by duronl
Replied by duronl on topic Re:help on making a cb module
sorry about all the stupid qeustions :P
should have know the solution was simple.

It is working like a charm.

thanks for the help.

Founder of Stampgasten.nl & globalxboxcommunity.com
Check: www.stampgasten.nl | www.globalxboxcommunity.com

Please Log in to join the conversation.

17 years 6 months ago #23016 by bjraines
Replied by bjraines on topic Re:help on making a cb module
nant wrote:

if you have never written a module before you should start studying some of the existing ones to learn.

[code:1]
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

global $my;

$query = "SELECT cb_gamertag FROM #__comprofiler WHERE id = ". $my->id;
$database->setQuery( $query );
$cb_fieldvalue = htmlspecialchars($database->loadResult());

echo 'cb_gamertag value for current user is ' . $cb_fieldvalue;
?>
[/code:1]

the above code displays the value of a cb_gamertag field (assuming it has been created in the CB backend) for the current logged in user and should get you started.



Just wanted to say that this little tidbit of code explained more to me than you could ever imagine. Thanks!

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.246 seconds

Facebook Twitter LinkedIn