Revision history for MovePages


Revision [22986]

Last edited on 2016-05-20 07:38:44 by JavaWoman [Replaces old-style internal links with new pipe-split links.]
Additions:
The [[Docs:HandlerInfo | handler]] **move.php** assumes that wikka is able to deal with [[RedirectingPages]], and doesn't adjust links pointing to the old page. It can be considered a rename handler.
The above code didn't work for me as it uses ##comment_on## (not sure where that comes from...). The following code works in v1.1.5.3. I now have this integrated this with [[PageAdminAction | PageAdmin]].
Deletions:
The [[Docs:HandlerInfo handler]] **move.php** assumes that wikka is able to deal with [[RedirectingPages]], and doesn't adjust links pointing to the old page. It can be considered a rename handler.
The above code didn't work for me as it uses ##comment_on## (not sure where that comes from...). The following code works in v1.1.5.3. I now have this integrated this with [[PageAdminAction PageAdmin]].


Revision [18432]

Edited on 2008-01-28 00:11:28 by JavaWoman [Modified links pointing to docs server]
Additions:
The [[Docs:HandlerInfo handler]] **move.php** assumes that wikka is able to deal with [[RedirectingPages]], and doesn't adjust links pointing to the old page. It can be considered a rename handler.
Deletions:
The [[HandlerInfo handler]] **move.php** assumes that wikka is able to deal with [[RedirectingPages]], and doesn't adjust links pointing to the old page. It can be considered a rename handler.


Revision [8610]

Edited on 2005-05-28 17:30:18 by JavaWoman [move to subcategory]
Additions:
CategoryDevelopmentHandlers
Deletions:
CategoryDevelopment


Revision [6145]

Edited on 2005-02-18 15:56:43 by DarTar [Adding header, SeeAlso and Category link]
Additions:
==== Move Handler====
>>See also:
~-RefactorWiki
~-PageAdminAction
>>
CategoryDevelopment


Revision [5970]

Edited on 2005-02-14 16:32:07 by PolVazo [Adding header, SeeAlso and Category link]
Additions:
The above code didn't work for me as it uses ##comment_on## (not sure where that comes from...). The following code works in v1.1.5.3. I now have this integrated this with [[PageAdminAction PageAdmin]].
Deletions:
The above code didn't work for me as it uses ##comment_on## (not sure where that comes from...). The following code works in v1.1.5.3. I now have this integrated this with PageAdmin.


Revision [5969]

Edited on 2005-02-14 16:31:13 by PolVazo [Mention PageAdmin]
Additions:
The above code didn't work for me as it uses ##comment_on## (not sure where that comes from...). The following code works in v1.1.5.3. I now have this integrated this with PageAdmin.
Deletions:
The above code didn't work for me as it uses ##comment_on## (not sure where that comes from...). The following code works in v1.1.5.3.


Revision [5968]

Edited on 2005-02-14 16:29:39 by PolVazo [Fixed code]
Additions:
----
The above code didn't work for me as it uses ##comment_on## (not sure where that comes from...). The following code works in v1.1.5.3.
%%(php)
<div class="page">
if ($newtag = $_POST["newtag"]) {
if ($this->LoadPage($newtag)) $error = "Tag <b>".$newtag."</b> already exists";
if (!$error) {
$this->Query("update ".$this->config["table_prefix"]."links set from_tag = '".$newtag."' where from_tag = '".$this->tag."'");
//$this->Query("update ".$this->config["table_prefix"]."pages set comment_on = '".$newtag."' where comment_on = '".$this->tag."'");
$this->Query("update ".$this->config["table_prefix"]."comments set page_tag = '".$newtag."' where page_tag = '".$this->tag."'");
$this->Query("update ".$this->config["table_prefix"]."pages set tag = '".$newtag."' where tag = '".$this->tag."'");
if ($_POST["forwarder"]) $this->SavePage($this->tag, "=>[[".$newtag."]]", $this->page["comment_on"], "moved to ".$newtag, $this->page["private"]);
$this->SetMessage("Page has been moved!");
if ($_POST["forwarder"]) $this->Redirect($this->href());
else $this->Redirect($this->href("", $newtag));
}
}
if ($error) print "<div class='error'>".$error."</div>";
print $this->FormOpen("move");
print "Move page to <input name='newtag' value='".$newtag."' size='40' maxlength='50'> - Keep old page as forwarder <input type='checkbox' name='forwarder' value='1' checked><input type='submit' value='move'>";
print $this->FormClose();
</div>
%%


