Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [MOD] Custom comments styling and more (sNews 1.5)  (Read 15626 times)

Mika

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 9
  • Posts: 1408
    • http://www.ni5ni6.com/
[MOD] Custom comments styling and more (sNews 1.5)
« on: December 19, 2006, 07:19:53 PM »

My latest article will give you some insight into comments area customization options, but it's just too big for copy/paste method.

I hope you'll find it useful ;)
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
[MOD] Custom comments styling and more (sNews 1.5)
« Reply #1 on: December 20, 2006, 09:42:12 AM »

Soooo great, Krešimir Mihelec... this I will study, learn from and implement on my site... Great job.

Sex to you, man ;)
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

David

  • sNews Dude
  • Hero Member
  • *****
  • Karma: 7
  • Posts: 580
[MOD] Custom comments styling and more (sNews 1.5)
« Reply #2 on: December 20, 2006, 11:59:40 AM »

hey Mika, I want more articles like that :D Great job, thanks.
Logged

4Sandrix

  • Hero Member
  • *****
  • Karma: -13
  • Posts: 613
    • http://fedrick.deviantart.com
[MOD] Custom comments styling and more (sNews 1.5)
« Reply #3 on: December 20, 2006, 04:52:15 PM »

Good one Mika : ) Thx for share )
Logged
I'm kind of like Han Solo always strokin' my own Wookiee
I'm the root of all that's evil yeah but you can call me Cookie

Fred K

  • sNews Dude
  • ULTIMATE member
  • *****
  • Karma: 134
  • Posts: 2806
[MOD] Custom comments styling and more (sNews 1.5)
« Reply #4 on: February 03, 2007, 04:12:13 PM »

I've run into problems with this mod, moving it from 1.5.30 to 1.5.31 gives a blank page error. I assume I'm missing some bracket, semi-colon or similar, but I've done a straight copypaste of the code from a 1.5.30 site that works (my snews site) to a (local) version running 1.5.31, and double-checked that the mod code looks the same in both places, so I thought I'd ask here if there could be anything in 1.5.31 that would upset this mod? Any thoughts?

Mika

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 9
  • Posts: 1408
    • http://www.ni5ni6.com/
[MOD] Custom comments styling and more (sNews 1.5)
« Reply #5 on: February 03, 2007, 06:22:10 PM »

:| Nope, no problems in my installaton.

Here's the simplest mod example
Quote
function tags($tag) {
...
$tags['comments'] = '<div class="comment ,style,">,<p class="date">,name, on ,date,edit,</p>,<p>,comment,</p>,</div>';
...
Quote
/*
create two new CSS classes
.small {your-style}
.big {your-style}
*/

function comment($freeze_status) {
...
foreach ($tag as $tag) {
switch (true) {
case ($tag == 'style'): echo $commentNum %2 == 0 ? 'big' : 'small'; break;
...
« Last Edit: August 25, 2007, 03:30:26 AM by Phil Martin (Philmoz) »
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

Fred K

  • sNews Dude
  • ULTIMATE member
  • *****
  • Karma: 134
  • Posts: 2806
[MOD] Custom comments styling and more (sNews 1.5)
« Reply #6 on: February 03, 2007, 07:06:03 PM »

The problem was the nickname check I was running, to get different styles on admin and non-admin comments, but I got it working now after retyping the segments. Probably missed som character before. Thanks! All's cool and works well. :)

Sasha

  • Hero Member
  • *****
  • Karma: 28
  • Posts: 947
    • cssanarchy.com
[MOD] Custom comments styling and more (sNews 1.5)
« Reply #7 on: March 17, 2007, 07:52:01 AM »

Can someone make simple code whit all changes in sNews for admin comments and user comments whit also simple css?That be so greatful for most users who not uderstand all php code.Thx in advance....
Logged
Every morning, I get up and look through the 'Forbes' list of the richest people in America. If I'm not there, I go to work. | If you love your job, you haven't worked a day in your life. snews with ♥

takil84

  • Newbie
  • *
  • Karma: 0
  • Posts: 49
[MOD] Custom comments styling and more (sNews 1.5)
« Reply #8 on: March 26, 2007, 09:20:52 AM »

Hi;
I couldnt make this mod with snews 15.31.
Can anyone who can make this mod make a little documentation how can it be done.
Thank you very much btw.I need this mod very much.Someone makes comment in my site with my name which Iam using in my comments.  :(
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
[MOD] Custom comments styling and more (sNews 1.5)
« Reply #9 on: March 26, 2007, 10:17:23 AM »

Hi, taki... in order to fix others from posting comments with your name on it... Well, check "approve comments before posting" in the admin section. If someone posts a comment you will have to OK it before it's visible on the site, and if they're using your name/nick, simply change that to something else...

(Said as an easier way to prevent folks from posting without you knowing as I can't explain Mika's MOD to you :lol:)
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

areyouami

  • Newbie
  • *
  • Karma: 3
  • Posts: 24
[MOD] Custom comments styling and more (sNews 1.5)
« Reply #10 on: August 18, 2007, 11:17:53 PM »

I did all in the article for 1.6 and though the even odd comments work, the admin styles don't work because I also have this mod:

http://snewscms.com/forum/index.php?topic=5323.0

Installed (which allows for multiple layouts, and admin has it's own layout) so when I put the

Code: [Select]
$_SESSION[db('website').'Logged_In'] = 'True';
$_SESSION['uname'] = s('username');
$_SESSION['Website'] = db('website');
$_SESSION['nickname'] = s('nickname');
$_SESSION['Website'] = db('website');
It just doesn't work cause it's logging me out whenever I go to approve my comments.
« Last Edit: August 21, 2007, 02:33:03 PM by Patric Ahlqvist »
Logged

crm

  • Newbie
  • *
  • Karma: 1
  • Posts: 26
    • planetmayfield.com
Re: [MOD] Custom comments styling and more (sNews 1.5)
« Reply #11 on: December 20, 2007, 11:20:24 PM »

My latest article will give you some insight into comments area customization options, but it's just too big for copy/paste method.

I hope you'll find it useful ;)

The link to the article listed above does not appear to be working.  I am really wanting to customize my comments any what it could be reposted?  I am looking at http://www.ni5ni6.com/ and the content stays the same.  Any ideas anyone?
Logged
Endlessly banging my head against the keyboard.

crm

  • Newbie
  • *
  • Karma: 1
  • Posts: 26
    • planetmayfield.com
Re: [MOD] Custom comments styling and more (sNews 1.5)
« Reply #12 on: December 21, 2007, 07:22:24 AM »

Nevermind.  I found what I needed by using the wayback machine on http://www.archive.org/.

Thanks!

This really helped!!
Logged
Endlessly banging my head against the keyboard.

henrich

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 405
  • Passion for quality and excellence!
    • My personal blog and portofolio
Re: [MOD] Custom comments styling and more (sNews 1.5)
« Reply #13 on: December 21, 2007, 10:32:19 AM »

How did you find man?

Because also i am interested to cosmetize the comments on the site that i intend to release shortly (i will publish also here). I want that one comment to be with white bg, the next with gray, then white, gray and so on.

That link above really does not work, i mean the one posted by Mika.
Logged
By(e) Henrich :)
------------------------------
IT related blog

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 955
Re: [MOD] Custom comments styling and more (sNews 1.5)
« Reply #14 on: December 21, 2007, 12:14:03 PM »

Go to the site crm provided - there You can find old versions of Mika site. Doesn't look fancy, but texts are all there.
Logged