Add image to an echo calling

  • Dan030981
  • Novice
  • Novice
  • User avatar
  • Joined: Oct 16, 2011
  • Posts: 18
  • Loc: Mass
  • Status: Offline

Post November 27th, 2011, 4:35 am

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 27th, 2011, 4:35 am

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8925
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post November 27th, 2011, 11:12 am

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?
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Dan030981
  • Novice
  • Novice
  • User avatar
  • Joined: Oct 16, 2011
  • Posts: 18
  • Loc: Mass
  • Status: Offline

Post November 27th, 2011, 12:08 pm

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
  • Joined: Dec 20, 2002
  • Posts: 8925
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post November 27th, 2011, 12:18 pm

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?
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Dan030981
  • Novice
  • Novice
  • User avatar
  • Joined: Oct 16, 2011
  • Posts: 18
  • Loc: Mass
  • Status: Offline

Post November 27th, 2011, 12:30 pm

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
  • Joined: Dec 20, 2002
  • Posts: 8925
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post November 27th, 2011, 2:45 pm

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.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Dan030981
  • Novice
  • Novice
  • User avatar
  • Joined: Oct 16, 2011
  • Posts: 18
  • Loc: Mass
  • Status: Offline

Post November 30th, 2011, 6:07 am

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 268 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
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.