Im in the middle of building a portal forum for a friend, were he wants music, games, the full works, he wanted to know if he could have a block on the portal index page which shows the newest music upload, as there is no im portal block that does this i have rewritten one, only i'm having a bit of trouble pulling the info for the image to appear, everything else works but that . link script is below and you can see it HERE
IF anyone could point the mistake i would be gratefull
<?php
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
if(!function_exists(imp_newest_song_block_func))
{
function imp_newest_song_block_func()
{
global $template, $table_prefix, $db, $lang, $phpEx, $board_config;
$sql = "SELECT song_id, song_imagename, song_title, song_singer, song_time FROM " .$table_prefix. "music WHERE song_approval <> 0 ORDER BY song_time DESC LIMIT 0,1";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query music information', '', __LINE__, __FILE__, $sql);
}
$picrow = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$template->assign_vars(array(
'L_NEWEST_SONG' => $lang['Newest_song'],
'SONG_IMAGE' => append_sid('music_page.' . $phpEx . '?song_imagename=' . $picrow['song_imagename']),
'SONG_TITLE' => $picrow['song_title'],
'SONG_POSTER' => $picrow['song_singer'],
'U_SONG_LINK' => append_sid('music_page.' . $phpEx . '?song_id=' . $picrow['song_id']),
'SONG_TIME' => create_date($board_config['default_dateformat'], $picrow['song_time'], $board_config['board_timezone'])
)
);
}
}
imp_newest_song_block_func();
?>
IF anyone could point the mistake i would be gratefull
<?php
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
if(!function_exists(imp_newest_song_block_func))
{
function imp_newest_song_block_func()
{
global $template, $table_prefix, $db, $lang, $phpEx, $board_config;
$sql = "SELECT song_id, song_imagename, song_title, song_singer, song_time FROM " .$table_prefix. "music WHERE song_approval <> 0 ORDER BY song_time DESC LIMIT 0,1";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query music information', '', __LINE__, __FILE__, $sql);
}
$picrow = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$template->assign_vars(array(
'L_NEWEST_SONG' => $lang['Newest_song'],
'SONG_IMAGE' => append_sid('music_page.' . $phpEx . '?song_imagename=' . $picrow['song_imagename']),
'SONG_TITLE' => $picrow['song_title'],
'SONG_POSTER' => $picrow['song_singer'],
'U_SONG_LINK' => append_sid('music_page.' . $phpEx . '?song_id=' . $picrow['song_id']),
'SONG_TIME' => create_date($board_config['default_dateformat'], $picrow['song_time'], $board_config['board_timezone'])
)
);
}
}
imp_newest_song_block_func();
?>
Comment