Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Ability to change number of views a picture has.  (Read 5899 times)

0 Members and 1 Guest are viewing this topic.

pgt96drvr

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 55
Ability to change number of views a picture has.
« on: July 01, 2004, 09:45:22 pm »

Here's the thing..  It may sound useless, but I accidentally deleted a person's pic that had an incredible number of views.  The person liked the fact that she was on the front page of the most viewed list, but after the deletion, the view count has gone to Zero.

Is there an easy way to change the number from Zero to like 2000 or so?

Thanks in advance.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Ability to change number of views a picture has.
« Reply #1 on: July 01, 2004, 11:40:29 pm »

Just use your database tool to edit the pics details, change the 'hits' column to what you want.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

pgt96drvr

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 55
Re: Ability to change number of views a picture has.
« Reply #2 on: July 02, 2004, 07:23:29 pm »

Ok, I am using phpMyAdmin.  Which table will I find the "pic details".   :-\\
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Ability to change number of views a picture has.
« Reply #3 on: July 02, 2004, 08:58:10 pm »

How about trying the 'pictures' table  ::)
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

pgt96drvr

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 55
Re: Ability to change number of views a picture has.
« Reply #4 on: July 03, 2004, 05:21:38 pm »



Ok, so I open up the picture table and I see this...

 
Field  Type Attributes Null Default Extra Action
   id  int(4)   No    auto_increment             
   del  int(11)   Yes  NULL               
   pictures_siteid  varchar(6)   Yes  NULL               
   bin_data  longblob BINARY Yes  NULL               
   filename  varchar(50)   Yes  NULL               
   filesize  varchar(50)   Yes  NULL               
   filetype  varchar(50)   Yes  NULL               
   imagew  varchar(10)   Yes  NULL               
   imageh  varchar(10)   Yes  NULL               
   main  int(11)   Yes  0               
 Check All  /  Uncheck All     With selected:       
 

I have had very little experience with tables before putting your awesome program on my site...   where do I go from here to change the "hits" ?
Logged

GGallery

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 61
Re: Ability to change number of views a picture has.
« Reply #5 on: July 03, 2004, 07:02:42 pm »

this doesnt look like coppermine  (unless it's heavily modified).

go to your favorite searchengine, type in 'mysql' and read through their documentation.
If you're hosting other people's stuff you have a certain responsibility and should first learn how to take care of their data before taking on such a task!
Logged

pgt96drvr

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 55
Re: Ability to change number of views a picture has.
« Reply #6 on: July 03, 2004, 07:42:05 pm »

First of all.. reading through mysql documentation.. how is that going to tell me where I can change the number of "hits" in the picture table? 

Secondly.. that data that you says looks like it can't be from coppermine...  That is the data that I took from the phpMyAdmin program of the picture table..  if you were to read the above posts correctly, you would know that.

Thridly..  You say that if I am hosting their data, i should learn to take care of it before taking on such a task.  I am asking a queston on how to change the number of views a person has.  This has nothing to do with properly managing the site.  It has nothing to do with me not knowing how or not being responsible with their data.

Please don't respond to the thread if you are not going to help out someone. Casper was doing just fine trying to help out a person that can't locate a field inside of a table... 

By the way, thanks for the warm welcome into your community GGallery - with such a helpful and kind reply to one of my only threads.  Your generosity and gentleman-like personality shines through like a beacon.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Ability to change number of views a picture has.
« Reply #7 on: July 04, 2004, 08:50:42 am »

well, basically GGallery is right: your posting doesn't remotely look like a coppermine pictures table; this is how a "regular" coppermine pictures table structure should look like:
Quote
#
# Table structure for table `cpg_pictures`
#

CREATE TABLE cpg_pictures (
  pid int(11) NOT NULL auto_increment,
  aid int(11) NOT NULL default '0',
  filepath varchar(255) NOT NULL default '',
  filename varchar(255) NOT NULL default '',
  filesize int(11) NOT NULL default '0',
  total_filesize int(11) NOT NULL default '0',
  pwidth smallint(6) NOT NULL default '0',
  pheight smallint(6) NOT NULL default '0',
  hits int(10) NOT NULL default '0',
  mtime timestamp(14) NOT NULL,
  ctime int(11) NOT NULL default '0',
  owner_id int(11) NOT NULL default '0',
  owner_name varchar(40) NOT NULL default '',
  pic_rating int(11) NOT NULL default '0',
  votes int(11) NOT NULL default '0',
  title varchar(255) NOT NULL default '',
  caption text NOT NULL,
  keywords varchar(255) NOT NULL default '',
  approved enum('YES','NO') NOT NULL default 'NO',
  user1 varchar(255) NOT NULL default '',
  user2 varchar(255) NOT NULL default '',
  user3 varchar(255) NOT NULL default '',
  user4 varchar(255) NOT NULL default '',
  url_prefix tinyint(4) NOT NULL default '0',
  randpos int(11) NOT NULL default '0',
  pic_raw_ip tinytext,
  pic_hdr_ip tinytext,
  PRIMARY KEY  (pid),
  KEY pic_hits (hits),
  KEY pic_rate (pic_rating),
  KEY aid_approved (aid,approved),
  KEY randpos (randpos),
  KEY pic_aid (aid),
  FULLTEXT KEY search (title,caption,keywords,filename)
) TYPE=MyISAM;
GauGau
Logged

pgt96drvr

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 55
Re: Ability to change number of views a picture has.
« Reply #8 on: July 04, 2004, 07:03:56 pm »

GauGau - you did it again.. thanks for your help...   Casper said earlier that i change the number of hits in "the 'pictures' table"...  well after looking at your post I saw that it was the wrong table...  I looked in cpg11d_pictures, and there it was.... (apparently there is a "pictures" table and also a cpg11_pictures" table) I was spending too much time in the wrong table.

Thanks for your help.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Ability to change number of views a picture has.
« Reply #9 on: July 04, 2004, 07:18:36 pm »

That other 'pictures' table has nothing to do with coppermine.  Perhaps you use another app that allows image uploads.

But obviously, I would be expecting you to realise I meant the coppermine related table.  ;)
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

pgt96drvr

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 55
Re: Ability to change number of views a picture has.
« Reply #10 on: July 07, 2004, 04:17:11 am »

Obviously, I would not have posted the table contents of "pictures" if I didn't think that had something to do with coppermine.   ::)



Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Ability to change number of views a picture has.
« Reply #11 on: July 07, 2004, 05:54:05 am »

[off topic]
you're recommended to keep track of all tables in your database and what application uses the tables. To find out what application actually uses the "pictures" table on your page, just rename it and check your site - the page that crashes needs the "pictures" table (of course there are more elegant ways to do this).
[/off topic]

GauGau
Logged

GGallery

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 61
Re: Ability to change number of views a picture has.
« Reply #12 on: July 08, 2004, 08:04:53 am »

Quote
the page that crashes needs the "pictures" table (of course there are more elegant ways to do this)
LOL - simply ingenious! LOL
Logged

smegf0rbrains

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Ability to change number of views a picture has.
« Reply #13 on: August 31, 2004, 02:20:48 pm »

i know this is gunna sound stupid, but what is my database tool?

i'd like to do the same as described above but where do i find the right table? i'm quite sure that my database is on a seperate server to my photogallery.

thanks in advance for any help
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Ability to change number of views a picture has.
« Reply #14 on: September 01, 2004, 07:32:03 am »

Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 21 queries.