php code help please

Discussion in 'PHP' started by ging999, May 22, 2008.

  1. #1
    Below are two scripts from a joomla module. The first calls in the gamertag from a parameters field in the back end of joomla and the second is the php for the module. Hopefully a very simple answer for this,
    I have created a new field on the register page for the gamertag and this is stored in a database (jos_users)(gamertag)this part works fine, how do i change the script so it gets the gamer tag from the database

    Many thanks


    <?php
    /**
    * @version $Id: helper.php 4330 2006-07-26 06:24:14Z webImagery $
    * @package Joomla_1.0.0
    * @copyright Copyright (C) 2005 - 2006 Open Source Matters. All rights reserved.
    * @license GNU/GPL, see LICENSE.php
    * Joomla! is free software. This version may have been modified pursuant
    * to the GNU General Public License, and as distributed it includes or
    * is derivative of works licensed under the GNU General Public License or
    * other free or open source software licenses.
    * See COPYRIGHT.php for copyright notices and details.
    */

    // no direct access
    defined('_JEXEC') or die('Restricted access');

    class modgamercardHelper
    {
    function getParams(&$params)
    {
    $params->def('gamertag', '');
    return $params;
    }


    }



















    <?php
    /**
    * mod_gamercard is free software. This version may have been modified pursuant
    * to the GNU General Public License, and as distributed it includes or
    * is derivative of works licensed under the GNU General Public License or
    * other free or open source software licenses.
    */

    // no direct access
    defined('_JEXEC') or die('Restricted access');

    // Include the syndicate functions only once
    require_once (dirname(__FILE__).DS.'helper.php');

    $params = modgamercardHelper::getParams($params);

    $gamertag = $params->get( 'gamertag');
    $class = $params->get( 'moduleclass_sfx' );


    $targetURL = "http://gamercard.xbox.com/" . urlencode($gamertag) . ".card";

    ?>

    <div class="gamercard<?php echo $class ?>">
    <IFRAME src="<?php echo $targetURL ?>" scrolling="no" frameBorder="0"></IFRAME>
    </div>
     
    ging999, May 22, 2008 IP