Hey all,
Does vb reconise this type of statement in php files
if not what would be the correct way to address this?
somefile.php
PHP Code:
define('ARTISTS_TABLE', $vbmod_prefix.'artists');
define('SONGS_TABLE', $vbmod_prefix.'songs');
etc
etc
so if i had this db query
PHP Code:
// select the featured songs
//
$sql = 'SELECT ' . SONGS_TABLE . '.song_id, song_title, ' . ARTISTS_TABLE . '.artist_id, artist_name, artist_prefix
FROM ' . SONGS_TABLE . ', ' . ARTISTS_TABLE .'
WHERE (' . SONGS_TABLE . '.artist_id = ' . ARTISTS_TABLE . '.artist_id ) AND
( status_id = "' . $mod_config['feature_status'] . '" )';
$sql = append_status_sql($sql);
$sql .= 'ORDER BY song_id DESC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$sql = 'SELECT song_desc
FROM ' . SONG_DESC_TABLE . '
WHERE (song_id = "' . $row['song_id'] . '")
LIMIT 1';
$desc_result = $db->sql_query($sql);
$song_desc = $db->sql_fetchfield('song_desc', '0', $desc_result);
$template->assign_block_vars('featured_songs', Array(
'SONG_DESC' => prepare_text($song_desc),
'SONG_TITLE' => $row['song_title'],
'ARTIST_NAME' => artist_add_prefix($row['artist_name'], $row['artist_prefix']),
'U_VIEWSONG' => append_sid('view_song.php?id=' . $row['song_id']),
'U_VIEWARTIST' => append_sid('view_artist.php?id=' . $row['artist_id']),
)
);
}
snip]]
Reason for asking, switched over from phpbb and not sure I have a grasp of vb's sql and template engines-
as mention just switched over from phpbb and need to convert some apps and their template engine is a lot differnt
In the php file I had something like this
PHP Code:
$template->assign_block_vars('list',Array(
'SONG_LENGTH' => format_length($sql_data['song_length']),
'SONG_QUALITY' => $sql_data['song_quality'],
'SONG_SIZE' => $sql_data['song_size'],
'SONG_BOX' => $song_box,
'ADDED_BY' => cut_string($sql_data['username'], 21)
)
);
so I could just place {SONG_SIZE} {SONG_BOX}in template and it will pull the correct data from the php / sql pages and place in either a cell/or table in the template. {SONG_SIZE} would put the size of song and {SONG_BOX) would build some cells / tables from another template
How would I convert these template to use VB's template engine/variables
Thanks in advance!