UFO Slice Logo
Post your Reply

You must be logged in to post a reply

"; // get initial $.ajax({ url: "https://napi.ufoslice.com/posts/878?" + Math.floor(Math.random() * 100001), dataType: 'json', success: function(data) { topic = data.topic; posts = data.posts; topic_id = topic[0].topic_id; topic_category_id = topic[0].topic_category_id; topic_category_name = topic[0].topic_category_name; topic_category_slug = topic[0].topic_category_slug; topic_author_displayname = topic[0].topic_author_displayname; topic_author_avatar = topic[0].topic_author_avatar; topic_date = topic[0].topic_date; topic_title = topic[0].topic_title; topic_slug = topic[0].topic_slug; //topic_message = topic[0].topic_message; topic_message = Autolinker.link(topic[0].topic_message, { sanitizeHtml: true }); topic_media = topic[0].topic_media; topic_youtubeid = topic[0].topic_youtubeid; // get media if (topic_media != "") { $("#topic_media").html(''); } else { $("#topic_media").hide(); } // check if it's a youtube video if(topic_youtubeid!="0") { // build YT Embed YTEmbed = '' $("#topic_youtube").html(YTEmbed) } else { $("#topic_youtube").hide() } $(".posts_topic_title").text(topic_title); $(".posts_author_date span").text(topic_date); $("#topic_message").html(topic_message); $("#topic_date span").text(topic_date); $("#topic_author").text(topic_author_displayname); $("#topic_author_avatar img").attr("src",topic_author_avatar) $(".breadcrumb_category").html('' + topic_category_name + '') $(".breadcrumb_post").html('' + topic_title + '') // load topic replies $.each(posts, function(i,item){ posts_id = item.posts_id; posts_message = Autolinker.link(item.posts_message, { sanitizeHtml: true }); posts_author_displayname = item.posts_author_displayname; posts_author_signupdate = item.posts_author_signupdate; posts_author_avatar = item.posts_author_avatar; posts_date = item.posts_date; builder = (`
` + posts_author_displayname + `
Member Since` + posts_author_signupdate + `
` + posts_date + `
` + posts_message + `
`) $("#posts").append(builder); }); $("#topic").show() $("#posts").show() //$("#topic").slideToggle(function function_name() { // $("#posts").slideToggle(); //}); } }); } getPosts(); $(function() { //hang on event of form with id=myform $("#replyform").submit(function(e) { //prevent Default functionality e.preventDefault(); //get the action-url of the form var actionurl = e.currentTarget.action; //do your own request an handle the results $.ajax({ url: "https://napi.ufoslice.com/postreply", headers: { 'x-tauth': '' }, type: 'post', dataType: 'json', data: $("#replyform").serialize(), success: function(data) { console.log(data) try { theResponse = data.callback[0].response; if (theResponse=="success") { $("#posts").html(""); $("#reply_text").val(""); notification('success', 'Added New Reply!') getPosts(); } else { notification("error", "Post Message Failed (1001)") } } catch(err) { //alert(err) notification("error", "Post Message Failed (1002)") } } }); }); }); -->