TinyPortal

Development => Support => Topic started by: WildGunsTomcat on February 05, 2009, 09:05:34 AM

Title: Need help with something
Post by: WildGunsTomcat on February 05, 2009, 09:05:34 AM
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!
Title: Re: Need help with something
Post by: ed_m2 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.
Title: Re: Need help with something
Post by: 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?

Title: Re: Need help with something
Post by: ed_m2 on February 05, 2009, 11:26:34 AM
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!]
Title: Re: Need help with something
Post by: ed_m2 on February 05, 2009, 11:31:21 AM
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';
    }
Title: Re: Need help with something
Post by: 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?
Title: Re: Need help with something
Post by: ed_m2 on February 05, 2009, 01:09:03 PM
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.
Title: Re: Need help with something
Post by: ed_m2 on February 05, 2009, 01:10:06 PM
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
Title: Re: Need help with something
Post by: WildGunsTomcat on February 05, 2009, 01:26:09 PM
Yeah...still not doing it.

Where do I stick your original PHP? In the index template? And if so where?
Title: Re: Need help with something
Post by: ed_m2 on February 05, 2009, 01:51:02 PM
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.
Title: Re: Need help with something
Post by: WildGunsTomcat on February 05, 2009, 01:57:02 PM
Ahhh okay let me try that.
Title: Re: Need help with something
Post by: WildGunsTomcat on February 05, 2009, 02:01:02 PM
Nope still nothing. The article section is showing up but it's not working.
Title: Re: Need help with something
Post by: ed_m2 on February 05, 2009, 02:05:40 PM
can you provide a link to the page u put it in ?
Title: Re: Need help with something
Post by: WildGunsTomcat on February 05, 2009, 02:11:39 PM
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.
Title: Re: Need help with something
Post by: ed_m2 on February 05, 2009, 02:16:22 PM
neither of the above ! sorry.
Title: Re: Need help with something
Post by: WildGunsTomcat on February 05, 2009, 02:20:26 PM
How about messengers like aim or yahoo