Project:Support desk

From MediaWiki.org
(Redirected from Support Desk)
Jump to: navigation, search
vde   This page is for questions relating to the MediaWiki software.

Welcome to MediaWiki.org's Support desk, the central on-wiki place to ask MediaWiki questions!

The greater purpose of this page is to make our Manual and other available help so good that you do not have to come here to ask questions, or making them easier to find.

There are other ways for of communication as well (IRC, mailing lists etc.). Read more here.

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using:
    • MediaWiki (reported by your wiki's Special:Version page)
    • PHP (likewise)
    • Database (likewise, e.g. MySQL 5.5)
  2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
  3. To start a new thread, click "Start a new discussion".

Archiving topics

Topics are automatically archived when they have been inactive for three weeks. If a question you have asked is approaching this limit and still has not been answered, please 'bump' it to prevent it being archived. However do not 'bump' for other reasons.

Start a new discussion

Contents

Thread titleRepliesLast modified
Database error212:59, 31 January 2015
User script interdependencies312:02, 31 January 2015
[RESOLVED] Errors when using GD image library511:50, 31 January 2015
Including the reproduction license in the search007:52, 31 January 2015
Database query error003:25, 31 January 2015
MediaWiki revisions blank?123:04, 30 January 2015
[Solved] Migrate nginx error 404218:54, 30 January 2015
ExtDev : Which hooks to page pre-rendering ?015:43, 30 January 2015
Tick "Ignore any warnings" by default015:26, 30 January 2015
I opened LocalSettings.php using notepad and saved it313:44, 30 January 2015
#1050 - Table 'calendar' already exists613:11, 30 January 2015
Possible bug in DatabasePostgres.php211:08, 30 January 2015
Add a dialect010:40, 30 January 2015
Two questions regarding edit forms104:46, 30 January 2015
Editing MediaWiki namespace101:41, 30 January 2015
$wgUser deprecated301:37, 30 January 2015
Does MediaWiki suite my project? Some info about the fork feature222:35, 29 January 2015
I see a search results page instead of an article015:40, 29 January 2015
Upload files without createpage - permission012:57, 29 January 2015
[RESOLVED] Call to uploaded file210:40, 29 January 2015
First page
First page
Previous page
Previous page
Last page
Last page

Database error

Not sure if anyone have had this problem before. My wiki page have working normal up until a couple of days ago. When I try to access my site, I get the following

A database query error has occurred. This may indicate a bug in the software.

Query: SELECT page_title FROM `page` WHERE page_is_redirect = '0' AND page_namespace = '8' AND (page_title NOT LIKE '%/%' ) AND (page_len > 10000) Function: MessageCache::loadFromDB(en)-big Error: 1146 Table 'my_wiki.page' doesn't exist (mysqlhost3)

What's strange is when I try show the tables using putty, it shows that I have a table called page. But when I used the command to select * from page, it says the table does not exist.

Has anyone had this problem before? If so, how did you fix it?

littledevils32611:29, 31 January 2015

Are you rally sure that the wiki is using the same database, meaning the one, on which you tried running the SELECT query? Or are you maybe unintendedly using a test instance or so at one place?

If this is not the problem, then it might be that the MySQL server was updated or the database files were moved. If that is the case, restarting the MySQL service and/or receating the database should help.

88.130.99.3112:28, 31 January 2015

Yes this is same database wiki is using. My site had been working fine and I never changed anything, but it's not working now. Regarding the MySQL server, putty shows a list of table names, one of which is 'page' (see above error message) but it complains that the table does not exist. However, when I access my tables through phpmyadmin, I don't have the table 'page'.

94.173.24.3612:59, 31 January 2015
 
 

User script interdependencies

I ask this question specifically in the context of the English Wikipedia, but I suppose it's equally valid for any MediaWiki installation. I originally asked these questions here, and copy them here in the hope of more support.

I'm starting to try and work with userscripts a little, and, probably due to my inexperience with both javascript and with mediawiki, I'm running in to a couple of questions. The questions all have to do with loading and dependencies.

  • I would like to use some functions/objects in multiple scripts. What is the suggested way to inject the dependencies into the executing script? There are the functions importScript, mw.loader.load and mw.loader.using([1]). I can't figure out how to inject the dependencies in to the executing script however, other than injecting them into the global namespace and picking them up from there, which can't be the intention. mw.loader.using takes a callback as an argument, but that callback doesn't have parameters for the dependencies. It returns a promise, but I can't find what the promise contains (it looks like nothing).
  • Scripts that actually do something other than providing functions tend to depend on the DOM, which may be built asynchronously. The mediawiki guidelines advice to use the mw.hook events rather than document.ready, which seems reasonable, but the three listed events there seem to be rather sparse. My specific usecase for now is adding a portlet link. I'd like it to be general, but I'd settle for it only working on Vector. On which event should I add that?
Martijn Hoekstra (talk)10:06, 30 January 2015

I wasn't aware of the mw.hook thing, but for things like portlet links that are not in article content you can use document.ready events without problems.

Example code with dependencies:

$(function() {
	// Code that will run when the page has finished loading
	mw.loader.using(['mediawiki.api', 'jquery.ui.dialog']).done(function() {
		// Code that will run when all dependencies have been loaded and are available on the page
	});
});
Ciencia Al Poder (talk)10:50, 30 January 2015

Well, that at least solves the document ready problem; it's not a problem. But I still don't get how I can depend on my own userscripts. For example, if I have User:Martijn Hoekstra/somedependency.js

  (function(){
    var myutilities = {
      do_my_thing: function(){
         // code that will do my thing
      }
    };
    //I want to expose myutilities to other scripts somehow now, preferably not through the global namespace but I don't know how
  })();

Then when I have User:Martijn Hoekstra/mydependingscript.js

  mw.loader.using(['some way to refer to User:Martijn Hoekstra/somedependency.js, what goes here?']).done(function(mydependency) {
    mydependency.do_my_thing();
  });

how do I get a hold of the dependency in User:Martijn Hoekstra/somedependency.js?

Martijn Hoekstra (talk)11:55, 30 January 2015

You'll need to use $.getScript for that, passing the complete URL of the script (if it's a wiki page, with the &action=raw&ctype=text/javascript query string):

  $.getScript('/w/index.php?title=User:Martijn_Hoekstra/somedependency.js&action=raw&ctype=text%2Fjavascript').done(function() {
    mydependency.do_my_thing();
  });

