News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

help me write one more SSI funtion!

Started by nvcnvn, April 20, 2009, 08:33:15 AM

Previous topic - Next topic

nvcnvn

I'm trying to write a funtion to....a....uhm....for an example:
You have a forum and you have a website, you want to show one post on your forum to your web site!
You can select which post will shoe with the hyperlink parameter. The content of the post will be show 100% like be show on your forum, just at the other themes, the other places!
I think it' will like the Board News Function! Just edit somethings but i don't know where!
Pls help me, thanks!


nvcnvn


[SiNaN]

If you are using SMF 2.0 versions, you can use ssi_fetchPosts() function like:

ssi_fetchPosts(1453);

Where 1453 is the id of post to display.
Former SMF Core Developer | My Mods | SimplePortal

nvcnvn

Quote from: [SiNaN] on June 22, 2009, 05:20:23 PM
If you are using SMF 2.0 versions, you can use ssi_fetchPosts() function like:

ssi_fetchPosts(1453);

Where 1453 is the id of post to display.

Oh, Thanks you! Bu this mod just print a link to post. It's not like what I'm tring to find!

[SiNaN]

You can use the alternate output method:

$data = ssi_fetchPosts(1453, false, 'array');

Example use:

$post_info = current(ssi_fetchPosts(1453, false, 'array'));
echo '<h3>', $post_info['link'], '</h3>
<hr style="width: 50%; margin-left: 0;" />
<p>', $post_info['body'], '</p>';


Details on alternate output: Advanced SSI FAQ
Former SMF Core Developer | My Mods | SimplePortal

nvcnvn

Quote from: [SiNaN] on June 23, 2009, 03:53:07 AM
You can use the alternate output method:

$data = ssi_fetchPosts(1453, false, 'array');

Example use:


$post_info = current(ssi_fetchPosts(1453, false, 'array'));
echo '<h3>', $post_info['link'], '</h3>
<hr style="width: 50%; margin-left: 0;" />
<p>', $post_info['body'], '</p>';


Details on alternate output: Advanced SSI FAQ

Oh, thanks you! Know i can do it, but it's still a bug,
For an example: In the post content the BBcode, Simle, and wen i print the post[body], there is a BBcode tag and simle symbol with down the format???
How can I....you know! :X

[SiNaN]

I couldn't understand what you mean. Do you want to strip out formatting and images, smileys etc. or they don't appear for you and you want to show them?
Former SMF Core Developer | My Mods | SimplePortal

nvcnvn

Quote from: [SiNaN] on July 02, 2009, 09:45:43 AM
I couldn't understand what you mean. Do you want to strip out formatting and images, smileys etc. or they don't appear for you and you want to show them?
For an exmaple, when I post, I write some thing like this:

This is my photo [img]http://mysite.com/pts.gif[/img]

And when I view this post as the way you tell me, It's show exaclly what I wrote:

This is my photo [img]http://mysite.com/pts.gif[/img]

Without image view!

And I don't know how to view it!

[SiNaN]

Well, it should parse the BBC correctly actually. Are you sure the post body is not cut? See if this change makes it works:

Code (Find) Select
<p>', $post_info['body'], '</p>';

Code (Replace) Select
<p>', parse_bbc($post_info['body']), '</p>';
Former SMF Core Developer | My Mods | SimplePortal

nvcnvn

Oh, that right, I have fixed it! Thank you very much :X

Advertisement: