Hey guys,
I'm fairly new to SMF and Tinyportal and I did an search of the forums and didn't see a post asking this so I'm going to give it a shot.
I would like to be able to take ONE post from my forums and display it as an article on my front page of Tiny Portal. I would like to be able to see the icon of the poster, and have a comment link on that article/post that would open up the post in the forum...effectively taking them into the post on the forum.
I am a total noob as far as this goes...so any help would be MOST appreciated. I must iterate...I don't like the way forum posts are currently displayed by tinyportal...I want them to look more like articles.
My website is www.cruciblegaming.com
Thanks in advance!
i have a custom page that does something similar i think....
look at http://www.covtri.co.uk/index.php?page=15&tid=311, if the functionality is close i'll post up the code.
Quote from: ed_m on February 05, 2009, 09:37:04 AM
i have a custom page that does something similar i think....
look at http://www.covtri.co.uk/index.php?page=15&tid=311, if the functionality is close i'll post up the code.
That is DAMN close to what I want. The only thing I would add is an Icon of the poster on the top left. Is that something that can be done?
Quote from: WildGunsTomcat on February 05, 2009, 09:39:09 AM
Quote from: ed_m on February 05, 2009, 09:37:04 AM
i have a custom page that does something similar i think....
look at http://www.covtri.co.uk/index.php?page=15&tid=311, if the functionality is close i'll post up the code.
That is DAMN close to what I want. The only thing I would add is an Icon of the poster on the top left. Is that something that can be done?
... i expect so... although it would need a query from multiple tables... something i havent quite got my head around just yet !
[edit to add: looking at the code apparently i have got my head around it at some point before!]
here's my code.... in a php page.... with no frames as it attempts to reproduce the look of a TP article.
it actually returns the first post in the topic (tid) given in the url.
and the 'view discussion' link goes to the first post, it could go to the last i guess.
a few obvious bits of text & urls to edit.
i haven't shared this before so perhaps others can suggest improvements in the syntax.
$tid= $_GET['tid'];
if(is_numeric($tid))
{
$request = db_query("SELECT subject, body, id_first_msg FROM smf_messages, smf_topics WHERE smf_messages.ID_MSG = smf_topics.ID_FIRST_MSG AND smf_topics.ID_TOPIC =" . $tid);
$result = mysql_fetch_assoc($request);
echo '
<div class="tborder tp_article_frame">
<div class="titlebg tp_subject">'
. $result['subject'] .
'</div>
<div class="tp_articletext">'
. doUBBC($result['body']) .
'<p align="right"><a href="http://www.covtri.co.uk/index.php?topic=' . $tid . '.msg' . $result['id_first_msg'] . ' ">
View forum discussion</a></p>
</div>
</div> ';
}
else
{
echo 'Invalid argument';
}
Yeah I tried to plug it into a PHPBox module and it just says invalid argument...any suggestions?
Quote from: WildGunsTomcat on February 05, 2009, 11:53:44 AM
Yeah I tried to plug it into a PHPBox module and it just says invalid argument...any suggestions?
look at the link i posted.... you need to put a valid topic ID from your forum in the URL when you call the page.
oh... in a block ? my stuff is in a page...... you'll need to define the tid variable instead of the GET command.
replace:
$tid= $_GET['tid'];
with
$tid= ??;
where ?? is the topic id you want to display
Yeah...still not doing it.
Where do I stick your original PHP? In the index template? And if so where?
Quote from: WildGunsTomcat on February 05, 2009, 01:26:09 PM
Where do I stick your original PHP? In the index template? And if so where?
nooo.. in a php article.
Ahhh okay let me try that.
Nope still nothing. The article section is showing up but it's not working.
can you provide a link to the page u put it in ?
see I don't think I have any of my settings right. Do you have teamspeak or ventrilo? I'll give you access to my web page and you can look at what I'm doing wrong.
neither of the above ! sorry.
How about messengers like aim or yahoo