News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Dumb Questions

Started by DarkNexxus, June 01, 2010, 08:10:06 AM

Previous topic - Next topic

DarkNexxus

I'm using the newest release of SMF and I'm using the SSI function to display certain posts from specific forums onto a php index page. That's all working fine. Trouble is, the posts all show this icon called xx.gif and the text output is screwy. Instead of Don't it shows  Don\'t.

Anyway to remove those items from showing? And if possible, edit the font size?

Thanks in advance.

Kays

Hi, to change to output format. It's best to output it as an array. The Advanced FAQ has instructions on how to do so.

[README] SSI FAQ's

Once you do, you can use the stripslashes() function to get rid of that backslash and to change the icon. You can also then change the output style and font size then.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

DarkNexxus

That would only solve part of my issue. Sorry I wasn't clear before. The extra character also shows up in the posts on the forum. Seems if I fixed that issue, that would solve at least half of my problem.

Writing arrays is good and all but I was hoping for a simpler approach. I prefer to work inside the code of a page, but since this software is new to me, I'm not sure where to start, I would assume SSI.php, but the original post starts in Post.php, so if someone can point me in the right direction (a block of code would be nice too! :) ) then I can try to do it that way. If I fail miserably as I sometimes do, I can always put it in an array.

Thank you for your response(s) and time.

Kays

Although it seems complex. Output as an array is actually the best method. One of the main reasons being that once you have it set up you will not need to change it even if SSI.php is changed due to version upgrade. Do read the FAQ on it as it does explain it better.

Quote
I would assume SSI.php, but the original post starts in Post.php, so if someone can point me in the right direction (a block of code would be nice too!

For SSI output, it is all done in SSI.php. Look in there for examples.

The extra back slashes are another issue. Possibly due to magic_quotes being enabled. Normally SMF should handle that. Does it also do this in PM.


If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

DarkNexxus

I don't know if it does it in PM. The board hasn't been up for a full day yet and the users are still using the old board.

Kays

Do check if it's happening in PM. That might give a better idea of where the problem is.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

DarkNexxus

Doesn't appear so. I sent myself a PM and this is what I got
You're a dummy.
Do you watch Law & Order?


However, some older messages did transfer over it seems. It started me on page 2, on page 1, I had some old messages. They also have the extra characters


we don\'t need him but I\'ve noticed he\'s usually

That's a part of a copied message from the old VB.

DarkNexxus

I just realized that it's only the converted files that are doing this. New posts and PMs sent or posted to the SMF board isn't doing it.

I've been playing around with the array ideas and figured I'll give it a try. Sorry if I wasted your time but I do thank you for all your suggestions.

Kays

It might be possible to get rid of the backslashes with a database query. But that's a bit beyond me.

To get rid of them on the display page. In Dispaly.php around line 1190 look for:


'body' => $message['body'],


And change it to:


'body' => stripslashes($message['body']),




If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

DarkNexxus

That did the trick. Thanks!

Advertisement: