forked from 4ducky/4ducky
Move the original PHP site into legacy/
The PHP sources, templates and old jQuery-based scripts move unchanged into legacy/ for reference. Shared assets (media/, images/, favicon.ico, the default avatar) stay at the repository root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,186 @@
|
||||
function LoadData2 (str,divId,imageId)
|
||||
{
|
||||
|
||||
if (str=="")
|
||||
{
|
||||
document.getElementById(divId).innerHTML="";
|
||||
return;
|
||||
}
|
||||
if (window.XMLHttpRequest)
|
||||
{// code for IE7+, Firefox, Chrome, Opera, Safari
|
||||
xmlhttp=new XMLHttpRequest();
|
||||
}
|
||||
else
|
||||
{// code for IE6, IE5
|
||||
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
|
||||
xmlhttp.onreadystatechange=function()
|
||||
{
|
||||
if (xmlhttp.readyState==4 && xmlhttp.status==200)
|
||||
{
|
||||
document.getElementById(divId).innerHTML=xmlhttp.responseText;
|
||||
}
|
||||
}
|
||||
|
||||
xmlhttp.open("POST","/ajax_getdata.php",true);
|
||||
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
|
||||
xmlhttp.send("q="+str+"&imageId="+imageId);
|
||||
}
|
||||
|
||||
function LoadData(str,divId,imageId)
|
||||
{
|
||||
getValues("/ajax_getdata.php",divId);
|
||||
|
||||
function getValues (url,divId) {
|
||||
var result = null;
|
||||
jQuery.ajax({
|
||||
type: "POST",
|
||||
url: "/ajax_getdata.php",
|
||||
global:false,
|
||||
data: "q="+str+"&imageId="+imageId,
|
||||
success: function(data) {
|
||||
|
||||
jQuery('#'+divId).html(data);
|
||||
jQuery('#'+divId).css("display","block");
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function CloseU(){
|
||||
jQuery('#MenuLoad').css("display","none");
|
||||
}
|
||||
function Menu(art,er){
|
||||
|
||||
if(art=="upload"){
|
||||
jQuery('#UploadD').css("background-position","24px top");
|
||||
}
|
||||
if(art=="addon"){
|
||||
jQuery('#UploadD').css("background-position","90px top");
|
||||
}
|
||||
|
||||
if(er=="error"){
|
||||
jQuery('#UbLoad').css("display","none");
|
||||
jQuery('#MenuLoad').css("display","block");
|
||||
return;
|
||||
}
|
||||
jQuery('#MenuLoad').css("display","block");
|
||||
jQuery('#UbLoad').css("display","block");
|
||||
LoadData(art,"UploadD_d",0);
|
||||
jQuery('#UbLoad').css("display","none");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function SubmitComment(imageId) {
|
||||
|
||||
var fileName = jQuery("#image_comment").val();
|
||||
var urlName = jQuery("#url_comment").val();
|
||||
var content=jQuery("#content_comment").val();
|
||||
if(content.length <1){
|
||||
jQuery('#CommentError').html("Your comment is too short!");
|
||||
jQuery('#CommentError').css("display","block");
|
||||
return
|
||||
}
|
||||
|
||||
if(fileName.length > 4){
|
||||
jQuery('#CommentForm').submit();
|
||||
}else{
|
||||
|
||||
jQuery("#image_comment").prop('disabled', true);
|
||||
jQuery("#url_comment").prop('disabled', true);
|
||||
jQuery("#content_comment").prop('disabled', true);
|
||||
jQuery("#SubBut").prop('disabled', true);
|
||||
|
||||
jQuery('#SubLoad').css("display","block");
|
||||
|
||||
var result = null;
|
||||
jQuery.ajax({
|
||||
type: "POST",
|
||||
url: "/ajax_getdata.php",
|
||||
async:false,
|
||||
global:false,
|
||||
data: "q=add&imageId="+imageId+"&content="+encodeURIComponent(content)+"&urlUpload="+urlName,
|
||||
success: function(data) {
|
||||
result = data;
|
||||
}
|
||||
});
|
||||
if(result.length > 1){
|
||||
/*if(result="notok-user"){
|
||||
document.getElementById("CommentError").innerHTML = "Session-Error!";
|
||||
document.getElementById("CommentError").style.display = "block";
|
||||
return;
|
||||
}
|
||||
if(result="notok-image"){
|
||||
document.getElementById("CommentError").innerHTML = "Image-Error!";
|
||||
document.getElementById("CommentError").style.display = "block";
|
||||
return;
|
||||
}
|
||||
if(result="notok-comment"){
|
||||
document.getElementById("CommentError").innerHTML = "Comment-Error!";
|
||||
document.getElementById("CommentError").style.display = "block";
|
||||
return;
|
||||
}
|
||||
if(result.length > 1){
|
||||
document.getElementById("CommentError").innerHTML = result;
|
||||
document.getElementById("CommentError").style.display = "block";
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
jQuery("#image_comment").prop('disabled', false);
|
||||
jQuery("#url_comment").prop('disabled', false);
|
||||
jQuery("#content_comment").prop('disabled', false);
|
||||
jQuery("#SubBut").prop('disabled', false);
|
||||
document.getElementById('CommentForm').reset();
|
||||
jQuery('#SubLoad').css("display","none");
|
||||
LoadData("comments","cmts",imageId);
|
||||
}
|
||||
}
|
||||
|
||||
function PostData(content,divId,imageId)
|
||||
{
|
||||
|
||||
document.getElementById(divId).innerHTML=getValues("/ajax_getdata.php");
|
||||
|
||||
|
||||
function getValues (url) {
|
||||
var result = null;
|
||||
jQuery.ajax({
|
||||
type: "POST",
|
||||
url: "/ajax_getdata.php",
|
||||
async:false,
|
||||
global:false,
|
||||
data: "q="+str+"&imageId="+imageId,
|
||||
success: function(data) {
|
||||
result = data;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function toggle(DivName) {
|
||||
var ele = document.getElementById(DivName);
|
||||
var text = document.getElementById("displayText");
|
||||
if(ele.style.display == "block") {
|
||||
ele.style.display = "none";
|
||||
text.innerHTML = "show";
|
||||
}
|
||||
else {
|
||||
ele.style.display = "block";
|
||||
text.innerHTML = "hide";
|
||||
}
|
||||
}
|
||||
function changeUpload(divShow,divHide) {
|
||||
var Show = document.getElementById(divShow);
|
||||
var Hide = document.getElementById(divHide);
|
||||
Hide.style.display = "none";
|
||||
Show.style.display = "block";
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user