OK, I'll give you an example of what I just did. I am using Bobster tabbed forumhome mod.
Every time I add a tab, I do:
PHP Code:
$tabid = $db->insert_id();
$db->query_write("
REPLACE INTO " . TABLE_PREFIX . "phrase
(languageid, varname, text, product, fieldname, username, dateline, version)
VALUES (
0,
'tab_{$tabid}_html',
'" . $db->escape_string($vbulletin->GPC['name']) . "',
'bobster_tfh',
'global',
'" . $db->escape_string($vbulletin->userinfo['username']) . "',
" . TIMENOW . ",
'" . $db->escape_string($vbulletin->options['templateversion']) . "'
)
");
require_once(DIR . '/includes/adminfunctions_language.php');
build_language(-1);
That inserts a phrase for that tab.
When I edit the tab, I already have the tabid, so I do
PHP Code:
$phrase = $db->query_first("
SELECT phraseid, varname, text
FROM " . TABLE_PREFIX . "phrase
WHERE varname = 'tab_{$vbulletin->GPC['id']}_html'
AND languageid = 0
");
And below the tab name in edit mode, I do for translation link
PHP Code:
print_description_row($vbulletin->GPC['id'] ? '<div class="smallfont" style="margin-top:6px"><a href="phrase.php?do=edit&fieldname=global&phraseid=' . $phrase['phraseid'] . '" target="translate">' . $vbphrase['translations'] . '</a></div>' : '');
In forumhome, Bobster displays the tab like that
PHP Code:
$yui->add_tab($tab['name'], true, 'tabindex.php?' . $content, $active, $tab['cache'], $tab['limitto']);
So I simply did
PHP Code:
$tabid = $tab['tabid'];
$tabname = 'tab_' . $tabid . '_html';
if($tab['iden'] == 'm')
{
$tabname = 'tabmodule_' . $tabid . '_html';
}
$tab['name'] = $vbphrase[$tabname];
(the extra code is for the modules which I also did but did not include in example)
--------------------------------------------------------------------------
Now, in your case, since you are doing one per line, then you'd have to insert them each with a unique id or that will not work, unless you tag them with an $i value. And that could be complicated.