Skip to Content Skip to Menu

🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

help on making a cb module

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
18 years 3 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 or Create an account to join the conversation.

  • duronl
  • duronl
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
18 years 3 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 or Create an account to join the conversation.

  • bjraines
  • bjraines
  • OFFLINE
  • Posts: 87
  • Thanks: 0
  • Karma: 2
18 years 2 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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum