Talk:WikiDB

From TestWiki
Jump to: navigation, search

Some old discussion has been deleted. See here for diffs: [1].

External queries[edit]

Moved to WikiDB/Feature requests#External queries.

Count of records[edit]

Moved to WikiDB/Feature requests#Count of records.

Table Formatting[edit]

Moved to Talk:WikiDB/Repeat tag syntax#Table Formatting.

Parser Functions & Other Extensions[edit]

Due to the way that the WikiDB_Parse function was written, using a local parser it won't call into any extensions that have registered with the global parser (e.g. Parser Functions). However, I have replaced the Parse call with the following, and it seems to be working on my version 1.9.3.

function WikiDB_Parse( $Input, $Parser, $LineStart = true ) 
{
                        $title = $Parser->mTitle;
                        $options = $Parser->mOptions;
                        $output = $Parser->parse( $Input, $title, $options, true, false );
                        return $output->getText();
}

-Jacob 16:49, 14 April 2007 (BST)

Looking at my code, a (slightly different) version of this function already exists. As you don't give details about what code was there before your changes I'm not sure whether this is something I've already fixed, or whether you are pointing out something a bit more subtle. If I don't hear anything else, I'll assume it's fixed, but if there are still problems then please let me know! --HappyDog 12:22, 19 February 2008 (GMT)

Using the <repeat> tag to display filtered/sorted Tables[edit]

Moved to Talk:WikiDB/Repeat tag syntax#Using the <repeat> tag to display filtered/sorted Tables.

Versioning of WikiDB Extension Files[edit]

  • Since this Extension is in continual development now toward v1 and will continue in development afterwards, I'd like to suggest a small change to ALL of your WikiDB extension files to contain a Version number so that all of us using the extension can check back here and quickly determine if there have been any updates to the files. A version number can be attached to the $wgExtensionCredits array in each of your php files as shown below for another extension I have installed on my wiki.
$wgExtensionCredits['parserhook'][] = array(
'name' => 'CreateBox',
'url' => 'http://www.mediawiki.org/wiki/Extension:CreateBox',
'description' => 'Specialized Inputbox for page creation',
'author' => 'Ross McClure',
'version' => '1.5'
);
  • Also, what would be even more helpful would be to maintain current version numbers on all files on this page so that all of us using this extension won't have to look in the file sources themselves for the version numbers.
  • Further, since you're working toward v1 right now and common version numbering starts with 0.x.y for pre-v1 release versioning, you could start a version number for your files at 0.1.0 or something similar.
  • Finally, would you consider opening up the development of this extension to the open-source community to allow the inclusion of other code developers/designers/contributors to help develop this extension?

Thanks! -- Mdrayman 04:31, 1 July 2007 (BST)

The problem is that when I work on it, changes go live straight away which means that (a) sometimes the code is broken (hence my big warning) and (b) that it is too much work to do a version change on each update. I store the code in a local Subversion repository, so it would be fairly easy to add the SVN revision to the top of each file - this will probably do the trick. There might be some way of outputting this in some central place as well, but I'm not sure. I will have a think about it... Of course the real solution is to use a separate local testing server (which is what this was, originally, but it has since become the 'public face'), which is something else I might do when I have a bit of time to set one up.
Re: opening up the code - I am happy for people to make suggestions and to send me feature implementations or bug-fixes. I am capable of handling patch files, complete source file with modifications or even just informal code snippets, and of incorporating the changes back into the main branch, and have already done so on a few occasions. However for the time being I want to keep everything centralised here. Once we get a bit nearer v1, and the spec. is more clearly defined (particularly re: syntax issues) I will look into adding it to the MW SVN code repository. --HappyDog 13:48, 4 July 2007 (BST)
I have added SVN revision tags to the files, which contain the most recent revision no. of the files. I have also added a new feature to my WikiDebug extension to display this info in-wiki, and have added this functionality to the files page. I hope this solves the problem for you (feedback is always welcome!) --HappyDog 00:50, 13 July 2007 (BST)
The latest version (which is not yet posted here) has also added code to display the version number on Special:Version. Check that page, and if a version no. is being displayed then I have updated the site with this new feature.
Regarding the overall versioning of the software, I have decided to adopt a scheme whereby I don't have to remember to update version numbers every time I update the files (as the update often happens automatically). The revision number is automatically incremented with every change, plus there is a version number that I manually bump whenever there is a schema or stored-date-format change. This will be available in the next version, when it is made live. --HappyDog 12:22, 19 February 2008 (GMT)

Create Forms to fill in Table data[edit]

Moved to WikiDB/Feature requests#Create Forms to fill in Table data.

Hyperlink reference to Table:Name when editing page[edit]

Moved to WikiDB/Feature requests#Hyperlink reference to Table:Name when editing page.

Adding table properties within repeat tag[edit]

Moved to Talk:WikiDB/Repeat tag syntax#Adding table properties within repeat tag.

Some display suggestions[edit]

Moved to WikiDB/Feature requests#Some display suggestions.

Relationships between tables[edit]

Moved to WikiDB/Feature requests#Relationships between tables.

Empty tables[edit]

Moved to WikiDB/Bugs#Empty tables.

Working with WikiDB and SemanticMediaWiki (SMW)[edit]

Hi, I'm using Mediawiki v1.16. I am wondering if there is a way to integrate between those 2 above extensions. I'll explain by simple example: I created a new semantic form called "Form:Books" which contain 2 fields: book number and book name. In addition, I created a related template called "Template:Books" and contain a simple <repeat> tag that based on "Books" table (WikiDB table). Can I pass the form field and use it as a parameter for the repeat tag? In other words, I want to have a form that is based on a simple tables I defined under this WikiDB.

(booknum is the field name on Books table. booknumber is the field name on Books form): <repeat table="Books" criteria="booknum={{{booknumber}}}" /> TNX a lot.

Hi there. This isn't really an issue with SMW as such, but more that WikiDB doesn't currently support <repeat> tags within templates in the way that you want (which affects many use-cases, not just SMW). This is a feature I would like to add to WikiDB, but it is a non-trivial thing to implement due to the way templates work. I am considering ways of approaching this, but I don't expect a proper solution for some time as it is hard! Suggestions, tips or patches welcome... --HappyDog 07:42, 12 July 2013 (UTC)
Note that this should now be possible in WikiDB v4 (r906). --HappyDog 00:52, 3 November 2014 (UTC)

WikiDB & Cite Extensions[edit]

Moved to WikiDB/Bugs#WikiDB & Cite Extensions.

Empty string in criteria[edit]

Hello. How can I test empty strings in criteria of the repeat tag? It looks like simple criteria = "column_name = ''" does not work. Thanks. --Okino 11:34, 14 January 2014 (UTC)

Good spot!
I have updated WikiDB to allow this (v3, r856 downloadCHANGELOG). In this new version you can achieve what you want using criteria = "column_name =", or criteria = "column_name !=" to match non-blank values.
Thanks for bringing this to my attention. --HappyDog 12:29, 15 January 2014 (UTC)

Move page problem[edit]

Moved to WikiDB/Bugs#Move page problem.

Table Definition Oddities and Getting Unique Data Records[edit]

I have two questions I'm hoping you might be able to answer.

One, I'm struggling with Table Definitions.

If I put say:

> Edition:string
> Deck:string

On the Table Definition page, the definitions will apply to the data correctly, but instead of displaying as a nice table of definitions it will display:

> Edition:string > Deck:string

On the page. I'm not sure what I'm doing wrong here. (Or if the person who maintains the wiki installed things wrong.)

Two, is there a way to output only unique entries?

Like if I have:

  • Name: Testing 1
  • Name: Testing 1
  • Name: Testing 2
  • Name: Testing 2

Is there some way I can get an output of:

Testing 1, Testing 2

Instead of

Testing 1, Testing 1, Testing 2, Testing 2

?

74.65.72.174 23:39, 23 May 2021 (BST)

Hi there - thanks for getting in touch.
Re: Your first question - If your table definition is displaying the > characters, then you are not entering into a page within a table namespace. Your wiki should be configured to have at least one table namespace, as per the instructions on this page. Either this has not been set up correctly, or the page you are editing is not within one of the table namespaces you have defined. If you want to experiment with how things should work, then feel free to run some tests on this wiki.
Re: Your second question - There is not currently a way to do this, but it is a good feature suggestion. I have added it to WikiDB/Feature requests.
--HappyDog (talk) 23:29, 22 June 2021 (BST)