I discovered recently when playing with the latest version of Microsoft Office 2013 that it had a template called Blog post
which apparently allows you to post news articles directly to popular blog software. After a bit of investigating I decided I could write a script to allow articles to be posted directly to any N-13 News installation.
http://n-13news.googlecode.com/files/n13news4.0.2_xmlapi.zip
Extract the 4 files and copy them to your server into the same directory you installed N-13 News.
xmlapi.php
file, towards the top of the file are a few settings, edit these to match your own server settings./* EDIT THESE SETTINGS \*/
$apiSettings = array();
$apiSettings['blogURL'] = 'http://dev.network-13.com/news'; // Change this to the location where you show your news
$apiSettings['blogName'] = 'Network-13'; // Name of your blog/site
/* ~~~~~~~~~~~~~~~~~~~ */
These instructions apply for Microsoft Word 2007 and above. To open the Blog post
template, navigate to File
> New
> and find the Blog post
template. Once you've opened it it may ask you to add new account, if it doesn't, select the Manage Accounts
option.
Select New
, where it says select your blog provider, select Other
, you should be given a screen like this
For the Blog URL
enter the location of the xmlapi.php
file, for example http://example.com/news/xmlapi.php
The username and password is the same username and password you use to login to N-13 News. Once you add the account, hopefully that should be all that's required. Now you should be able to open existing articles on your server and publish new ones.
Many thanks to Ryan Hemelaar who wrote the basis of the code I built on top of.
Nice work m8
but i just tryd to open a post i made and the images dont show. if i use images in word for a new articel wil the pic show?
well i guess i can test that..
EDIT: okay images dont work and danish nativ letters dont work æøå givs me this ���
Images should work provided you change the $apiSettings['uploadDir'] = 'D:\www\blog\uploads\\'
directory to your news upload directory and have chmod'd that directory to 777.
Getting the same problem with the characters turning into ���, will see if I can figure out what's causing it.
Alright I think I fixed the weird character issues, if you redownload the zip and upload a new copy of xmlrpc.inc
, this should hopefully make non-english characters display correctly.
thanks m8 the æøå is working now. now it is just the right path to the upload folder. i am not shure ware i sould start it from. /home/www/edb-hosting.dk/nyt/upload like this? or /www/edb-hosting.dk/nyt/upload this. or like /edb-hosting.dk/nyt/upload.
but ill play around whit it wen i have the time. still developing the local sites of .com whit a new design. .net and .dk site i using the same database indstalation as a test. hope it dos not course problems :-/ it seams to work fine for now
edb-hosting.dk/blog.html edb-hosting.net/blog.html
EDIT: okay i tryd some difrent settings and got a broke image icon. the link it gave me was http://dev.network-13.com/blog/uploads/728122343test1.jpg ??????? i dont get it
okay in xmlapi.php on line 280 i changed http://dev.network-13.com/blog/uploads/ to http://edb-hosting.dk/nyt/uploads/
now the broken images show the right link but still no images and upload folder is empty and permissions is set to 777
I've made some changes to the xmlapi.php
file, some of the settings don't need to be edited manually now, instead the script pulls the systems from the news system, hopefully this will fix whatever problem seems to be happening with the images not being uploaded properly. If you re-download the zip from the first post and replace your own copy of xmlapi.php
with the latest one and change the settings at the top, try again to see if images now upload.
Hi sorry for the late reply
it seams to upload the images now. but it still dos not show them.
but it seams also to be better to just use the normal way to post storys. the layout is not as good when using word
How add summary in Microsoft Word?