k4l4sh
12-01-2004, 07:55 AM
Hey
my first attempt at some kind of mod , this might already been made (?), I'd like your comments (improvements and extra features/possibilities?)
This is very basic, as I'm figuring out how this whole cmps thing works
- Basicly I just cut a piece from latesttopics (view code below) and added some simple php
- I created an exact same module as the exsisting Latest Forum Topics, except you don't add the adv_portal_latesttopics to the used templates
you can see an example here:
My website (http://www.burst.cc/index.php?page=halflife&do=game_info)
<?php
$forumid = array (
"battlefield_1942" => 7,
"unreal_tournament" => 8,
"halflife" => 11,
"farcry" => 13,
"cod" => 14
);
$page = $_REQUEST['page'];
$id=$forumid[$page];
$maxlimit = 8;
$threads = $DB_site->query("
SELECT * FROM thread WHERE forumid = '$id' ORDER BY threadid DESC LIMIT 0, $maxlimit
");
while ($thread = $DB_site->fetch_array($threads))
{
if (strlen($thread['title']) > $vba_options['portal_threads_maxchars'] AND $vba_options['portal_threads_maxchars'])
{
$thread['title'] = fetch_trimmed_title($thread['title'], $vba_options['portal_threads_maxchars']);
}
$thread = process_thread_array($thread, '', $vba_options['portal_threads_showicon']);
$getbgrow = getrowcolor();
eval('$threadbits .= "' . fetch_template('adv_portal_latesttopicbits') . '";');
}
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_latesttopics') . '";');
$DB_site->free_result($threads);
unset($thread, $threadbits, $foruminfo, $query, $inforums);
?>
my first attempt at some kind of mod , this might already been made (?), I'd like your comments (improvements and extra features/possibilities?)
This is very basic, as I'm figuring out how this whole cmps thing works
- Basicly I just cut a piece from latesttopics (view code below) and added some simple php
- I created an exact same module as the exsisting Latest Forum Topics, except you don't add the adv_portal_latesttopics to the used templates
you can see an example here:
My website (http://www.burst.cc/index.php?page=halflife&do=game_info)
<?php
$forumid = array (
"battlefield_1942" => 7,
"unreal_tournament" => 8,
"halflife" => 11,
"farcry" => 13,
"cod" => 14
);
$page = $_REQUEST['page'];
$id=$forumid[$page];
$maxlimit = 8;
$threads = $DB_site->query("
SELECT * FROM thread WHERE forumid = '$id' ORDER BY threadid DESC LIMIT 0, $maxlimit
");
while ($thread = $DB_site->fetch_array($threads))
{
if (strlen($thread['title']) > $vba_options['portal_threads_maxchars'] AND $vba_options['portal_threads_maxchars'])
{
$thread['title'] = fetch_trimmed_title($thread['title'], $vba_options['portal_threads_maxchars']);
}
$thread = process_thread_array($thread, '', $vba_options['portal_threads_showicon']);
$getbgrow = getrowcolor();
eval('$threadbits .= "' . fetch_template('adv_portal_latesttopicbits') . '";');
}
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_latesttopics') . '";');
$DB_site->free_result($threads);
unset($thread, $threadbits, $foruminfo, $query, $inforums);
?>