i am using image cache for my banner image in newsletter.Am uploading and sending the image to mail. The problem is that the image is not loading for the first time. If i again come and edit the page it will send a mail with proper image
$output = "
<html>
<body>";
$output.= theme( 'imagecache', 'banner_img', 'images/motel_wright-1.1.png', 'Wright Motel', 'Wright Motel' );
$output.= "
</body>
</html>";
print $output;
Please help me
I have had similar problems. Few suggestions:
1) As you are using the theme function you might need to rebuild the registry. Try
http://api.drupal.org/api/drupal/includes!theme.inc/function/drupal_theme_rebuild/7
2) If the above fails you will need to use xdebug and find out which function in drupal was not triggered in the first place.
Do post your finding here.
Related
I am adding image on existing pdf overlay on one box.
here is my code
$sign .= '<img style="height:'.$coordinates_eqv[4].'px;width:'.$coordinates_eqv[3].'px;margin-left:'.$coordinates_eqv[1].'px;margin-top:'.$coordinates_eqv[2].'px;position:relative;z-index:99" src="'.$sign_attach.'">';
$pdf->WriteHTML($sign);
$pdf->UseTemplate($import_page);
$pdf->Output($output_file,'I');
But the issue is when pdf creates my images goes hide behind the content it doesn't appear on box it goes hide behind the box.
Please help me out from this issue
Thanx in advanced
I solved the issue by adding one div and gave it to z-index.
$sign .= '<div style="position:absolute;z-index:99"><img style="height:'.$coordinates_eqv[4].'px;width:'.$coordinates_eqv[3].'px;margin-left:'.$coordinates_eqv[1].'px;margin-top:'.$coordinates_eqv[2].'px;" src="'.$sign_attach.'"></div>';
Happy coding
I am trying to send an email with one image sitting over the top of a background image, I can get it to work if I do this
$message .= "<tr><td background='https://path-to-background/image.jpg'><img src=https://path-to-image/" . $file. " ></td></tr>";
But the background image repeats
If I inline style it it doesnt work at all like this
$message .= "<tr><td><img src=https://path-to-dir/" . $file. " style='background-image: url('https://path-to-background/image.jpg'); background-repeat: no-repeat;'></td></tr>";
I know it may have something to do with " and ' but Ive tried everything and cant get the dam thing to work,
Any help as always is much appreciated
Thanks
Try moving the style property to the <td> tag.
Example:
$message .= "<tr><td background="path to background" style=\"background: url('path to background') no-repeat;\">Content</td></tr>";
Bear in mind that how emails are displayed on different devices will vary. I would recommend using a tool such as litmus to help with getting email templates where you need them.
Please post the entire code, as it may not be only the message body
thats causing problems.
Are you using php mail() or another library?
Did you set your header correctly to show HTML?
You might want to try your HTML code in the browser to make sure it works, before debugging the email (background image repeats sounds like a html/css error?).
Most Email programs do not show HTML correctly. Another argument for testing HTML first. You'll most likely need to inline css, there are a bunch of free tools if you google css inliner, that add the styles as inline.
I'm completely new to PHP and I'm writing a page which displays some images from my hard drive.
I've tried different syntaxes and none of them worked out for me ...
I've tested
echo '<img src="/var/www/netbeans/PhpProject2/Plate.jpg" alt ="Test" />';
and It didn't show anything for me .... I've tested this code Also and it didn't worked for me too, I've attached My monitor screen page below. as you can see it seems that my images are not found. I've pasted every address of my images in my browser separately and I was able to see them but when I add them in src argument of img function I'm not able to see them!
What do you think might be the source of problem .... I need to work on a project which needs to be fast enough in working with images.. what do you think I should use ? is "
Try to remove the /var/www. Path should be the http path not the file physical path.
echo '<img src="/netbeans/PhpProject2/Plate.jpg" alt ="Test" />';
I am testing phplist and tried to send campaign.
In start campaign, I added html code in compose message
It was broken especially these tags
<table> <div> <tr> <strike>
The test mail shows in the top "e>" and  , iv> r> and
some "text" as "t ext" and then all images normally. Some
<a href> on <img> are also not working.
After lot of trying I sent one blank message which also had e> printed in email body.
Can anyone help me pointing out where this header part is?
Why html is broken? Please help
Ok...
I added this in config.php and everything works fine
Thanks for the help friends...
define("HTMLEMAIL_ENCODING","8bit");
I believe it's related to your PHP version, login to your host cpanel and try a different PHP version. (I.E. from 5.2 to 5.3)
I'm using cakephp 2 and I'm trying to allow my users to upload an image which is then used as the background for their page.
I have the images uploading fine and saving to a (webroot)files/User/$userid/$bodybgimage. I've also got the name of the image in the database.
Trouble is I want because I don't know in advance what user id is going to be requesting their background image I can't put their background in the stylesheet, so I'm trying to get it added in the default layout. I've tried to add with jquery: (the image filename is in $bodybgimage)
<?php if(!$bodybgimage == '') {?>
$('body').css('background-image', 'url('<?php echo '../files/User/'.$userId.'/'.$bodybgimage; ?>')');
<?php }?>
But this seems to just remove everystyle I had for the body!
I also tried doing adding it straight to the body tag like so:
<body<?php if(!$bodybgimage == '') echo ' style="background-image:url(../files/User/'.$userId.'/'.$bodybgimage.')"';?>>
But again to no avail. Can anyone help me out. I know the image and all's there because if I put the background-image style in the stylesheet the image pops up ok. There must be a sensible way to do this that I'm missing. Plz help!
Please can you try to omit the "../" before the files as i assume that your images founded in a folder named files beside your script not ?