Export Personal Messages to XML

Started by live627, July 16, 2007, 01:37:31 PM

Previous topic - Next topic

live627

Link to Mod

This Mod allows you to export your Personal Messages in a XML format.

Version 1.0
! Fixed Namespace issue
! Release

cybergurk

Moin,

I have found "BUG" ?

hxxp:parser.smfportal.de/variables.htm [nonactive]/PersonalMessage.php
require_once($sourcedir . '/ExportMessages.php');

change to (Remove "/" )

require_once($sourcedir . 'ExportMessages.php');


Gruß Achim
www.filmanleitungen.de | hxxp:www.joomla-tutorials.de [nonactive]

SleePy

Actually the / is needed.

$sourcedir should contain the path to your sources directory without the trailing /
So the / Is needed :)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

cybergurk

Gruß Achim
www.filmanleitungen.de | hxxp:www.joomla-tutorials.de [nonactive]

JOSHSKORN

I actually had the exact same problem and I've managed to fix it.  Basically when I click on Export All PMs, I receive the following error:


Fatal error: exportmessages(): Failed opening required '/ExPortMessages.php' (include_path='.:/usr/local/lib/php:/usr/local/share/pear') in /hsphere/local/home/threei/3iclan.net/thesite/Sources/PersonalMessage.php on line 2269


You'd think the error is in line 2269, but actually it's in line 2266.  You need to add the $sourcedir to the list of variables.  So,


function ExportMessages()
{
global $db_prefix, $ID_MEMBER, $scripturl, $user_info, $context, $txt;

// Sadly to make this work for package manager the easy way was to just include a file.
require_once($sourcedir . '/ExPortMessages.php');
ExportMessagesXML();
}


now looks like:


function ExportMessages()
{
global $db_prefix, $sourcedir, $ID_MEMBER, $scripturl, $user_info, $context, $txt;

// Sadly to make this work for package manager the easy way was to just include a file.
require_once($sourcedir . '/ExPortMessages.php');
ExportMessagesXML();
}


Well that's what I did to make it work for me.

SleePy

Yea I missed a variable that needed to be globalized.

Updated as 1.0.1 to fix this.

Version 1.0.1
! Initial Function should globalize the Sources Directory
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

jeronij

i have just installed this, and the ExPortMessages.php file is empty. Can you please check this is correct?

I get this message when I try to export:

Fatal error: exportmessages() [function.require]: Failed opening required '/home/jeronij/public_html/forums/Sources/ExportMessages.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jeronij/public_html/forums/Sources/PersonalMessage.php on line 2160

SleePy

This sometimes happens with package manager and it doesn't copy the new file over with contents on some hosts.

Just open up the compressed file and get the ExportMessages.php file out and upload it to your sources folder replacing the currently blank one.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

White_Wolf

This mod installs without errors, and I even see my two options "export inbox" and "export all" but whenever I click either one, all I get is a blank white screen.

My browser shows the url as http://www.xxxxxxxxxx.org/forum/index.php?action=pm;sa=export
for the "export all". And the export inbox takes me to http://www.xxxxxxxxxxxx.org/forum/index.php?action=pm;sa=export;l=-1

but all they are is blank screens :(
I am using:
SMF= 1.1.4
Arcade= 2.0.9
Tinyportal= v0.9.8

SleePy

It may be possible that the php file did not get saved correctly to the Sources folder.

Decompress the file, Then upload the ExPortMessages.php file to your Sources folder.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

mark7144

Everything installs successfully but same problem as everyone else... blank page when you click on the export links.

This is not a problem with me, the mod needs to be fixed :)

Great mod though, look forward to the update.

SleePy

Actually its an issue with the server ;)
Decompress the file and Upload the .php file to the Sources folder.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

mark7144

Out of all the many mods I have installed this the first one with such an issue. Is there not another way of creating the mod so it isn't required to do it this way?

SleePy

Saddly no, Since my mod does cdata to output the html and stuff correctly for the xml output. It would break package manager. And It is really hard to work around this and would create confusing code.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

mark7144

OK can you then explain really clearly what I need to do for a work around?

SleePy


  • Unpack the mod
  • Move the ExportMessages.php to your Sources folder on your website
  • Replace the file.
This happens sometimes because the server isn't allowing php to copy the file due to different permissions and/or users on the files/folders.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

mark7144

Thank you, this fixed it. I have one question, what's the advantage of being able to save PMs in XML over that of HTML?

And once the XML file is saved, how is the user supposed to view it?

SleePy

XML offers may advantages,
I would say the greatest is if you have time its easy to create xslt style sheets (I don't have time at the moment to write one) that will display the output nicely. Such as my mods right now if you view the .xml file in your browser you get a nice output, and yet the source of it is really clean stil with just hte data.

It also makes it easier to update to a master file by just following the simple format it does. At the moment i don't plan on it but importing pms would be very easy to do with the xml format.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

mark7144

When I view the exported XML in my browser (FF or IE) it's just code?

SleePy

Yea i haven't made xlst style sheets for those. But try the mod package itself after you decompress it. THere is a package-info.xml file that is a great example of how this can be done.

I didn't make those, Daniel did, I just adopted them for use in my mods.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Advertisement: