Revision history for IncludePageAction


Revision [19174]

Last edited on 2008-01-28 00:14:29 by JavaWoman [Modified links pointing to docs server]

No Differences

Revision [16930]

Edited on 2007-05-31 23:27:22 by JavaWoman [Reverted]
Additions:
if (!in_array($page, $this->config["includes"]) && $page != $this->tag) {
if ($this->HasAccess("read", $page)) {

$this->config["includes"][] = $page;
$page = $this->LoadPage($page);

if (!$numlines) {
print $this->Format($page["body"]);
else {
$newtext = $this->Format($page["body"]);
$newtext = explode ("\n", $newtext);
$i = 0;
while ($i <= $numlines-1) {
print ($i+1).") ".$newtext[$i]."\n";
$i++;
}
} else print "<span class='error'>Circular reference detected</span>";
There are little quirks that I'd like help fixing. Such as that styles get messed up if you have indentations on your to do list items. Also things obviously get a little wierd if one of your To Do list items it a subproject page with an include call to to do list items it contains. I'd like it to be able to handle this though. I think this is one thing that could make Wikka pretty capable of being a hipster GTD solution. ;)
CategoryDevelopmentActions
Deletions:
if (!in_array($page, $this->config["includes"])


Revision [16729]

Edited on 2007-05-31 10:42:22 by UmpRl1 [Reverted]
Additions:
if (!in_array($page, $this->config["includes"])
Deletions:
if (!in_array($page, $this->config["includes"]) && $page != $this->tag) {
if ($this->HasAccess("read", $page)) {

$this->config["includes"][] = $page;
$page = $this->LoadPage($page);

if (!$numlines) {
print $this->Format($page["body"]);
else {
$newtext = $this->Format($page["body"]);
$newtext = explode ("\n", $newtext);
$i = 0;
while ($i <= $numlines-1) {
print ($i+1).") ".$newtext[$i]."\n";
$i++;
}
} else print "<span class='error'>Circular reference detected</span>";
There are little quirks that I'd like help fixing. Such as that styles get messed up if you have indentations on your to do list items. Also things obviously get a little wierd if one of your To Do list items it a subproject page with an include call to to do list items it contains. I'd like it to be able to handle this though. I think this is one thing that could make Wikka pretty capable of being a hipster GTD solution. ;)
CategoryDevelopmentActions


Revision [8588]

Edited on 2005-05-28 12:04:59 by JavaWoman [move to subcategory]
Additions:
CategoryDevelopmentActions
Deletions:
CategoryDevelopment


Revision [6900]

Edited on 2005-03-25 17:28:53 by SeanOmlor [move to subcategory]
Additions:
I wasn't sure where to put this question, forgive me if I am breaking Wiki-netiquette. I thought perhaps instead of deleting this page, someone could help me with a small upgrade to the IncludeAction. See, I am attempting to use WikkaWiki as a PIM and have been playing with some of the contributions on the GmBowenWikkaAsPIM page. One thing I want to do however is to have a page that lists my current projects which themselves are each Wiki Pages. Each of these Wiki Pages start out with a To Do list at the top. What I want is for the Project list page to have "includes" that pull "x" number of ////lines//// from the specified Wiki Page instead of the whole thing as the include Action currently does.
I'm pretty brain dead in this explanation so here is a screenshot that should explain what I mean better. Notice the automatic line numbering.
Here's my include.php hack at this point. (Be gentle. I'm not a programmer, nor familiar with PHP). It takes "page", as before, and now also "numlines" which is pretty self explanatory.
Deletions:
I wasn't sure where to put this question, forgive me if I am breaking Wiki-netiquette. I thought perhaps instead of deleting this page, someone could help me with a small upgrade to the IncludeAction. See, I am attempting to use WikkaWiki as a PIM and have been playing with some of the contributions on the GmBowenWikkaAsPIM page. One thing I want to do however is to have a page that lists my current projects which are all Wiki Pages. Each of these Wiki Pages start out with a To Do list at the top. What I want is for the Project list page to have includes to the respective Project Pages underneath each listing that pulls "x" number of ////lines//// from the specified Wiki Page instead of the whole thing. as is a list of Wiki Name projects with include calls underneath each of them that pulls "x" number of lines from the respective Wiki page. Here is it's crude implementation so far. Notice the automatic line numbering.
Here's my include.php hack at this point. (Be gentle. I'm not a programmer, nor familiar with PHP).


Revision [6899]

Edited on 2005-03-25 17:25:34 by SeanOmlor [move to subcategory]
Additions:
{{image class="center" alt="PimInclude Example" title="PimInclude Screenshot" url="http://www.seanomlor.com/pim/images/PimInclude.jpg"}}
Deletions:
{{image class="center" alt="PimInclude Example" title="PimInclude Screenshot" url="http://www.seanomlor.com/wikka/images/PimInclude.jpg"}}


Revision [6898]

Edited on 2005-03-25 17:24:55 by SeanOmlor [move to subcategory]
Additions:
=====""IncludePageAction""=====

This is a little action I made for including a page in another page, for example, a navigation bar. This is very useful if you want the same thing to appear on many different pages, but you don't want to have to edit each page every time you want to change something.

**Syntax:**

**""{{incpage page="PageName"}}""**


Save the following script as actions/incpage.php

-- Jamie

''Hi Jamie. Thank you for the contribution, however it appears that your action duplicates an action that is already in Wikka version 1.1.4.0 and above. You can see the code for the standard Wikka 'include' action on the IncludeAction page. To avoid confusion, my preference is to remove this page.'' -- JsnX

----

%%(php)
<?php
if (!isset($vars['page'])) {
echo "No page specified.<br><br><strong>Syntax: {{incpage page=\"wikiname\"}}</strong> (Case insensitive)";
}
else {
$url = $vars['page'];
$host = $this->config['mysql_host'];
$db = $this->config['mysql_database'];
$user = $this->config['mysql_user'];
$passwd = $this->config['mysql_password'];
$connection = @mysql_connect($host, $user, $passwd);
@mysql_select_db($db, $connection);
$sql = "select body from" . $this->config['table_prefix'] . " pages where tag=\"$url\" and latest=\"Y\"";
$query = mysql_query($sql, $connection);
while ($nav = mysql_fetch_array($query)) {
$body = $nav['body'];
break;
}
$body = $this->Format($body, "wakka");
echo $body;
}
?>
%%

----
I wasn't sure where to put this question, forgive me if I am breaking Wiki-netiquette. I thought perhaps instead of deleting this page, someone could help me with a small upgrade to the IncludeAction. See, I am attempting to use WikkaWiki as a PIM and have been playing with some of the contributions on the GmBowenWikkaAsPIM page. One thing I want to do however is to have a page that lists my current projects which are all Wiki Pages. Each of these Wiki Pages start out with a To Do list at the top. What I want is for the Project list page to have includes to the respective Project Pages underneath each listing that pulls "x" number of ////lines//// from the specified Wiki Page instead of the whole thing. as is a list of Wiki Name projects with include calls underneath each of them that pulls "x" number of lines from the respective Wiki page. Here is it's crude implementation so far. Notice the automatic line numbering.
{{image class="center" alt="PimInclude Example" title="PimInclude Screenshot" url="http://www.seanomlor.com/wikka/images/PimInclude.jpg"}}

Here's my include.php hack at this point. (Be gentle. I'm not a programmer, nor familiar with PHP).

%%(php)
<?php

if (is_array($vars))
{
foreach ($vars as $param => $value)
{
if ($param == 'page') {
$page=$this->htmlspecialchars_ent($vars['page']);
$page = strtolower($page);
}
if ($param == 'numlines') {
$numlines=$this->htmlspecialchars_ent($vars['numlines']);
}
}
}

if (!$this->config["includes"]) $this->config["includes"][] = strtolower($this->tag);

if (!in_array($page, $this->config["includes"]) && $page != $this->tag) {
if ($this->HasAccess("read", $page)) {

$this->config["includes"][] = $page;
$page = $this->LoadPage($page);

if (!$numlines) {
print $this->Format($page["body"]);
}
else {
$newtext = $this->Format($page["body"]);
$newtext = explode ("\n", $newtext);
$i = 0;
while ($i <= $numlines-1) {
print ($i+1).") ".$newtext[$i]."\n";
$i++;
}
}
}
} else print "<span class='error'>Circular reference detected</span>";

?>
%%

There are little quirks that I'd like help fixing. Such as that styles get messed up if you have indentations on your to do list items. Also things obviously get a little wierd if one of your To Do list items it a subproject page with an include call to to do list items it contains. I'd like it to be able to handle this though. I think this is one thing that could make Wikka pretty capable of being a hipster GTD solution. ;)

----
Deletions:
=====""IncludePageAction""=====

This is a little action I made for including a page in another page, for example, a navigation bar. This is very useful if you want the same thing to appear on many different pages, but you don't want to have to edit each page every time you want to change something.

**Syntax:**

**""{{incpage page="PageName"}}""**


Save the following script as actions/incpage.php

-- Jamie

''Hi Jamie. Thank you for the contribution, however it appears that your action duplicates an action that is already in Wikka version 1.1.4.0 and above. You can see the code for the standard Wikka 'include' action on the IncludeAction page. To avoid confusion, my preference is to remove this page.'' -- JsnX

----

%%(php)
<?php
if (!isset($vars['page'])) {
echo "No page specified.<br><br><strong>Syntax: {{incpage page=\"wikiname\"}}</strong> (Case insensitive)";
}
else {
$url = $vars['page'];
$host = $this->config['mysql_host'];
$db = $this->config['mysql_database'];
$user = $this->config['mysql_user'];
$passwd = $this->config['mysql_password'];
$connection = @mysql_connect($host, $user, $passwd);
@mysql_select_db($db, $connection);
$sql = "select body from" . $this->config['table_prefix'] . " pages where tag=\"$url\" and latest=\"Y\"";
$query = mysql_query($sql, $connection);
while ($nav = mysql_fetch_array($query)) {
$body = $nav['body'];
break;
}
$body = $this->Format($body, "wakka");
echo $body;
}
?>
%%

----


Revision [3260]

Edited on 2004-12-15 20:22:01 by JavaWoman [removed underline on heading]
Additions:
=====""IncludePageAction""=====
Deletions:
=====__""IncludePageAction""__=====


Revision [2440]

Edited on 2004-11-25 04:06:05 by JsnX [duplicate action?]
Additions:
''Hi Jamie. Thank you for the contribution, however it appears that your action duplicates an action that is already in Wikka version 1.1.4.0 and above. You can see the code for the standard Wikka 'include' action on the IncludeAction page. To avoid confusion, my preference is to remove this page.'' -- JsnX


Revision [2430]

Edited on 2004-11-24 18:54:50 by JamieScuffell [duplicate action?]
Additions:
%%(php)
Deletions:
%%php


Revision [2429]

Edited on 2004-11-24 18:53:41 by JamieScuffell [duplicate action?]
Additions:
=====__""IncludePageAction""__=====
Deletions:
=====IncludePageAction=====


Revision [2428]

Edited on 2004-11-24 18:52:55 by JamieScuffell [duplicate action?]
Additions:
=====IncludePageAction=====


Revision [2427]

Edited on 2004-11-24 18:52:17 by JamieScuffell [duplicate action?]
Additions:
**Syntax:**
**""{{incpage page="PageName"}}""**
-- Jamie
Deletions:
<<**Syntax:**
""{{incpage page="PageName"}}""
<<
-- Jamie


Revision [2426]

The oldest known version of this page was created on 2004-11-24 18:51:28 by JamieScuffell [duplicate action?]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki