Share » Forums » Developer » [Solution] to stop DB flood , do u...

[Solution] to stop DB flood , do u have better ?

[Solution] to stop DB flood , do u have better ?

Monday 02 June 2003 5:15:22 am - 3 replies

Author Message

Bård Farstad

Monday 02 June 2003 6:32:22 am

This is a good idea. It's much the same way as we do when a user edits an object.

However this does not work if you want the users to be able to have several drafts of the same class. E.g. I would like to have two drafts of an article.

Mabye we could create a setting for the default behaviour or handle users in a special way.

--bård

Documentation: http://ez.no/doc

Selmah Maxim

Monday 02 June 2003 6:50:56 am

User can have 2 draft, but not if class id is 15, i made this coz i have section where user can submit some data about his work or what ever, and i don`t wanna let him spam this section with his ads, so if submit once he can just modify it, he cann`t submit again, and this is just for user group 12, the resgistered users, editors ,and admin can have drafts.

Now am trying with user register, i cann`t get work :

if ( $module->isCurrentAction( 'Publish' ) )
{
$http =& eZHTTPTool::instance();
$user =& eZUser::currentUser();

$db = eZDb::instance();
$DBCheck =& $db->arrayQuery( "select id , current_version from ezcontentobject where
contentclass_id = '4' and published ='0' and modified='0'
order by current_version desc limit 1 ");
if(count($DBCheck) > 0)
{
include_once( 'lib/ezutils/classes/ezoperationhandler.php' );
$operationResult = eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $DBCheck[0][id],
'version' => $DBCheck[0][current_version] ) );
}
else
{
include_once( 'lib/ezutils/classes/ezoperationhandler.php' );
$operationResult = eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $object->attribute( 'id' ),
'version' => $version->attribute( 'version') ) );
}

it`s not work , coz the $object->attribute( 'id' ) is not equal $DBCheck[0][id] , and don`t know how set the $object->attribute( 'id' ) to $DBCheck[0][id] !

do u have idea about this ?

Selmah Maxim

Monday 02 June 2003 8:36:29 am

didn`t work !!

coz of nodeAssignment value, i cann`t get the Assignment id :( , coz of this the object will take the ObjectID as parentid :(

I cann`t figure out the db map, to huge for me to do it alone :(

I hope in next version will be way to do this, or somthing to clean the DB from unactive records!

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu