Function to create categories and articles using php.

This forum is for general questions about extensions for Joomla! 3.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
Ultimouomo
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Sep 21, 2011 11:52 pm

Function to create categories and articles using php.

Post by Ultimouomo » Sat Jan 19, 2013 2:40 pm

Hello to all,
I ask a little help for a component for Joomla 3.0:

- I need a php function that creates a category using the parameters title, alias, and description, it should create the rest of the items automatically.

- Same thing, always in php to create an article, using the parameters title, alias, category and description.

I made them manually, creating a php-mysql script that adds a record in table categories for first issue and a record in table content for the second issue.

However i left some parameters to zero, i don't know how to get them, they are:

asset_id
lft
rgt

So it works but the created records can't be trashed because there is nothing in asset_id. The only way to trash them is to save by view and then to trash.

Then wandering around on the internet I read that i should ALWAYS use the functions of jtable to manage asset_id, checkin and checkout but i don't know how since i'm a newbie.

Then i have a doubt:
if i put a function into a button in JToolBarHelper of a view, can this function call an external function of another class (that normally should be called by another view)?

I humbly ask for help!

My real problem is that i should need a teacher to meet (by teamviewer), disponible to follow me through these first steps, we can make agree every time (even evening or night time for me), i'll be grateful!

I thank in advance for every answer

Best regards

Locked

Return to “Extensions for Joomla! 3.x”