ZendFramework images not loading - zend-framework

I have a site I am developing in the ZendFramework and I have two social image pictures on the homepage. When I first load the page the images aren't there, however if I then click a link the images appear if I then click another link further into the site they disappear again, the images are in a div in the layout file they should be there all the time everything else in the layout file is apart from these.. I have been struggling on an issue of trying to echo image paths from a database in the src property of the tag and couldn't get it to work then I realized this was happening and I am assuming it has something to do with the social images problem as the page where I want the database images to appear doesn't have the social links either..
Sorry for the rant I just don't really know how to explain the problem, hope it comes across ok, if you need any more information on this matter don't hesitate to ask!
Thanks in advance!
Rik

When you echo the path to the image for the src attribute of the image tag, you should be using the baseUrl helper so the path is always absolute and references your base URL.
For example, you would call <?php echo $this->baseUrl('images/test.png') ?> and that will result in something like /zendapp/public/images or /images.
I suspect what is happening is the image tag looks something like this: <img src="images/thepic.png" />. You should make sure all images, CSS, Javascript references etc all use absolute paths like /images and avoid ../images, ./images, or images and the like.
Hope that helps.

If don't wont use native view helper function $this->baseUrl(). Just add slash before image url <img src="/images/thepic.png" alt="Some description" width="" heigth="" />

Related

typo3 FE image links with securedl

We recently moved a working installation of our typo3 website to another server and now some images are displayed wrong. They are being resized (displayed smaller than they actually are) and the anchor tag has this source:
src="/index.php?eID=tx_nawsecuredl&u=0&g=0&t=138......b&file=fileadmin/templates/../images/clear.gif"
As you can see, we use the naw_securedl extension. When I remove everything of the link until fileadmin (/index.php?eID=tx_nawsecuredl&u=0&g=0&t=138......b&file=) the image works, but of course this is not the sense of securedl.
Does anyone know a solution for this? I tried to figure out that is could be the setting "linkFormat" which is currently set to
/index.php?eID=tx_nawsecuredl&u=###FEUSER###&g=###FEGROUPS###&t=###TIMEOUT###&hash=###HASH###&file=###FILE###
and I updated the .htaccess file but it doesn't change anything...
Any help is appreciated. Thanks!

how to display image( as image path ) from database in play framework

i know how to display images in view page on static,
but i am really confused about, display image in view page by image path from database..
the image path is saved in the database using the input type=file is uses and the image name and path save to database.. and how to display that in the view page when call the image path
i don'nt know how to do this..
any one know the answer please share here..
with reguards... prasanth..
Assuming your image is saved in public/images/ and the path saved in your database is images/image.jpg, you can simply pass the path to your view and use the router to resolve the image:
#(path : String)
<img src="#routes.Assets.at(path)" />
In the end this will give you the following HTML:
<img src="/assets/images/image.jpg" />
(you can verify this by looking at the source code of the generated HTML page, ctrl - u in Firefox)
The assets folder is where Play puts all the images from the public/images directory.

jQuery Mobile sprites not displaying when css included as a local resource in a UIWebView on iPhone

On the iPhone I'm using a UIWebView to display some content that is stored on the device so my content can be viewed on the device when there is no internet connection. I'm using the jQuery and mobile stuff in an attempt to create web apps and mobile apps that use one code base.
When I include:
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />
everything works fine, the sprites that make up the back button, home icon etc. all work fine. When I include the above as a local resource such as:
<link rel="stylesheet" href="jquery.mobile-1.0a4.1.min.css" />
The sprites do not display, I just get a dark circle where the sprite should appear. All the other attributes defined in the css work fine, just not the sprites. If I misname the local resource, everything is messed up, so I know the css as a local resource is being included, but it is being handled differently as a local resource vs a remote resource. It even works if I hit the local dev box running apache... so it must have something to do with how the web server is serving the page vs. including it as a file......
I played around with loading the same page twice with separate UIWebViews in an attempt to see if there is some timing issue... since a local resource would load much quicker than a remote resource. The second instance of the UIWebView loaded it correctly. Is there a $.mobile command I can call to refresh the page, or for the library to do it's magic?
any ideas?
thanks for any help
Question was answered in the jQuery forum. Funny, the answer was related to my comments above, and I still didn't think to look at the image files! palm2forehead
had to go in the jquery mobile css file and remove the references to the "images" directory. IOS doesn't handle directories like normal systems so once I did that all was ok.
It did not solve my issue chaning the path.
I had to look up in the mobile.css, i found that the icon were first set with an image, an then moved with classes, i had to set the the full background property on the classes that moved the background image.
Like so:
.ui-icon-plus {
background:#9c9c9c url(icons-18-white.png) no-repeat 0 50%; }
Old way were:
.ui-icon-plus {
background-position:-0 50%;}
Put everything (js,css) to www folder along with index.html file, and include file like this <script src="jquery-mobile-min.js">`, it has solved my problem.

Using HTML pages in UIWebView, strange issues with relative page images but links work

So I'm creating an app which basically is a UIWebView that loads an HTML page, which should have images on it. The HTML page is loading fine (confirmed with a little text on the page), but then I have this code in it:
<img src="images/image_1.png">
test
Check this out:
The tag has a broken image link
But, when I tap on the link, the
image loads!
How is this happening? What kind of solution is there?
I have the images in a subfolder of resources, which I added by "Create Folder References."
Help? A note: This is on iPad, using 4.2. But that shouldn't matter, right Apple? (Also, changing it to xml <img /> type tag doesn't do anything)
The image was way too big - over 2500px wide. Resizing to 1024px fixed it. Thanks Jose Vega.
Also, Automator is a gift from the Gods when it comes to batch operations.

iphone webview show html with images and css file

I found some interesting URL http://cubiq.org/rotating-wheel-for-your-iphone-webapps which has rotational menu. Its good. It has html file along with images, css files etc.
In iPhone app, I copied (to root folder) all the files and imported to project. I'm using UIWebView's load request to load the html. But I'm not getting the rotatable menu.
Can some one post me the code (or tutorial or prototype or example) on how to use it?
Also let me know how to catch the even on click on "OK" button at the middle of the html.
Thanks in advance.
checkout IUI : http://code.google.com/p/iui/