Answer the question
In order to leave comments, you need to log in
Removal code for a resource?
Hello!
Help implement the code to unpublish the miniShop2 resource when the button is clicked.
Can you change this code?
<?php
$res = $modx->getObject('modResource',$id);
$createdby = $res->get('createdby');
$user = $modx->user->getOne('Profile');
$profile = $user->get('id');
if($createdby == $profile){
if($_GET['user'] == $profile ) {
$unid = $_GET['id'];
$resource = $modx->getObject('modResource', $unid );
$resource->set('published',1);
$resource->save();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question