<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1026872" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1026872</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/image-link-counter#comment-1161184</link>
    <description> &lt;p&gt;Thanks Busy,&lt;br /&gt;
I will give that a shot and see how it works, thanks for all your time.&lt;/p&gt;
 </description>
     <pubDate>Sun, 07 Nov 2004 18:57:06 +0000</pubDate>
 <dc:creator>Lamur</dc:creator>
 <guid isPermaLink="false">comment 1161184 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/image-link-counter#comment-1161172</link>
    <description> &lt;p&gt;You haven&#039;t given much details on your set up or methods but the following can be added to.&lt;/p&gt;
&lt;p&gt;You could set up your main database and have imageid (auto increment), image name, description, caption, views, votes ... whatever you want. If you want the works it may be better to seperate the view, votes and possibly the caption (whatever is called without seeing the big image) into another row.&lt;/p&gt;
&lt;p&gt;CREATE TABLE imagelog (&lt;br /&gt;
  imageid int(5) NOT NULL auto_increment,&lt;br /&gt;
  imagename varchar(25) NOT NULL,&lt;br /&gt;
  views int(5) NOT NULL default &#039;0&#039;,&lt;br /&gt;
  caption varchar(50) NOT NULL,&lt;br /&gt;
  PRIMARY KEY  (imageid),&lt;br /&gt;
  UNIQUE KEY pid (imageid),&lt;br /&gt;
  KEY imageid_2 (imageid)&lt;br /&gt;
) TYPE=MyISAM;&lt;/p&gt;
&lt;p&gt;the numbers in brackets can be changed to whatever, int = number and 5 would allow up to 99999, varchar = text and numbers, well everything really and 50 equals 50 total characters (including spaces) example: it&#039;s my sentence&lt;br /&gt;
16 long but it starts at 0 . the 25 limit for image name may not be enough, if say you input a name which is 26 characters long you will cut off the end, then when you go to display the image it will only have a .jp (or whatever) extension, so depending how you name your images as to how you determine the length. Some people get carried away, like picture_of_missy_the_cat_chasing_a_shadow_20th_feb_1902.jpg&lt;/p&gt;
&lt;p&gt;so every time you add an image name, the imageid will increment one (automatically) and you can id the images via this id name.&lt;br /&gt;
The above has not been tested - I just wrote it off top of my head - looks right.&lt;br /&gt;
Don&#039;t include the images diminsions (width and height) into the databse, you can use PHP&#039;s getimagesize() function to get that for you when you display the image, also, hopefullly the thumb and main images have the same name, but with thumbnail having a t_ or something infront, if so only add the main images name, you can add the thumbnail extension when you display it (make sure the t_ is infront of the name, not after like bigpic_t.jpg or you&#039;ll be making work for yourself splitting the name etc&lt;/p&gt;
&lt;p&gt;If you are a complete novice at PHP/mySQL you could take a look over at hotscripts.com for a ready made script or get your hands dirty and do it yourself.&lt;br /&gt;
It&#039;s not hard but without knowing details it&#039;s like asking how long is a bit of string - the options are endless&lt;/p&gt;
 </description>
     <pubDate>Sun, 07 Nov 2004 10:43:39 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1161172 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/image-link-counter#comment-1161171</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;Busy wrote:&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;If you are drawing the image name from the database, this is even easier as you already have a unquie id, if you aren&#039;t then you will have to add a id to the url or something.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;So how would I draw the image from the database, say MySQL, and assign a Unique ID to each image? I am fairly new to this, I appologize.&lt;/p&gt;
 </description>
     <pubDate>Sun, 07 Nov 2004 06:15:28 +0000</pubDate>
 <dc:creator>Lamur</dc:creator>
 <guid isPermaLink="false">comment 1161171 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/image-link-counter#comment-1161012</link>
    <description> &lt;p&gt;offer the linked thumbnails (with counter underneath), on the image page (viewing full image) add one to the database value (of course each image has an id of some sort)&lt;/p&gt;
&lt;p&gt;this counter is displayed on the thumbnail page, just set database so default is 0&lt;/p&gt;
&lt;p&gt;This way even if they did go directly to the image it would still count the hit, as long as the page was opened it will count it.&lt;/p&gt;
&lt;p&gt;If you are drawing the image name from the database, this is even easier as you already have a unquie id, if you aren&#039;t then you will have to add a id to the url or something.&lt;/p&gt;
 </description>
     <pubDate>Tue, 02 Nov 2004 09:51:45 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1161012 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/image-link-counter#comment-1161007</link>
    <description> &lt;p&gt;Well, one way I can think of is to use a redirect page, which works something similar to this:&lt;/p&gt;
&lt;p&gt;1, user clicks on image&lt;br /&gt;
2, user goes to a page for a second which runs a PHP program to update the number of image views then gets redirected to the actual image.&lt;/p&gt;
&lt;p&gt;of course, once a user has the actual url of the image... whats to stop them from giving it to a friend to have a look at? wouldn&#039;t that mess up the counter and give &quot;false&quot; results?&lt;/p&gt;
 </description>
     <pubDate>Tue, 02 Nov 2004 05:05:52 +0000</pubDate>
 <dc:creator>Renegade</dc:creator>
 <guid isPermaLink="false">comment 1161007 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
