Author Topic: Resetting Few things  (Read 4043 times)

0 Members and 1 Guest are viewing this topic.

Offline Fastian

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Resetting Few things
« on: January 19, 2006, 10:14:16 PM »
Hi,

I want to give a whole new start to my 4Images gallery. Basically, I got a new feature from my Host (Host more than one domain)
So I am moving my 4images from my sub domain to a new domain (keeping everything in the same folder just renaming it)

I have 45 categories with 3000 Images.

I want to delete all images & categories and then upload everything. But with current settings, new categories will start from 46 and news images will be from 3001.

What can I do that when I add new categories and images they start from 1. So that it look like a new site.

Kind of resetting  Images & Categories Table from database. (Without any problem)
I m not a  Programmer.
          But
I m a Good Learner.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Resetting Few things
« Reply #1 on: January 20, 2006, 12:57:39 AM »
You can use either use this mysql query:
Code: [Select]
ALTER TABLE `4images_images` AUTO_INCREMENT = 1 and
Code: [Select]
ALTER TABLE `4images_categories` AUTO_INCREMENT = 1
Or you can remove and then recreate your 4images_images and 4images_categories tables:
Code: [Select]
DROP TABLE IF EXISTS 4images_images;
CREATE TABLE 4images_images (
  image_id int(10) unsigned NOT NULL auto_increment,
  cat_id int(10) unsigned NOT NULL default '0',
  user_id int(11) NOT NULL default '0',
  image_name varchar(255) NOT NULL default '',
  image_description text NOT NULL,
  image_keywords text NOT NULL,
  image_date int(11) unsigned NOT NULL default '0',
  image_active tinyint(1) NOT NULL default '1',
  image_media_file varchar(255) NOT NULL default '',
  image_thumb_file varchar(255) NOT NULL default '',
  image_download_url varchar(255) NOT NULL default '',
  image_allow_comments tinyint(1) NOT NULL default '1',
  image_comments int(10) unsigned NOT NULL default '0',
  image_downloads int(10) unsigned NOT NULL default '0',
  image_votes int(10) unsigned NOT NULL default '0',
  image_rating decimal(4,2) NOT NULL default '0.00',
  image_hits int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (image_id),
  KEY cat_id (cat_id),
  KEY user_id (user_id),
  KEY image_date (image_date),
  KEY image_active (image_active)
) TYPE=MyISAM;
and
Code: [Select]
DROP TABLE IF EXISTS 4images_categories;
CREATE TABLE 4images_categories (
  cat_id int(10) unsigned NOT NULL auto_increment,
  cat_name varchar(255) NOT NULL default '',
  cat_description text NOT NULL,
  cat_parent_id int(10) unsigned NOT NULL default '0',
  cat_hits int(10) unsigned NOT NULL default '0',
  cat_order int(10) unsigned NOT NULL default '0',
  auth_viewcat tinyint(2) NOT NULL default '0',
  auth_viewimage tinyint(2) NOT NULL default '0',
  auth_download tinyint(2) NOT NULL default '0',
  auth_upload tinyint(2) NOT NULL default '0',
  auth_directupload tinyint(2) NOT NULL default '0',
  auth_vote tinyint(2) NOT NULL default '0',
  auth_sendpostcard tinyint(2) NOT NULL default '0',
  auth_readcomment tinyint(2) NOT NULL default '0',
  auth_postcomment tinyint(2) NOT NULL default '0',
  PRIMARY KEY  (cat_id),
  KEY cat_parent_id (cat_parent_id),
  KEY cat_order (cat_order)
) TYPE=MyISAM;
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)