
Скрипт исправлен. Для каждой категории в каталоге есть свой раздел.
Вставлять в "Страница редактирования/добавления материала" каталога файлов.
Сам скрипт :
Code
<script type="text/javascript">
$('input[name=ocat]').change(function() {
var dmpd_fID = this.value;
if(this.value == 18){ $('#frame').html('<iframe src="/forum/90-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 26){ $('#frame').html('<iframe src="/forum/96-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 27){ $('#frame').html('<iframe src="/forum/99-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 15){ $('#frame').html('<iframe src="/forum/93-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 28){ $('#frame').html('<iframe src="/forum/95-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 16){ $('#frame').html('<iframe src="/forum/97-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 17){ $('#frame').html('<iframe src="/forum/98-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 19){ $('#frame').html('<iframe src="/forum/100-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
});
function func() {
document.getElementById('doSmbBt').click();
forumpost.document.getElementById('frF3').value = $('#ldF1').val();
forumpost.document.getElementById('message').value = $('#message').val();
forumpost.document.getElementById('frF16').click();
}
$('input.manFlSbm').hide();
$('input.manFlRst').hide();
<?if($PAGE_ID$="add")?>
document.write('<div id="frame"></div><input class="manFlSbm" id="ldF18" type="button" style="font-weight:bold;" value="Добавить" onclick="func();" /><input class="manFlRst" type="button" id="ldF19" value="Очистить" onClick="addEntForm.reset()"/><br>')
<?else?>
document.write('<input class="manFlSbm" id="ldF18" type="button" style="font-weight:bold;" value="Изменить" onclick="func();" /><input class="manFlRst" type="button" id="ldF19" value="Восстановить" onClick="addEntForm.reset()"/><br>')
<?endif?>
</script>
$('input[name=ocat]').change(function() {
var dmpd_fID = this.value;
if(this.value == 18){ $('#frame').html('<iframe src="/forum/90-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 26){ $('#frame').html('<iframe src="/forum/96-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 27){ $('#frame').html('<iframe src="/forum/99-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 15){ $('#frame').html('<iframe src="/forum/93-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 28){ $('#frame').html('<iframe src="/forum/95-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 16){ $('#frame').html('<iframe src="/forum/97-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 17){ $('#frame').html('<iframe src="/forum/98-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == 19){ $('#frame').html('<iframe src="/forum/100-0-0-1-1" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
});
function func() {
document.getElementById('doSmbBt').click();
forumpost.document.getElementById('frF3').value = $('#ldF1').val();
forumpost.document.getElementById('message').value = $('#message').val();
forumpost.document.getElementById('frF16').click();
}
$('input.manFlSbm').hide();
$('input.manFlRst').hide();
<?if($PAGE_ID$="add")?>
document.write('<div id="frame"></div><input class="manFlSbm" id="ldF18" type="button" style="font-weight:bold;" value="Добавить" onclick="func();" /><input class="manFlRst" type="button" id="ldF19" value="Очистить" onClick="addEntForm.reset()"/><br>')
<?else?>
document.write('<input class="manFlSbm" id="ldF18" type="button" style="font-weight:bold;" value="Изменить" onclick="func();" /><input class="manFlRst" type="button" id="ldF19" value="Восстановить" onClick="addEntForm.reset()"/><br>')
<?endif?>
</script>
При добавлении материала автоматически создается тема на форуме (в каком разделе указывается в скрипте в 1-й строчке: "forumID"). Тема = название материала, Описание = полное описание материала
При изменении материала на форуме ничего не происходит.
Не забываем отключить капчу при создании темы на форуме
Скрипт как бы работает во всех браузерах.
Если заметите ошибки - просьба сообщить!
Code
if(this.value == [color=red]18)[/color]{ $('#frame').html('<iframe src="[color=green]/forum/90-0-0-1-1[/color]" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == [color=red]26[/color]){ $('#frame').html('<iframe src="[color=green]/forum/96-0-0-1-1[/color]" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == [color=red]27[/color]){ $('#frame').html('<iframe src="[color=green]/forum/99-0-0-1-1[/color]" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == [color=red]15[/color]){ $('#frame').html('<iframe src="[color=green]/forum/93-0-0-1-1[/color]"
if(this.value == [color=red]26[/color]){ $('#frame').html('<iframe src="[color=green]/forum/96-0-0-1-1[/color]" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == [color=red]27[/color]){ $('#frame').html('<iframe src="[color=green]/forum/99-0-0-1-1[/color]" width="1" height="1" frameborder="0" name="forumpost"></iframe>');}
if(this.value == [color=red]15[/color]){ $('#frame').html('<iframe src="[color=green]/forum/93-0-0-1-1[/color]"
Красным отмечены ID категорий.Зеленым в какой форум будет копироваться материал.

![]() ![]() | ![]() |