Not logged in. · Lost password · Register
Forum: General Help and Support Development RSS
How to detect change of pagetitle (first heading)
Avatar
og #1
Member since May 2006 · 436 posts · Location: Bayern
Group memberships: Members
Show profile · Link to this post
Subject: How to detect change of pagetitle (first heading)
My plugin needs to know when the title of a page was changed. Therefore i hook into "IO_WIKIPAGE_WRITE" (AFTER) and compare current title with the previous one. If there is no previous (attic) version, there is no change.

The code i use to utilize the first heading for the current page is:
$curr = p_get_first_heading($ID);

And the one to get the same info from an attic version looks like this:
$last = $INFO['meta']['last_change']['date'];
$txt = rawWiki($ID,$last)
if (preg_match('/^==+(.+?)==+/',$txt,$match))
{
  $title = trim($match[1]);
}

Maybe this is too complicated and there is a way to access the first title from the attic metadata?
Oli...
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-02-17, 08:21:39 (UTC +01:00)