treybraid Posted March 23, 2011 Share Posted March 23, 2011 I posted yesterday and wasnt very clear or the question was way to broad... here is my issue condensed and hoping someone can help me... I am using a sports component and mods in Joomla 1.5 --- that displays a standings table with game results- next game... i am trying to drop/add the team logo next to the team name in the table/s... this is the code from the team page echoing the logo and putting it next to the team name--- see bottom where i have it spaced out.... as you can expect it isn't working of course <?php if ($this->params->get('team_logo') == 1 && $this->team->logo) { ?> <!-- team logo --> <div style="display: inline; float: left; padding-left: 2px;"> <img src="<?php echo JURI::base() . $this->params->get('images_path') . $this->team->logo;?>" alt="<?php echo stripslashes($this->team->name);?>" title="<?php echo stripslashes($this->team->name);?>" border="1" /><br /> <br /> </div> <!-- team logo --> <?php } ?> and here is the code from the standings module: i highlighted where in the table the logo would be called... i understand broad question here; but, was hoping someone could help me out with this... <?php /** * @version $Id: mod_gridiron_win_loss.php, v1.5.0 March 2011 01:32:15 * @author Fastball Productions * @package Gridiron * @copyright Copyright (C) 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(); // get the module parameters $heading = $params->get( 'heading', '' ); $seasonid = $params->get( 'seasonid', '1' ); $gametypes = $params->get( 'gametypes', '1' ); $teamids = $params->get( 'teamids', '' ); $leagueids = $params->get( 'leagueids', '' ); $divisionids = $params->get( 'divisionids', '0' ); $wheading = $params->get( 'wheading', 'Wins' ); $lheading = $params->get( 'lheading', 'Losses' ); $winpctheading = $params->get( 'pctheading', 'Winning Percentage' ); $gamesplayedheading = $params->get( 'gpheading', 'Games Played' ); $pointsforheading = $params->get( 'pfheading', 'Points For' ); $pointsagainstheading = $params->get( 'paheading', 'Points Against' ); $theading = $params->get( 'theading', 'Ties' ); $showties = $params->get( 'showties', 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); } // win/loss/ties variables; $wins = 0; $losses = 0; $ties = 0; // if there are team ids, division ids, or league ids configured, get all of the divisions to separate them; if ($teamids || $divisionids || $leagueids) { if ($teamids) { //$db->setQuery("SELECT d.id, d.division FROM #__fastball_division AS d LEFT JOIN #__fastball_team AS t ON d.id = t.divisionid WHERE (t.published = 1 AND t.divisionid IS NOT NULL AND FIND_IN_SET(t.id, '{$teamids}')) GROUP BY d.id ORDER BY d.division"); $divisions[] = -1; } else if ($divisionids) { //$db->setQuery("SELECT d.id, d.division FROM #__fastball_division AS d LEFT JOIN #__fastball_team AS t ON d.id = t.divisionid WHERE (t.published = 1 AND t.divisionid IS NOT NULL AND FIND_IN_SET(d.id, '{$divisionids}')) GROUP BY d.id ORDER BY d.division"); $db->setQuery("SELECT d.id, d.division FROM #__gridiron_division AS d LEFT JOIN #__gridiron_team AS t ON d.id = t.divisionid LEFT JOIN #__gridiron_schedule AS s ON (t.id = s.visitingteam OR t.id = s.hometeam) WHERE (t.published = 1 AND t.divisionid IS NOT NULL AND FIND_IN_SET(d.id, '{$divisionids}') AND s.season = {$seasonid} AND FIND_IN_SET(s.gametype, '$gametypes')) GROUP BY d.id ORDER BY d.division"); $divisions = $db->loadObjectList(); } else { $db->setQuery("SELECT d.id, d.division FROM #__gridiron_division AS d LEFT JOIN #__gridiron_team AS t ON d.id = t.divisionid LEFT JOIN #__gridiron_schedule AS s ON (t.id = s.visitingteam OR t.id = s.hometeam) WHERE (t.published = 1 AND t.divisionid IS NOT NULL AND FIND_IN_SET(d.leagueid, '{$leagueids}') AND s.season = {$seasonid} AND FIND_IN_SET(s.gametype, '$gametypes')) GROUP BY d.id ORDER BY d.division"); $divisions = $db->loadObjectList(); } } if (!function_exists('getStandingsTeamsModule')) { function getStandingsTeamsModule($divisionid, $seasonid, $teamids, $gametypes) { $db =& JFactory::getDBO(); $seasonid = intval($seasonid); $divisionid = intval($divisionid); if ($teamids) { $db->setQuery("SELECT a.id AS value, a.name AS text FROM #__gridiron_team AS a LEFT JOIN #__gridiron_schedule AS s ON (a.id = s.visitingteam OR a.id = s.hometeam) WHERE (a.published = 1 AND FIND_IN_SET(a.id, '$teamids') AND FIND_IN_SET(s.gametype, '$gametypes') AND s.season = {$seasonid}) ORDER BY a.name"); } else { $db->setQuery("SELECT a.id AS value, a.name AS text FROM #__gridiron_team AS a LEFT JOIN #__gridiron_schedule AS s ON (a.id = s.visitingteam OR a.id = s.hometeam) WHERE (a.published = 1 AND a.defaultteam = 1 AND a.divisionid = {$divisionid} AND FIND_IN_SET(s.gametype, '$gametypes') AND s.season = {$seasonid}) ORDER BY a.name"); } $teamlist = $db->loadObjectList(); /* array to store the wins, losses, ties, and teamid; */ $gamedata = array(); /* go through each teams schedule and get their wins, losses, and ties so that we know how to order the league standings; */ foreach ($teamlist as $team) { $wins = $losses = $ties = $gamesplayed = 0; /* now get the total points for each team and each game; */ $db->setQuery("SELECT s.hometeam, s.visitingteam, b.finalv, b.finalh FROM #__gridiron_schedule AS s LEFT JOIN #__gridiron_boxscore AS b ON b.gameid = s.id WHERE (s.scored = 1 AND s.season = {$seasonid} AND (s.visitingteam = {$team->value} OR s.hometeam = {$team->value}))"); $games = $db->loadObjectList(); /* go through each game and count the wins/losses/ties for the team then dump the results into an array for sorting; */ foreach ($games as $game) { $gamesplayed++; if ($game->hometeam == $team->value) { if ($game->finalh > $game->finalv) { $wins++; } else if ($game->finalh < $game->finalv) { $losses++; } else { $ties++; } } else { if ($game->finalv > $game->finalh) { $wins++; } else if ($game->finalv < $game->finalh) { $losses++; } else { $ties++; } } } /* calculate winning percentage; */ $winpct = $wins + ($ties*.5); if ($gamesplayed > 0) { $winpct = $winpct/$gamesplayed; } else { $winpct = 0; } $winpct = number_format($winpct, 3); $gamedata[] = array('winpct' => $winpct, 'wins' => $wins, 'losses' => $losses, 'ties' => $ties, 'teamid' => $team->value); } /* sort the gamedata array by winpct, wins, losses, ties; */ $winpct = $wins = $losses = $ties = array(); foreach ($gamedata as $key => $value) { $winpct[$key] = $value['winpct']; $wins[$key] = $value['wins']; $losses[$key] = $value['losses']; $ties[$key] = $value['ties']; } array_multisort($winpct, SORT_DESC, $wins, SORT_DESC, $losses, SORT_ASC, $ties, SORT_ASC, $gamedata); $teamsort = array(); foreach ($gamedata as $game) { $teamsort[] = $game['teamid']; } /* teamsort will be used to order the database results so that the team with the best record is on top; */ $teamsort = implode(',', $teamsort); if ($teamids) { $db->setQuery("SELECT t.* FROM #__gridiron_team AS t WHERE (t.published = 1 AND FIND_IN_SET(t.id, '$teamids')) ORDER BY FIND_IN_SET(id, '$teamsort')"); } else { $db->setQuery("SELECT t.* FROM #__gridiron_team AS t WHERE (t.published = 1 AND t.defaultteam = 1 AND t.divisionid = {$divisionid}) ORDER BY FIND_IN_SET(id, '$teamsort')"); } $teams = $db->loadObjectList(); return $teams; } } if (!function_exists('getStandingsStatsModule')) { function getStandingsStatsModule($teams, $seasonid, $gametypes) { $db =& JFactory::getDBO(); $i = 0; $standings = array(); /* go through each team and get their wins, losses, and ties; */ foreach ($teams as $team) { $wins = $losses = $ties = $gamesplayed = $pointsfor = $pointsagainst = 0; /* now get the total points for each team and each game; */ $db->setQuery("SELECT s.hometeam, s.visitingteam, b.finalv, b.finalh FROM #__gridiron_schedule AS s LEFT JOIN #__gridiron_boxscore AS b ON b.gameid = s.id WHERE (s.scored = 1 AND s.season = {$seasonid} AND (s.visitingteam = {$team->id} OR s.hometeam = {$team->id}))"); $games = $db->loadObjectList(); /* go through each game and count the wins/losses/ties for the team then dump the results into an array for sorting; */ foreach ($games as $game) { $gamesplayed++; if ($game->hometeam == $team->id) { $pointsfor = $pointsfor + $game->finalh; $pointsagainst = $pointsagainst + $game->finalv; if ($game->finalh > $game->finalv) { $wins++; } else if ($game->finalh < $game->finalv) { $losses++; } else { $ties++; } } else { $pointsfor = $pointsfor + $game->finalv; $pointsagainst = $pointsagainst + $game->finalh; if ($game->finalv > $game->finalh) { $wins++; } else if ($game->finalv < $game->finalh) { $losses++; } else { $ties++; } } } /* create an object with the team stats to return in the array; */ $obj = new stdClass(); $obj->id = $team->id; $obj->name = stripslashes($team->name); $obj->leagueid = $team->leagueid; $obj->gamesplayed = $gamesplayed; $obj->wins = $wins; $obj->losses = $losses; $obj->ties = $ties; $obj->pointsfor = $pointsfor; $obj->pointsagainst = $pointsagainst; $obj->winpct = $wins + ($ties*.5); if ($obj->gamesplayed > 0) { $obj->winpct = $obj->winpct/$gamesplayed; } else { $obj->winpct = 0; } $standings[] = $obj; $i++; } return $standings; } } ?> <?php if ($teamids || $divisionids || $leagueids) { ?> <table width="100%" border="0" align="center"> <tr> <td colspan="4" style="text-align:center;font-size:18px;"><b><?php echo $heading;?></b></td> </tr> <?php foreach ($divisions as $did) { ?> <tr> <td style="text-align:center; width:4px; "></td> <td bgcolor="#990000" style="text-align:left; width: 200px; border-bottom: 0px #000 solid; color: #FFF;"><b>Team</b></td> <td bgcolor="#990000" style="text-align:center; width:20px; border-bottom: 0px #000 solid; color:#FFF;"><b><?php echo $wheading;?></b></td> <td bgcolor="#990000" style="text-align:center; width:20px; border-bottom: 0px #000 solid; color:#FFF;"><b><?php echo $lheading;?></b></td> <td bgcolor="#990000" style="text-align:center; width:50px; border-bottom: 0px #000 solid; color: #FFF;"><b>Pct.</b></td> <td bgcolor="#990000" style="text-align:center; width:30px; border-bottom: 0px #000 solid; color: #FFF;"><b>GP</b></td> <td bgcolor="#990000" style="text-align:center; width:30px; border-bottom: 0px #000 solid; color: #FFF;"><b>PF</b></td> <td bgcolor="#990000" style="text-align:center; width:30px; border-bottom: 0px #000 solid; color: #FFF;"><b>PA</b></td> <td style="text-align:center; width:4px; "></td> <?php if ($showties) { ?> <td style="text-align:center; width:25px;"><b><?php echo $theading;?></b></td> <?php } ?> </tr> <?php $teams = getStandingsTeamsModule($did->id, $seasonid, $teamids, $gametypes);?> <?php $statdata = getStandingsStatsModule($teams, $seasonid, $gametypes); ?> <?php foreach ($statdata as $stats) { ?> <?php $stats->shortname == '' ? $name = $stats->name:$name = $stats->shortname;?> <tr> [color=purple][i][b]<td style="text-align:center; width:4px;"></td>[/b][/i][/color] <td style="text-align:left; width: 200px; font-size: 12px;"><a href="<?php echo JRoute::_("index.php?option=com_gridiron&view=team&id=$stats->id");?>"><?php echo $name;?></a></td> <td style="text-align:center; width:20px;"><?php echo $stats->wins ? $stats->wins:0;?></td> <td style="text-align:center; width:20px;"><?php echo $stats->losses ? $stats->losses:0;?></td> <td style="text-align:center; width:50px;"><?php echo number_format($stats->winpct, 3)?></b></td> <td style="text-align:center; width:30px;"><?php echo $stats->gamesplayed;?></td> <td style="text-align:center; width:30px;"><?php echo $stats->pointsfor;?></td> <td style="text-align:center; width:30px;"><?php echo $stats->pointsagainst;?></td> <td style="text-align:center; width:4px;"></td> <?php if ($showties) { ?> <td style="text-align:center; width:25px;"><?php echo $stats->ties ? $stats->ties:0;?></td> <?php } ?> </tr> <?php } ?> <tr><td colspan="4"></td></tr> <?php } ?> </table> <?php } ?> thanks trey Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/ Share on other sites More sharing options...
treybraid Posted March 23, 2011 Author Share Posted March 23, 2011 here is screenshot attached ... the logo would be next to each team name... [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1191372 Share on other sites More sharing options...
treybraid Posted March 24, 2011 Author Share Posted March 24, 2011 someone please ... i was hoping for some feedback.... thanks trey Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1191576 Share on other sites More sharing options...
techdude Posted March 24, 2011 Share Posted March 24, 2011 That should work as long as JURI::base() = the base dir, $this->params->get('images_path') = the path to the images, and $this->team->logo contains the name of the logo file. One question, though, do you need to call stripslashes() on $this->team->logo in the path? Post back here with the result of only echo JURI::base() . $this->params->get('images_path') . $this->team->logo; Is it possible that you need to omit the JURI::base() portion? remember, the src attribute MUST BE A URL, or RELATIVE PATH BASED ON THE WEB DIR. Let me know if I can help any. Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1191582 Share on other sites More sharing options...
treybraid Posted March 24, 2011 Author Share Posted March 24, 2011 thanks techdude--none of that worked though....got the whitescreen.... any other idea's... thanks trey Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1191597 Share on other sites More sharing options...
techdude Posted March 24, 2011 Share Posted March 24, 2011 Try print_r($this); Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1191601 Share on other sites More sharing options...
treybraid Posted March 24, 2011 Author Share Posted March 24, 2011 what does that do? what exactly should i be putting there? trey Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1191603 Share on other sites More sharing options...
treybraid Posted March 24, 2011 Author Share Posted March 24, 2011 Someone...any other suggestions... Thanks Trey Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1191723 Share on other sites More sharing options...
techdude Posted March 25, 2011 Share Posted March 25, 2011 print_r($this) will show you EXACTLY what the $this object looks like, so you can see what values it contains. If you can post that here, I will be able to help you select the header image from the list. Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1192144 Share on other sites More sharing options...
treybraid Posted March 25, 2011 Author Share Posted March 25, 2011 dumn question but what do i put and where is this what i would put: echo JURI::base() . $this->params->get('images_path') . $this->team->logo; print_r($this) if so this is what it generated when i put it in... and when viewed on my local install... echo JURI::base() . $this->params->get('images_path') . $this->team->logo; print_r($this) Lakeland Renegades 1 0 1.000 1 35 17 ...this is a standings table; so, the logo should be pulled from the backend team page where the logo is....if that makes any sense... thanks trey Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1192189 Share on other sites More sharing options...
treybraid Posted March 25, 2011 Author Share Posted March 25, 2011 i took the script form the team page where the logo is called.... i added this... <?php if ($this->params->get('team_logo') == 1 && $this->team->logo) { ?><?php echo JURI::base() . $this->params->get('images_path') . $this->team->logo;?> and of course i get the white page.... Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1192215 Share on other sites More sharing options...
techdude Posted March 25, 2011 Share Posted March 25, 2011 If you $this is a JObject, you should be able to run the following: <pre><?php print_r($this->getProperties ()); ?></pre> This will return the list of properties available. If this is not the case, please post back with the type of the $this variable. Print_r() gives the type and properties of an object. Try echo get_class($this); Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1192313 Share on other sites More sharing options...
treybraid Posted March 26, 2011 Author Share Posted March 26, 2011 i added this: <?php print_r($this->getProperties ()); ?> to the table <td style="text-align:center; width:4px; "><?php print_r($this->getProperties ()); ?></td> this is what it gave me: Array ( ) what do i need to do next? thanks trey ..techdude i am not a php expert-- just dabbling in this module trying to get it to work... all the help is appreciated... Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1192341 Share on other sites More sharing options...
techdude Posted March 28, 2011 Share Posted March 28, 2011 Hmm... could be a context problem. Try <pre><?php var_dump($this); ?></pre> Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1193342 Share on other sites More sharing options...
treybraid Posted March 29, 2011 Author Share Posted March 29, 2011 this is what it said.... thanks...trey object(JDocumentRendererModule)#205 (3) { ["_doc"]=> object(JDocumentHTML)#101 (29) { ["_links"]=> array(2) { [0]=> string(112) " string(115) " array(0) { } ["title"]=> string(46) "GAFL.org | The Gulf Atlantic Football League" ["description"]=> string(65) "Joomla! - the dynamic portal engine and content management system" ["link"]=> string(0) "" ["base"]=> string(0) "" ["language"]=> string(5) "en-gb" ["direction"]=> string(3) "ltr" ["_generator"]=> string(44) "Joomla! 1.5 - Open Source Content Management" ["_mdate"]=> string(0) "" ["_tab"]=> string(2) " " ["_lineEnd"]=> string(1) " " ["_charset"]=> string(5) "utf-8" ["_mime"]=> string(9) "text/html" ["_namespace"]=> string(0) "" ["_profile"]=> string(0) "" ["_scripts"]=> array(4) { ["/GAFL/media/system/js/mootools.js"]=> string(15) "text/javascript" ["/GAFL/media/system/js/caption.js"]=> string(15) "text/javascript" ["http://localhost/GAFL/modules/mod_yn_slider/script/yn_slider.js"]=> string(15) "text/javascript" ["/GAFL/modules/mod_jv_tabs/assets/js/jv_tab_news.js"]=> string(15) "text/javascript" } ["_script"]=> array(1) { ["text/javascript"]=> string(462) " window.addEvents({ 'domready': function(){ /* thumbnails example , div containers */ new Showcase({ overallContainer: 'overall_container', elementScrolled: 'inner_container', thumbsContainer: 'YouNews_articles', itemsVisible:4, elemsSlide:1, duration:200, autoSlide:0, itemsSelector: '.ynsnews', itemWidth: 240, navigationContainer: 'navigation', navigationElem: 'a' }); } }); " } ["_styleSheets"]=> array(2) { ["http://localhost/GAFL/modules/mod_yn_slider/css/stylesheet.css"]=> array(3) { ["mime"]=> string( "text/css" ["media"]=> NULL ["attribs"]=> array(0) { } } ["/GAFL/modules/mod_jv_tabs/assets/stylies/jv_news/style.css"]=> array(3) { ["mime"]=> string( "text/css" ["media"]=> NULL ["attribs"]=> array(0) { } } } ["_style"]=> array(0) { } ["_metaTags"]=> array(2) { ["http-equiv"]=> array(1) { ["content-type"]=> string(24) "text/html; charset=utf-8" } ["standard"]=> array(2) { ["robots"]=> string(13) "index, follow" ["keywords"]=> string(14) "joomla, Joomla" } } ["_engine"]=> NULL ["_type"]=> string(4) "html" ["_buffer"]=> array(1) { ["component"]=> array(1) { [""]=> string(104) " " } } ["_errors"]=> array(0) { } ["template"]=> string(9) "sportline" ["baseurl"]=> string(5) "/GAFL" ["params"]=> object(JParameter)#215 (7) { ["_raw"]=> string(379) "compress=0 menuName=mainmenu menustyle=2 useimages=0 defaultcolor=red showfont=0 showcolor=0 showwidth=0 sitewidth=wide fontsize=medium seo=Joomla Sport Template tags=Joomla Sport, Premium Joomla Template by Youjoomla show_butt1=1 show_butt2=1 button1=Login button2=Register button1_link=index.php?option=com_user&view=login button2_link=index.php?option=com_user&task=register " ["_xml"]=> NULL ["_elements"]=> array(0) { } ["_elementPath"]=> array(1) { [0]=> string(56) "C:\wamp\www\GAFL\libraries\joomla\html\parameter\element" } ["_defaultNameSpace"]=> string( "_default" ["_registry"]=> array(1) { ["_default"]=> array(1) { ["data"]=> object(stdClass)#226 (18) { ["compress"]=> string(1) "0" ["menuName"]=> string( "mainmenu" ["menustyle"]=> string(1) "2" ["useimages"]=> string(1) "0" ["defaultcolor"]=> string(3) "red" ["showfont"]=> string(1) "0" ["showcolor"]=> string(1) "0" ["showwidth"]=> string(1) "0" ["sitewidth"]=> string(4) "wide" ["fontsize"]=> string(6) "medium" ["seo"]=> string(21) "Joomla Sport Template" ["tags"]=> string(50) "Joomla Sport, Premium Joomla Template by Youjoomla" ["show_butt1"]=> string(1) "1" ["show_butt2"]=> string(1) "1" ["button1"]=> string(5) "Login" ["button2"]=> string( "Register" ["button1_link"]=> string(36) "index.php?option=com_user&view=login" ["button2_link"]=> string(39) "index.php?option=com_user&task=register" } } } ["_errors"]=> array(0) { } } ["_file"]=> string(46) "C:\wamp\www\GAFL\templates\sportline\index.php" } ["_mime"]=> string(9) "text/html" ["_errors"]=> array(0) { } } Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1193667 Share on other sites More sharing options...
techdude Posted March 29, 2011 Share Posted March 29, 2011 Ok, here is my try at this one: $this is a JDocumentHTML object, so its methods, etc. are defined here: http://api.joomla.org/Joomla-Framework/Document/JDocumentHTML.html You didn't show the configuration file for this module, but I assume here that the configuration file has a properly set up params section that looks kindof like this: <params> <param name="images_path" type="text" blah blah blah.../> </params> JURI::base should contain the base dir that the images directory is relative to. So far, that gives us echo JURI::base.$params->get('images_path'); Note that before you do this, you need to get a valid variable $params using mosParameters(). As for the actual image file name, you are probably looking at using $team->logo, not $this->team->logo. So your final result should be something like this. <!-- team logo --> <div style="display: inline; float: left; padding-left: 2px;"> <img src="<?php echo JURI::base() . $params->get('images_path') . $team->logo;?>" alt="<?php echo stripslashes($team->name);?>" title="<?php echo stripslashes($team->name);?>" border="1" /><br /> <br /> </div> <!-- team logo --> If I misunderstood, please explain the structure of your site to me in a little more detail. Post back with the results! Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1193706 Share on other sites More sharing options...
treybraid Posted March 29, 2011 Author Share Posted March 29, 2011 wrong - nothing... im looking for a referance to the params and i dont see it... trey no white screen at least.... Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1193774 Share on other sites More sharing options...
treybraid Posted March 29, 2011 Author Share Posted March 29, 2011 i dont know if this matters... i just took a look at the html and this is an example being pulled for a team... <tr> <td style="text-align:center; width:20px; height:20px; ">[color=red][b]<!-- team logo --> <img src="http://localhost/GAFL/" alt="" title="" border="1" /> <!-- team logo --></td>[/b][/color] <td style="text-align:left; width: 200px; font-size: 12px;"><a href="/GAFL/index.php?option=com_gridiron&view=team&id=5">Florida Rush</a></td> <td style="text-align:center; width:20px;">1</td> <td style="text-align:center; width:20px;">0</td> <td style="text-align:center; width:50px;">1.000</b></td> <td style="text-align:center; width:30px;">1</td> <td style="text-align:center; width:30px;">63</td> <td style="text-align:center; width:30px;">7</td> <td style="text-align:center; width:4px;"></td> </tr> this is code in the table.... highlighted in bold-italics actually pulls down the team... <tr> <td style="text-align:center; width:20px; height:20px; "><!-- team logo --> <img src="<?php echo JURI::base() . $params->get('images_path') . $team->logo;?>" alt="<?php echo stripslashes($team->name);?>" title="<?php echo stripslashes($team->name);?>" border="1" /> <!-- team logo --></td> [color=green][i][b] <td style="text-align:left; width: 200px; font-size: 12px;"><a href="<?php echo JRoute::_("index.php?option=com_gridiron&view=team&id=$stats->id");?>"><?php echo $name;?></a></td>[/b][/i][/color] <td style="text-align:center; width:20px;"><?php echo $stats->wins ? $stats->wins:0;?></td> <td style="text-align:center; width:20px;"><?php echo $stats->losses ? $stats->losses:0;?></td> <td style="text-align:center; width:50px;"><?php echo number_format($stats->winpct, 3)?></b></td> <td style="text-align:center; width:30px;"><?php echo $stats->gamesplayed;?></td> <td style="text-align:center; width:30px;"><?php echo $stats->pointsfor;?></td> <td style="text-align:center; width:30px;"><?php echo $stats->pointsagainst;?></td> <td style="text-align:center; width:4px;"></td> <?php if ($showties) { ?> <td style="text-align:center; width:25px;"><?php echo $stats->ties ? $stats->ties:0;?></td> <?php } ?> </tr> Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1193782 Share on other sites More sharing options...
treybraid Posted March 29, 2011 Author Share Posted March 29, 2011 this is the params at the beginning of the module: // get the module parameters $heading = $params->get( 'heading', '' ); $seasonid = $params->get( 'seasonid', '1' ); $gametypes = $params->get( 'gametypes', '1' ); $teamids = $params->get( 'teamids', '' ); $leagueids = $params->get( 'leagueids', '' ); $divisionids = $params->get( 'divisionids', '0' ); $wheading = $params->get( 'wheading', 'Wins' ); $lheading = $params->get( 'lheading', 'Losses' ); $winpctheading = $params->get( 'pctheading', 'Winning Percentage' ); $gamesplayedheading = $params->get( 'gpheading', 'Games Played' ); $pointsforheading = $params->get( 'pfheading', 'Points For' ); $pointsagainstheading = $params->get( 'paheading', 'Points Against' ); $teamlogo = $params->get('images_path', 'Team Logo'); --- added but this isnt right of course... $theading = $params->get( 'theading', 'Ties' ); $showties = $params->get( 'showties', 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); } Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1193790 Share on other sites More sharing options...
techdude Posted March 29, 2011 Share Posted March 29, 2011 Exactly! The $params object is used at the beginning of the file. As long as you have the correct parameter set, you should be able to use it. Also note that the object appears in the global context, while you appear to be using it in a control context. Try putting this line before the output of the image. global $params; Also, you may get a better idea what is going on if you add this code to the top of the page. Just make sure you remove it before your site "goes live". <?php error_reporting(E_ALL | E_STRICT); ini_set('display_errors', '1');?> Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1193794 Share on other sites More sharing options...
treybraid Posted March 29, 2011 Author Share Posted March 29, 2011 where do i put this....global $params; ???? <img src="<?php echo JURI::base() . $params->get('images_path') . $team->logo;?>" alt="<?php echo stripslashes($team->name);?>" title="<?php echo stripslashes($team->name);?>" border="1" /> ....i just see no referance made anywhere for the params to the image... trey Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1193808 Share on other sites More sharing options...
treybraid Posted March 29, 2011 Author Share Posted March 29, 2011 hey i just added this to the params $params = &JComponentHelper::getParams('com_gridiron'); and looked in the html and this almost did it: <tr> <td style="text-align:center; width:20px; height:20px; "><!-- team logo --> <img src="http://localhost/GAFL/images/gridiron/" alt="" title="" border="1" /> <!-- team logo --></td> <td style="text-align:left; width: 200px; font-size: 12px;"><a href="/GAFL/index.php?option=com_gridiron&view=team&id=2">Lakeland Renegades</a></td> <td style="text-align:center; width:20px;">1</td> <td style="text-align:center; width:20px;">0</td> <td style="text-align:center; width:50px;">1.000</b></td> <td style="text-align:center; width:30px;">1</td> <td style="text-align:center; width:30px;">35</td> <td style="text-align:center; width:30px;">17</td> <td style="text-align:center; width:4px;"></td> almost there..... trey Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1193815 Share on other sites More sharing options...
techdude Posted March 29, 2011 Share Posted March 29, 2011 Great! now all you need to do is figure out the $team->logo portion. That info should be stored and retrieved in the same manner as $team->name. Could it be that (looking back at your first post) you meant $stats->name, $stats->logo? Try to add the logo value to the $obj-><whatever> = $team-><whatever> section, then access the info using $stats. -- techdude Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1193831 Share on other sites More sharing options...
treybraid Posted March 29, 2011 Author Share Posted March 29, 2011 why wouldint i add this: and why does it blow out the page when i do add it.... <?php if ($this->params->get('team_logo') == 1 && $this->team->logo) { ?> <img src="<?php echo JURI::base() . $params->get('images_path') . $team->logo;?>" alt="<?php echo stripslashes($team->name);?>" title="<?php echo stripslashes($team->name);?>" border="1" /> <?php } ?> im completely stumped now...lol trey Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1193843 Share on other sites More sharing options...
techdude Posted March 29, 2011 Share Posted March 29, 2011 $this referrs to the JDocumentHTML Object. The page probably does not have error reporting turned on, so you will not see anything but a blank screen when there is an error. Try adding the code <?php error_reporting(E_ALL | E_STRICT); ini_set('display_errors', '1');?> to the top of the page. That way, you will be able to see the errors. --techdude Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/#findComment-1193847 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.