Exemplo n.º 1
0
function xml_import_stylevars($stylevars, $styleid, $importtype = 0)
{
    global $vbulletin;
    $querybits = array();
    $sv = get_xml_list($stylevars['stylevar']);
    $dateline = TIMENOW;
    $importname = $importtype ? 'Style-Generator' : 'Style-Importer';
    foreach ($sv as $stylevar) {
        //the parser merges attributes and child nodes into a single array.  The unnamed text
        //children get placed into a key called "value" automagically.  Since we don't have any
        //text children we just take the first one.
        $value = vb_base64_decode($stylevar['value'][0]);
        $querybits[] = "('" . $vbulletin->db->escape_string($stylevar['name']) . "', {$styleid}, '" . $vbulletin->db->escape_string($value) . "', {$dateline}, '{$importname}')";
    }
    if (!empty($querybits)) {
        $vbulletin->db->query_write($sql = "\n\t\t\tREPLACE INTO " . TABLE_PREFIX . "stylevar\n\t\t\t(stylevarid, styleid, value, dateline, username)\n\t\t\tVALUES\n\t\t\t" . implode(',', $querybits) . "\n\t\t");
    }
    $querybits = array();
}
Exemplo n.º 2
0
function xml_import_stylevars($stylevars, $styleid)
{
	global $vbulletin;

	$querybits = array();
	$sv = get_xml_list($stylevars['stylevar']);

	foreach ($sv AS $stylevar)
	{
		//the parser merges attributes and child nodes into a single array.  The unnamed text
		//children get placed into a key called "value" automagically.  Since we don't have any
		//text children we just take the first one.
		$value = base64_decode($stylevar['value'][0]);
		$querybits[] = "('" . $vbulletin->db->escape_string($stylevar['name']) . "', $styleid, '" .
			$vbulletin->db->escape_string($value) . "')";
	}

	if (!empty($querybits))
	{
		$vbulletin->db->query_write($sql = "
			REPLACE INTO " . TABLE_PREFIX . "stylevar
			(stylevarid, styleid, value)
			VALUES
			" . implode(',', $querybits) . "
		");
	}
	$querybits = array();
}
function xml_import_stylevars($stylevars, $styleid)
{
    $values = array();
    $sv = get_xml_list($stylevars['stylevar']);
    foreach ($sv as $stylevar) {
        //the parser merges attributes and child nodes into a single array.  The unnamed text
        //children get placed into a key called "value" automagically.  Since we don't have any
        //text children we just take the first one.
        $values[] = array('stylevarid' => $stylevar['name'], 'styleid' => $styleid, 'value' => base64_decode($stylevar['value'][0]));
    }
    if (!empty($values)) {
        vB::getDbAssertor()->assertQuery('replaceValues', array('table' => 'stylevar', 'values' => $values));
    }
}