treybraid Posted January 7, 2012 Share Posted January 7, 2012 I am using a football game module by fastball productions for a Joomla website. see the screenshots attached - the default layout out the module is vertical which in my case will display 4 games top-bottom... The 2nd image going left to right is what I am trying to acomplish. What would I need to edit; so, the games are displayed in a left to right fashion. Can someone help me out here? I editted the php file and changed the following lines refencing $rows changing them to $columns...and of course it isn't working... $db->setQuery($sql); $rows = $db->loadResultArray(); $teamids = implode(',', $rows); to---making reference to explode in a column $db->setQuery($sql); $columns = $db->loadResultArray(); $teamids = implode(',', $columns); Someone please let me know.. Thanks Trey 17288_.zip Quote Link to comment Share on other sites More sharing options...
treybraid Posted January 7, 2012 Author Share Posted January 7, 2012 here is the code from the php file.... <?php /** * @version $Id: mod_gridiron_game_results.php, v1.5.4 September 2011 01:32:15 * @author Fastball Productions * @package Gridiron * @copyright Copyright © 2011 Fastball Productions * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ // no direct access defined('_JEXEC') or die('Restricted access'); $db =& JFactory::getDBO(); $com_params = &JComponentHelper::getParams('com_gridiron'); // get the module parameters $heading = $params->get( 'heading', '' ); $showpast = $params->get( 'showpast', '1' ); $numberpast = $params->get( 'numberpast', '1' ); $linkboxscore = $params->get( 'linkboxscore', '1' ); $shownextgame = $params->get( 'nextgame', '1' ); $numbernext = $params->get( 'numbernext', '1' ); $linknext = $params->get( 'linknext', '1' ); $seasonid = $params->get( 'seasonid', '1' ); $gametypes = $params->get( 'gametypes', '1' ); $teamids = $params->get( 'teamids', '' ); $leagueids = $params->get( 'leagueids', '' ); $divisionids = $params->get( 'divisionids', '' ); $displaylogo = $params->get( 'displaylogo', 0); if (is_array($gametypes)) { $gametypes = implode(',', $gametypes); } if (is_array($teamids)) { $teamids = implode(',', $teamids); } if (is_array($leagueids)) { $leagueids = implode(',', $leagueids); } if (is_array($divisionids)) { $divisionids = implode(',', $divisionids); } // if there is a league configured, get the teams within the league/division; if ($teamids == '' && ($divisionids || $leagueids)) { if ($divisionids) { // get a listing of all team ID's that belong in the league and division; $sql = "SELECT id FROM #__gridiron_team WHERE (FIND_IN_SET(divisionid, '$divisionids'))"; } else { // get a listing of all team ID's that belong in the league; $sql = "SELECT id FROM #__gridiron_team WHERE (FIND_IN_SET(leagueid, '$leagueids'))"; } $db->setQuery($sql); $columns = $db->loadResultArray(); $teamids = implode(',', $columns); } else if ($teamids == '') { // get the default team (single team component only); $db->setQuery("SELECT id FROM #__gridiron_team WHERE (defaultteam = 1)"); $teamids = $db->loadResult(); } // get the last x number of games played and the results; $db->setQuery("SELECT a.*, a.hometeam AS hometeamid, a.visitingteam AS visitingteamid, DATE_FORMAT(a.gamedatetime, '%a, %M %D') AS gamedate, DATE_FORMAT(a.gamedatetime, '%l:%i %p') As gametime, h.name AS hometeam, h.shortname AS hshortname, h.logo AS hlogo, v.name AS visitingteam, v.shortname AS vshortname, v.logo AS vlogo, b.finalv, b.finalh FROM #__gridiron_schedule AS a LEFT JOIN #__gridiron_team AS h ON a.hometeam = h.id LEFT JOIN #__gridiron_team AS v ON a.visitingteam = v.id LEFT JOIN #__gridiron_boxscore AS b ON a.id = b.gameid WHERE (a.scored = 1 AND a.season = {$seasonid} AND (FIND_IN_SET(a.gametype, '$gametypes')) AND (FIND_IN_SET(a.hometeam, '$teamids') OR FIND_IN_SET(a.visitingteam, '$teamids')) AND a.gamedatetime < now()) GROUP BY a.id ORDER BY a.gamedatetime DESC LIMIT 0, {$numberpast}"); $pastgames = $db->loadObjectList(); // get the next x number of games scheduled; $db->setQuery("SELECT a.*, a.hometeam AS hometeamid, a.visitingteam AS visitingteamid, DATE_FORMAT(a.gamedatetime, '%a, %M %D') AS gamedate, DATE_FORMAT(a.gamedatetime, '%l:%i %p') As gametime, h.name AS hometeam, h.shortname AS hshortname, h.logo AS hlogo, v.name AS visitingteam, v.shortname AS vshortname, v.logo AS vlogo, t.description AS gametype FROM #__gridiron_schedule AS a LEFT JOIN #__gridiron_team AS h ON a.hometeam = h.id LEFT JOIN #__gridiron_team AS v ON a.visitingteam = v.id LEFT JOIN #__gridiron_gametype AS t ON a.gametype = t.id LEFT JOIN #__gridiron_location AS l ON a.location = l.id WHERE (a.scored = 0 AND a.season = {$seasonid} AND (FIND_IN_SET(a.gametype, '$gametypes')) AND (FIND_IN_SET(a.hometeam, '$teamids') OR FIND_IN_SET(a.visitingteam, '$teamids')) AND DATE_ADD(a.gamedatetime, INTERVAL 3 HOUR) > now()) GROUP BY a.id ORDER BY a.gamedatetime ASC LIMIT 0, {$numbernext}"); $nextgames = $db->loadObjectList(); ?> <table width="100%" border="0" align="center"> <?php if ($showpast && $numberpast > 0) { ?> <tr> <td width="618" style="text-align:center;" colspan="2"><b><?php echo $heading;?></b></td> </tr> <tr> <td style="font-size:12px; font-weight:bold; color:#000;"><u>Games</u></td> <td width="540" style="text-align:center; font-size:12px; font-weight:bold; color:#000;"><u>Score</u></td> </tr> <?php foreach ($pastgames as $past) { ?> <?php $past->vshortname ? $past->visitingteam = $past->vshortname:NULL;?> <?php $past->hshortname ? $past->hometeam = $past->hshortname:NULL;?> <tr> <td valign="middle" style="font-size:11px; color:#000; font-weight:bold;" nowrap="nowrap"> <?php if ($displaylogo) { ?> <img src="<?php echo JURI::base() . $com_params->get('images_path') . $past->vlogo;?>" alt="" width="35" align="middle" /> <?php } ?> <?php echo $past->visitingteam; ?> </td> <td valign="middle" style="text-align:center; font-size:11px; font-weight:bold;"><?php if ($linkboxscore) { ?><a href="<?php echo JRoute::_("index.php?option=com_gridiron&view=boxscore&id=$past->id");?>"><?php echo $past->finalv;?></a><?php } else { ?><?php echo $past->finalv;?> </td> <?php } ?> </tr> <tr> <td valign="middle" style="font-size:11px; color:#000; font-weight:bold;" nowrap="nowrap"> <?php if ($displaylogo) { ?> <img src="<?php echo JURI::base() . $com_params->get('images_path') . $past->hlogo;?>" alt="" width="35" align="middle" /> <?php } ?> <?php echo $past->hometeam;?> </td> <td valign="middle" style="text-align:center; font-size:11px; font-weight:bold;"><?php if ($linkboxscore) { ?><a href="<?php echo JRoute::_("index.php?option=com_gridiron&view=boxscore&id=$past->id");?>"><?php echo $past->finalh;?></a><?php } else { ?><?php echo $past->finalh;?> </td> <?php } ?> </tr> <tr> <td colspan="3" nowrap="nowrap" style="font-size:11px; color:#000; font-weight:bold;"><hr /></td> <?php } ?> <?php } ?> <?php if ($shownextgame && $numbernext > 0 && $nextgames) { ?> <tr> <td colspan="2" style="font-size:12px; color:#000; font-weight:bold;"><?php echo $next->gamedate . ' ' . $next->gametime;?></td> </tr> <?php foreach ($nextgames as $next) { ?> <?php $next->visitingteam == '' ? $next->visitingteam = 'TBA':$next->visitingteam = $next->visitingteam;?> <?php $next->hometeam == '' ? $next->hometeam = 'TBA':$next->hometeam = $next->hometeam;?> <?php $next->vshortname ? $next->visitingteam = $next->vshortname:NULL;?> <?php $next->hshortname ? $next->hometeam = $next->hshortname:NULL;?> <tr> <td colspan="2" nowrap="nowrap" style="font-size:11px; color:#000; font-weight:bold;"> <?php if ($linknext) { ?> <?php if ($next->visitingteam == 'TBA') { ?> <?php echo $next->visitingteam;?> <?php } else { ?> <?php if ($displaylogo) { ?> <img src="<?php echo JURI::base() . $com_params->get('images_path') . $next->vlogo;?>" alt="" width="35" align="middle" /> <?php } ?> <a href="<?php echo JRoute::_("index.php?option=com_gridiron&view=schedule&id=$next->visitingteamid");?>"><?php echo $next->visitingteam;?></a> <?php } ?> At <?php if ($next->hometeam == 'TBA') { ?> <?php echo $next->hometeam;?> <?php } else { ?> <?php if ($displaylogo) { ?> <img src="<?php echo JURI::base() . $com_params->get('images_path') . $next->hlogo;?>" alt="" width="35" align="middle" /> <?php } ?> <a href="<?php echo JRoute::_("index.php?option=com_gridiron&view=schedule&id=$next->hometeamid");?>"><?php echo $next->hometeam;?></a> <?php } ?> <?php } else { ?> <?php echo $next->visitingteam;?> vs. <?php echo $next->hometeam;?> <?php } ?></td> <tr> <td colspan="3" nowrap="nowrap" style="font-size:11px; color:#000; font-weight:bold;"><hr /></td> </tr> <?php } ?> <?php } ?> </table> Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted January 7, 2012 Share Posted January 7, 2012 When posting code, enclose it within the forum's . . . BBCode tags. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.