Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Envy on December 07, 2005, 05:47:34 AM

Title: Pulling specific info to an extermal html page
Post by: Envy on December 07, 2005, 05:47:34 AM
Wasn't quite sure how to title this, but hopefully I can explain it better...

At the moment I have a html page for my front news page, and my SMF forum. I have worked out how to show the latest forum topics ( ssi_function=recentTopics ) and am really happy with that.

I was looking at the ssi_function=boardNews function and was wondering if it's possible to be able to select which posts I show. So instead of putting in boardNews, put in something like topic=#### ? The reason I ask is, I have lots of people posting on my forum, and every now and then they post information which I think should be on the front page... at the moment I just copy and paste it into my html document, but then I have to manually link back to the original thread. I would just love to have a string of code to put in where I just change the topic number. That way it could show how many comments and the "write a comment" line as well.

Does anyone know if this is possible? *crosses fingers she made sense*
Title: Re: Pulling specific info to an extermal html page
Post by: Elissen on December 07, 2005, 10:30:42 AM
I use something like this:
<?php
$message
= 25;

include(
'SSI.php');

$res = db_query("SELECT ID_MSG, subject, body, ID_MEMBER, posterName, posterTime
               FROM smf_messages
               WHERE ID_MSG =
$message", __FILE__, __LINE__);
$row = mysql_fetch_assoc($res);
mysql_free_result($res);

echo
doUBBC('[b]' . $row['subject'] . '[/b][br][size=8pt]Posted by [iurl=http://www.resonantdynamics.com/forum/index.php?action=profile;u=' . $row['ID_MEMBER'] . ']' . $row['posterName'] . '[/iurl][/size][br][br]' . $row['body']) . '<br /><br />';
?>

See www.resonantdynamics.com, what you see there are forum posts.
Title: Re: Pulling specific info to an extermal html page
Post by: Envy on December 08, 2005, 08:13:24 PM
Hmm, can I put that php code into my html page? It doesn't seem to want to display it for me  :(
Title: Re: Pulling specific info to an extermal html page
Post by: JayBachatero on December 08, 2005, 10:55:36 PM
You will need to change name.html to name.php for it to work.
Title: Re: Pulling specific info to an extermal html page
Post by: Envy on December 08, 2005, 11:56:23 PM
That's what I though, but then shtml stuff doesn't work >< That's why I'm wanting a html ability to do this.

Even if I can only pull the X Coments | Write a comment part. Is there a way to have the front shtml page update the X part when ever someone replies to a certain thread?
Title: Re: Pulling specific info to an extermal html page
Post by: Elissen on December 09, 2005, 03:29:46 AM
It ain't shtml, it's php. shtml is similar in principle, but generally in shtml vb or java is used. This is php, hence the need to name the file .php.

And why doesn't it work? It works for me. Do you get some sort of error?
Title: Re: Pulling specific info to an extermal html page
Post by: Envy on December 09, 2005, 06:29:41 AM
Hmm.. I'm obviously not explaining myself properly.

I know php and shtml are different things, that's why I asked for a html way to do it. It doesn't work because my page is .shtml not .php I can't rename my file .php because it has other elements in it that don't work, and I don't know php (at all) to remake my whole front page... that's why I used the .shtml ssi includes, because I sort of understand those...

I'm assuming that there is no way to do this via html?
Title: Re: Pulling specific info to an extermal html page
Post by: Elissen on December 09, 2005, 07:15:57 AM
Never used shtml myself, but put the code I pasted above in a file names content.php and add this to your shtml page:
<!--#include virtual="./content.php" -->
Title: Re: Pulling specific info to an extermal html page
Post by: JayBachatero on December 09, 2005, 09:18:31 AM
Actually just look at http://yousite.com/forum/ssi_examples.shtml
Title: Re: Pulling specific info to an extermal html page
Post by: Envy on December 09, 2005, 03:18:50 PM
Quote from: JayBachatero on December 09, 2005, 09:18:31 AM
Actually just look at http://yousite.com/forum/ssi_examples.shtml

I've already looked at that, that's how I got the latest replied topics and members... from my first post:
QuoteAt the moment I have a html page for my front news page, and my SMF forum. I have worked out how to show the latest forum topics ( ssi_function=recentTopics ) and am really happy with that.

The ssi_examples only really has "boardNews" that is similar, but I don't want to show the latest topic from a particular board, I want to pick and choose which posts I show on the front page, I get two pages of new posts a day, I don't want the front page updated that much. And I don't want to make it just come from one board (aka a news board) as I want people to be able to reply no matter where the post is, general, spells, professions etc...

At the moment I'd settle for just being able to have the reply count update and I'll write the news posts myself, I just thought there would be a way to take out some of the manual side.
Title: Re: Pulling specific info to an extermal html page
Post by: SleePy on December 09, 2005, 08:49:03 PM
you would have to include a file using the virutal thing posted above. then in that file have your php.