Note that it doesn't allow cross-domain requests, so the script must be on the same wiki. Otherwise, there's no way to do that, except if you save your function in a sort of global variable and make the script attempt to read that variable to execute the function upon being loaded.

Ciencia Al Poder (talk)12:02, 31 January 2015
 
 
 

[RESOLVED] Errors when using GD image library

I'm seeing blank pages when I attempt to use GD as the image library as opposed to ImageMagick.

I've got an old MediaWiki site that I've just upgraded from version 1.8.2 to 1.24.0. I also installed a completely fresh copy of 1.24.0 onto the same server. When I set them both to use ImageMagick I receive errors about proc_open being disabled at the top of the page and, although pages will load, the images won't and instead say:

Error creating thumbnail: Unable to run external programs, proc_open() is disabled.
Error code: 1

Essentially my host has disabled proc_open for security.

So I try to use GD instead. The fresh installation lets me upload new images and add them to pages, then it creates the thumbnails as it should. All works fine with GD. The upgraded site, however, just goes to a blank page after pressing the upload button. It also shows a blank page on several pages that have images (ie the same pages that would have the above error if using ImageMagick), eg Gallery of new images, and File list.

It appears that I can't use ImageMagick due to proc_open being disabled. But does anyone know why GD would work fine on one installation but not on another?

The errors that appear when loading those blank pages look like: PasteBin

I'm using:

  • PHP: 5.3.29
  • MySQL: 5.6.22
  • MW: 1.24.0

Thanks

Chris huh (talk)16:49, 28 January 2015

If you have both 1.24, the problem may be one setting in LocalSettings.php causing an error, or if you forgot to run the upgrade script on the migrated database.

It's strange that the debug log stops at that line. That may indicate a fatal PHP error or, in the worst case, a segfault. Note that PHP fatal errors aren't logged in the debug log, you should enable the display of PHP errors (see Manual:How_to_debug) or look at the error log of the webserver.

Ciencia Al Poder (talk)10:57, 29 January 2015

I've turned on PHP debugging via the LocalSettings.php option. Where would it display any PHP errors? In the page itself or in a log? I don't see any errors on neither the page nor in the log file.

I will have to look through my LocalSettings.php to see if there is anything that could be causing it. Thanks

Chris huh (talk)17:11, 29 January 2015

Read the section PHP errors on that page.

Ciencia Al Poder (talk)20:46, 29 January 2015

