Jaxel
Well-known member
Okay... as some of you know, I am working on a modular portal/sidebar system. I plan on having sidebar modules controlled by XML files... below is an example of such an XML file:
I already asked before if XF had a built in XML handler, and as it turns out, XF simply uses the built in SimpleXML feature in PHP... which is fine, but I'll have to learn how it works since I've always just used built in functions from within VB. However, my question is, does XF have a built in file upload handler like VB did?
With VB, I would have just done:
How would I do this same thing in XF? Remember that I don't need to store the file anywhere. It just need to be read into a variable called $xmlArray and then thrown away.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<module>
<module_name>facebook</module_name>
<module_class></module_class>
<module_template>EWRporta_Sidebar_Facebook</module_template>
<module_content><![CDATA[<div class="section">
<div class="secondaryContent" id="facebook" style="padding-right: 0px; padding-bottom: 0px;">
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:fan profile_id="{$option.profile_id}" stream="0" connections="8" logobar="0" width="240" height="216" css="{xen:link 'full:js/facebook.css'}?50"></fb:fan>
</div>
</div>]]></module_content>
<module_settings>
<profile_id>144610425559666</profile_id>
</module_settings>
</module>
I already asked before if XF had a built in XML handler, and as it turns out, XF simply uses the built in SimpleXML feature in PHP... which is fine, but I'll have to learn how it works since I've always just used built in functions from within VB. However, my question is, does XF have a built in file upload handler like VB did?
With VB, I would have just done:
Code:
$vbulletin->input->clean_array_gpc('f', array(
'upload' => TYPE_FILE,
));
$upload = file_get_contents($vbulletin->GPC['upload']['tmp_name']);
require_once(DIR.'/includes/class_xml.php');
$xmlobj = new vB_XML_Parser($upload);
$xmlArray = $xmlobj->parse();
How would I do this same thing in XF? Remember that I don't need to store the file anywhere. It just need to be read into a variable called $xmlArray and then thrown away.