Revision [5966]

Edited on 2005-02-14 14:57:09 by PolVazo [Fixed code]
Additions:
The [[HandlerInfo handler]] **move.php** assumes that wikka is able to deal with [[RedirectingPages]], and doesn't adjust links pointing to the old page. It can be considered a rename handler.
Deletions:
The [[WikiHandler handler]] **move.php** assumes that wikka is able to deal with [[RedirectingPages]], and doesn't adjust links pointing to the old page. It can be considered a rename handler.


Revision [5965]

Edited on 2005-02-14 14:56:06 by PolVazo [Added the word rename to help people looking for a rename handler]
Additions:
The [[WikiHandler handler]] **move.php** assumes that wikka is able to deal with [[RedirectingPages]], and doesn't adjust links pointing to the old page. It can be considered a rename handler.

%%(php)<div class="page">
<?php
if ($this->page) {
if ($this->UserIsOwner() || $this->IsAdmin()) {
if ($newtag = $_POST["newtag"]) {
if ($this->LoadPage($newtag)) $error = "Tag <b>".$newtag."</b> already exists";

if (!$error) {
$this->Query("update ".$this->config["table_prefix"]."links set from_tag = '".$newtag."' where from_tag = '".$this->tag."'");
$this->Query("update ".$this->config["table_prefix"]."pages set comment_on = '".$newtag."' where comment_on = '".$this->tag."'");
$this->Query("update ".$this->config["table_prefix"]."pages set tag = '".$newtag."' where tag = '".$this->tag."'");

if ($_POST["forwarder"]) $this->SavePage($this->tag, "=>[[".$newtag."]]", $this->page["comment_on"], "moved to ".$newtag, $this->page["private"]);

$this->SetMessage("Page has been moved!");
if ($_POST["forwarder"]) $this->Redirect($this->href());
else $this->Redirect($this->href("", $newtag));
}
}

if ($error) print "<div class='error'>".$error."</div>";
print $this->FormOpen("move");
print "Move page to <input name='newtag' value='".$newtag."' size='40' maxlength='50'> - Keep old page as forwarder <input type='checkbox' name='forwarder' value='1' checked><input type='submit' value='move'>";
print $this->FormClose();
} else print "<em>You're not the owner of this page.</em>";
} else print "Page ".$this->tag." doesn't exist.";

?>
Deletions:
the handler **move.php** assumes that wikka is able to deal with [[RedirectingPages]], and doesn't adjust links pointing to the old page.

%%(php)<div class="page">
<?php
if ($this->page) {
if ($this->UserIsOwner() || $this->IsAdmin()) {
if ($newtag = $_POST["newtag"]) {
if ($this->LoadPage($newtag)) $error = "Tag <b>".$newtag."</b> already exists";

if (!$error) {
$this->Query("update ".$this->config["table_prefix"]."links set from_tag = '".$newtag."' where from_tag = '".$this->tag."'");
$this->Query("update ".$this->config["table_prefix"]."pages set comment_on = '".$newtag."' where comment_on = '".$this->tag."'");
$this->Query("update ".$this->config["table_prefix"]."pages set tag = '".$newtag."' where tag = '".$this->tag."'");

if ($_POST["forwarder"]) $this->SavePage($this->tag, "=>[[".$newtag."]]", $this->page["comment_on"], "moved to ".$newtag, $this->page["private"]);

$this->SetMessage("Page has been moved!");
if ($_POST["forwarder"]) $this->Redirect($this->href());
else $this->Redirect($this->href("", $newtag));
}
}

if ($error) print "<div class='error'>".$error."</div>";
print $this->FormOpen("move");
print "Move page to <input name='newtag' value='".$newtag."' size='40' maxlength='50'> - Keep old page as forwarder <input type='checkbox' name='forwarder' value='1' checked><input type='submit' value='move'>";
print $this->FormClose();
} else print "<em>You're not the owner of this page.</em>";
} else print "Page ".$this->tag." doesn't exist.";

?>


Revision [1029]

The oldest known version of this page was created on 2004-08-19 00:09:27 by DreckFehler [Added the word rename to help people looking for a rename handler]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki