240 lines
5.4 KiB
JavaScript
240 lines
5.4 KiB
JavaScript
var hc_picid="";
|
|
function hcuinfo(thepid)
|
|
{
|
|
if(typeof thepid== 'undefined') {thepid = '';}
|
|
doc="/include/analytics/hcuinfo.php";
|
|
hc_picid=thepid;
|
|
jQuery.ajax({
|
|
url: doc,
|
|
type: 'POST',
|
|
cache: false,
|
|
data:{thepid:thepid,theuid:userid,uphoto:userphoto},
|
|
success: function(data) {
|
|
if(!data.error)
|
|
{
|
|
|
|
hc_uphoto=data.uphoto;
|
|
hc_uphoto='<img src="'+hc_uphoto+'" width="50" height="33" style="height:auto;float:left;margin-right:5px;"/>Entry By <a href="http:/profile.php?user='+data.uname+'" target="_blank">'+data.uname+'</a><br />Posted On: '+data.entrydate;
|
|
jQuery("#entry_info").html(hc_uphoto);
|
|
if(data.ccount==1)
|
|
{
|
|
nchtml="<strong>Comment:</strong> 1";
|
|
}
|
|
else
|
|
{
|
|
nchtml="<strong>Comments:</strong> "+data.ccount;
|
|
}
|
|
jQuery("#nu_comments").html(nchtml);
|
|
}
|
|
if(data.allcomments != "")
|
|
{
|
|
jQuery('#blog_comments').html(data.allcomments);
|
|
}
|
|
else
|
|
{
|
|
jQuery('#blog_comments').html("");
|
|
}
|
|
if(data.somestuff != "")
|
|
{
|
|
jQuery('#add_spacing').html(data.somestuff);
|
|
jQuery('#add_spacing').css('display','block');
|
|
}
|
|
|
|
},
|
|
error: function(resp, textStatus, errorThrown) {
|
|
// alert(resp.responseText);
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
function hc_postcomment()
|
|
{
|
|
if(typeof thepid== 'undefined') {thepid = '';}
|
|
doc="/include/analytics/hc_postcomment.php";
|
|
|
|
var hccomment = jQuery('textarea#comment_body').val();
|
|
jQuery('textarea#comment_body').val("");
|
|
jQuery('#comment_success').html("");
|
|
if(hccomment == "")
|
|
{
|
|
jQuery('#comment_success').css('color','yellow');
|
|
jQuery('#comment_success').html("<em>Please write something!</em>");
|
|
|
|
}
|
|
else
|
|
{
|
|
jQuery.ajax({
|
|
url: doc,
|
|
type: 'POST',
|
|
cache: false,
|
|
data:{thepid:hc_picid,theuid:userid,thename:username,thecment:hccomment},
|
|
success: function(data) {
|
|
|
|
if(!data.error)
|
|
{
|
|
jQuery('#comment_success').css('color','lightgreen');
|
|
jQuery('#comment_success').html("Success: Comment Added");
|
|
currhtml=jQuery('#blog_comments').html();
|
|
newhtml=data.rcment+currhtml;
|
|
jQuery('#blog_comments').html(newhtml);
|
|
}
|
|
else
|
|
{
|
|
jQuery('textarea#comment_body').val(hccomment);
|
|
jQuery('#comment_success').css('color','yellow');
|
|
jQuery('#comment_success').html("<em>Error: Please submit again!</em>");
|
|
}
|
|
},
|
|
error: function(resp, textStatus, errorThrown) {
|
|
// alert(resp.responseText);
|
|
jQuery('textarea#comment_body').val(hccomment);
|
|
jQuery('#comment_success').css('color','yellow');
|
|
jQuery('#comment_success').html("<em>Error: Please submit again!</em>");
|
|
}
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
function edit_comment(val)
|
|
{
|
|
jQuery('#profile_comment_body_'+val+'').focus();
|
|
jQuery('#profile_comment_body_'+val+'').css('background','#fff');
|
|
jQuery('#profile_comment_body_'+val+'').css('color','#000');
|
|
}
|
|
|
|
function edit_comment_act(val)
|
|
{
|
|
jQuery('#profile_comment_body_'+val+'').css('background','transparent');
|
|
jQuery('#profile_comment_body_'+val+'').css('color','#fff');
|
|
jQuery('#hc_cmsg_'+val+'').html("");
|
|
thecomment=jQuery('#profile_comment_body_'+val+'').html();
|
|
doc="/include/analytics/hc_ed_comment_act.php";
|
|
jQuery.ajax({
|
|
url: doc,
|
|
type: 'POST',
|
|
cache: false,
|
|
data:{thecid:val,theuid:userid,thecment:thecomment},
|
|
success: function(data) {
|
|
if(!data.error)
|
|
{
|
|
jQuery('#hc_cmsg_'+val+'').css('color','lightgreen');
|
|
jQuery('#hc_cmsg_'+val+'').html("Congratulations: Comment updated!");
|
|
}
|
|
else
|
|
{
|
|
jQuery('#hc_cmsg_'+val+'').css('color','yellow');
|
|
jQuery('#hc_cmsg_'+val+'').html("<em>Error: Please try again!</em>");
|
|
|
|
}
|
|
},
|
|
error: function(resp, textStatus, errorThrown) {
|
|
//alert(resp.responseText);
|
|
jQuery('#hc_cmsg_'+val+'').css('color','yellow');
|
|
jQuery('#hc_cmsg_'+val+'').html("<em>Error: Please try again!</em>");
|
|
|
|
}
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
function del_comment_act(val)
|
|
{
|
|
jQuery('#hc_cmsg_'+val+'').html("");
|
|
doc="/include/analytics/hc_del_comment_act.php";
|
|
jQuery.ajax({
|
|
url: doc,
|
|
type: 'POST',
|
|
cache: false,
|
|
data:{thecid:val,theuid:userid},
|
|
success: function(data) {
|
|
if(!data.error)
|
|
{
|
|
jQuery('#comment_'+val+'').html("");
|
|
}
|
|
else
|
|
{
|
|
jQuery('#hc_cmsg_'+val+'').css('color','yellow');
|
|
jQuery('#hc_cmsg_'+val+'').html("<em>Error: Please try again!</em>");
|
|
|
|
}
|
|
},
|
|
error: function(resp, textStatus, errorThrown) {
|
|
//alert(resp.responseText);
|
|
jQuery('#hc_cmsg_'+val+'').css('color','yellow');
|
|
jQuery('#hc_cmsg_'+val+'').html("<em>Error: Please try again!</em>");
|
|
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function hc_approve_entry(val)
|
|
{
|
|
approved="no";
|
|
ischecked=jQuery('#hc_approve').is(':checked');
|
|
if(ischecked)
|
|
{
|
|
jQuery('input[name=hc_reject]').attr('checked',false);
|
|
approved="yes";
|
|
}
|
|
else
|
|
{
|
|
approved="pending";
|
|
}
|
|
|
|
hc_update_status(val,approved);
|
|
|
|
}
|
|
|
|
|
|
function hc_reject_entry(val)
|
|
{
|
|
rejected="";
|
|
ischecked=jQuery('#hc_reject').is(':checked');
|
|
if(ischecked)
|
|
{
|
|
jQuery('input[name=hc_approve]').attr('checked',false);
|
|
rejected="no";
|
|
|
|
}
|
|
else
|
|
{
|
|
rejected="pending";
|
|
}
|
|
|
|
hc_update_status(val,rejected);
|
|
|
|
}
|
|
|
|
function hc_update_status(theid,thestatus)
|
|
{
|
|
|
|
doc="/include/analytics/hc_update_status.php";
|
|
jQuery.ajax({
|
|
url: doc,
|
|
type: 'POST',
|
|
cache: false,
|
|
data:{thepid:theid,thestatus:thestatus},
|
|
success: function(data) {
|
|
if(!data.error)
|
|
{
|
|
|
|
}
|
|
else
|
|
{
|
|
//alert(data.error);
|
|
|
|
}
|
|
},
|
|
error: function(resp, textStatus, errorThrown) {
|
|
// alert(resp.responseText);
|
|
|
|
|
|
}
|
|
});
|
|
} |