Search Results

Search found 4716 results on 189 pages for 'comment'.

Page 9/189 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Multiple IntenseDebate Comment Counts

    - by Aristotle
    I just setup IntenseDebate on my blog this evening and am, for the most part, pleased with it. One thing I did see is that they offered me a small snippet to show the current number of comments: <script> var idcomments_acct = 'abcdefgef12345678mykey8675309acdc'; var idcomments_post_id; var idcomments_post_url; </script> <script type="text/javascript" src="http://www.intensedebate.com/js/genericLinkWrapperV2.js"></script> This is nice, but what I would like to do is have something similar on my archives page where many posts are listed - not just one. Presently the page looks like this: Some Post TitleAuthor NameShort abstract from this post... Some Post TitleAuthor NameShort abstract from this post... I would like it to look like this: Some Post TitleAuthor NameShort abstract from this post...7 Comments Some Post TitleAuthor NameShort abstract from this post...3 Comments But I'm not exactly sure how I can do this with IntenseDebate. Do they offer any sort of method to gather the total number of comments for multiple pages from a single page?

    Read the article

  • Facebook-WordPress comment/feedback integration

    - by warren
    Currently I have my Facebook profile automatically republish blog posts from a WordPress instance. What I would like to be able to do, however, is to also have comments posted to either the blog of Facebook show up on the other in the appropriate location. Is there a way to do this with the Facebook API?

    Read the article

  • Remove trailing slash from comment form

    - by Sergio Vargott
    and i really need a code to remove the ending slash when a user put their link. for example i need them to put their url to grab their avatar, but in some cases they put their url ending with a slash (.com/) how can i remove that slash automatically? because when they put their url like that the avatar doesn't show i need them to end like this (.com) in order to show their avatar. I was looking for a remove trailing slash php code, but any solution will be appreciated. i tried to use this code but didn't work $string = rtrim($string, '/');

    Read the article

  • PartCover shows 0% coverage for getter and 100% coverage for setter despite the code being commented

    - by Gorgsenegger
    Hi all, I have a public property in my code as below: [DependencyInjection] public IEVentController EventController { get; set; } I also have a line of code referencing the EventController property: EventController.ExecuteObjectEvents( someObject, null ); Now currently (due to some missing implementation in another part of the application) I commented both these code sections out. Nevertheless, when I run PartCover it shows me a coverage of 0% for get_EventController and 100% for set_EventController. The strange thing is, that the Coverage Details view also correctly shows me that the code is commented out and therefore should not be treated as code - why does PartCover recognise it anyway? I would have expected to not get the getter and setter listed in the PartCover result. There is definitely no other reference to that code in the class to be tested, any ideas? Thanks in advance & Best regards G.

    Read the article

  • current_user and Comments on Posts - Create another association or loop posts? - Ruby on Rails

    - by bgadoci
    I have created a blog application using Ruby on Rails and have just added an authentication piece and it is working nicely. I am now trying to go back through my application to adjust the code such that it only shows information that is associated with a certain user. Currently, Users has_many :posts and Posts has_many :comments. When a post is created I am successfully inserting the user_id into the post table. Additionally I am successfully only displaying the posts that belong to a certain user upon their login in the /views/posts/index.html.erb view. My problem is with the comments. For instance on the home page, when logged in, a user will see only posts that they have written, but comments from all users on all posts. Which is not what I want and need some direction in correcting. I want only to display the comments written on all of the logged in users posts. Do I need to create associations such that comments also belong to user? Or is there a way to adjust my code to simply loop through post to display this data. I have put the code for the PostsController, CommentsController, and /posts/index.html.erb below and also my view code but will post more if needed. class PostsController < ApplicationController before_filter :authenticate auto_complete_for :tag, :tag_name auto_complete_for :ugtag, :ugctag_name def index @tag_counts = Tag.count(:group => :tag_name, :order => 'count_all DESC', :limit => 20) conditions, joins = {}, :votes @ugtag_counts = Ugtag.count(:group => :ugctag_name, :order => 'count_all DESC', :limit => 20) conditions, joins = {}, :votes @vote_counts = Vote.count(:group => :post_title, :order => 'count_all DESC', :limit => 20) conditions, joins = {}, :votes unless(params[:tag_name] || "").empty? conditions = ["tags.tag_name = ? ", params[:tag_name]] joins = [:tags, :votes] end @posts= current_user.posts.paginate( :select => "posts.*, count(*) as vote_total", :joins => joins, :conditions=> conditions, :group => "votes.post_id, posts.id ", :order => "created_at DESC", :page => params[:page], :per_page => 5) @popular_posts=Post.paginate( :select => "posts.*, count(*) as vote_total", :joins => joins, :conditions=> conditions, :group => "votes.post_id, posts.id", :order => "vote_total DESC", :page => params[:page], :per_page => 3) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @posts } format.json { render :json => @posts } format.atom end end def show @post = Post.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @post } end end def new @post = Post.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @post } end end def edit @post = Post.find(params[:id]) end def create @post = current_user.posts.create(params[:post]) respond_to do |format| if @post.save flash[:notice] = 'Post was successfully created.' format.html { redirect_to(@post) } format.xml { render :xml => @post, :status => :created, :location => @post } else format.html { render :action => "new" } format.xml { render :xml => @post.errors, :status => :unprocessable_entity } end end end def update @post = Post.find(params[:id]) respond_to do |format| if @post.update_attributes(params[:post]) flash[:notice] = 'Post was successfully updated.' format.html { redirect_to(@post) } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @post.errors, :status => :unprocessable_entity } end end end def destroy @post = Post.find(params[:id]) @post.destroy respond_to do |format| format.html { redirect_to(posts_url) } format.xml { head :ok } end end end CommentsController class CommentsController < ApplicationController before_filter :authenticate, :except => [:show, :create] def index @comments = Comment.find(:all, :include => :post, :order => "created_at DESC").paginate :page => params[:page], :per_page => 5 respond_to do |format| format.html # index.html.erb format.xml { render :xml => @comments } format.json { render :json => @comments } format.atom end end def show @comment = Comment.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @comment } end end # GET /posts/new # GET /posts/new.xml # GET /posts/1/edit def edit @comment = Comment.find(params[:id]) end def update @comment = Comment.find(params[:id]) respond_to do |format| if @comment.update_attributes(params[:comment]) flash[:notice] = 'Comment was successfully updated.' format.html { redirect_to(@comment) } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @comment.errors, :status => :unprocessable_entity } end end end def create @post = Post.find(params[:post_id]) @comment = @post.comments.build(params[:comment]) respond_to do |format| if @comment.save flash[:notice] = "Thanks for adding this comment" format.html { redirect_to @post } format.js else flash[:notice] = "Make sure you include your name and a valid email address" format.html { redirect_to @post } end end end def destroy @comment = Comment.find(params[:id]) @comment.destroy respond_to do |format| format.html { redirect_to Post.find(params[:post_id]) } format.js end end end View Code for Comments <% Comment.find(:all, :order => 'created_at DESC', :limit => 3).each do |comment| -%> <div id="side-bar-comments"> <p> <div class="small"><%=h comment.name %> commented on:</div> <div class="dark-grey"><%= link_to h(comment.post.title), comment.post %><br/></div> <i><%=h truncate(comment.body, :length => 100) %></i><br/> <div class="small"><i> <%= time_ago_in_words(comment.created_at) %> ago</i></div> </p> </div> <% end -%>

    Read the article

  • Error handling in Rails Controller for adding embedded Mongoid documents to Model

    - by Dragonfly
    I have a Item model that has embedded documents. Currently, the following comments_controller code will add a comment to the item successfully. However, if pushing the comment document onto the comments array on item fails, I will not know this. #this does work, but i do not know if the push fails def create comment = Comment.new(:text => params[:text]) @item.comments << comment render :text => comment end I would like to have something like this, but @item.comments << comment does not return true or false: #this does not work def create comment = Comment.new(:text => params[:text]) if @item.comments << comment render :text => comment else render :text => 'oh no' end end Nor does it throw an exception when the document push fails: #this does not work def create begin comment = Comment.new(:text => params[:text]) @item.comments << comment render :text => comment rescue Exception => e render :text => 'oh no' end end Thanks!

    Read the article

  • Commenting practices?

    - by Tarmon
    Hey Everyone, As a student in computer engineering I have been pressured to type up very detailed comments for everything I do. I can see this being very useful for group projects or in the work place but when you work on your own projects do you spend as much time commenting? As a personal project I am working on grows more and more complicated I sometimes feel as though I should be commenting more but I also feel as though it's a waste of time since I will probably be the only one working on it. Is it worth the time and cluttered code? Thoughts?

    Read the article

  • Showing x amount of comments on post list in WordPress

    - by shoestringo
    Hi all, Im currently scouting for a plugin for Wordpress which will show a certain amount of comments for each blog entry on the home page and under each category. For example on the home page: Entry #3 Blog content Comment Comment Comment Entry #2 Blog content Comment Comment Comment Entry #1 Blog content Comment Comment Comment I hope Ive explained clearly. I havent found what Im looking for yet, maybe Im searching the wrong phrases! Any pointers would be appreciated, thanks for your time!

    Read the article

  • Caught AttributeError while rendering: 'str' object has no attribute '_meta'

    - by D_D
    def broadcast_display_and_form(request): if request.method == 'POST' : form = PostForm(request.POST) if form.is_valid(): post = form.cleaned_data['post'] obj = form.save(commit=False) obj.person = request.user obj.post = post obj.save() readers = User.objects.all() for x in readers: read_obj = BroadcastReader(person = x) read_obj.post = obj read_obj.save() return HttpResponseRedirect('/broadcast') else : form = PostForm() posts = BroadcastReader.objects.filter(person = request.user) return render_to_response('broadcast/index.html', { 'form' : form , 'posts' : posts ,} ) My template: {% extends "base.html" %} {% load comments %} {% block content %} <form action='.' method='POST'> {{ form.as_p }} <p> <input type="submit" value ="send it" /></input> </p> </form> {% get_comment_count for posts.post as comment_count %} {% render_comment_list for posts.post %} {% for x in posts %} <p> {{ x.post.person }} - {{ x.post.post }} </p> {% endfor %} {% endblock %}

    Read the article

  • What are the benefits vs costs of comment annotation in PHP?

    - by Patrick
    I have just started working with symfony2 and have run across comment annotations. Although comment annotation is not an inherent part of PHP, symfony2 adds support for this feature. My understanding of commenting is that it should make the code more intelligible to the human. The computer shouldn't care what is in comments. What benefits come from doing this type of annotation versus just putting a command in the normal PHP code? ie- /** * @Route("/{id}") * @Method("GET") * @ParamConverter("post", class="SensioBlogBundle:Post") * @Template("SensioBlogBundle:Annot:post.html.twig", vars={"post"}) * @Cache(smaxage="15") */ public function showAction(Post $post) { }

    Read the article

  • Using SQLAlchemy, how can I return a count with multiple columns

    - by Andy
    I am attempting to run a query like this: SELECT comment_type_id, name, count(comment_type_id) FROM comments, commenttypes WHERE comment_type_id=commenttypes.id GROUP BY comment_type_id Without the join between comments and commenttypes for the name column, I can do this using: session.query(Comment.comment_type_id,func.count(Comment.comment_type_id)).group_by(Comment.comment_type_id).all() However, if I try to do something like this, I get incorrect results: session.query(Comment.comment_type_id, Comment.comment_type, func.count(Comment.comment_type_id)).group_by(Comment.comment_type_id).all() I have two problems with the results: (1, False, 82920) (2, False, 588) (3, False, 4278) (4, False, 104370) Problems: The False is not correct The counts are wrong My expected results are: (1, 'Comment Type 1', 13820) (2, 'Comment Type 2', 98) (3, 'Comment Type 2', 713) (4, 'Comment Type 2', 17395) How can I adjust my command to pull the correct name value and the correct count?

    Read the article

  • Google s'achemine vers la recherche sans recherche ou comment délivrer des résultats sans que l'utilisateur n'ait à le demander

    Google s'achemine vers la recherche sans recherche Ou comment délivrer des résultats sans que l'utilisateur n'ait à le demander Lors de la conférence « LeWeb10 », qui se tient actuellement à Paris (à Saint-Denis exactement), Marissa Mayer, ex-Vice Présidente du Search Product (du moteur de recherche donc) de Google - et à présent en charge de la branche Géolocalisation et des Services Localisés - est revenue sur une des perspectives d'avenir de la société. Lors d'un entretien sur la grande scène de la manifestion, elle a ainsi laissé entendre qu'un des prochains produits importants de Google serait la « découverte contextuelle » (contextual discovery) Il ne s...

    Read the article

  • Un hacker de 12 ans pirate des sites officiels pour Anonymous en échange de jeux vidéo, « et il a dit aux autres comment faire » ajoute la police

    Un hacker de 12 ans pirate des sites officiels pour Anonymous en échange de jeux vidéo, « et il a dit aux autres comment faire » ajoute la police 12 ans et il plaide déjà coupable à trois chefs d'accusation de piratage par un tribunal canadien. L'élève de cinquième qui avait alors 11 ans au moment des faits a aidé le collectif Anonymous à lancer des attaques DDoS contre des sites gouvernementaux pendant la crise estudiantine québécoise de l'année passée. Avec la promesse d'obtenir des jeux...

    Read the article

  • Should I comment Tables or Columns in my database?

    - by jako
    I like to comment my code with various information, and I think most people nowadays do so while writing some code. But when it comes to database tables or columns, I have never seen anyone setting some comments, and, to be honest, I don't even think of looking for comments there. So I am wondering if some people are commenting their DB strcuture here, and if I should bother commenting, for instance when I create a new column to an existing table?

    Read the article

  • Comment programmer le robot humanoïde Nao en .Net ? Extrait d'une session sur le sujet donnée aux TechDays 2011

    Comment programmer le robot humanoïde Nao en .Net ? Extrait d'une session sur le sujet donnée aux TechDays 2011 La semaine dernière, à l'occasion des TechDays et pour présenter son Developer Program, l'équipe d'Aldebaran Robotics a donné une conférence sur la manière de programmer son petit robot Nao via .Net, ce qui se révèle somme toute assez simple. Extrait, avec des actions basiques comme dire "Bonjour" ou tourner la tête :

    Read the article

  • Bitcoin ou comment investir 18 euros et récolter plus de 600 000 euros ? L'histoire d'un jeune norvégien

    Bitcoin ou comment investir 18 euros et récolter plus de 600 000 euros ? L'histoire d'un jeune norvégien En 2009, alors qu'il était encore étudiant, un norvégien du nom de Kristoffer Koch entend parler des bitcoins, la monnaie virtuelle qui permet de faire des achats sur Internet. Par curiosité, il décide de dépenser 150 couronnes norvégiennes (environ 18 euros) pour acquérir 5 000 bitcoins. Par la suite il a complètement perdu de vue son investissement, jusqu'au jour où les médias s'intéressent...

    Read the article

  • Comment se débarrasser du nouveau botnet "pratiquement indestructible" ? Les conseils de Microsoft et de Symantec

    Comment se débarrasser du nouveau botnet "pratiquement indestructible" ? Les conseils de Microsoft et de Symantec Microsoft met en garde contre Popureb, un nouveau Rootkit sophistiqué, capable d'écraser le MBR (Master Boot Record) et particulièrement difficile, voire impossible à détecter. Le centre de protection de Microsoft (Microsoft Malware Portection Center) affirme dans un billet de blog que si le système d'exploitation d'un utilisateur est infecté par le Trojan Win32/Popureb.E, il devra rétablir le MBR, et utiliser ensuite le CD de restauration pour restaurer son système à un état antérieur à l'infection.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >