Hello, only three questions (I didn't find nothing similar googling archives) and I'd almost finished my app...;)
- Downloads: I enabled the upload funcionality usuing functions form specialupload, integrating it when you press the button appearing in edit mode (the "save changes"). My apllication based in Mediawiki modifies a file of pure text that I have previously uploaded...but how I get a link to download the file?. I mean, if uload was thought to images, then putting the image you could download it wih right button of the mouse, but it is a uplaoded text file, that I have to download....there's any function to do this, or simply I remade one of the navigation links to point the file? (rough method, I suppose; but if there's a specific function to download files as there is one to upload file, would be better...)
- Dinamic logo: I change in localsettings.php the image to be loaded in the logo; however I would like to change the logo according to change of "screen"; this would be when I enter in index.php and I know what action is done, but doesnt' work. I printed a var to screen to know if I was getting well the path, and it's correct. Not critical, but if there's a way of do it...
-Installing my application: to do my application I have based on Mediawiki. To the present moment, the instructions would be
1.install mediawiki 1.4.0 and 2.copy all the files I have modified overwriting the older ones, but careful with localsettings.
I can't simply say "copy the files" because my aplication uses the database for users (not for text). Can I modify the installing program to integrate my apllication, and reduct it to a single step (substitute the Article.php by my Article.php, etc...) I suppose it work, yes? And I suppose there's no problem with that, as I inform continously that is based and powered by Mediawiki, being open source, yes?
Thanks in advance
Jordi
On 6/19/05, Jordi Domingo jordidr@gmail.com wrote:
Hello, only three questions (I didn't find nothing similar googling archives) and I'd almost finished my app...;)
- Downloads: I enabled the upload funcionality usuing functions form
specialupload, integrating it when you press the button appearing in edit mode (the "save changes"). My apllication based in Mediawiki modifies a file of pure text that I have previously uploaded...but how I get a link to download the file?. I mean, if uload was thought to images, then putting the image you could download it wih right button of the mouse, but it is a uplaoded text file, that I have to download....there's any function to do this, or simply I remade one of the navigation links to point the file? (rough method, I suppose; but if there's a specific function to download files as there is one to upload file, would be better...)
I believe the Image object is what you are looking for.
- Dinamic logo: I change in localsettings.php the image to be loaded
in the logo; however I would like to change the logo according to change of "screen"; this would be when I enter in index.php and I know what action is done, but doesnt' work. I printed a var to screen to know if I was getting well the path, and it's correct. Not critical, but if there's a way of do it...
I assume you are refering to $wgLogo. If you want to change it based on the request, I would look into using an extension function (so you can use $wgRequest).
-Installing my application: to do my application I have based on Mediawiki. To the present moment, the instructions would be
1.install mediawiki 1.4.0 and 2.copy all the files I have modified overwriting the older ones, but careful with localsettings.
I can't simply say "copy the files" because my aplication uses the database for users (not for text). Can I modify the installing program to integrate my apllication, and reduct it to a single step (substitute the Article.php by my Article.php, etc...) I suppose it work, yes? And I suppose there's no problem with that, as I inform continously that is based and powered by Mediawiki, being open source, yes?
If you've modified the original source files, I'd using a diff/merge application.
You can make all the changes you want, it's open source. ;) You may want to be more specific and clearer.
-- Jamie ------------------------------------------------------------------- http://endeavour.zapto.org/astro73/ Thank you to JosephM for inviting me to Gmail! Have lots of invites. Gmail now has 2GB.
On 6/20/05, Jamie Bliss astronouth7303@gmail.com wrote:
On 6/19/05, Jordi Domingo jordidr@gmail.com wrote:
Hello, only three questions (I didn't find nothing similar googling archives) and I'd almost finished my app...;)
- Downloads: I enabled the upload funcionality usuing functions form
specialupload, integrating it when you press the button appearing in edit mode (the "save changes"). My apllication based in Mediawiki modifies a file of pure text that I have previously uploaded...but how I get a link to download the file?. I mean, if uload was thought to images, then putting the image you could download it wih right button of the mouse, but it is a uplaoded text file, that I have to download....there's any function to do this, or simply I remade one of the navigation links to point the file? (rough method, I suppose; but if there's a specific function to download files as there is one to upload file, would be better...)
I believe the Image object is what you are looking for.
Ok, in /includes/image.php there's functions like geturl or getimagepath. I'll see if there's made some function similar to offer download. If not, as I said I'll just get the url and offer the file as a link in the upper menu...
- Dinamic logo: I change in localsettings.php the image to be loaded
in the logo; however I would like to change the logo according to change of "screen"; this would be when I enter in index.php and I know what action is done, but doesnt' work. I printed a var to screen to know if I was getting well the path, and it's correct. Not critical, but if there's a way of do it...
I assume you are refering to $wgLogo. If you want to change it based on the request, I would look into using an extension function (so you can use $wgRequest).
Yes, $wgLogo. But the problem is that I comment in index.php # $action = $wgRequest->getVal( 'action', 'view' ); and remade it according to an extenal file, assigning differents actions and differents logos. The actions are catched, but not the logos.
Also, doesn't seem to work if I change $wgLogo in article or editpage...
Note: oops, just now I remember I have one of this images as $wglogo in localsettings.php. I'll try to comment that line...
-Installing my application: to do my application I have based on Mediawiki. To the present moment, the instructions would be
1.install mediawiki 1.4.0 and 2.copy all the files I have modified overwriting the older ones, but careful with localsettings.
I can't simply say "copy the files" because my aplication uses the database for users (not for text). Can I modify the installing program to integrate my apllication, and reduct it to a single step (substitute the Article.php by my Article.php, etc...) I suppose it work, yes? And I suppose there's no problem with that, as I inform continously that is based and powered by Mediawiki, being open source, yes?
If you've modified the original source files, I'd using a diff/merge application.
You can make all the changes you want, it's open source. ;) You may want to be more specific and clearer.
I haven't altered the database (I just don't use cur table). I altered index.php, localsettings.php, /languages/languageca.php, and some of /includes (also adding new files as Article2.php). So, I have the changes more or less "in mind" - and I don't remember any not referred to PHP.
Seeing the internal organization of the mediawiki tar, I suppose I just can overwrite my modified files (and add the new ones); as for the installation program, I see /config/index.php and install-utils.inc as files to be altered to personalize the installation (putting messages of "based on wediawiki", of course).
Then, as there's no problem being open source (and crearly saying it's mediawiki-lamp based) I could do a new tar with my application name, and so the installation program of my application would be simplified to only install Mediawiki (with my incorpored changes).
-- Jamie
Lot of thanks
Jordi
On 19/06/05, Jordi Domingo jordidr@gmail.com wrote:
I get a link to download the file?. I mean, if uload was thought to images, then putting the image you could download it wih right button of the mouse, but it is a uplaoded text file, that I have to download....there's any function to do this, or simply I remade one of the navigation links to point the file? (rough method, I suppose; but if there's a specific function to download files as there is one to upload file, would be better...)
The way to do what I think you mean in wikitext is using the [[Media:Filename]] syntax (refer to the file itself, not the description). Internally, this is a call to Skin::makeMediaLinkObj() (in v1.5 this has moved to the new "Linker" class)
[Ignore this paragraph if you knew it already:] Note that whether the browser views or saves a text file is down to the configuration of a) the browser, and b) your server. For instance, a file sent with a content-type of "text/plain" will generally be displayed directly in the browser window. You can more-or-less force a save by getting your server to make up some other content-type (e.g. "text/x-something"); or, I believe some browsers respond to an extra header saying "Content-Disposition:attachment" - originally defined for e-mail messages in http://www.ietf.org/rfc/rfc2183.txt
On 6/21/05, Rowan Collins rowan.collins@gmail.com wrote:
On 19/06/05, Jordi Domingo jordidr@gmail.com wrote:
I get a link to download the file?. I mean, if uload was thought to images, then putting the image you could download it wih right button of the mouse, but it is a uplaoded text file, that I have to download....there's any function to do this, or simply I remade one of the navigation links to point the file? (rough method, I suppose; but if there's a specific function to download files as there is one to upload file, would be better...)
The way to do what I think you mean in wikitext is using the [[Media:Filename]] syntax (refer to the file itself, not the description). Internally, this is a call to Skin::makeMediaLinkObj() (in v1.5 this has moved to the new "Linker" class)
Yes, it seems what I need. However, looking the code in skin.php, it seems it refers to the originally uploaded file; and I rename/move the file (necessary for avoiding conflicts); I'll try it, or maybe modifying this function if it doesn't work (being not exactly the originally uplaoded file).
[Ignore this paragraph if you knew it already:] Note that whether the browser views or saves a text file is down to the configuration of a) the browser, and b) your server. For instance, a file sent with a content-type of "text/plain" will generally be displayed directly in the browser window. You can more-or-less force a save by getting your server to make up some other content-type (e.g. "text/x-something"); or, I believe some browsers respond to an extra header saying "Content-Disposition:attachment" - originally defined for e-mail messages in http://www.ietf.org/rfc/rfc2183.txt
Mmm, it's true, I work with PO files (*.po), but after all internally are text/plain. I suppose I'll have to put a tooltip or something "press right button", as I can't suppose any specific browser for my aplication (could be konqueror, mozilla, firefox, etc...). I'll try to conf the server, as you say.
-- Rowan Collins BSc [IMSoP]
Lot of thanks!!!
Jordi
On 21/06/05, Jordi Domingo jordidr@gmail.com wrote:
Mmm, it's true, I work with PO files (*.po), but after all internally are text/plain. I suppose I'll have to put a tooltip or something "press right button", as I can't suppose any specific browser for my aplication (could be konqueror, mozilla, firefox, etc...). I'll try to conf the server, as you say.
Well, it should be possible to set up your server to send a specific filetype for files with that extension; I don't know that they have an "official" filetype, but sending "text/x-po" or "text/x-localisations" would seem reasonable. According to http://httpd.apache.org/docs/mod/mod_mime.html.en#addtype doing this in Apache should be just a case of adding the following line in an appropriate configuration file/section:
AddType text/x-localisations .po
Most browsers will then say something like "this file is of type text/x-localisations, and I don't have an associated action for those, would you like to save it?"
On 6/21/05, Rowan Collins rowan.collins@gmail.com wrote:
On 21/06/05, Jordi Domingo jordidr@gmail.com wrote:
Mmm, it's true, I work with PO files (*.po), but after all internally are text/plain. I suppose I'll have to put a tooltip or something "press right button", as I can't suppose any specific browser for my aplication (could be konqueror, mozilla, firefox, etc...). I'll try to conf the server, as you say.
Well, it should be possible to set up your server to send a specific filetype for files with that extension; I don't know that they have an "official" filetype, but sending "text/x-po" or "text/x-localisations" would seem reasonable. According to http://httpd.apache.org/docs/mod/mod_mime.html.en#addtype doing this in Apache should be just a case of adding the following line in an appropriate configuration file/section:
AddType text/x-localisations .po
Most browsers will then say something like "this file is of type text/x-localisations, and I don't have an associated action for those, would you like to save it?" -- Rowan Collins BSc [IMSoP]
Thanks, it works! The file it's httpd.conf, if anyone needs it.
By the way: there's some function to know if anyone has downloaded a given file (not necessarily an uploaded file)? I don't see it in the list (recent months), or in Image.php.
I suppose it will be enough with the tooltip I put in logout (something like "Logout: remember download your file first")...
Jordi
mediawiki-l@lists.wikimedia.org