Ajuda botão bugado! 06.07.14 17:16
Pessoal sou novo aqui e tenho um CMS de habbo, eu achei na net, mas ele está bugado, o botão "POST", ele não executa ação alguma, segue a baixo o código:
ATENÇÃO: É um caso de vida ou morte fpfpfpfpfpfpfpfp preciso de ajuda imediata!
- Código:
<?php
define('USERNAME_REQUIRED', TRUE);
define('ACCOUNT_REQUIRED', TRUE);
include("../../global.php");
$username = $core->EscapeString($_SESSION['username']);
if(!$users->UserPermission('hk_news', $username))
{
header("Location: ../nopermission.php");
die;
}
?>
<script type="text/javascript" src="../Public/tiny_mce/jquery.tinymce.js"></script>
<script language="javascript">
$('textarea.wysiwyg').tinymce({
script_url : '../Public/tiny_mce/tiny_mce.js',
theme : "advanced",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,forecolor,backcolor",
theme_advanced_buttons3 : "",
skin : "o2k7",
skin_variant : "blue",
});
$('#mainimage').keypress(function(e){
if(e.which == 13){
$('#ImagePreview').attr('src', $(this).val());
}
});
$('#mainimage').change(function(){
$('#ImagePreview').attr('src', $(this).val());
});
$('#campaignimage').change(function(){
$('#CampaignImagePreview').attr('src', $(this).val());
});
function LoadPage(PageName) {
$('.page').css('display', 'none');
$('.overlay').css('display', 'none');
$.ajax({
type: "POST",
url: PageName + ".php",
success: function(msg){
$('.conColumn').html(msg);
$('li#' + OldPage).removeClass('selected');
$('li#' + PageName).addClass('selected');
OldPage = PageName;
}
});
}
function SubmitForm() {
$('button.PostStory').attr('disabled', 'disabled');
$ .ajax({
type: "POST",
url: "functions/news_post_story.php",
data: "shortstory=" + escape($('#ShortStory').val()) + "&longstory=" + escape($('#LongStory').val()) + "&image=" + $('#mainimage').val() + "&title=" + $('#title').val() + "&campaign=" + $('#campaign').val() + "&campaignimage=" + $('#campaignimage').val(),
success: function(){
$('button#General').html('Posted!');
LoadPage('news');
$('.page').css('display', 'none');
$('.overlay').css('display', 'none');
}
});
}
</script>
<h1>Post New Article</h1>
<div class="ImagePreview">
<img src="img/block_32.png" id="ImagePreview" /><br /><br />
<label for="mainimage">Main Image: </label>
<select name="mainimage" id="mainimage" sttyle="width:300px">
<option value=""></option>
<?php
$newsimages = opendir('../../Public/Images/news/') or die('Error');
while($images = @readdir($newsimages)) {
if(!is_dir($images))
echo '<option value="Public/Images/news/'.$images.'">'.$images.'</option>';
}
closedir($newsimages);
?>
</select><br /><br />
<img src="img/block_32.png" id="CampaignImagePreview" /><br />
<label for="campaignimage">Campaign Image: </label><br />
<select name="campaignimage" id="campaignimage" sttyle="width:120px">
<option value=""></option>
<?php
$newsimages = opendir('../../Public/Images/campaign/') or die('Error');
while($images = @readdir($newsimages)) {
if(!is_dir($images))
echo '<option value="/Public/Images/campaign/'.$images.'">'.$images.'</option>';
}
closedir($newsimages);
?>
</select>
</div>
<br /><label for="title">Title: </label><br />
<input type="text" name="title" id="title" sttyle="width:343px" /><br /><br />
<label for="campaign">Campaign </label><br />
<select name="campaign" id="campaign">
<option value="0">No</option>
<option value="1">Yes</option>
</select><br /><br />
Short story:<br />
<textarea class="wysiwyg" name="short" id="ShortStory" sttyle="width:350px; height:175px"></textarea><br /><br />
Long story:<br />
<textarea class="wysiwyg" name="long" id="LongStory" sttyle="width:100%; height:275px"></textarea><br /><br />
<button onclick="SubmitForm()" class="PostStory">Post</button>
ATENÇÃO: É um caso de vida ou morte fpfpfpfpfpfpfpfp preciso de ajuda imediata!