Forums

How is category found in wp_posts table (16 posts)

  1. rforster
    Member
    Posted 3 years ago #

    Good Morning,

    I'm about to do an import into my wp_posts table using a csv and phpMyAdmin. I'm going to add clumns as necessary and rename to match the table. My test import will be baseball games for the month of June.

    My question is where is the category field? I see post_category but my table has all zeros and when I go to edit right in the table I see no indication that the post ties to a different table. Any ideas?

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    It's a bit more complicated. See WordPress_Taxonomy for a mild discussion.

  3. rforster
    Member
    Posted 3 years ago #

    OH - MY - GOSH!

    I'm sure that the goal is flexibility and probably accomplishes it nicely.

    I just wanted to import the baseball games as posts.

    At this time, is importing a csv or any other type of file that phpMyAdmin can handle going to work?

    Thanks for responding.

  4. flick
    Member
    Posted 3 years ago #

    Consider an RSS format? I used Excel to tidy up my data, and then generated the RSS format and imported this using the WP admin interface.

    These two threads were very helpful for me in that they showed the format that is needed for WordPress to take up the information successfully:

    Importing 60,000 articles
    Creating Batch posts

    One problem I couldn't overcome was 'authors'. I tried setting the author name in the RSS tag, which didn't work. Tried ID, but that didn't work either. Someone even suggested logging in as that user to import the file, but that didnt' work either. Ended up manually changing all the post authors :) Luckily I only had about 70 to do.

  5. rforster
    Member
    Posted 3 years ago #

    I went to manage / import and get:
    *******
    If you have posts or comments in another system, WordPress can import those into this blog. To get started, choose a system to import from below:

    No importers are available.
    *******
    I'm running 2.5.1, am I in the wrong screen?

    I'm using Excel 2000 so no XML export. Just CSV, dbf, for data.

    Realistically I'm just doing this for personal use and don't want to type 162 baseball games in. :) And Football. And Basketball, hockey, church calendar, little league... :) Thx for the help.

  6. rforster
    Member
    Posted 3 years ago #

    Had no import.php and import in my admin folder.

  7. flick
    Member
    Posted 3 years ago #

    I'm a little confused now, does this mean the problem with the 'lack' of importer(s) has now been resolved?

    Actually, the XML export for Excel is no help at all.
    What I did was to put all the values in their respectively columns, then build a string in the final column to concatenate everything.

    I'm not particularly good at explaining myself in short sentences, so maybe a proper tutorial from a random google search result might help explain the concept of concatenating cells.

    Then I simply copied this all in to a text editor (in my case: Notepad++) and saved the file as a .xml.

    It's very important that to get the spacing for the XML file though apparently.

    Thinking might write this all up in detail at some point :D

  8. rforster
    Member
    Posted 3 years ago #

    Mosey,

    Uploaded the import stuff and all is well.

    Great tip on concatenating in Excel. Spacing? I'll give it a shot, we'll see what happens....

  9. flick
    Member
    Posted 3 years ago #

    Let me(/us) know how it goes! I personally really enjoyed playing around with the import and Excel and would like to find out more about ways of extending it.

    p/s: For the spacing, I edited the necessary parts/spacing in Notepad++ first before inserting it into the final column.

  10. rforster
    Member
    Posted 3 years ago #

    I'm looking at this but have to head to dinner. To start with, there must be a template worksheet you have in Excel. I looked at the output of my site and I think my Excel columns should be:
    <item>
    <title>
    <link>
    <pubDate>
    <dc:creator>
    <category>
    <category domain="category" nicename="Events">
    <guid isPermaLink="false">
    <description>
    <content:encoded>
    <wp:post_id>
    <wp:post_date>
    <wp:post_date_gmt>
    <wp:comment_status>
    <wp:ping_status>
    <wp:post_name>
    <wp:status>
    <wp:post_parent>
    <wp:menu_order>
    <wp:post_type>
    <wp:post_password>

    From here I could cut and paste the data from a csv opened in excel into the appropriate column. Some will be blank or have default values. Basically this is a one size fits all approach but it would be simple to cut and past a 3 colum time, title, post type of list into this to turn it into posts.
    How is 1:05 evaluated by the rss import?
    Use a formula in the spreadsheet to add 7 hours for GMT?
    How is Apr 8, 2008?

    This is all I can think of for now. Can u cut and paste your Concat formula as a sample? Purty please? :)

    Or maybe I'm heading in the wrong direction....

  11. flick
    Member
    Posted 3 years ago #

    Actually you really don't need all the info. The information I used was simply:

    <item>
     <pubDate>2008-09-14 17:25:00</pubDate>
     <dc:creator>admin</dc:creator>
     <title>TITLE</title>
     <category>News</category>
     <content:encoded><![CDATA[SOMETHING HERE]]></content:encoded>
     </item>

    as per the code referenced in the two threads posted earlier.

    But perhaps your information needs more than this?

    Unfortunately I don't have the file at hand at present, but will try and dig it up later on :) Sorry!

  12. rforster
    Member
    Posted 3 years ago #

    My need was to avoid typing in things like baseball and basketball schedules. Both of these have different formats depending on what the team puts on their site for public download. I think there a lot of people that have data that could be displayed on a WP installation that is in csv or tab format so they would end up needing an RSS import solution.

    Just below is a cut and paste of a line from the csv for the Diamondbacks. This is I think output from an Outlook calendar. Most of the stuff isn't necessary in WP but two things stand out. Would need to create the post time through some sort of concatenation. Also need to make a GMT version.

    START_DATE,START_TIME,START_TIME_ET,SUBJECT,LOCATION,DESCRIPTION,END_DATE,END_TIME,END_TIME_ET,REMINDER_OFF,REMINDER_ON,REMINDER_DATE,REMINDER_TIME,REMINDER_TIME_ET,SHOWTIMEAS_FREE,SHOWTIMEAS_BUSY
    2/28/2008,1:05 PM,3:05 PM,Rockies at Diamondbacks,Tucson Electric Park,Spring training game - buy tickets now! http://mlb.mlb.com/spring_training/tickets.jsp?c_id=ari,2/28/2008,4:05 PM,6:05 PM,FALSE,TRUE,2/28/2008,12:05 PM,2:05 PM,FREE,BUSY

    So:
    Does excel have a formula to convert the two separate Date and columns or just change the format to match what you put above and concat the date, a space, and then the time?
    Write a formula for adding whatever number of hours to your local time to create the GMT. I wrote a simple formula in a cell and the concat grabs the result.
    Can line feeds or whatever formatting be used in the concat function in Excel? Or placed in a cell and added in that way? This would avoid formatting the text file later.

    Nice little project here. Would have been done typing in the games by now. :)

  13. flick
    Member
    Posted 3 years ago #

    Thanks for putting in the example that you're considering :) I do wonder if, for your case, it might be easier for you to consider using (and customising) a plugin called Gigpress?

    It's essentially a plugin for bands (or fansites :D) to maintain a schedule of performances by a band/musician and uses a new table for all the data. The key variables include 'date' (with an option for events that last multiple days) 'start time', 'end time', 'venue', 'description', 'ticket link' and a lot more, which seem to be what you might be needing.

    It would probably make it easier for you to construct/format an import from the csv file directly into the mySQL database.

    And another good thing is that the plugin also allows you to associate each game (in your case?) with a news post if you wanted to write an article about each game.

    Just an idea :)

  14. rforster
    Member
    Posted 3 years ago #

    Hey Mosey, I looked at Gigpress and it looks like the best plugin for a band, hands down. I'm going to reactivate and see if I can use the "show" field for Chase field or Coyotes Arena if it accepts enough characters.

    I also reactivated events calendar and made a couple of entries. This is OK but if I wanted to put a link or picture in the description would have to hand code.

    Both of these have a big plus in using a separate table for the events instead of making them posts.

    From the start I have been trying to find a way to use the standard interface and all the nice features and just modify the output. WordPress is about writing and the posts and pages and all are great.

    The last couple of days have been fun and now if I ran into a situation where I had to import data from a list I know I could handle it. The first decision would be to decie whether it should be in it's own table as a list to be put on a page or whether it is some sort of commentary where the date is important for archiving. :)

    Thanks for all the help.

  15. flick
    Member
    Posted 3 years ago #

    Not sure how helpful I have been, but thanks rforster :) It does sound like a really interesting project, and it would be great to see the final website when it's all complete!

    Am wondering why I never thought about Gigpress in the first place, as it's one of my favourite plugins (I've tried Event Calendar and wasn't as impressed even though I know it's quite popular) and I will also be editing it to work on another site as well.

    p/s: A plugin that might be worth glancing at is League Manager but it doesn't seem to be quite as well documented and complete as Gigpress.

  16. rforster
    Member
    Posted 3 years ago #

    I think I'll give Gigpress a run. Very "one band" oriented. Just need to change a bunch of stuff from Shows to Events on the output side and can use the City field for the name of the event, again changing the name.

    I'd love to use the block of code from the WP post screen for the description box for editing, in this case, the "Notes" field. I'll ppst back later.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.