Jump to content

Recommended Posts

can you give us your mysql table of the click counter..

 

or, atleast describe your method for counting the clicks

 

either way

 

the method of returning the "Most Viewed" image.. would be simple if in mysql

 

 

SELECT `image_src`,`image_id` FROM `images` ORDER BY `image_clicks` DESC LIMIT 1

I should have added that I'm a total newb when it comes to php.  I downloaded something called "ccount" and am using that as a click counter.  I couldn't figure it out via MySQL.

 

Do you think you could walk me through it using MySQL?

 

My site is www.designsbybarlow.com if that helps.

ok.. create a landing page for all of the images.. then echo the content of the image inside the php file..

 

example

 

image.php?file=whatever.jpg

 

then inside of image.php

 

do something like

 

<?php

  $file = "images/".$_GET['file'];

  // here record it as a click for $file in mysql

  $e = getimagesize($file);

  header("content-type: {$e['mime']}");

  readfile($file);

?>

omg...

this request need more than 1 script.. u need 2 script to have what u need

 

in global..

1. u need 2 table

a. table contain image => build yourself but have picid

b. table named pic_counter=> contain picid & picclick

 

this pic/image table must seperated.. don't ever try to put together.. and DON't make same mistake like i do

*and don't ask what is it.. that's something related to corrupt table

 

2. let's say when you want to see 1 image.. he/she must click mypic.php?id=1 plz add time after id. reason.. to avoid someone steal ur image and put on his/her site; to expire your image. you image today have expire until ... (put on time).. without time.. he will show blank img

 

3. inside mypic.php contain 3 modules.. more the better

 

a. view if the time already expire or not

 

b. if everything goes wrong.. show bad img.. but if not.. query table pic_counter to add 1

 

c. show the image

 

sry.. i was work here.. and there a lot user need my/our help

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.