UtopiaSoftware Forums

Full Version: UNP Codes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi. I would like to turn off HTML to prevent people b**gering up the site but I would like more choice for users on how to align pictures for example. Currently I can only align pictures using HTML. Is there some way I can create new UNP codes? Which php file should i be looking at to do this?

Any help would be apprecaited.

I have the latest newpro.

Siggles
Do you want them all aligned the same way, or do you want it user-selectable?

Brian Wrote:
Do you want them all aligned the same way, or do you want it user-selectable?


Hi, thanks for getting back so soon. It would be nice to alternate the pictures (left and right) and even (if this isn't taking it too far) set a margin border. so it isn't up against the text.

This is the way I would do it. It's not necessarily nice looking, but it works.

Open news.inc.php.

Find:

PHP Code:
$findarray['image'] = '/\[img\]([-_.\/a-zA-Z0-9!&%\#?+,\'=:~]+)\[\/img\]/i';
$replacearray['image'] = '<img src="\\1" border="0" alt="Image" />'


Add under it:

PHP Code:
$findarray['imageleft'] = '/\[imgleft\]([-_.\/a-zA-Z0-9!&%\#?+,\'=:~]+)\[\/img\]/i';
$replacearray['imageleft'] = '<img src="\\1" border="0" alt="Image" align="left" style="margin-right: 10px" />';
$findarray['imageright'] = '/\[imgright\]([-_.\/a-zA-Z0-9!&%\#?+,\'=:~]+)\[\/img\]/i';
$replacearray['imageright'] = '<img src="\\1" border="0" alt="Image" align="right" style="margin-left: 10px" />'


Then you would use [imgleft] and [imgright] for alignment.

Thanks Brian!! I have made a few changes there. Now I know where to look such as border=1, etc etc. Great script. Love it! See it in action here at a busy website.

MISA
Excellent, looking great. No problem.

And thanks. Smile
Reference URL's