TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,993
  • Total Topics: 21,324
  • Online today: 363
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 197
  • Total: 197

Homepage Help

Started by geekincsupport, January 09, 2008, 02:38:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

geekincsupport

Hey All, I'm using the following code for the homepage I presume this is how SMF Is doing theres? Dragoon gave this to me IS there anyway to better this code? and I need to some how incorperate index.php?Action=forum my forums are located at forums.geekinc.info I want to better my code and call the news I can't get anything working properly

http://www.geekinc.info - Were the homepage goes.
http://www.forums.geekinc.info - Is were the forum is located I need help please

<?php
    $news_board_id 
1;
$root_path '';
$intro 'Test welcome';
$ssi_theme 1;
require_once($root_path 'forum/SSI.php');
template_main_above();
global $db_prefix$context$user_info;
$result db_query("SELECT mes.ID_MSG, mes.posterTime, mes.subject, mes.ID_MEMBER, mes.body,
                           t.ID_FIRST_MSG, t.ID_BOARD, t.ID_TOPIC,
                           m.ID_MEMBER, m.realName, 
                           b.ID_BOARD, b.name AS bName
                    FROM 
{$db_prefix}messages AS mes, {$db_prefix}members AS m, {$db_prefix}topics AS t,
                         
{$db_prefix}boards AS b
                    WHERE t.ID_BOARD = b.ID_BOARD
                         AND t.ID_BOARD = 
$news_board_id
                         AND b.ID_BOARD = 
$news_board_id
                         AND mes.ID_MEMBER = m.ID_MEMBER
                         AND t.ID_FIRST_MSG = mes.ID_MSG
                    ORDER BY mes.posterTime DESC
                    LIMIT 5"
,__FILE____LINE__);
$items = array();
while($row mysql_fetch_assoc($result))
{
  
if ($func['strlen']($row['body']) > 150)
$row['body'] = $func['substr']($row['body'], 0150) . '...';
  
$items[] = array(
       
'link' => '<a href="'.$scripturl.'?topic="'.$row['ID_TOPIC'].'">'.$row['subject'].'</a>',
       
'preview' => parse_bbc($row['body'], true),
  
);
}
echo '
<div class="clearfix" style="width: 100%;">
<div class="windowbg" style="border: solid 1px #888; float: right; padding: 1em; margin: 0em 0em 0em 1em; width: 40%;"><h3>News:</h3>'
;
foreach ($items as $c) {
echo '<br /><div>',$c['link'],'</div><div>',$c['preview'],'</div><br />';
}
echo '</div>';
echo '<p>',$intro,'</p></div>';
ssi_shutdown();
?>


G6Cad

Any reason you cant ask Dragooon in his topic he have in the block code and snippets board about this ?

This website is proudly hosted on Crocweb Cloud Website Hosting.