Add image to an echo calling

  • Dan030981
  • Novice
  • Novice
  • User avatar
  • Posts: 23
  • Loc: Mass

Post 3+ Months Ago

I'm heaving some trouble with added a image on the right side of this echo calling. Is there away to work around this?

PHP Code: [ Select ]
if (is_plugin_enabled('vazco_gifts')) {
                echo "<div><a href='" .$vars['url']. "pg/vazco_gifts/edit/" .$_SESSION['user']->username. "'>" .elgg_echo("vazco_gifts:select"). "</a></div>";
        }
  1. if (is_plugin_enabled('vazco_gifts')) {
  2.                 echo "<div><a href='" .$vars['url']. "pg/vazco_gifts/edit/" .$_SESSION['user']->username. "'>" .elgg_echo("vazco_gifts:select"). "</a></div>";
  3.         }
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9086
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Could you explain in more detail? Are you currently receiving some sort of error message? I am not sure what you mean by the "right side". Are you talking on your web page, or in your code? What are you trying to achieve?
  • Dan030981
  • Novice
  • Novice
  • User avatar
  • Posts: 23
  • Loc: Mass

Post 3+ Months Ago

What I'm trying to achieve is once the plugin is activated, an image will appear on the right side of the plugin link.

There is no errors message, just a blank.
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9086
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

In your code above it looks like this:

PHP Code: [ Select ]
elgg_echo("vazco_gifts:select")


May be what is responsible for outputting an image, but I am unsure. What is the purpose of that function, and is it doing its job correctly? Can you post that function?
  • Dan030981
  • Novice
  • Novice
  • User avatar
  • Posts: 23
  • Loc: Mass

Post 3+ Months Ago

The plugin/function is working correctly. The purpose is when the plugin is activated, a link will appear. When the link is clicked on, it will take the user to another page where they can enter certain info.

I would like to put an image on the side of that link that appear when the plugin is active.

I'm just having a really tough time on where or what to put in the echo statement to make the image appear alongside of the link.

Code: [ Select ]
  if (is_plugin_enabled('vazco_gifts')) {
          echo "<div><a href='" .$vars['url']. "pg/vazco_gifts/edit/" .$_SESSION['user']->username. "'>" .elgg_echo("vazco_gifts:select"). "</a></div>";
      }
  1.   if (is_plugin_enabled('vazco_gifts')) {
  2.           echo "<div><a href='" .$vars['url']. "pg/vazco_gifts/edit/" .$_SESSION['user']->username. "'>" .elgg_echo("vazco_gifts:select"). "</a></div>";
  3.       }
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9086
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

So currently the way it is, just a text link shows up. If that is correct then:

PHP Code: [ Select ]
elgg_echo("vazco_gifts:select")


probably just writes out text. I would just try putting the image at the end of the div there. So:

PHP Code: [ Select ]
      if (is_plugin_enabled('vazco_gifts')) {
              echo "<div><a href='" .$vars['url']. "pg/vazco_gifts/edit/" .$_SESSION['user']->username. "'>" .elgg_echo("vazco_gifts:select"). "</a></div><img src='someimage.jpg'>";
          }
  1.       if (is_plugin_enabled('vazco_gifts')) {
  2.               echo "<div><a href='" .$vars['url']. "pg/vazco_gifts/edit/" .$_SESSION['user']->username. "'>" .elgg_echo("vazco_gifts:select"). "</a></div><img src='someimage.jpg'>";
  3.           }


Or possibly wrap that image in divs so you can style it better. Not sure if that helps at all.
  • Dan030981
  • Novice
  • Novice
  • User avatar
  • Posts: 23
  • Loc: Mass

Post 3+ Months Ago

Bigwebmaster,

exactly what I was trying to accomplish, thanks.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 70 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.