Hello, voici un hack pour le module News de InstantZero.
Il y a peut être des aberrations dans mon hack ?
News 1.61SecurityImages pour Proposer un article
Fichier
news/include/storyform.inc.phpVers la ligne 186
Après
$smiley_checkbox = new XoopsFormCheckBox('', 'nosmiley', $nosmiley);
$smiley_checkbox->addOption(1, _DISABLESMILEY);
$option_tray->addElement($smiley_checkbox);
$sform->addElement($option_tray);
//TODO: Approve checkbox + "Move to top" if editing + Edit indicator
Avant
//Submit buttons
$button_tray = new XoopsFormElementTray('' ,'');
Insérer
// Hack SecurityImage by DuGris
if ( defined('SECURITYIMAGE_INCLUDED') ) {
$captcha = true;
if (is_object($xoopsUser) && $xoopsUser->isAdmin($com_modid)) {
$captcha = false;
}
if ($captcha) {
$security_image = new SecurityImage( _SECURITYIMAGE_GETCODE );
if ($security_image->render()) {
$sform->addElement($security_image, true);
}
}
}
// Hack SecurityImage by DuGris
Ensuite, fichier
news/submit.phpVers la ligne 291
Après
include_once XOOPS_ROOT_PATH.'/modules/news/include/storyform.inc.php';
break;
case 'post':
Avant
$nohtml_db = isset($_POST['nohtml']) ? $_POST['nohtml'] : 1;
if (is_object($xoopsUser) ) {
$uid = $xoopsUser->getVar('uid');
Insérer
// Hack SecurityImage by DuGris
include_once(XOOPS_ROOT_PATH ."/class/xoopsformloader.php");
$captcha = true;
if (is_object($xoopsUser) && $xoopsUser->isAdmin($com_modid)) {
$captcha = false;
}
if ($captcha) {
if ( defined('SECURITYIMAGE_INCLUDED') && !SecurityImage::CheckSecurityImage() ) {
redirect_header( 'j a v a s c r i p t:history.go(-1)' , 1, _SECURITYIMAGE_ERROR ) ;
}
}
// Hack SecurityImage by DuGris