Permalink
Browse files

SITE: first semi functionnal comment displaying Ajax method

  • Loading branch information...
Asimov4 committed Apr 7, 2012
1 parent efa18b1 commit bd618310c36bf4c9df855003b75e5ed5eac5ee01
Showing with 40 additions and 29 deletions.
  1. +7 −0 SITE/ajax.php
  2. +29 −29 SITE/examples/example_unrollcomments.php
  3. +4 −0 SITE/script_php/pages_secondlevel/comments.php
View
@@ -21,8 +21,11 @@
Contact : nicolas.seichepine.org/?action=contact
*/
+session_start();
+
include_once("config.php");
include_once("script_php/pages_secondlevel/actions.php");
+include_once("script_php/pages_secondlevel/comments.php");
// Demande
@@ -38,6 +41,10 @@
case "post":
post($_POST['title'],$_POST['message'],$_POST['anonymization'],$_POST['category'],$_SESSION['login_c'],$valid=0,$output='JSON');
break;
+
+ case "unrollcomment":
+ affichage_comments(27);
+ break;
// Message d'erreur
default:
@@ -12,34 +12,6 @@
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
-
- <script>
- // var BASE URL = 'http://refresh.org';
- var ACTIONS_URL = 'http://refresh.nouvelingenieur.fr/index.php';
-
- $('.speccom').click(function() {
-
- var url = ACTIONS_URL + $(this).attr("href");
-
- // show that is working
- $('.loader').html('Loading posts from : ' + url);
-
- // load posts
- $.ajax(
- {
- url: url,
- success: function(rep)
- {
- $('.placeholder').html(rep);
- }
- });
-
-
-
- return false;
-
- });
- </script>
<style media="screen" type="text/css">
.newsformcomment {
@@ -63,9 +35,37 @@
<div class='loader'></div>
<div class="newsformcomment">
-
<p>Here goes the comments</p>
</div>
+
+ <script type="text/javascript">
+ // var BASE URL = 'http://refresh.org';
+ var ACTIONS_URL = '../ajax.php';
+
+ $('.speccom').click(function() {
+
+ var url = ACTIONS_URL + $(this).attr("href");
+
+ // show that is working
+ $('.loader').html('Loading posts from : ' + url);
+
+ // load posts
+ $.ajax(
+ {
+ url: url,
+ success: function(rep)
+ {
+ $('.newsformcomment').html(rep);
+ }
+ });
+
+
+
+ return false;
+
+ });
+ </script>
+
</body>
</html>
@@ -1109,6 +1109,10 @@ function affichage_comments($thread_id,$moderation_mode=false,$unique_mode=false
}
@mysql_free_result($result);
}
+ }
+ else
+ {
+ echo('<div class="warning">Vous ne disposez pas des droits n&eacute;cessaires</div>');
}
}
}

0 comments on commit bd61831

Please sign in to comment.