Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: quote or code your php or html coding  (Read 3882 times)

Vinoth

  • Newbie
  • *
  • Karma: 1
  • Posts: 33
quote or code your php or html coding
« on: May 16, 2007, 12:25:28 AM »

quote or code your php or html coding. is it possible in sNews.

I searched and i did not get any answers, so i ask is there any mod available already.
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
quote or code your php or html coding
« Reply #1 on: May 16, 2007, 12:44:12 AM »

Vinoth,
no mod necessary, just wrap the code you're quoting in the article within pre (or code) tags. Only snag is that you have to type html entites to represent stuff like < > and &, something like this
Quote
This is the start of an article, and on the next line we'll quote a PHP function:
<?php center(); ?>
So it's really simple... ;)
Logged

Vinoth

  • Newbie
  • *
  • Karma: 1
  • Posts: 33
quote or code your php or html coding
« Reply #2 on: May 16, 2007, 02:52:44 AM »

it does not quote , instead it reduces the size of the php code.
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
quote or code your php or html coding
« Reply #3 on: May 16, 2007, 05:48:41 AM »

So by "quote" you mean that you want the code to appear within quotemarks, and/or highlighted in other fashion (like for instance on this page or when you use the quote tag in this forum)? That's something you can do fairly easy with CSS. If you for example wrap your code bits within <pre> tags, then you can add /lots of/ styling to the pre selector in your stylesheet. Quote marks can be brought in by using an image as background for <pre>, or you can use pesudo-elements to set graphic quote marks before and after <pre>. Example (note that IE6 and backwards doesn't understand these pseudo elements ... )
Quote
pre:before { content: url(images/startquote.gif); } pre:after { content: url(images/endquote.gif); }
« Last Edit: November 15, 2007, 11:17:11 AM by philmoz »
Logged