Browse Source

Fixed tags not getting edited correctly

pull/24/head
Teknikode 8 years ago
parent
commit
78508ca145
  1. 6
      ricehalla/edit_tags.php
  2. 18
      ricehalla/main.php
  3. 18
      ricehalla/view_image.php
  4. 11
      templates/default/js/common.js

6
ricehalla/edit_tags.php

@ -2,10 +2,10 @@ @@ -2,10 +2,10 @@
include('../includes/config.php');
$filename = "";
if(isset($_GET) && $logged_in)
if(isset($_POST) && $logged_in)
{
$id = rawurldecode($_GET['id']);
$tags = rawurldecode($_GET['tags']);
$id = rawurldecode($_POST['id']);
$tags = rawurldecode($_POST['tags']);
$user_id = $user->id;
$desktop = $db->select('ricehalla', 'id=? AND user_id=?', array($id, $user_id));
if ($desktop)

18
ricehalla/main.php

@ -134,13 +134,23 @@ @@ -134,13 +134,23 @@
tagClass: "btn-primary",
afterAddingTag: function(tag){
var current_tags = $('#taglist-<?php echo $result['id']; ?>').tags().getTags();
var url = "../edit_tags.php?id=<?php echo $result['id']; ?>&tags="+current_tags;
postServerData(url);
var url = "../edit_tags.php";
var data = "id="+encodeURIComponent(<?php echo $result['id']; ?>)+"&tags="+encodeURIComponent(current_tags);
$.ajax({
type: "POST",
url: url,
data: data
});
},
afterDeletingTag: function(tag){
var current_tags = $('#taglist-<?php echo $result['id']; ?>').tags().getTags();
var url = "../edit_tags.php?id=<?php echo $result['id']; ?>&tags="+current_tags;
postServerData(url);
var url = "../edit_tags.php";
var data = "id="+encodeURIComponent(<?php echo $result['id']; ?>)+"&tags="+encodeURIComponent(current_tags);
$.ajax({
type: "POST",
url: url,
data: data
});
}
});
});

18
ricehalla/view_image.php

@ -114,13 +114,23 @@ if (isset($_GET['id'])) @@ -114,13 +114,23 @@ if (isset($_GET['id']))
tagClass: "btn-primary",
afterAddingTag: function(tag){
var current_tags = $('#taglist-<?php echo $result['id']; ?>').tags().getTags();
var url = "../edit_tags.php?id=<?php echo $result['id']; ?>&tags="+current_tags;
var response = Get_Server_Response(url);
var url = "../edit_tags.php";
var data = "id="+encodeURIComponent(<?php echo $result['id']; ?>)+"&tags="+encodeURIComponent(current_tags);
$.ajax({
type: "POST",
url: url,
data: data
});
},
afterDeletingTag: function(tag){
var current_tags = $('#taglist-<?php echo $result['id']; ?>').tags().getTags();
var url = "../edit_tags.php?id=<?php echo $result['id']; ?>&tags="+current_tags;
var response = Get_Server_Response(url);
var url = "../edit_tags.php";
var data = "id="+encodeURIComponent(<?php echo $result['id']; ?>)+"&tags="+encodeURIComponent(current_tags);
$.ajax({
type: "POST",
url: url,
data: data
});
}
});
});

11
templates/default/js/common.js

@ -95,16 +95,7 @@ $(function() { @@ -95,16 +95,7 @@ $(function() {
// Fix input element click problem
$('.dropdown input, .dropdown label').click(function(e) {
e.stopPropagation();
});
function postServerData(url, data)
{
$.ajax({
type: "POST",
url: url,
data: data
});
}
});
});
function removeAmp(code)

Loading…
Cancel
Save