import with createdby and created

More
12 years 1 month ago #30885 by danio_d
Hello,

I need to import content with author info and created data.
Try to import with column created_by with userid, and created with ex. 2010-10-25 but its do not work.

It is possible to import items with userid and create date?

THX
Daniel

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #30886 by johnypas
try to export the data in xml and after that use navicat or phpmyadmin to import it in content table. flexicontent will take care of asset id . make sure that your articles have id s

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #30887 by danio_d
THX Johny, but i try to use import including in flexicontent.
This option work good, but not import createdby and created. And i think i need import itemid also.

debug:
Code:
COLUMNS: field_contact_person, field_miasto, field_wojewodztwo, field_phone, field_email, field_odbior, title, text, field_state, field_cena, created_by, created, hits RECORD no 1: Array ( [type_id] => 3 [language] => pl-PL [catid] => 14 [cid] => Array ( ) [vstate] => 2 [state] => -4 [custom] => Array ( [field_contact_person] => Array ( [0] => John Smith ) [field_miasto] => Array ( [0] => Radlin ) [field_wojewodztwo] => Array ( [0] => 24 ) [field_phone] => Array ( [0] => 666444555 ) [field_email] => Array ( [0] => smith@wp.pl ) [field_odbior] => [field_state] => Array ( [0] => 2 ) [field_cena] => Array ( [0] => 6200 ) [created_by] => Array ( [0] => 398 ) [created] => Array ( [0] => 2010-01-05 00:00 ) [hits] => Array ( [0] => 685 ) ) [title] => Title ites [text] => Lorem ipsum text‚ )

But in sql created_by is 391 (i have this number when i made import) and created date is today. Hits is empty.

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #30893 by ggppdk
comment removed ...

see updated comment bellow: ...


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #30902 by danio_d
Helo ggppdk,

I hope that You wilt answer :) . Thank You.

I tested your code, but's nothings change. After changes user id is still 391 (like login user), and created is today.

Debug:
Code:
COLUMNS: field_contact_person, field_miasto, field_wojewodztwo, field_phone, field_email, field_odbior, title, text, field_state, field_cena, created_by, created, hits RECORD no 1: Array ( [type_id] => 3 [language] => pl-PL [catid] => 14 [cid] => Array ( ) [vstate] => 2 [state] => -4 [custom] => Array ( [field_contact_person] => Array ( [0] => John Smith ) [field_miasto] => Array ( [0] => Radlin ) [field_wojewodztwo] => Array ( [0] => 24 ) [field_phone] => Array ( [0] => 666555444 ) [field_email] => Array ( [0] => smith@wp.pl ) [field_odbior] => [field_state] => Array ( [0] => 2 ) [field_cena] => Array ( [0] => 6200 ) [created_by] => 393 [created] => 2010-01-05 00:00 [hits] => Array ( [0] => 685 ) ) [title] => Title item [text] => Lorem ipsum text )

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #30903 by ggppdk
Test adding them ...

In file
administrator/components/com_flexicontent/controllers/items.php

about line 840, replace:
Code:
$core_props = array('catid', 'cid', 'language', 'alias');
with
Code:
$core_props = array('catid', 'cid', 'language', 'alias', 'created', 'created_by');

and about line 885, replace:
Code:
if ($fieldname=='title' || $fieldname=='text' || $fieldname=='alias' || $fieldname=='language' || $fieldname=='catid' || $fieldname=='cid') {
with
Code:
if ($fieldname=='title' || $fieldname=='text' || $fieldname=='alias' || $fieldname=='language' || $fieldname=='catid' || $fieldname=='cid' || $fieldname=='created' || $fieldname=='created_by' ) {

Ok, one more change is needed, please test this and report back:

At about line 916 , and before :
Code:
else if ( $fieldname=='catid' ) { if ($maincat_col) $data[$fieldname] = $field_values; }
add
Code:
else if ( $fieldname=='created' || $fieldname=='created_by' ) { $data[$fieldname] = $field_values; }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.339 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline