Hi sorry for my english..
how can I call an image from a mySQL database to a php command..
like this <span class='desc'>$last_visit</span>
THX
call image from a mySQL database
Moderator: General Moderators
ok thxBurrito wrote:when you say 'call an image' you mean the image is stored in the DB (in a blob field or something) or the name of the image is in the db???
your bit of code is a little misleading...there's nothing image related in there?
we need a little more explanation of what you're trying to do to help you.
sorry
I want to show the avatar in the welcome box of Invision Power Board portal (IPDynamic Lite)
the HTML code of the Welcome Box is
Code: Select all
<div class='tableborder'>
<div class='maintitle'><{CAT_IMG}> {ibf.lang.wbox_welcome}, $name</div>
<div class='tablepad'>
<span class='desc'>$last_visit</span>
<br />· <a href="e;{ibf.script_url}act=Search&CODE=getnew"e; style='text-decoration:none'>{ibf.lang.wbox_getnewposts}</a>
<br />· <a href="e;{ibf.script_url}act=UserCP"e; style='text-decoration:none'>{ibf.lang.wbox_mycontrols}</a>
<br />· <a href="e;javascript:buddy_pop();"e; style='text-decoration:none'>{ibf.lang.wbox_myassistant}</a>
<br />· <a href="e;{ibf.script_url}act=Login&CODE=03&return=$return"e; style='text-decoration:none'>{ibf.lang.wbox_logout}</a>
</div>
</div>
<br />
<div class='tableborder'>
<div class='maintitle'><{CAT_IMG}> <a href='{ibf.script_url}&act=Msg'>{ibf.lang.pm_title}</a></div>
<div class='tablepad'><span class='desc'>$pm_string</span></div>
</div>in the PHP file from user profile there's
Code: Select all
$this->output .= $this->html->avatar_main( array (
'MEMBER' => $this->member,
'avatar_galleries' => $av_gals,
'current_url_avatar' => $url_avatar,
'current_avatar_image' => $my_avatar,
'current_avatar_type' => $ibforums->langї'av_t_'.$avatar_type],
'current_avatar_dims' => $this->memberї'avatar_size'] == "e;x"e; ? "e;"e; : $this->memberї'avatar_size'],
) , $formextra, $hidden_field, $this->md5_check );but I don't know why...
THX
from the looks of the code you posted the top part looks to be a "template" file of some sort. Most templates of that kind will not let you "inject" php directly into them. My guess is that there is some variable set somewhere that you can call by {avatar} or some such and place it wherever you want on that page.
it also looks to be storing the url of the avatar in the database and not the file itself (this is a good thing).
my suggestion: find where those vars are being set ({ibf.script_url}, {CAT_IMG} etc) and see if you can locate one for the avatar then place that in your template file...would probably be worth trying {current_url_avatar} and {url_avatar} since those are already "oulined" on the other page...
it also looks to be storing the url of the avatar in the database and not the file itself (this is a good thing).
my suggestion: find where those vars are being set ({ibf.script_url}, {CAT_IMG} etc) and see if you can locate one for the avatar then place that in your template file...would probably be worth trying {current_url_avatar} and {url_avatar} since those are already "oulined" on the other page...
I would try this:
Code: Select all
<img src="e;{ibf_members.avatar}"e; />