A
A
alex--n2017-06-22 13:34:07
JavaScript
alex--n, 2017-06-22 13:34:07

How to update links to already uploaded images in mediawiki?

Good afternoon. Need to move from wikia to mediawiki. Articles are unloaded on the docks, everything is in order. By default, images cannot be unloaded - I wrote a parser and unloaded them. Having received the images, I uploaded them using the maintenance/importImages.php file. In articles, the link to the file is red, as if the file does not exist. But after clicking and trying to download, he writes that such a file already exists and whether I want to reload it. If you do it in the reverse order, first upload the picture, then the article, you get the same thing.
The main magic is that if I click "Edit" on an article and, without changing anything, click "Save", the pictures appear. There are several more links in the imagelinks table in the database. Maybe after resaving the article, the wiki starts looking for the file? The main question is how to make sure that when adding images (and everything is updated in the database in the images table at once), the links in the articles are updated? Or maybe some script can take and resave all the articles? I understand the wiki for the first time, I can miss something)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Proskurin, 2018-11-19
@Raneto4ka

Get rid of the id, or make it unique for each block. For two or more blocks, the id must not match.
Now you have a list of boxes $('.box'), you need to iterate through it in an array, and apply your scripts to its children.

var boxes = $('.box');
boxes.each(function () {
   var $box = $(this);
   // Засуньте сюда весь ваш код, который нужен отдельно для каждого чекеда. 
   // Только не надо функции выносить. Функции не должны ссылаться на глобальные переменные,
   // все элементы вы должны передавать через аргументы. 
   // Дальше ищите элементы относительно $box. Например, вам нужен .handle, просто
   // пишите $box.find('.handle') - так вы получите только элементы с классом handle, которые
   // находятся внутри текущего бокса.
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question