Oh yeah, it says it right there. My bad. I'm not seeing any errors on the page so i guess it's one of those fatal PHP errors that occurs before the system can get to that line of code. I'll try looking at the LocalSettings.php.

Thanks

Chris huh (talk)11:13, 30 January 2015

I'm not sure what it was in the LocalSettings but by using the fresh installation's copy I got it working.

Thanks

Chris huh (talk)10:54, 31 January 2015
 
 
 
 
 

Including the reproduction license in the search

Is there a way to limit a search to only pictures carrying a certain license? E.g., At my publication I'm not allowed to use pictures under the ShareAlike license, but only those licensed "CC BY" or "CC BY-ND."

It would save a lot of time if I could run a search that only produced pictures with these license-types.

73.168.230.6707:52, 31 January 2015

Database query error

Not sure if anyone have had this problem before. My wiki page have working normal up until a couple of days ago. When I try to access my site, I get the following

A database query error has occurred. This may indicate a bug in the software.

Query: SELECT page_title FROM `page` WHERE page_is_redirect = '0' AND page_namespace = '8' AND (page_title NOT LIKE '%/%' ) AND (page_len > 10000) Function: MessageCache::loadFromDB(en)-big Error: 1146 Table 'my_wiki.page' doesn't exist (mysqlhost3)

What's strange is when I try show the tables using putty, it shows that I have a table called page. But when I used the command to select * from page, it says the table does not exist.

Has anyone had this problem before? If so, how did you fix it?

littledevils32603:25, 31 January 2015

MediaWiki revisions blank?

I'm working with a mediawiki that apparently got pretty spammed up. The current installation is not working at all. I downloaded a copy of the latest mediawiki, and imported the entire database. I ran the updater script. Now all the pages are restored however it seems like the last couple of revisions are blank. So almost all of the pages are blank unless they only had one revision....

Any ideas?

144.126.16.16217:10, 30 January 2015

Can you explain the problem in more detail?

I assume that before you did the recent upgrade, you used MediaWiki 1.5 or newer. If so, then I have the following questions:

When you look at a page, the page table inside th DB is used to get a revision number for that page. Next the revision table is queried for exactly this revision and in this process an old_id is obtained. Finally this value is used to get the according text from the table text.

So do you have a corrupted revision table (which does not point to an existing entry in the text table)?

Or are the entries in the text table actually present (old_id does exist), but the according text is empty? In this case: Is it possible that a user has just deleted the text through MediaWiki and saved an epty page instead? IIrc you can see the size differences when you compare the according fields in the revision table.

88.130.99.3123:04, 30 January 2015
 

[Solved] Migrate nginx error 404

Edited by another user.
Last edit: 10:29, 19 January 2015

Hello,

i have dump sql and import to new server.

New server: nginx -v (with fcgiwrap)

  • nginx version: nginx/1.6.2

php -v

  • PHP 5.4.36-1~dotdeb.1 (cli) (built: Dec 19 2014 23:01:37)
  • Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

mysql -V

  • mysql Ver 14.14 Distrib 5.5.40, for debian-linux-gnu (x86_64) using readline 6.2

LocalSettings.php (old):

   ##$wgScriptPath = "/wiki";
   $wgScriptExtension = ".php";
   $wgArticlePath = "$wgScriptPath/$1";
   $wgUsePathInfo = true;
   ## The protocol and server name to use in fully-qualified URLs
   $wgServer = "http://l4d2-funs.myriapulse.com";
 

LocalSettings.php (new):

   $wgScriptPath = "";
   $wgScriptExtension = ".php";
   $wgArticlePath = "$1";
   $wgUsePathInfo = true;
   ## The protocol and server name to use in fully-qualified URLs
   $wgServer = "http://ip_vps";

I have tested multiple configuration but same...

virtualhost:

    server {
        listen 80;
 
        root /usr/share/nginx/html/wiki;
        index index.html index.htm index.php;
 
        # Make site accessible from http://localhost/
        server_name localhost;
 
        #error_page 404 /404.html;
 
        #error_page 500 502 503 504 /50x.html;
        #location = /50x.html {
        #       root /usr/share/nginx/html;
        #}
        # Here, multiple test and same results...
        location /wiki/ {
                #try_files $uri $uri/ @rewrite;
                #try_files $uri $uri/ @wiki;
                try_files $uri $uri/ /index.php?$args;
        }
 
        # Don't log robots.txt or favicon.ico files
        location = /favicon.ico { log_not_found off; access_log off; }
        location = /robots.txt  { allow all; access_log off; log_not_found off; }
 
        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
#               fastcgi_intercept_errors on;
#               try_files $uri = 404;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_index index.php;
                include fastcgi_params;
        }
 
        location ~ /\.ht {
                deny all;
        }
 
        location @rewrite {
                rewrite ^/(.*)$ /index.php?title=$1&$args;
        }
 
        location /maintenance/ {
                return 403;
        }
 
        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                try_files $uri /index.php;
                expires max;
                log_not_found off;
        }
 
        location = /_.gif {
                expires max;
                empty_gif;
        }
 
        location ^~ /cache/ {
                deny all;
        }
 
        location /dumps {
                root /usr/share/nginx/html/wiki/local;
                autoindex on;
        }
}


what is wrong please?

Cheers,

Owned67 (talk)17:10, 17 January 2015

$wgArticlePath should probably be "/wiki/$1".

You should also try the configuration provided by http://shorturls.redwerks.org/

Ciencia Al Poder (talk)10:35, 19 January 2015

Thanks, solved

Owned67 (talk)18:54, 30 January 2015
 
 

ExtDev : Which hooks to page pre-rendering ?

Hi all,

I'm currently developping an extension for mediawiki and need your help please. I tried few things by my own and search around a bit but I didn't find anything about my issue.

My problem is the following : I try to add dynamic content at beginning of some pages (based on some database extended informations). Currently, I use the "onArticleAfterFetchContentObject" hook in order to add my dynamic content before any parser (it's important because my dynamic content contains wikitext !). It works great, except one thing : after editing an article, user is redirected to the article without calling "onArticleAfterFetchContentObject". This makes sense, because content doesn't need to be reloaded from database after an edit, but this causes my dynamic content isn't added to the page unless someone purge it...

Now, I'm not sure about what I should do to solve this issue. Should I try to force purge after each edit ? How ? Should I try to add my dynamic content after an edit too ? How ? Should I try to find another hook to add my dynamic content and manually apply parser on it ? How ? (dynamic content only contains basic wikitext like bold and italic)

I want to precise that storing this dynamic content into a magic word into the article is not feasible. And by the way, I found it strange that even if "onArticleAfterFetchContentObject" hook is called where user is on edit.php, added dynamic content isn't shown in html textarea, but I didn't investiguate on it.

Thanks and sorry for my awkward english.

Kallys (talk)15:43, 30 January 2015

Tick "Ignore any warnings" by default

Heiya, is there a setting/way to tick "Ignore any warnings" situated in the "Upload Options" section on "Special:Upload" by default for all users. Thanks and cheers

[[kgh]] (talk)15:26, 30 January 2015

I opened LocalSettings.php using notepad and saved it

Now the wiki's broken. How can I revert it?

Sandvich18 (talk)09:46, 29 January 2015

Will opening it in Notepad++ and saving it in UTF-8 without BOM work?

Sandvich18 (talk)10:14, 29 January 2015

See Manual:LocalSettings.php! Yes, saving the file in UTF- without BOM will ix the wrong ncoding again.

88.130.64.25018:10, 29 January 2015

Thanks :)

Sandvich18 (talk)13:44, 30 January 2015
 
 
 

#1050 - Table 'calendar' already exists

SQL query:

