Results 1 to 2 of 2

Thread: MOD for importing GT links

  1. #1
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default MOD for importing GT links

    Well, after working most of the evening, I got the MOD to work so that I can customize the import of GT links into INDEXU.

    The GT import for v3.1 does not do several things:[list=1][*]Does not handle dates for custom fields[*]Does not convert Yes/No to 1/0[*]Does not "match" data in the GT links file to any corresponding fields in the standard indexu table ( for example, I already have a password field which I would like to keep instead of the random one generated by the standard 3.1 import ).[*]Does not import all the GT files ( e.g., hits, ratings, votes, etc )[/list=1]This MOD does all of the above.

    The 3.1 Indexu import does work but if you need to customize it, it is not easy to customize. Well, it is hard for me since I don't know PHP ( OK, I have learned a few things in the past month, but to say I know something about PHP would be a stretch ).

    I still have to fix a couple of things and to write it up, so it may take a few days.

    When I have it ready, I will post it as a file attachment.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  2. #2
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    In the attached zip file I have included the following files from the lite version:
    application1.php
    english.php
    db_import_gt.php

    I've also included these instructions.

    Run the standard v3.1 import and import the categories first.

    First, you will want to alter the idx_link file to include the required columns. Create custom columns (fields) only for those that you want to. In other words, if you have a gt links2 field that you NOT want to import, do not create the column in the idx_link table.

    First, you will need to locate the application1.php file as appropriate ( I put mine in the public_html/indexu folder. Locate the english.php and pagination.class.php files (see lines 131-132 in the application1.php file ) as needed. You can modify these to fit your needs.

    In the application1.php file, you will need to edit the variable at the beginning of the file. They the same as in the application.php file on your server (see lines 30 - 50).

    There is no need to edit the db_import_form1.html file.

    you will need to modify the db_import_gt.php file to correspond to your gt links 2 file. This could be extensive. There are 5 main sections to modify. I have indicated these area with the phrase "// mod - modify this."

    First, you will need to modify lines 4 and 8 to show the correct paths.

    Second, you will need to modify the addslashes area. Add for each field ( Well, that is what I did but it may only be necessary for the char/text type fields.

    Third, add the sql table names here. The order should be the same as in the idx_link table [IMPORTANT].

    Fourth, add the data[] variables here. The data[] variables hold the information for each field from gt links 2. For ease of use the data[] variables are assigned to the INDEXU variables (values) here. Assign all the variables that you want to insert into your INDEXU table.

    Fifth, add the "values" here. The values are the actual data to be inserted into the idx_link table. The order should be the same as in the idx_link table [IMPORTANT].

    I already had a few fields in my gt links2 file that corresponded to the same fields in INDEXU. I just matched them up in section 4. For example, I had a password in gt links 2 and I transferred that to the INDEXU password field. You can also transfer dates from the gt links 2 format to the sql format and transfer yes/no fields as 1/0.

    Just follow the examples already there for each of the 5 sections.

    Also, you might want to remove any HTML code as it may cause errors.

    And I added the gt links 2 ID field to the INDEXU table and transfered the info.

    THERE IS ONE CRUCIAL THING:
    I set sections 3 and 5 to show one variable per line. First, It just makes it easier to see and edit the info. And to spot errors.

    But the really important thing was to allow me to see the one-to-one relationship between the two sections. You have to have the same number of variables in section 3 as values in section 5. I could copy each section into Excel or a Word table and align them so that I could see the variable and the value on the same line.

    If you have more lines (variables) in section 3 than lines (values) in section 5 (or vice versa), the insert will not work.

    This is crucial.

    I believe you can run this from the address box in your browser. Or add it to your admin menu.

    In any event, remove it from your server when finished. It is dangerous to leave it on the server.

    esm
    Attached Files Attached Files
    Last edited by esm; 05-30-2005 at 04:35 PM. Reason: added the english.php file
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

Similar Threads

  1. Moving from G-T Links 2
    By esm in forum Pre-Sales Questions
    Replies: 14
    Last Post: 05-30-2005, 04:26 PM
  2. Delete 800 links one at a time ?
    By killipso in forum v5.x
    Replies: 2
    Last Post: 01-26-2004, 10:55 AM
  3. Replies: 18
    Last Post: 12-27-2003, 05:35 PM
  4. Special Import of GT links
    By esm in forum v5.x
    Replies: 4
    Last Post: 05-21-2003, 05:12 PM
  5. Replies: 19
    Last Post: 04-03-2003, 01:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •