Sedang Disiapkan

222327 Sitemap XML to javascript menu

I have a sitemap containing the urls of my forum.

I need the following:

The sitemap urls get converted to a javascript menu.

As a menu, I'd like you to use the following:

[url removed, login to view]

What I want you to do is:

- write a script that processes the [url removed, login to view] as input

- crawls the urls of the sitemap for their title

- inputs the urls into the array of the javascript menu according to the following rules:

1) Most urls will end with a number.

For threads for example: [url removed, login to view]

For subforums for example: [url removed, login to view]

You need to check subforum urls and input them into the top level of the javascript menu

You need to check the thread urls for their ending number and input them into the menu according to their numbers

An example what it should look like:

Top Headline

+1

++11

+++111

----1111

----1112

----1113

----1114

----1115

----1116

All the above would be clickable and link to the urls of the forum.

+ means an expandable tree item, - means it's the lowest level.

The array in the javascript would look like this:

d = new dTree('d');

[url removed, login to view](0,-1,'Top Headline');

[url removed, login to view](1,0,'1','[url removed, login to view]');

[url removed, login to view](2,1,'11','[url removed, login to view]');

[url removed, login to view](3,2,'111','[url removed, login to view]');

[url removed, login to view](4,3,'1111','[url removed, login to view]');

[url removed, login to view](5,3,'1112','[url removed, login to view]');

[url removed, login to view](7,3,'1113','[url removed, login to view]');

[url removed, login to view](8,3,'1114','[url removed, login to view]');

[url removed, login to view](9,3,'1115','[url removed, login to view]');

[url removed, login to view](10,3,'1116','[url removed, login to view]');

[url removed, login to view](d);

Instead of using the number as node title, I want you to get the title from the link of the processed page and input as a node title.

Subforum urls (see above) should be put into the array at root level.

All other urls that do not match the above need to be displayed on the root level of the tree.

You do NOT have to write the javascript menu. It's already ready to go.

Only the array in javascript needs to be written and the title fetched from the page.

I would prefer to have this as a php script that I run from the command line.

It gets the [url removed, login to view] as input. The location of the javascript menu file can be hardcoded into the script.

Kemahiran: Semua Boleh, Javascript, PHP, XML

Lihat lebih lanjut: what is a tree node, tree node, run javascript, node of a tree, node in tree, javascript go to, go to top javascript, go javascript, get location javascript, what is node, what is a javascript, xml php array, javascripts, javascript page title, php javascript tree, php write file xml, javascript array com, node javascript, ready javascript, php write xml file, php file write array, script tree, javascript document ready, javascript http file, check processed

Tentang Majikan:
( 0 ulasan )

ID Projek: #1968562