Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Instructions for DLE 10.4, I don’t know if it’s suitable for older versions or not, but the code will be similar.
What do we need? You need to cut out all checks for the emptyness of $title and remove the js that parses the input and throws an error if it is empty.
You can do it easier - find this input, set some word or hash as its value, plus make it hidden (type=hidden), and remove the news title from the news template.
This is done in the same files for which the check cutting process is described.
We make copies of these files so that we can undo the changes in case of an error:
Line 198:
Delete or comment on it.
There may be problems with ajax search for similar news (they are searched by title), for this you can replace the code in the same file:
function find_relates ( )
{
var title = document.getElementById('title').value;
ShowLoading('');
$.post('engine/ajax/find_relates.php', { title: title, mode: 1 }, function(data){
HideLoading('');
$('#related_news').html(data);
});
return false;
};
function find_relates ( )
{
return false;
};
if(document.addnews.title.value == ''){ Growl.info({
title: '{$lang[p_info]}',
text: '{$lang['addnews_alert']}'
}); return false; }
else{
dd=window.open('','prv','height=400,width=750,resizable=1,scrollbars=1')
document.addnews.mod.value='preview';document.addnews.target='prv'
document.addnews.submit();dd.focus()
setTimeout(\"document.addnews.mod.value='addnews';document.addnews.target='_self'\",500)
}
dd=window.open('','prv','height=400,width=750,resizable=1,scrollbars=1')
document.addnews.mod.value='preview';document.addnews.target='prv'
document.addnews.submit();dd.focus()
setTimeout(\"document.addnews.mod.value='addnews';document.addnews.target='_self'\",500)
function find_relates ( )
{
var title = document.getElementById('title').value;
ShowLoading('');
$.post('engine/ajax/find_relates.php', { title: title }, function(data){
HideLoading('');
$('#related_news').html(data);
});
return false;
};
function find_relates ( )
{
return false;
};
if(document.addnews.title.value == ''){
Growl.info({
title: '{$lang[p_info]}',
text: '{$lang['addnews_alert']}'
});
status = 'fail';
}
if( trim( $title ) == "") {
msg( "error", $lang['addnews_error'], $lang['addnews_alert'], "javascript:history.go(-1)" );
}
if(document.addnews.title.value == ''){ Growl.info({
title: '{$lang[p_info]}',
text: '{$lang['addnews_alert']}'
}); return false; }
else{
dd=window.open('','prv','height=400,width=750,left=0,top=0,resizable=1,scrollbars=1')
document.addnews.mod.value='preview';document.addnews.target='prv'
document.addnews.submit();dd.focus()
setTimeout(\"document.addnews.mod.value='editnews';document.addnews.target='_self'\",500)
}
dd=window.open('','prv','height=400,width=750,left=0,top=0,resizable=1,scrollbars=1')
document.addnews.mod.value='preview';document.addnews.target='prv'
document.addnews.submit();dd.focus()
setTimeout(\"document.addnews.mod.value='editnews';document.addnews.target='_self'\",500)
function find_relates ()
{
var title = document.getElementById('title').value;
ShowLoading('');
$.post('engine/ajax/find_relates.php', { title: title, id: '{$row['id']}' }, function(data){
HideLoading('');
$('#related_news').html(data);
});
return false;
};
function find_relates ()
{
return false;
};
if(document.addnews.title.value == ''){
Growl.info({
title: '{$lang[p_info]}',
text: '{$lang['addnews_alert']}'
});
status = 'fail';
}
if( trim( $title ) == "" and $ifdelete != "yes" ) msg( "error", $lang['cat_error'], $lang['addnews_alert'], "javascript:history.go(-1)" );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question