Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 6th 2007
     # 1
    Hi,
    I was wondering how could i ad a class to the div li , for just the first comment of every discussion?

    wayne
    • CommentAuthorGrahack
    • CommentTimeNov 7th 2007
     # 2
    It's a theme question I think. Please refer to the docs for a clean theme modification.
    Not tested, but copy themes/comments.php in your new theme folder, you'll find this line
    $CommentList .= '<li id="Comment_'.$Comment->CommentID.'"'.($CommentClass == ''?'':' class="'.$CommentClass.'"').'>
    around line 74. Then just add this line
    if ( $RowNumber == 1 ) $CommentClass .= ' FirstComment';
    BEFORE it.

    Could you please tell us what is this for ?
  1.  # 3
    to make the first comment styled differently of course! :P

    I'm gonna try this out
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 7th 2007 edited
     # 4
    Yeah, i'm gonna use vanilla as a news platform, and if i can have control over the first comment, then i can make it different from the rest. So the first comment would be the Article, and all the rest can be comments on the article :)..

    Thanks so much, i'll try it out today :P

    wayne :)
    • CommentAuthorLunch
    • CommentTimeNov 7th 2007
     # 5
    If you want you can skip a little bit of processing time and just do this:

    ol#Comments li:first-child { /* your styles here */ }
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 7th 2007 edited
     # 6
    I guess, but i'd like to keep my css all together...
  2.  # 7
    that would be great if it worked in all browsers. ie6 still has a big chunk of the market
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 8th 2007 edited
     # 8
    Ok, thank you very much... How can i do the same with the discussions??? thanks in advance Wayne :) I'm assuming i'll be editing the Discussion.php file...
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 8th 2007 edited
     # 9
    I've been trying the same code for the discussion, but i have no program experience, i speggetti code ;) and can't seem to get results... I do notice that I may want to use $FirstRow = 1; for the discussion one's though, because unlike the comments, these rows sink ;0)
    •  
      CommentAuthorWanderer
    • CommentTimeNov 8th 2007
     # 10
    I'm not sure this add-on would help, it keeps the discussions in chronological order of posting, newest on top, I love it, it's essential for my needs. Thanks Wallphone

    Chronological
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 8th 2007
     # 11
    That's pretty cool, but want do me any good, i'm just trying to add an extra style class to just the first discussion only :)
    •  
      CommentAuthorWanderer
    • CommentTimeNov 8th 2007
     # 12
    Yes I think I know what you want, but currently that first discussion moves around as you say.

    With Chronological, it stays on top as long as it's the latest discussion (by creation date not newest comments date).

    By the way, I love your term "spaghetti code" it's much nicer than "hacker" :-)

    Me, I also add meatballs to my spaghetti!
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 8th 2007
     # 13
    Right, but i c there's a variable in the framework $FirstRow instead of $RowNumber so i thought i could just use that... but again, i'm just trying to do the above just like the comments, except with the discussions... I think using $FirstRow should take care of the Chronological problem that would come up. i just can't figure out what to include in the if statement...
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 8th 2007
     # 14
    Ok, i've added a class to the first comments, now how could i use an if statement to get rid of the Author and Date on the first comment?
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 8th 2007
     # 15
    Never mind i c i can use Display:None; for the Comment header in this case :P
    • CommentAuthorGrahack
    • CommentTimeNov 9th 2007
     # 16
    Do you want this new class on the first page or on every page ?
    • CommentAuthorGrahack
    • CommentTimeNov 9th 2007
     # 17
    In the first li of themes/discussion.php (maybe line 11), add
    .($FirstRow?' FirstDiscussion':'') to the serie of classes, right before .'">
    Replace $FirstRow by
    ($FirstRow AND ForceIncomingInt("page", 0) < 2)
    if you want only a FirstDiscussion class on the FIRST page of the discussion list.

    (remember hacking themes)
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 9th 2007
     # 18
    Thats it :) thank you so much, I tried doing it myself with no success. Sometimes i get it , sometimes i don't. But i will have to say Vanilla is really helping me to learn php :)
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 9th 2007
     # 19
    Once i finish this theme, i will definitely release it to the vanilla community. It's a News/Mag Theme and the comments part so far, are kinda like articles... where you have the main article and then people can post comments under it. The biggest change is the article looks like an article, doesn't look like a comment at all.
    • CommentAuthorGrahack
    • CommentTimeNov 9th 2007
     # 20
    A non-existing add-on that would be great for you is TemplateComment.
    Acting when creating a discussion only, this could help the writer of an article (or a bug reporter in our Issue Tracker).
    With a simple javascript onload thing, the comment form could be pre-filled.
    Each category could be assigned a template.
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 9th 2007 edited
     # 21
    Your absolutely right! You could have the form laid out with "Title" "Sub-Title" "Article Content" "Conclusion/ Sources..." The reason why I'm using vanilla for the articles in the first place is because search engines especially google Love Vanilla, they eat it up all day :P Here's a link you can copy and paste to check out what I've done so far... Don't want it to be and actual link here yet because don't want google indexing this... I had to get rid of the vanilla links for this theme but will add them to the footer as Powered by Vanilla :) You'll notice my first and only category is label golf blogs, this is perfect also for a blog like system. www.zgolfer.com/discussion/3/copperhead-golf-course-the-dominant-play-at-innisbrook-resort-near-tampa-florida/#Item_3
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 9th 2007
     # 22
    Lemme know what ya think of it so far... BTW I plan on having 50 + Categories and all will have a separate icon
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 15th 2007 edited
     # 23
    Ok, so far everythings going well... Now i need to do something to the firstcomment a little more complicated, just not sure how to do it... I want to move the comment header to the bottom for just the first comment. how might i go about this one??? All i can figure is in the comments.php file we're gonna ad one or two "if thens"...
    • CommentAuthorGrahack
    • CommentTimeNov 17th 2007
     # 24
    I guess you're right, everything is in the comments.php file, and you'll need a 'if', but no 'then' ;).
    What you need first is to break the strings to have separate instructions for the different <li></li> that you want to invert. Then have a try yourself!!! I think it can be as simple as:
    if ( it's the first ) {$CommentList.='<li>...1...</li>';$CommentList.='<li>...2...</li>';}
    else {$CommentList.='<li>...2...</li>';$CommentList.='<li>...1...</li>';}
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 17th 2007
     # 25
    I'll give it a try and let ya know how it turns out :)
    •  
      CommentAuthorgarvin
    • CommentTimeNov 17th 2007
     # 26
    Dude. That is awesome what you are doing. I'm going to have to try this myself.
    •  
      CommentAuthorgarvin
    • CommentTimeNov 17th 2007
     # 27
    Now looking at the rest of the Vanilla areas here, with this kind of concept, you could basically build an "Addon"esque vanilla install. Same for Swell. I think you could do a lot with this very concept.
    • CommentAuthorGrahack
    • CommentTimeNov 18th 2007
     # 28
    Sorry, I don't understand the "concept". Could you detail please ?
    •  
      CommentAuthorgarvin
    • CommentTimeNov 18th 2007
     # 29
    Look at the individual Addon's discussion page. Such as: http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=321

    That could basically be replicated with this idea: changing the first comment in the discussion to look different. Its the same thing for Swell's comment page: http://lussumo.com/swell/169/Vanilla-114-Package-Problem/#Comments

    I'm just saying with this concept: changing the look of the first comment, vanilla could very well be extended outside the realm of forums and into other types of CMS.

    Also, you'll have to excuse me. It was 2am when I wrote that and I was falling asleep mid-type.
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 18th 2007
     # 30
    That's exactly what i'm trying to achieve here, i'm turning vanilla into a cms kinda news theme site...
    • CommentAuthorGrahack
    • CommentTimeNov 18th 2007
     # 31
    Ok, understood now. Maybe we can hope this to be built-in in next versions...
    I don't know how to say in in English, but "forgive to you I give".
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 18th 2007
     # 32
    :oP "Grahack" you're really helping me to learn even more about vanilla and php :) thank you so much... Hopefully i'll have alot of people wanting to use the theme i'm building here :)

    wayne
    •  
      CommentAuthorgarvin
    • CommentTimeNov 18th 2007
     # 33
    I would totally use it. Especially to learn off to put into different needs that I have that this could totally work for. Its a great idea. Keep rolling with it.
    •  
      CommentAuthorwaynem80
    • CommentTimeNov 18th 2007
     # 34
    here's what i've got so far, take a look around... NC Golf Community
Add your comments
    Username Password
  • Format comments as