-- -- Database: `iwpa03` -- -- -------------------------------------------------------- -- -- Table structure for table `calendar` -- CREATE TABLE `calendar` (

`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`parent_id` INT( 11 ) DEFAULT  '0',
`owner_id` INT( 11 ) DEFAULT NULL ,
`project_id` INT( 11 ) NOT NULL ,
`title` VARCHAR( 255 ) DEFAULT NULL ,
`place` VARCHAR( 255 ) DEFAULT NULL ,
`notes` TEXT,
`start_datetime` DATETIME DEFAULT NULL ,
`end_datetime` DATETIME DEFAULT NULL ,
`status` INT( 1 ) DEFAULT  '0',
`rrule` TEXT,
`visibility` INT( 1 ) DEFAULT  '0',
`participant_id` INT( 11 ) NOT NULL ,

PRIMARY KEY ( `id` ) ) ENGINE = INNODB DEFAULT CHARSET = utf8 AUTO_INCREMENT =1;

MySQL said:

  1. 1050 - Table 'calendar' already exists

This is what i am getting when i want to inject the datebase to my other mediawiki installation

192.44.85.2313:05, 14 June 2013

If you want to replace the table "calendar" with another one, you should delete the old table before. (Another solution would be to make sure that the DB dump, which you want to import, contains "DROP IF EXISTS" statements for each table. They will prevent this error as well).

88.130.80.11515:35, 14 June 2013

Hello i tried to insert DROP TABLE IF EXISTS `calendar` for each table is this the correct syntax if so i am getting error like this Error SQL query:

[...]

MySQL said:

  1. 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Rar!��' at line 1
192.44.85.2316:41, 14 June 2013

Just go to the DB, in which you want to replace the table, delete it and import it again. As simple as that.

88.130.80.11517:40, 14 June 2013

How to edit the table i am new to mysql please

192.44.85.2311:57, 15 June 2013

Use a tool like PHPMyAdmin. It has a graphical user interface and is really easy to use.

On the command line things become way more complicated (at least for unexperienced users like you):

You will have to log in, select the database and drop the table, e.g. with something like this:

mysql -u my-mysql-username -pmy-mysql-password
use my-database-name
DROP TABLE `calender`;

where you have to replace everything starting with "my-" with your actual names.

88.130.80.11513:07, 15 June 2013
 
 
 
 
 

Possible bug in DatabasePostgres.php

With this commit the new setting "standard_conforming_strings" was added:
github.com/wikimedia/mediawiki/commit/71d5b68221002d71c88783acab7df267a4e04cec

Some of my users (MediaWiki 1.19, PHP 5.2.5, PostgreSQL 8.4.1) has not enough rights to change this setting:
wiki-forum.de/installationsprobleme-der-version-1-19-0-t347486.htm

I suggest to check first if the necessary rights are available. If this is not possible (sorry I'm not a PostgrSQL user) there should be check at least a check if the setting is necessary. By PostgrSQL 9.1 the default is "ON". So there is not need to check. Lower versions could be checked through the following query:

SHOW standard_conforming_strings;
Marc Gutt (talk)17:49, 29 January 2015

You should report a bug, assuming this is still a problem in recent versions of MediaWiki. Note that MediaWiki 1.19 will end its support soon.

Ciencia Al Poder (talk)10:30, 30 January 2015
 

Add a dialect

A thread, Thread:Project:Support desk/Add a dialect, was moved from here to Extension talk:Translate. This move was made by Ciencia Al Poder (talk | contribs) on 30 January 2015 at 10:40.

Two questions regarding edit forms

Here is my setup:

MediaWiki  1.23.5
PHP     5.5.17 (apache2handler)
MySQL   5.6.21 

When a user wants to add a new section, there will be a textbox with label "subject/headline". Is there a way to change that label? I am already familiar with the relevant hooks (editpage class), but I wasn't able to find a way to change the label. I guess I'd also be interested in knowing how I can change the copyright warning at the bottom of the edit form. So the first question is as follows:

Is there some way, preferably via a hook, to change the labels and messages related to edit forms?

Now the second question/issue concerns passing some information to the edit form so that I can reuse it when processing the edit. With simple forms, you can have a hidden textbox and then use that to pass information. Is there any way to do that with edit forms? Basically I have some information about the user that I need to hold and keep hidden from the user and then I would need that information for the 'EditPage::attemptSave' hook. The second question is basically:

Is there a way to pass hidden information to the edit form and recover it after the edit has been submitted (via a hook)?

Thank you in advance

Mfort123 (talk)23:22, 29 January 2015

If you just want to change the text for your own wiki, you can edit the relevant system message in the MediaWiki amespace. To find the right message to edit, you can use Special:AllMessages on your wiki, or alternatively, use the procedure outlined at qqx. See https://www.mediawiki.org/w/index.php?title=Project:Sandbox&action=edit&section=new&uselang=qqx for an example "qqx" URL, which tells you that the page you need to edit on your wiki to edit the "Subject/headline" message is MediaWiki:Subject.

As for the second issue, if you pass the information in a hidden form field , the user will still be able to see the information by viewing the HTML source of the edit page. Couldn't you simply fetch the relevant information in the EditPage::attemptSave hook, and do all the processing internally?

This, that and the other (talk)04:46, 30 January 2015
 

Editing MediaWiki namespace

Hi, I've just installed MediaWiki using Bitnami and I'd like to start designing my Wiki and customizing it to my liking but atm I can't because I can't edit the MediaWiki namespace. How do I gain this ability? My PC is secure in the sense I'm the only one that uses it and my net connection is private (I'm at home I'm not at a coffee shop or other public place) so I'm confident doing so won't cause me big problems.

Software details
Software Version
MySQL 5.5.40
PHP 5.4.35
MediaWiki 1.24.1
Operating system Windows 7 64 bit SP1
Fuse809 (talk)20:41, 29 January 2015

You should log in as the user that you created when you first set up the wiki, as it should have the appropriate permissions. Visit "Special:ListUsers" on your wiki if have forgotten the user name.

See also Manual:FAQ#Initial_user_was_not_created_by_installer_or_it_is_not_an_administrator

This, that and the other (talk)01:41, 30 January 2015
 

$wgUser deprecated

Since $wgUser is deprecated, what is the new method for getting the user class?

Cblair91 (talk)22:30, 29 January 2015

As far as I know, $wgUser is not deprecated. You can use variable by add "global $wgUser" to user code.

*devunt (talk)22:38, 29 January 2015

Manual:User.php#See_also

Notice this: "Manual:$wgUser - global user object (deprecated)"

Cblair91 (talk)22:43, 29 January 2015

It depends on where in the code you want to access this information. On a special page, for instance, one can use $this->getUser().

What exactly are you trying to do?

This, that and the other (talk)01:37, 30 January 2015
 
 
 

Does MediaWiki suite my project? Some info about the fork feature

Hi everybody

I'd like to install MediaWiki on two websites for two different projects, but I need some info before:

1) can I "fork" some Wikipedia articles into my website? How can I accomplish it? I know I can copy/paste them, but are there other ways to do this with many articles?

2) the other website is project oriented. Each member will be able to fork the project of another member, and all the related fork have to be notified in order to collect them into a group: something like the Fork feature of GitHub, but these forks will stay in my website. Is it possible with MediaWiki? How?

Thank you in advance!

Best regards,

Ivan

IvanPsy (talk)22:01, 28 January 2015

You should look at work I did on my page puller extension]. It isn't forking in the git sense, but it would allow you (with some work) to keep the pages in some sort of synchronisation.

MarkAHershberger(talk)00:10, 29 January 2015

Thank you for your answer. It sounds interesting: what are its features?

IvanPsy (talk)22:35, 29 January 2015
 
 

I see a search results page instead of an article

I'd like to revive a question I posed in the summer:

I have now installed version 1.24.1 as a completely fresh installation on a different computer, with Vector as the skin, and I have the same issue. (The issue is that when I click "Search", MediaWiki presents a search results page, instead of bringing me to the article that matches the title.)

This leads me to believe that something has gone awry with Vector, because Monobook behaves as expected.

Does anybody know if there is a setting somewhere that tells Vector to bring users directly to the matching article? I have updated $wgVectorUseSimpleSearch, with no results other than the cosmetic addition of "go" and "search".

Supāsaru15:40, 29 January 2015

Upload files without createpage - permission

Hi, if i give a group the permission to upload files (upload) but not to create page (createpage) they are not able to upload a file. As i understand an upload will create a page for that file - that is imho the problem. Is there a workaround? This group has the permission to edit pages but they schouldn't have the permission to create new ones. However they should be abel to upload and link images in an existing page. Is there a solution for? Best regards and thanks in adavance!

MediaWiki 1.22.13 PHP 5.4.36-0+deb7u3 (apache2handler) MySQL 5.5.41-0+wheezy1

LNAG-IT (talk)12:57, 29 January 2015

[RESOLVED] Call to uploaded file

In our wiki exists several updated files. By example File:myfile.jpg. Then myfile.jpg is located in ../images/c/cf/myfile.jpg. I need to open (or download) directly (from a php program) the myfile.jpg. How the program can get the full path for myfile.jpg (../images/c/cf/myfile.jpg)?.

Jmarchn (talk)21:53, 27 January 2015

To access the physical path from the same server, it should be as simple as construct it from your upload directory, the /c/cf/ part, and the filename.

The /c/cf/ part is the first and 2 first (respectively) md5 sum hash characters of the filename (myfile.jpg). This can be done with the md5() function.

Ciencia Al Poder (talk)11:04, 28 January 2015

Thanks!!!

function path_from_md5fn_fn ($fn) {
  $s = md5 ($fn);
  return substr($s,0,1).'/'.substr($s,0,2).'/'.$fn;
}
Jmarchn (talk)07:30, 29 January 2015
 
 
First page
First page
Previous page
Previous page
Last page
Last page