Jump to content

Archived

This topic is now archived and is closed to further replies.

runnerjp

help me please :(

Recommended Posts

hey hey
ok if u look at my website at mo [url=http://www.runnerselite.com]www.runnerselite.com[/url]
you will notice that the info from [code]<?php ssi_recentTopics(); ?>[/code]
which at the mo is
General Discussion]  Welcome to SMF! by Simple Machines  Today at 02:03:54 PM 

does not fit into the area i want it to in nav bar...how can i make it so the data fits nicely into the nav bar???

Share this post


Link to post
Share on other sites
Well if you would like to create your own format (instead of the table format which is the default output formate of ssi_recentTopics() ) you can pass in a variable for the output method and it will return the posts in the array.  You can look at SSI.php in order to figure out how to output what.

To do this method ... do:

[code]$posts = ssi_recentTopics($output_method = "custom");[/code]

Share this post


Link to post
Share on other sites
Here's the code of how the $posts array is constructed:
[code]$posts[] = array(
'board' => array(
'id' => $row['ID_BOARD'],
'name' => $row['bName'],
'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0">' . $row['bName'] . '</a>'
),
'topic' => $row['ID_TOPIC'],
'poster' => array(
'id' => $row['ID_MEMBER'],
'name' => $row['posterName'],
'href' => empty($row['ID_MEMBER']) ? '' : $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => empty($row['ID_MEMBER']) ? $row['posterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'
),
'subject' => $row['subject'],
'short_subject' => strlen(un_htmlspecialchars($row['subject'])) > 25 ? htmlspecialchars(substr(un_htmlspecialchars($row['subject']), 0, 22) . '...') : $row['subject'],
'time' => timeformat($row['posterTime']),
'timestamp' => $row['posterTime'],
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . ';topicseen#msg' . $row['ID_MSG'],
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . '#msg' . $row['ID_MSG'] . '">' . $row['subject'] . '</a>',
'new' => !empty($row['isRead']),
'newtime' => $row['logTime']
);[/code]

Here's how it is outputted to the screen:

[code]echo '
<table border="0" class="ssi_table">';
foreach ($posts as $post)
echo '
<tr>
<td align="right" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>
<td valign="top">
<a href="', $post['href'], '">', $post['subject'], '</a>
', $txt[525], ' ', $post['poster']['link'], '
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.from' . $post['newtime'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>', '
</td>
<td align="right" nowrap="nowrap">
', $post['time'], '
</td>
</tr>';
echo '
</table>';[/code]

It shouldn't be hard to look at the code above and figure out how to output the data. Using the above code as a reference.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.