Author Topic: Fast-create categories?  (Read 19102 times)

0 Members and 1 Guest are viewing this topic.

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Fast-create categories?
« on: May 14, 2008, 03:03:30 PM »
I would like to add a whole lot of categories, about 5 000 of them. Instead of manually creating new categories one by one, is there a faster way to load them automatically? Let's say I create categories A-Z, and then have a list of subcategories with about 200 for each letter. Can I somehow load these in an easier way with the help of a list I upload or something?

Offline † manurom

  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • manurom's 4images templates
Re: Fast-create categories?
« Reply #1 on: May 16, 2008, 09:27:07 AM »
Hello;
I tried once the [Plugin] Batch Import, and it worked pretty well.
I created a large amount of categories, with a file "spacer.gif" in each one. Uploaded them to "my_site/temp_upload/" (directory I created for this purpose), and used the plugin.

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Fast-create categories?
« Reply #2 on: May 16, 2008, 12:37:16 PM »
ok. I've installed the plug-in. My folder is {template_url}/temp_upload (is that the way to write it?)

Exactly how do you create a large amount of "categories" to be uploaded? (I supposed you're talking about folders?) How do I in that case create about 5 000 folders without having to do it one-by-one and give every single one the appropriate name? And the spacer-gif? I don't want any spacer-gif in every category... or will they be invisible? When entering a category there should not be a picture saying spacer.gif.

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Fast-create categories?
« Reply #3 on: May 16, 2008, 01:04:01 PM »
Hi,


do it so.....

create dirs with this names as example on your HDD in folder temp_upload (your own PC)
example

Main_Cat1
Main_Cat2
Main_Cat2

in folder Main_Cat1
create folders
Sub_Cat1
Sub_Cat2
...
Sub_Cat5000

in folder Main_Cat2
create folders
Sub_Cat1
Sub_Cat2
...
Sub_Cat5000


now upload whole "temp_upload" to your ftp

in batch_import.php
change
Code: [Select]
// Path to the directory the image data are stored.
// No trailing slash!
$data_src_path = "/path/to/images/folder";

to your path

example

Code: [Select]
// Path to the directory the image data are stored.
// No trailing slash!
$data_src_path = "/home/userid/www_public/4images/temp_upload";

spacer.gif you don't need..

i tested this, works fine

and of course

set
Code: [Select]
// Default category permissions
// AUTH_ALL   = All
// AUTH_USER  = Registered Users
// AUTH_ACL   = Private
// AUTH_ADMIN = Administrators
$auth_viewcat      = AUTH_ALL;
$auth_viewimage    = AUTH_ALL;
$auth_download     = AUTH_USER;
$auth_upload       = AUTH_USER;
$auth_directupload = AUTH_ADMIN;
$auth_vote         = AUTH_ALL;
$auth_sendpostcard = AUTH_ALL;
$auth_readcomment  = AUTH_ALL;
$auth_postcomment  = AUTH_USER;

for permissions
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Fast-create categories?
« Reply #4 on: May 16, 2008, 02:03:32 PM »
Thanks.

But how do I create folders on my harddrive fast? For example, it would be easier if I had a long list with 5 000 folder names that could be "translated" into folders somehow. If I create every folder one at a time it would take a long time to do it.

I'm having problem with the address:

You wrote:

"/home/userid/www_public/4images/temp_upload";

Should I exchange "home" with my www.mysite.com and "userid" with my log-in name or exxactly how do I do it?

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Fast-create categories?
« Reply #5 on: May 16, 2008, 02:34:13 PM »
hi,

for "fast" folders
http://www.google.at/search?hl=en&q=Batch+Folder+Creator&btnG=Google-Suche&meta=

for
"/home/userid/www_public/4images/temp_upload";

look into your 4images Admin CP, click on phpinfo()
search for DOCUMENT_ROOT

or

SCRIPT_FILENAME

there will you see your correct PATH to admin/phpinfo.php
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline † manurom

  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • manurom's 4images templates
Re: Fast-create categories?
« Reply #6 on: May 16, 2008, 03:37:01 PM »
@Nicky;
you rise perfecton! :mrgreen:

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Fast-create categories?
« Reply #7 on: May 16, 2008, 04:04:34 PM »
ok, thanx. it's working now.  :D

got some other problems though...  :roll: I guess I have to solve that somehow... if the folder's name is "Z W", and I want it to sort by the "W" and not the first letter "Z", how the heck is that accomplished... this is probably not the right forum for that though..  :mrgreen:

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Fast-create categories?
« Reply #8 on: May 16, 2008, 04:25:36 PM »
do you have

A
B
C

Z W

Z Y

?
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Fast-create categories?
« Reply #9 on: May 16, 2008, 04:26:12 PM »
@Nicky;
you rise perfecton! :mrgreen:

you mean with google link?  :mrgreen:
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Fast-create categories?
« Reply #10 on: May 16, 2008, 04:38:27 PM »
Basically... I have "top" categories A-Z. In every category (A-Z) I'll have names (first name + last name). I want it to sort by the last name and not the first name.

When I upload the folders it will sort by the first name.

Offline † manurom

  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • manurom's 4images templates
Re: Fast-create categories?
« Reply #11 on: May 16, 2008, 04:42:09 PM »
@Nicky;
you rise perfecton! :mrgreen:

you mean with google link?  :mrgreen:
Not at all! Just with your own work!

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Fast-create categories?
« Reply #12 on: May 16, 2008, 08:43:10 PM »
By the way, wouldn't it have to be easier to directly create a list that would be translated into categories? Instead of first creating folders, then upload them, then have the plug-in sort them?

Offline † manurom

  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • manurom's 4images templates
Re: Fast-create categories?
« Reply #13 on: May 16, 2008, 10:31:21 PM »
Well, it should be possible building a CSV file with MS Excel, for instance, and merge it in the database.
But I'm not really familiar to that sort of process.

Maybe someone here knows how to do it.
Hope you'll get any answer.

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Fast-create categories?
« Reply #14 on: May 18, 2008, 09:07:58 PM »
ok. is it possible to add a function to the above plugin that sorts the categories alphabetically before adding them as categories?

1. Read from folder temp_upload.
2. Sort alphabetically after the last name. For example John Doe would be sorted after Doe.
3. Add sorted names to categories.

Also, that annoying "confirm" after each category is added is easy to remove I guess?