Example #1
0
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
/**
 * Xoops header ...
 */
include_once "../../mainfile.php";
include_once "../../header.php";
/**
 * Modules class includes  
 */
include_once "class/yogurt_scraps.php";
/**
 * Factories of tribes  
 */
$scraps_factory = new Xoopsyogurt_scrapsHandler($xoopsDB);
/**
 * Verify Token
 */
if (!$GLOBALS['xoopsSecurity']->check()) {
    redirect_header($_SERVER['HTTP_REFERER'], 3, _MD_YOGURT_TOKENEXPIRED);
}
/**
 * 
 */
$myts =& MyTextSanitizer::getInstance();
$scrapbook_uid = $_POST['uid'];
$scrap_text = $myts->displayTarea($_POST['text'], 0, 1, 1, 1, 1);
$mainform = !empty($_POST['mainform']) ? 1 : 0;
$scrap = $scraps_factory->create();
$scrap->setVar('scrap_text', $scrap_text);
Example #2
0
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include_once '../../mainfile.php';
include_once '../../header.php';
include_once '../../class/criteria.php';
include_once 'class/yogurt_scraps.php';
/**
* Factories of tribes  
*/
$scraps_factory = new Xoopsyogurt_scrapsHandler($xoopsDB);
$scrap_id = intval($_POST['scrap_id']);
if ($_POST['confirm'] != 1) {
    xoops_confirm(array('scrap_id' => $scrap_id, 'confirm' => 1), 'delete_scrap.php', _MD_YOGURT_ASKCONFIRMSCRAPDELETION, _MD_YOGURT_CONFIRMSCRAPDELETION);
} else {
    /**
     * Creating the factory  and the criteria to delete the picture
     * The user must be the owner
     */
    $criteria_scrap_id = new Criteria('scrap_id', $scrap_id);
    $uid = intval($xoopsUser->getVar('uid'));
    $criteria_uid = new Criteria('scrap_to', $uid);
    $criteria = new CriteriaCompo($criteria_scrap_id);
    $criteria->add($criteria_uid);
    /**
     * Try to delete