Not sure if this would fall here or Webmasters so I apologize in advance.
Currently I have an image viewer written in PHP that uses a rewrite to change:
http://example.com/image/s8d8s.png to http://example.com/s8d8s
When they load this viewer it will display the image with all kinds of links and stats for the image. It also connects to my MySQL database and adds a view to the stats table. So that I can show how many views each image has.
The issue: When a use right-clicks on an image in the viewer and gets the image's direct link(http://example.com/image/s8d8s.png) and uses that by sending it to a friend or embedding it on a website, I want to be able to track that and add a view to my database.
Is there a way I can manipulate the apache rewrite to trick a browser into thinking it's viewing a image direct link but it be a PHP file that will add a view?
Related
I am getting the image links where my image is there by using reverse image search provided by google but now we want the exact path of that page where my particular image is situated like http://www.indiamart.com/lelijiye-bengaluru/maroon-color-desginer-saree.html page
Direct linking is the use of a particular image or multimedia file on another website by linking directly to it on another web host's server. (I use Photobucket)
For example, if you want to post an image on another forum, a direct linking URL (found on the edit image page) can be used to display that image via the PBase server on another website or forum.
An easy way to find the direct linking URL for your images is to go to the edit image page and see the 'direct linking URL' at the top right of the screen.
does anyone have an idea on how I could capture the image id when a user clicks the next / previous button in Fancybox? I like how Fancybox changes depending on the size of the image so I prefer to use this over some of the other galleries that I have seen. Has anyone successfully done this? The site is in PHP.
The general idea would be to "proxy" your images by a PHP script.
This script would:
add 1 to the view count of the image
serves the image to the browser (instead of serving an HTML page as usual)
You would then update the src attribute of your pictures img tag :
<img src="mypicture.png"/>
would become
<img src="view_picture.php?picture=1"/>
Note that you must be careful and not authorize a filename in the picture parameter and/or carrefully check that the user is not trying to see a file that you don't want to show him (think view_picture.php?picture=../.htpasswd )
Consider using a general website analytics software, like Piwik. This will give you additional insights on you visitors and their actions on your site, rather than a simple image view counter.
I am running a site that uses Fancybox and Piwik, all image views through Fancybox will automatically show up in the Downloads section of Piwik reports without any additional configuration.
But you could easily customize this through Fancybox's onComplete callback and Piwik's trackPageView(). See Piwik Javascript API and Fancybox API for details.
How could I use imagegrabscreen to get a thumbnail image and a full size image of a specific website.
I was thinking that I could have an array that I feed the wanted uri's into but I am a bit stuck on how I would set the wxh of the image I need to grab. I also think that I would need a thumbnail class and a fullimage class and call them when required.
Any better Ideas?
Keep in mind that imagaegrabscreen is Windows-only. If you have multiple displays set up, this function will only grab the primary display. Also, for this to work, your Apache service must be set to Allow service to interact with desktop otherwise you will just get a blank image.
This discussion covers the use of imagegrabscreen pretty well: Getting imagegrabscreen to work
There are a lot of other discussions about saving webpages as images, too - here are a few:
Website screenshots
Web Page Screenshots with PHP?
How can I generate a screenshot of a webpage using a server-side script?
PHP: How to capture browser window screen with php?
What is the best way to create a web page thumbnail?
Screenshot of current page using PHP
shell tool which renders web site including javascript
In any languages, Can I capture a webpage and save it image file? (no install, no activeX)
I need help writing javascript (jquery?) for a web app to save a set of images to an IndexedDB and then load them into an html page.
I have two html pages, img.html that is just a listing of images in this format:
'image-id','base64-image'
and index.html, my main page that includes a series of image tags in this format:
<img name="imglist" id="image-id" img-src="">
I'd like the user to be able to click a button to load all of the images from img.html into IndexedDB and then click another button to read the images from IndexedDB and insert them into the appropriate image tag in index.html (the 'image-id' in img.html corresponds to the appropriate img tag id in index.html).
Also, is it possible to set a cookie (or some other method) that will cause the DB to be erased after a certain time period? I'd like to be able to force the user to re-load the images from the server about once a week.
I'm not great with javascript or indexeddb, so any help or examples would be great.
See the article titled Storing images and files in IndexedDB.
N.B. I just posted a similar question here, though it concerns the particular case of a cross-site request. If your requests are on the same site, the link above should be a perfect example for you to work by.
My app is posting to users' Facebook walls, and linking to a page they have created. The page is in html. I'd like to be able to put a thumbnail of the page as the image on the wall post. I'm not sure whether this is possible or not. Anyone have any ideas?
If it helps, the page itself is stored as a series of 'elements'... for each one, I know the size and position of the element, and the content (which may be text or an image). So I can pull all that in from the database.
I guess it would be sufficient to create a thumbnail using php at the point when the user clicks 'Publish This to my wall', if that's easier than doing it on the fly - I can save the image and then link to it.
Any ideas?
I create thumbnails for my site using CutyCapt, which works very well indeed on both Windows and Linux. You can use exec to invoke this from php.
There are also web services that allow you a quota of free thumbnail snapshots, that are easy to integrate into your website. e.g.
http://www.websnapr.com/
or
http://webthumb.bluga.net/home
I figured out how to do this. I used the PHP gd library, which allows you to create a base image and then add images and text. Works pretty well.