vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Integration with vBulletin - MediaWiki Latest Additions & Changes (https://vborg.vbsupport.ru/showthread.php?t=142520)

majorxp 03-18-2007 10:00 PM

MediaWiki Latest Additions & Changes
 
Last Updated Wiki pages block
Version 1.4

Purpose
This extension will list the last updated or new wiki entries.


It can be included as a vbAdvanced block or included wherever you desire. It was designed to be included in a vbAdvanced block for vBulletin. It also goes nicely with Nuhit's MediaWiki integration tool but is not required.


Requirements
This is only supported on MediaWiki 1.8.2 - 1.10. It might run on a lower version, but it hasn't been tested. It has been reported 1.12 not to function. If you are interested in updating this to support additional versions as they are released let me know and you can be a co-developer on this.

Warning
This is only designed for boards with less than 50 wiki page edits per minute. If you have more, it almost becomes a useless mod (and puts a senseless burden on the server).

No warranty other than this file will take up a few kb on your hard drive.


Instructions
  1. Edit the setting where you want the created file (wikichanges.htm) placed
  2. If you have a table prefix on your WIKI, then edit the sql to reflect your prefix
  3. Place this file in the extensions directory in your wiki
  4. add this line at the bottom of LocalSettings.php (before the "?>")
    PHP Code:

    //  Add last updates
    require_once "$IP/extensions/makevbmodule.php"

  5. Edit a wiki article
  6. Browse to the file in your setting below to see if it worked
  7. Add vbAdvanced block to include the file
  8. Test links inside included page to ensure it works (you may have to edit depending upon your configuration)
Upgrade Instuctions
  1. Backup your old version
  2. Edit the current version's settings locally
  3. Replace the old version with the updated version with your settings
  4. Edit a wiki article (to generate a new wikichanges.htm file)
  5. Confirm new file generation

Demos

Here are some demos of the plugin. If you would like yours to be included, just post your url in the thread.
www.golegend.com
www.euro-chimaera.co.uk
PinataIsland.info


Support
Support is limited to this forum and to those who click install (yes I can see who did). If you have any questions or find a bug, post it here. I spend time with my family on the weekends, so expect long waits then.


Versions
1.4 - Important bug fix. This fixes two issues:
  • Links to namespaces were not being included in links
  • Special or other undesirable pages being listed when updated
This version correctly generates links and will only show updated articles, user pages, images, and categories.

1.3 -Added namespace for User pages (thanks jimmcq)
1.2 - Removed some personal code references
1.1 - Update with table prefix setting (thanks jimmcq)
1.0 - Initial Release

Keywords: MediaWiki, Wiki, vbAdvanced, vbWiki, Nuhit

Jon_Simmonds 03-19-2007 04:54 PM

Thanks, this could prove usefull for me :)

jimmcq 03-19-2007 08:49 PM

Nice work!

It looks like you need a make a couple of small updates though... You didn't add anything to put the prefix in front of the database table name (if there is a prefix), and you appear to the your own filepath (/legend/wiki/) hardcoded into the output.

After I changed those then it seemed to work just fine.

majorxp 03-19-2007 09:57 PM

Thanks Jimmcq!

(don't forget to hit install)

jimmcq 03-19-2007 10:01 PM

I'm new to vbAdvanced... How would I add wikichanges.htm to vbAdvanced?

majorxp 03-19-2007 10:11 PM

Add a new module and choose wikichanges.htm from the drop-down box in "File to Include". Also make sure you choose "Yes" in "Clean File Output". Once you have the module added, simply choose what pages you want it to show up.

If the file doesn't show up under the drop-down, change the directory that the file is created in makevbmodule.php settings.

jimmcq 03-19-2007 10:35 PM

That worked! Thanks! One other small change is that you appear to be missing the namespace in the title. What I mean is that a user page titled "User:majorxp" is just being linked as "majorxp".

Also (and this may not apply to everyone) but you may want to utf8_decode the title names for that special characters like ñ come out correctly.

majorxp 03-19-2007 11:11 PM

added....I guess I have to manually add all the namespaces that would be used....

jimmcq 03-19-2007 11:11 PM

I think you're going to need to do an actual db lookup of the namespaces... There are quite a few others that you haven't included such as Talk, User talk, Help, Image, {SITENAME}, MediaWiki, Template, etc.

I think the ordering could change and custom ones could be added, etc. so that's why they can't really be hardcoded.

majorxp 03-20-2007 07:00 PM

updated instructions............

jimmcq 03-20-2007 09:56 PM

for the namespace stuff, take a look at the 'makeTitle' function in the file includes/Title.php of MediaWiki

Pottsy 03-22-2007 08:18 AM

Hi,

This looks good, but it only seems to pick up some changes (and not others) and I can't see why it's not picking up all.

I tried editing a page, and the change isn't shown. The earliest changes in the list are from a few days ago. I am using mw 1.6.8 - will that make any difference?

hinch 03-22-2007 10:27 AM

installed and working perfectly thanks alot

http://www.euro-chimaera.co.uk/index.php

majorxp 03-22-2007 02:27 PM

Quote:

Originally Posted by Pottsy (Post 1209413)
I tried editing a page, and the change isn't shown. The earliest changes in the list are from a few days ago. I am using mw 1.6.8 - will that make any difference?

You bring up a good point about version compatibility. I haven't tested it on 1.6.8, so I don't know. I'm going to list 1.8.2 as the minimum version since that is the oldest version I have tested with.

Pottsy 03-22-2007 10:07 PM

Quote:

Originally Posted by majorxp (Post 1209585)
You bring up a good point about version compatibility. I haven't tested it on 1.6.8, so I don't know. I'm going to list 1.8.2 as the minimum version since that is the oldest version I have tested with.

Maybe... but your new ver 1.4 works well with 1.6.8. Thank you!

Atakan KOC 03-25-2007 05:49 PM

Thanks....

majorxp 03-25-2007 06:54 PM

Don't forget to click install! :)

jimmcq 04-01-2007 06:55 PM

I'm using it at PinataIsland.info

vprp 04-04-2007 01:26 PM

When you add the following line at LocalSettings.php

// Add last updates
require_once "$IP/extensions/makevbmodule.php";

Do you add it after the <?php or before? Also, should I replace $IP and put the path?

ElfMage 04-05-2007 12:49 PM

vprp, you should add the line

require_once "$IP/extensions/makevbmodule.php";

towards the end of the LocalSettings.php, before the ?>. Example:

PHP Code:

// Add last updates
require_once "$IP/extensions/makevbmodule.php"
?> 

You don't need to replace $IP, since MediaWiki defines it with the correct path to your wiki installation.

klaush 06-26-2007 04:05 PM

Great stuff!

Please give me a hint, when the mediawiki is not located in the forum location and has another domain name...

For example the wiki is located under: www.mywiki.de and the url for the forum is www.myforum.de.

Any idea?

BlackxRam 07-31-2007 05:44 PM

I have the same question. Can this be used to pull info from my Wiki or a Partner Wiki on a different domain? What would be needed to make that work?

Warlord 07-20-2008 08:44 PM

Nice hack. Couple questions though...

If I want to edit the appearance of the file it generates, how do I do that?

I want to make the font smaller, the background a diff color and I want to put a line break in between the article and the username.

Also, when making is a module for vbadvanced, did you just put it in an iframe or something?

rwoscott 07-22-2008 02:13 AM

This is beautiful.
Works FANTASTIC.

I have been contemplating how to do this for a while, but it's always been in the far too hard out of my league.

So thanks again.

majorxp 07-23-2008 05:23 PM

Quote:

Originally Posted by klaush (Post 1277035)
Great stuff!

Please give me a hint, when the mediawiki is not located in the forum location and has another domain name...

For example the wiki is located under: www.mywiki.de and the url for the forum is www.myforum.de.

Any idea?

Just update the vbadvanced to include the file at that location.



Quote:

Originally Posted by Warlord (Post 1580141)
Nice hack. Couple questions though...

If I want to edit the appearance of the file it generates, how do I do that?

I want to make the font smaller, the background a diff color and I want to put a line break in between the article and the username.

Also, when making is a module for vbadvanced, did you just put it in an iframe or something?

You would have to edit the code of the mod to change the appearance.

In vbadvanced, you can include the output file.





Quote:

Originally Posted by rwoscott (Post 1581066)
This is beautiful.
Works FANTASTIC.

I have been contemplating how to do this for a while, but it's always been in the far too hard out of my league.

So thanks again.

My pleasure.

Warlord 07-24-2008 03:59 PM

Quote:

Originally Posted by majorxp (Post 1582421)
You would have to edit the code of the mod to change the appearance.

In vbadvanced, you can include the output file.

Yeah, I tried that, figured it would be no big deal, I just add the html code to make it appear the way I wanted, but kept getting errors no matter what I did. :( Guess I need to brush up on coding, it didn't like a lot of the characters I was using. I'm sure I'll figure it out though given enough time. Thought maybe there might just be an easy fix somewhere. Thanks

jimmcq 08-26-2008 08:56 PM

Has this been updated to work with more recent versions of Mediawiki? Mediawiki 1.12.0 gave an "Internal Error" until I disabled this Add-on.

majorxp 08-26-2008 09:12 PM

No. I'm using this with Nuhit's MediaWiki integration too, and that hasn't been updated so I have to stay for support on 1.8 only. If someone wants to take this on to update it to support 1.12, I would be happy to help, but I cannot take on a new project at this time.

I'll update the project notes to reflect this.

Jrain157 01-14-2009 03:37 PM

Does this work if you're running the NuHIT Wiki 1.3 RC5 and no mediawiki?

majorxp 01-16-2009 06:53 PM

Quote:

Originally Posted by Jrain157 (Post 1712229)
Does this work if you're running the NuHIT Wiki 1.3 RC5 and no mediawiki?

Nope. This uses a mediawiki hook to grab the data.

KrisP 01-22-2009 05:55 AM

Major, I was hoping you could take a look at this error with mediawiki 1.13.3:

Detected bug in an extension! Hook UpdateBlock failed to return a value; should return true to continue hook processing or false to abort.

Backtrace:

#0 /var/www/vhosts/mydomain.com/httpdocs/wiki/includes/Article.php(1564): wfRunHooks('ArticleSaveComp...', Array)
#1 /var/www/vhosts/mydomain.com/httpdocs/wiki/includes/Article.php(1317): Article->doEdit('test5?gr?fe', '', 98)
#2 /var/www/vhosts/mydomain.com/httpdocs/wiki/includes/EditPage.php(997): Article->updateArticle('test5?gr?fe', '', false, false, false, '')
#3 /var/www/vhosts/mydomain.com/httpdocs/wiki/includes/EditPage.php(2274): EditPage->internalAttemptSave(false, false)
#4 /var/www/vhosts/mydomain.com/httpdocs/wiki/includes/EditPage.php(464): EditPage->attemptSave()
#5 /var/www/vhosts/mydomain.com/httpdocs/wiki/includes/EditPage.php(349): EditPage->edit()
#6 /var/www/vhosts/mydomain.com/httpdocs/wiki/includes/Wiki.php(492): EditPage->submit()
#7 /var/www/vhosts/mydomain.com/httpdocs/wiki/includes/Wiki.php(59): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
#8 /var/www/vhosts/mydomain.com/httpdocs/wiki/index.php(93): MediaWiki->initialize(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
#9 {main}

KrisP 01-22-2009 08:20 AM

Isent it possible to make a bug trace on a finer level to see what actually goes wrong inside the Updateblock ?

KrisP 01-22-2009 08:34 AM

The wikichanges.htm actully gets data on the following form:

<tr class="alt2"><td colspan="7"><span class="smallfont"><a href="/wiki/index.php?title=Test5" title="Test5">Test5</a> - by Euroman<BR></span></td></tr>

<tr class="alt1"><td colspan="7"><span class="smallfont"><a href="/wiki/index.php?title=Test3" title="Test3">Test3</a> - by Euroman<BR></span></td></tr>

<tr class="alt2"><td colspan="7"><span class="smallfont"><a href="/wiki/index.php?title=Teset1" title="Teset1">Teset1</a> - by Euroman<BR></span></td></tr><tr class="alt1">

etc.

KrisP 01-22-2009 08:54 AM

Conclusion so far:

Mod is actully working as far as:

1. Output gets produced correctly in: wikichanges.htm
2. Also I can se page actully gets correctly updated with saved change

Only problem:
Error message after saving because updateblock is not "true".

Possible solution: Can we somehow define/set updateblock to "true" so we wont get the error message? It that is possible then mod is working 100 pt.

KrisP 01-22-2009 09:47 AM

Here is the patch to mediawiki 1.13.3:

In makevbmodule.php:

After:
PHP Code:

$wik $wik '</span>';
$fh fopen($myFile'w') or die("Can't open file.");
fwrite($fh$wik);
fclose($fh); 

Add:

PHP Code:

return true


:D

KrisP 01-22-2009 10:35 AM

Could anybody help me rewrite links to piniata style: http://pinataisland.info/index.php?t...451&oldid=prev ?
PHP Code:

http://pinataisland.info/index.php?title=Swanana&diff=24451&oldid=prev 

I believe the diff parameter can be fetched from recent changes as o.rc_this_oldid and refered to as $row['rc_this_oldid'] in url. Should be pretty easy, but I cant seem to get syntax right and I am not sure I understand conventions for use of ' vs. " ...

majorxp 01-23-2009 02:12 AM

KrisP -

Looks like you found your answer!

I'm not really sure what exactly you are asking in post 36 though.

KrisP 01-23-2009 07:55 PM

Well, if you look at the demo website http://pinataisland.info/central.php their recent wiki links are different. They point to a page where you can see the change of the article on the top of the page and the article itself on the bottom. I would like that too on my site.

majorxp 01-25-2009 03:50 AM

most interesting idea........

I like that.

You can edit that by the code you found above...

KrisP 01-25-2009 04:13 PM

Here is the code:

$query = "SELECT o.rc_this_oldid, ...

$wik = $wik . '<a href="/wiki/index.php?title=' . $row['rc_title'] . '&diff=' . $row['rc_this_oldid'] . '&oldid=prev' . '">' . $row['rc_title']. '</a>' . $new . ' - by ' . $row['rc_user_text'] . '<BR>';


All times are GMT. The time now is 02:08 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02150 seconds
  • Memory Usage 1,837KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete