Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Comment bacground image: how to?  (Read 4119 times)

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Comment bacground image: how to?
« on: December 22, 2007, 12:38:07 PM »

Hello guys and gals,
This is not an issue, just a cosmetic inquire for having a sexier comment zone (no, Pat,  I'm not lookin for a bimbo pic) ;D

You know how clever I am when having to deal with Php, so I need a little hand ;)

So what's the question?
I'ld like to have, only into the comments zone, a background pic which won't be displayed when visitor types his comment.

And what's the problem, man?
I don't know how to call my CSS class in my sNews function comment! ???

That's it. That's all.
Have a nice day reader.

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Comment bacground image: how to?
« Reply #1 on: December 22, 2007, 03:17:47 PM »

Sven,
you don't need to hack snews.php for that, at least not generally speaking. But you can look at it. ;)
Find this line:
Quote
$tags['comments']
and check the name of the <div> (if any) that the comments are output in. (If there is no container, you can add one...)
I think that in a normal snews.php, comments will be printed in <div class="commentsbox">, so you want to add a style rule in your stylesheet for .commentsbox, that includes something like:

Quote
.commentsbox {background: url(path-to-background-image/image-name.type) no-repeat right top;}
(replace with your own values of course).
Shake and stir, sir!
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Comment bacground image: how to?
« Reply #2 on: December 22, 2007, 05:21:24 PM »

Inte sure förstod vi varje andra, Fred  ;D

Your suggestion will display the (bimbo) pic behind the form, but not in the comment text area's box...
Should this class be applied to this line?
Code: [Select]
echo html_input('textarea', 'text', 'text', '', ''.l('comment'), '', '', '', '', '', '5', '5', '', '', '');I suppose  Yes.
Output Html:
Code: [Select]
<textarea id="text" class="comment" cols="5" rows="5" name="text"/>display the bg pic. But:
1/ don't know where in the above Php code to put my class,
2/ don't know how to hide the pic when visitor is typing a comment. Javascript's needed?

Roger

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Comment bacground image: how to?
« Reply #3 on: December 22, 2007, 05:40:50 PM »

meh- you're right, I'm stupid...
But "commentsbox" still holds true, it's just in a different place.

In function comments(), around where the comments form starts, you'll find something like this:
Quote
if ($freeze_status != 'freezed') {
      echo '<div class="commentsbox"><h2>'.l('addcomment').'</h2>';

Now... "commentsbox" may be something else in standard snews.php, the above quote is from a modded version (although I haven't messed much with the comments function), so have a look at your comments() function (it's directly after center()) and check the container for your comments form. If there is none, then you'd probably want to add one, so you can style it as you like.

Sorry about the mixup, but as we all know I'm not so clever... ;)
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Comment bacground image: how to?
« Reply #4 on: December 22, 2007, 06:49:36 PM »

meh- you're right, I'm stupid...
I'm the forum dumber and I won't let anybody take my place!

Yeap! I think you're right: I might have used a Mod (which one? I don't remember).
I commented out this Div.
Styling forms is a real pain in the ass.

Forget it.
That certainly was one of the worst question I've ever asked on the forum.

Joost

  • Guest
Re: Comment bacground image: how to?
« Reply #5 on: December 23, 2007, 02:45:04 AM »

meh- you're right, I'm stupid...
I'm the forum dumber and I won't let anybody take my place!

Time for a poll?  ;D
Logged