Setting category and other metadata via MediaWiki API - php

I have a lot of data that I want to upload to mediawiki with content and category metadata.
I found Api.php?action=edit for uploading and some bots framework in php
but I cant find any thing for setting the category.
Anybody know how to set category data with mediaWiki API or any framework?

If you want to add some page to a category, you would do it the same way as if you were editing the page manually: by adding code like [[Category:Some Category]] to the end of the article.

Related

How can I fetch data from database to multiple views in Laravel?

This might be a challenging topic, because I haven't found anything on Google or YouTube.
So I want to fetch data from a database to multiple views/pages in a Laravel application.
An example of this challenge:
A client who is a photographer. He wants website where he can showcase a gallery of his photographs in a gallery page. He also wants to display the latest the photographs on the home page under the title latest images.
He has an admin page where he can upload all his photographs to a database.
If anyone has an idea how to do this, I will appreciate it!
Thanks!
There are allot of ways of solving this problem, i would recommend building a gallery component. This component can be used on the home and gallery page.
You can parse the image models to the component see Passing Additional Data To Components https://laravel.com/docs/5.7/blade#components-and-slots.

Migrating Large PHP Website to Wordpress

I used to have a Wordpress website a few years ago. After getting hacked, I decided to create my own PHP script and extract the necessary data from my Wordpress Installation and keep the same URL structure. Now, a few years later, I want to move back to Wordpress for various reasons. My site has over 2500 articles, and manually importing these articles will be a pain, and I want to keep the same URL structure, as to not lose any SEO.
Here is my SEO structure
https://www.example.com/post-id/post-title-all-lower-case/
I have a database with the following values:
post id
post url (the url slug)
category id
post title
post content
etc..
I can easily create an xml or rss feed with these values for the 2500 posts. But I don't know how to import this content to wordpress. Anyone got any ideas on how I can go through a smooth transition?
I just need this content imported. Creating the theme and everything else is the easy part.
All help is greatly appreciated!
EDIT: SOME PROGRESS!
I have uploaded all my content to a new wordpress installation. Each post has a custom field with a unique number. This number MUST be the post_id.
How do I make it so that I make this custom field the post_id of that post?
All help is greatly appreciated!
You can use this wordpress plugin for safe migration.
https://wordpress.org/plugins/duplicator/
I did something like this a couple of years ago, using MS Excel to concatenate the cells to export to a csv file we could load directly to the mysql db using PHPMyAdmin. We were also doing categories, which involved various tables. For posts, I think you can load directly to the wp_posts db table. I'd create a single post in WP, look to see what table counts change. The look at the tables that changed to see how you would need to populate a csv file to load your content.

Custom Customer Edit Page: Upload PDF file and retrieve for display

I followed this tutorial Add Custom Edit Customer Tab to create a custom tab and page for my customer.
I would like to make it as dynamic page that fetches data from the database however I don't know how to start it.
So far this is my progress
All the codes were copied from Add Custom Edit Customer Tab.
I'm new to magento and I don't now how to start creating a dynamic page in the admin page.
My goal is to upload a PDF file for every customer and display it below.
UPDATE: My goal is to create a magento module that allow admin to upload pdf file in the backend and will dynamically display on the customer login page.
I would like to know were can I create/relate my database table/attribute so that it will get and store the exact customer ID and file.
Is there any tutorials or blogs that you can recommend?
In case I will create another similar customer page that uploads PDF file, is there a way also that I will not repeat my self doing the same code?
I hope you can help me.
Thanks!
The best way to solve that problem is to understand how to create a simple module.
Allan Storm has one of the best blogging tutorial that can help you.
If you already understand the basic of Magento module you can advance in making complicated admin backend.
You can start by building Magento Admin Grid.
You can start on this tutorial http://navaneeth.me/creating-magento-extension-with-custom-database-table/#.VkwhrXYrKUk upon following, update the rosource model and collection model, extend them with this
Mage_Core_Model_Resource_Db_Abstract - (extend this on your resource model)
Mage_Core_Model_Resource_Db_Collection_Abstract - (extend this on your collection model)
To create upload file, try to understand this link http://arabgento.com/en/techniques-of-uploads-files-inside-magento/
don’t forget to declare your from container with (‘enctype’ => ‘multipart/form-data’)
I hope this helps.
For upload pdf and display it :
If you want to display pdf than use use "iframe" tag.
If you want to convert pdf to png or jpg and display than upload the pdf using AJAX on server and convert that pdf using "imagemagick" and display.

Extract posts from Drupal

I have a website (for which I don't have access but I have the database and the website on my local drive) that was made in Drupal and which I need to update. Since I have no experience working in Drupal, I decided to do a new website in PHP (Laravel) but I have to add the posts that are already in the Drupal website. There are sections in the website of which each has it's own posts.
I found where the posts are in the Drupal database, in the node and node_revisions table. But the problem is that I can't find a way to figure out which post is in which section. Hoe does Drupal differentiate these posts?
I recommend looking into drush node export. It might save you some time. You can export all nodes to a xml file.
"sections" probably is another node field where is stored node category.
Try to search for any of the "section" value in DB. Then you will see relation with nid from node table.

Joomla get article nice URL

I am new to Joomla and am trying to develop a module under 3.1. I managed to get the selected article ID and title in the module options but I don't know how to get the url to the ID, something similar to get_permalink(ID) in Wordpress.
You would want to run the url through JRoute to get the full url. You would also need to know how Joomla articles are usually built.
$url = JRoute::_('index.php?option=com_content&view=article&id='.$id);
This assumes that you have the id in the variable $id. For the rest of the url you would need to know the component you are calling (added as the option like above, Content manager is always com_content) and the view (which for an article is article). You can see the different views available for com_content by checking the file structure under /components/com_content/views/. Besides Article, you should see articles, categories, and category as well as a few other.

Categories