function smileys_import_add_pak in Smileys 6
1 call to smileys_import_add_pak()
- smileys_import_add in ./
smileys_import.module - Menu callback; Add a Smiley pack.
File
- ./
smileys_import.module, line 214
Code
function smileys_import_add_pak($pack) {
$delimeter = '=+:';
smileys_import_delete($pack, 1);
if (!($packd = smileys_import_packs($pack))) {
drupal_set_message(t('Cannot find smiley package %pack.', array(
'%pack' => $pack,
)));
drupal_goto('admin/settings/smileys/import');
}
$fcontents = @file(dirname($packd->filename) . '/' . $pack . '.pak');
for ($i = 0; $i < count($fcontents); $i++) {
$smile_data = explode($delimeter, trim(addslashes($fcontents[$i])));
for ($j = 2; $j < count($smile_data); $j++) {
$smile_data[$j] = str_replace("<", "<", $smile_data[$j]);
$smile_data[$j] = str_replace(">", ">", $smile_data[$j]);
db_query("INSERT INTO {smileys} (acronyms, image, description, standalone, promote_to_box, package) VALUES ('%s', '%s', '%s', %d, 0, '%s')", str_replace("\\'", "''", $smile_data[$j]), dirname($packd->filename) . '/' . str_replace("\\'", "''", $smile_data[0]), str_replace("\\'", "''", $smile_data[1]), 1, $pack);
}
}
}