Jump to content

adding a logo with php echo


treybraid

Recommended Posts

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

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.  :P

 

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.