i have set up Wiki:Family using the tutorial #2 specified here
http://www.mediawiki.org/wiki/Wiki_family
Specifically, i am using same code, same folder, same database and different tables (they differ by prefixes) to create a multilanguage mediaWiki.
for now i have created two languages,
french and english which can be access by fr.sitename.com/wiki/ and en.sitename.com/wiki/
now i need to add interlanguage links to the article, the syntax
[[:fr:Main Page]]
does not work it just redirects me to a new page saying that i need to create the page as it does not exists while i can access it at fr.sitename.com/wiki/Main_Page
can someone please help me solve this?
Probably need to update your interwiki table - what does it contain now for iw_prefix='fr' ?. For example, see maintenance/wikipedia-interwiki.sql. Also I think there is a MediaWiki extension to do this, if you prefer a Web-based interface.
Related
Ok I am using drupal 7.
I need to get information out of some tables so I can read them in a iPhone app. I found out I need a php code to convert a table to json format. I need the code to go to a database "x" then to table "y". Then list entity_id and name from all the fields. This will be a read only. I don't know the first thing about php code. Can anyone point me in the right direction? Thanks
Follow the steps :-
Learns PHP :-)
learn how drupal works
Learn Drupal hooks
Drupal query.
Once you are inside drupal you dont need to coonect to drupal database, its handled by Drupal.
After this you can use hook_menu and in call back function you can return required JSON output.
Use that link in your application.
Chheers!!!
I am building a Mediawiki at here.
It is going OK, but now I want to have some articles to document things that begin with a lower-case letter such as Unix commands: "man", "chmod", "ls", "iPod", etc. I don't want them to show up like Mediawiki tries to make all page titles and article titles begin with an upper-case letter.
Also, I don't want the searches to be case-sensitive. I want searching for "apple" to find "Apple", etc.
I believe that I've achieved having case-insensitive searches by following the instructions from the web page.
I believe that this is good, but I am a little squeamish about what I had to do:
Change the Structure of the database table _pages, changing the type of the page title to be VARCHAR(255) and changing the collation sequencing to be a kind of utf-8 case-insensitive.
Adding a global function to globalFunctions.php.
Changing the php code in the wiki's skin.
It seems like this should just be a php variable in LocalSettings.php
But this all seems to work. I mean, I could enter "apple" and it would find the article on "Apple" rather than prompting me to create a new article called "apple".
But then, I noticed that the page titles were still capitalized for such things as new article such as an article on "chmod".
I went back to googling and I found a web page that said to use the Mediawiki global variable called:
$wgAllowDisplayTitle = true;
and that this would enbled me to use templates such as the following:
{{DISPLAYTITLE:chmod}}
http://www.learnbymac.com/wiki/index.php?title=Chmod
This partially works. The title of the article is now "chmod", but really, in the database the title is still "Chmod" which wouldn't be so bad, but when I go to the Category "Unix", all of the Unix commands show up starting with an upper-case letter.
I read on the Mediawiki site that beginning a page title with a lower-case letter, in any language, is disallowed.
I would like things on my wiki to be like they are on my Mac, not case-sensitive, but case-preserving.
I know that Mediawiki has to consider about every language in the world, but I don't.
I really would rather not modify the structure of my Mediawiki database any further, but maybe that's what's required. I just noticed that not only are the page titles wrong in the category pages, but they are also wrong in the title when you are editing pages.
Here's a link to a category that lists the titles in the wrong case:
---Edit---
I figured it out. I believe that it is fine now. I was missing the following line in my Mediawiki configuration file, called "LocalSettings.php:.
# disable first-letter capitalization of page names
$wgCapitalLinks = false;
I know that I entered this the first time. I believe what happened was the changes got saved in my local file system instead of being saved by my text editor, via ftp, to my website.
As you noted, setting $wgCapitalLinks = false; in LocalSettings.php will do the trick. If you already had pages in your wiki, you will probably want to run the maintainence script CleanupCaps as well: http://www.mediawiki.org/wiki/Manual:CleanupCaps.php
For your second question: To have the search case insensitive you can use the TitleKey extension (http://www.mediawiki.org/wiki/Extension:TitleKey).
It is stable, and used on many major wikis. There is also the possibility to plug in a the Lucene serach engine, if you want more control over the behaviour (http://www.mediawiki.org/wiki/Extension:MWSearch)
In an attempt to redesign a website, I put this page together by hand. However, there are currently over 100 more shows already that need to be added, and three new shows get added every year.
In the old system, a text document was used as a makeshift 'database'; it stored data about each show, with shows separated by '#' and data fields separated with ']'. Here's an excerpt:
#The Whorl of the Leaves]WhorlOfTheLeaves]3]F]167
#Aladdin]Aladdin]8]N]0
#A Christmas Carol]XmasCarol84-]7]N]0
#The Feral Child]FeralChild]7]N]118
#Camelot]Camelot]11]N]169
A PHP script was then used to extract the information about each show and make the page seen here.
I'm sure a script could be used to put together a page such as the one shown above, but it seems like there should be a better system than a text document to store the information.
My question is: if the text document 'database' is working, should I bother changing it? Is there a better way to organize the information about each show?
SQLite would be prefect for you. It's a tiny database that requires no configuration or setup - yet comes built into most PHP installs.
Just use PDO and your good.
$db = new PDO('sqlite:/path/to/here/mydb.sq3');
$db->query('SELECT * FROM shows');
Yep, there are a ton of "better" ways of doing this. But if you're happy with it and it works, why change it?
You could save yourself a lot of trouble by using a content management system such as drupal.
So I need to make a site available in different languages. Using PHP 5.x and MySQL 5.x. I believe I will be using gettext which seems fine for static text throughout the site but what about dynamic data that is stored in the db? Im referring to things like stories, events business listings etc. How do I get those to display in a different language? My initial thought was in the backend have them be able to enter multiple versions of a story, event or listing, one for each language they want to use on the site. But there could be thousands of entries times how many languages they want to show. Is there a better solution/idea that someone can point me to?
Also another issue I was thinking is currently the site allows you to search events/stories/listings, how would that work in different languages? Im assuming if someone selected the site to show in spanish they are going to use spanish words to search the site, but if the information in the db is in english I dont know that would work. Any suggestions on that?
If you want the stories to be correct in all languages, then you need them stored in all languages and provide the backend to do the translations or enter the stories on different languages as you initially thought.
If you don't like that, you might add the google translate element in your pages, to provide automatic (not correct) translation.
For the search question, I would only search for the keywords in the fields of the database in the same language as the user. If Joe is visiting your page in English, only look for the search terms in title_en, content_en, description_en fields of your database (or the ones with language='en' if you have one row per article and translation in the database, instead of one row per article (with all translations inside)). Obviously, this does only work if you put all the translations on the database.
The best solution I have seen described is this.
As i18n CMS sites as you describe are in a constant state of flux, with new articles being added, some of which have had translations, in some languages.
If an article in a chosen language has not yet been translated then show a default language (English?).
Then pick any ideas which appeal to your case:
a) If showing a default article in English also throw onto the page an input box and invite your audience to translate it for you.
b) If showing a default article in English also put on the page an offer to send the content to google translate as well as doing a) above
c) put a bounty on the translation and optionaly do a) and/or b) above.
For example, say if a user wanted to 'add a place' to my database, how could I create a page almost instantly with that place's name in the domain e.g www.mydomain.com/placename?
I understand it might be a complex solution so if it is too complex to explain can you please push me into the right direction of what I should be researching.
Create functionality to create "pretty urls" in php. Read more about that here: http://www.roscripts.com/Pretty_URLs_-_a_guide_to_URL_rewriting-168.html
Create parsing functionality for the urls, so that it recognizes "/placename" as the page "placename"
Create a database structure for pages with the page id, title, content and the url slug, etc.
Create functionality to fetch the right page from the database according to the matching url slug.
Create functionality to render the retrieved informaton
If I understood you right that's one approach to what you want to do.
I'm assuming you're using Apache. If so, create a rule using mod_rewrite that forwards requests for /place/placename to /place.php?name=placename. Then write the place.php script, which will pull the user page from the database and display it in the appropriate fashion.
That's one way to do it - there are others.
First of all try to understand mod rewrite.
You could "mask: a GET url into a much nicer format.
Start here : http://www.elated.com/articles/mod-rewrite-tutorial-for-absolute-beginners/
Then google on and get yourself familiar with all the possibilities.
After that make sure the GET variable is unique in your database, to be absolutely sure use a unique ID.
Example :
domain.com/PLACEID/PLACENAME/
mod_rewrite could then translate this to your php script into :
domain.com/place.php?VAR=PLACEID&VAR2=PLACENAME
Search the data from the user/place through the PLACEID .
Good luck