News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Pulling specific info to an extermal html page

Started by Envy, December 07, 2005, 05:47:34 AM

Previous topic - Next topic

Envy

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*

Elissen

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.

Envy

Hmm, can I put that php code into my html page? It doesn't seem to want to display it for me  :(

JayBachatero

You will need to change name.html to name.php for it to work.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Envy

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?

Elissen

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?

Envy

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?

Elissen

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" -->

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Envy

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.

SleePy

you would have to include a file using the virutal thing posted above. then in that file have your php.

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Advertisement: