Ability to change number of views a picture has. Ability to change number of views a picture has.
 

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]

Main Menu

Ability to change number of views a picture has.

Started by pgt96drvr, July 01, 2004, 09:45:22 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

pgt96drvr

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.

Casper

Just use your database tool to edit the pics details, change the 'hits' column to what you want.
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

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

Casper

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



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" ?

GGallery

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!

pgt96drvr

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.

Joachim Müller

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

pgt96drvr

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.

Casper

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.  ;)
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

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




Joachim Müller

[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

GGallery

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

smegf0rbrains

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

Joachim Müller