treybraid Posted March 29, 2011 Author Share Posted March 29, 2011 ive done already with the errors... i just don't know what else to put to pull the team logo... trey Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1193857 Share on other sites More sharing options...
techdude Posted March 29, 2011 Share Posted March 29, 2011 Where do you have the team logo stored? do you enter it in params when you build a module? is it in a database? where are the teams stored, and where are the stats stored? -- techdude Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1193889 Share on other sites More sharing options...
treybraid Posted March 30, 2011 Author Share Posted March 30, 2011 the team logos are uploaded and are placed in this folder: images/gridiron folder.... the issue is grabbing the logos and matching them up with the team name which is sorted off of their win-loss record... if your familiar with joomla ill be happy to forward you the file's to take a look at locally on your computer... thanks trey Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1193954 Share on other sites More sharing options...
techdude Posted March 30, 2011 Share Posted March 30, 2011 Ok, I installed the two mods and the the component. Here is a list of errors that I received when trying to access them in the components -> gridiron section. The E_STRICT errors may be ignored, but they could point to the problem that you are having, so I recommend that you at least read them: gridiron: Strict Standards: Declaration of GridironController::display() should be compatible with that of JController::display() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 17 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 22 Fatal error: Call to a member function getUserStateFromRequest() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\models\leagues.php on line 26 leagues-a-divisions: Strict Standards: Declaration of GridironController::display() should be compatible with that of JController::display() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 17 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 22 Fatal error: Call to a member function getUserStateFromRequest() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\models\leagues.php on line 26 seasons: Strict Standards: Declaration of GridironController::display() should be compatible with that of JController::display() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 17 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 22 Fatal error: Call to a member function getUserStateFromRequest() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\models\seasons.php on line 25 Teams: Strict Standards: Declaration of GridironController::display() should be compatible with that of JController::display() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 17 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 22 Notice: Use of undefined constant nul - assumed 'nul' in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\libraries\joomla\application\component\model.php on line 170 Fatal error: Call to a member function getUserStateFromRequest() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\models\teams.php on line 27 Schedules: Strict Standards: Declaration of GridironController::display() should be compatible with that of JController::display() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 17 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 22 Fatal error: Call to a member function getUserStateFromRequest() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\models\schedules.php on line 27 players Strict Standards: Declaration of GridironController::display() should be compatible with that of JController::display() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 17 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 22 Fatal error: Call to a member function getUserStateFromRequest() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\models\players.php on line 25 Game Results: Strict Standards: Declaration of GridironController::display() should be compatible with that of JController::display() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 17 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 22 Fatal error: Call to a member function getUserStateFromRequest() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\models\boxscores.php on line 26 Fields: Strict Standards: Declaration of GridironController::display() should be compatible with that of JController::display() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 17 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 22 Fatal error: Call to a member function getUserStateFromRequest() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\models\locations.php on line 25 Game Types: Strict Standards: Declaration of GridironController::display() should be compatible with that of JController::display() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 17 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 22 Fatal error: Call to a member function getUserStateFromRequest() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\models\gametypes.php on line 25 About (much better) Strict Standards: Declaration of GridironController::display() should be compatible with that of JController::display() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 17 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\admin.gridiron.php on line 18 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 22 Strict Standards: Only variables should be assigned by reference in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\joomla\administrator\components\com_gridiron\controller.php on line 23 About Fastball Productions Baseball Management and Reporting Version 1.5 [PICTURE] Please visit our site for more information: http://www.fastballproductions.com All rights reserved. You may not distribute or sell this component, or use it or its modules, or any part of its program code, on more than a single licensed domain. Whew! Just so you know, I am running PHP 5.3.5, with MySQL 5.0.7 and Joomla 1.6.1 (I like to keep it up to date.) If you can fix some of the bugs, I will be able to help, but as it stands, I can't use any of the components. The error I would look into the most is the "Call to a member function getUserStateFromRequest() on a non-object" errors. The 'nul' constant could be a problem too, but the pass by reference is going to need some help in the near future if your want your mod to last when php 6 is released. Post back here for more help. --techdude Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1194448 Share on other sites More sharing options...
treybraid Posted March 30, 2011 Author Share Posted March 30, 2011 it's not joomla 1.6 compatible... probably the issue with all the errors... runs fine on my joomla install of 1.5.22.... actually ive got it running in 1 capacity or another on 3 site's... Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1194449 Share on other sites More sharing options...
techdude Posted March 31, 2011 Share Posted March 31, 2011 Ok, here is the solution I found. First, open the file and add a "<th> </th>" at the top to allow another column for the logo. Then, I added this code where the image should be: <td> <?php $params = &JComponentHelper::getParams('com_gridiron'); $logo = getTeamLogo($stats->id); ?> <img src="<?php echo JURI::base() . $this->params->get('images_path') . $logo;?>" alt="<?php echo $stats->name;?>" title="<?php echo $stats->name;?>" /> </td> That's it! I used the getTeamLogo() function to get the logo (from the functions.php file), and getParams() to get the images_path. You probably would want to move at least the getParams() part to the top of the document so it doen't have to run once for every row. Other than that, the rest is pretty straight forward. Also, just thought I'd complement on the overall design of the modules and components. Have a good day! -- techdude P.S. I like to logo! Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1195020 Share on other sites More sharing options...
techdude Posted March 31, 2011 Share Posted March 31, 2011 Please Note: The night before I found the solution, treybraid and I had the following chat. I figured I should add it here for the record. 3:35 PM me: Hello, how is the joomla coming along? trey.braid: hey 3:36 PM any luck with the logos 3:37 PM me: I installed the modules on my dev machine, but it is really buggy. 3:38 PM about the only thing under the Components -> gridiron menu that works is "About". What version of PHP, Joomla, and MySQL do you have? 3:40 PM trey.braid: joomla 1.5.22 its not compatible with 1.6 me: Gotcha! 3:41 PM I'll install 1.5 straight away and get back with you. trey.braid: thanks me: No problem 42 minutes 4:23 PM me: Ok, I installed Joomla 1.5.22. I installed the modules, and the component. I added a fake team. 4:24 PM When I go to index.php?league=1&division=0&team=0&option=com_gridiron, I get a list that says: trey.braid: k me: Leagues Divisions Teams Fake League Standings Division: Major Team W L T Pct GP PF PA Team 1 0 0 0 0.000 0 0 0 This is where the logo should be? 4:25 PM trey.braid: yes to the left of team2 4:26 PM 1 5 minutes 4:31 PM me: Ok. 30 minutes 5:02 PM me: Well, at first look, I see the function getTeamLogo($id) declaration. Could you use that to get the i mage 5:03 PM trey.braid: where did you see thst... what file.... me: In the functions.php trey.braid: should be able to 5:04 PM me: it is in <joomla base>\administrator\components\com_gridiron\helpers trey.braid: thats the one file i didnt look in... 5:05 PM me: Also, look at the team view, as it seems to pull up the logo just fine. http://localhost/joomla15/index.php?view=team&id=1&option=com_gridiron 5:06 PM trey.braid: yea i know... just couldnt pull it in the module.... me: I've gotta go right now. I'll check in later. (tomorrow maybe.) Bye. -- techdude Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1195025 Share on other sites More sharing options...
treybraid Posted March 31, 2011 Author Share Posted March 31, 2011 What would I need to add for this: GDLIB for PHP to resize the images and where would it need to be added... Techdude I have attached the module with the additionals to display the logo... Please let me know... all the logos are sized at 100px and they will be resized in the standings table to 20/20 or 30/30... right now they are very pixelated... Trey [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1195194 Share on other sites More sharing options...
techdude Posted March 31, 2011 Share Posted March 31, 2011 Here is what looks like an excellent class you could use for this purpose. Make sure you have GDLIB enabled on your server! (Hint: phpinfo()) http://www.bitrepository.com/resize-an-image-keeping-its-aspect-ratio-using-php-and-gd.html -- techdude Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1195224 Share on other sites More sharing options...
treybraid Posted March 31, 2011 Author Share Posted March 31, 2011 i wouldnt know where to start? and what to put down to resize from 100 to 25px's..... trey ...is this a single line of script??? Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1195301 Share on other sites More sharing options...
treybraid Posted April 1, 2011 Author Share Posted April 1, 2011 techdude can you help me out real quick on another module--- this one is game results and schedule module... see attached... again trying to pull the logo's... coming from the boxscore folder in the admin.... please let me know if you can help... trey [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1195310 Share on other sites More sharing options...
techdude Posted April 1, 2011 Share Posted April 1, 2011 Similar solution to the last one. Place: <?php $params = &JComponentHelper::getParams('com_gridiron'); ?> at the top of the template file. (php) Then, you can use <img src="<?php echo JURI::base().$params->get('images_path').$row->visitinglogo;?>" alt="" /> where you want the visitor's logo to go, and <img src="<?php echo JURI::base().$params->get('images_path').$row->homelogo; ?>" alt="" /> for the home team logo. Hope that helps! -- techdude Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1195576 Share on other sites More sharing options...
treybraid Posted April 1, 2011 Author Share Posted April 1, 2011 i added that and of course it didnt work.... i did look at the source code and im seeing this... <tr> <td width="20" height="20px"><img src="http://localhost/GAFL/images/gridiron/" alt="" /></td> <td style="font-size: 11.5px;">Miami Blitz</td> <td style="text-align:center;"><a href="/GAFL/index.php?option=com_gridiron&view=boxscore&id=7">3</a> </tr> any ideas what i am missing.... this is what i added to the table: <tr> <td height="20px" colspan="2"><b><u>Games</u></b></td> <td style="text-align:center;"><b><u>Score</u></b></td> </tr> <?php foreach ($pastgames as $past) { ?> <tr> <td width="20" height="20px"><img src="<?php echo JURI::base().$params->get('images_path').$row->visitinglogo;?>" alt="" /></td> <td style="font-size: 11.5px;"><?php echo $past->visitingteam;?></td> <td style="text-align:center;"><?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 width="20" height="20px"><img src="<?php echo JURI::base().$params->get('images_path').$row->homelogo; ?>" alt="" /></td> <td style="font-size: 11.5px;"><?php echo $past->hometeam;?></td> <td style="text-align:center;"><?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> Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1195624 Share on other sites More sharing options...
techdude Posted April 1, 2011 Share Posted April 1, 2011 Try getTeamLogo($past->id); Instead of $row->* You apparently were looking at a different page than I was. Could you tell me what file you edited, and what query string I have to append to my joomla page to view it? -- techdude Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1195629 Share on other sites More sharing options...
treybraid Posted April 1, 2011 Author Share Posted April 1, 2011 not working with that.... the file in the backend- admin>component>gridiron> views>>>> boxscore thanks trey Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1195635 Share on other sites More sharing options...
treybraid Posted April 2, 2011 Author Share Posted April 2, 2011 any idea what im doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1195912 Share on other sites More sharing options...
treybraid Posted April 4, 2011 Author Share Posted April 4, 2011 anyone.... techdude???? Quote Link to comment https://forums.phpfreaks.com/topic/231512-adding-a-logo-with-php-echo/page/2/#findComment-1196655 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.