Kunena 7.0.4 Released

The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0

This category contains miscellaneous, uncategorised user contributions, (templates, modules, plugins and hacks) relating to older versions of Kunena that are no longer supported.

The topics in this category are for historical interest only. Owing to the structural changes that occurred in K 1.7, many of the ideas in these topics will not work with later versions and, for that reason, the topics are locked.

Question How to add a category by front-end php code and also do the ordering

More
14 years 2 months ago #118555 by texasjin
At front side, I have the following sample code to add a category:

$query = 'INSERT into #__kunena_categories (parent, name)' .
' VALUES (5,"testcategory")';
$db->setQuery($query);

I can verify using phpMyadmin that the new category is successfully added to the table, however, since the ordering field is zero, this category won't be shown to user unless I reorder the whole table.

Then I put the following code at front end (copied somewhere, don't quite understand the logic though), I guess since we have the field "ordering" in the table, then we can call reorder()? but it doesn't work for me. Anybody helps me to reorder this table using front end PHP/joomla code?

Thanks a lot.

$table = JTable::getInstance('#__kunena_categories', 'Table');
$table->reorder();

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

More
14 years 2 months ago #118556 by texasjin
Forgot to mention that I am using joomla 1.6.4 and kunena 1.6.5.

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

Time to create page: 0.267 seconds