Using Profiles like social Media sites

More
9 years 6 months ago #49178 by ggppdk
Hello

more such work will be in next version v2.3.x

Regards


-- 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
9 years 6 months ago #49341 by milind.purandare
thanks

Can you help me with a short code piece to create a new item using PHP code?
(I am trying to create a blank profile page post registration & save it in background)

$user = JFactory::getUser();
$category = 3; // need code here. Should it be category or type?
$newitem = new Item($category); // need code here.
$newitem.owner = $user ; // need code here to set the item as created by this user

$newitem.save() ; // need code here to save this item


many many thanks....

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

More
9 years 6 months ago #49345 by ggppdk
Hello

do you want to create a FLEXIcontent item ?
or a Joomla article ?


-- 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
9 years 6 months ago #49355 by milind.purandare
Hi

Flexcontent Item... using PHP code.

When user logs in I will check if he has a page (the code for this part was contributed on this forum by another person), if not I would like to create a FlexItem for that user and also set him/her as the owner. Since there will be only one item of that type per user, I can use a FlexMenu (UserProfile Category) and show that as a profile page.

:)

That should sort the present gap I have...

Thanks in anticipation...

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

More
9 years 6 months ago #49356 by ggppdk
Hello

here is a draft FAQ article about this, please note that it is untested/incomplete:

How to create a FLEXIcontent item by calling the FLEXIcontent item model in custom code


-- 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
9 years 6 months ago #49464 by milind.purandare
Thanks a million.

The line
require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_flexicontent'.DS.'models'.DS.'item.php');

does not let me proceed. (code stops on this line)

So I dropped it.

So I do :
$mynewitem = new FlexicontentModelItem();
$data = array();
$data = 0; // indicate a new item will be created
$data = "1" ; // e.g. 1 for article
$data= 'en-GB'; // e.g. 'en-GB'
$data = 1;
$data = array("1","2","3");
$data = 2; // item version is approved
$data = 1; // 1 for published ...
$data = 'PHP CODE CREATED TITLE';
$data = 'PHP CODE CREATED DESCRIPTION';
$mynewitem->store($data);


Then the code goes upto mynewitem-store where it enters the Store method in ParentclassItem.php of Flex.

Then it throws invalid token on entry!! (It is right at start of the "store" method)

Am I doing something wrong with includes?

Just hairline away from my integration... your help much appreciated.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.598 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