links', '/\\(:newforumtopic\\s*(.*?):\\)/i', "sf_NewTopic"); # creates a "Create New Topic" box (adaptation of newpagebox) function NewForumTopic($pagename, $opt) { global $ScriptUrl, $PageUrl; $defaults = array( 'base' => '', 'template' => '', 'label' => FmtPageName(' $[Go] ', $pagename), 'button' => 'right', 'size' => '30', 'value' => FmtPageName(' $[Create New Topic] ', $pagename), 'focus' => 'true', ); $opt = array_merge($defaults, ParseArgs($opt)); $buttonHTML = ""; $onfocusHTML = "onfocus=\"if(this.value=='{$opt['value']}') {this.value=''}\" onblur=\"if(this.value=='') {this.value='{$opt['value']}'}\" "; $out = "\n
" . ($opt['button']=="left" ? $buttonHTML : "") . "" . ($opt['button']=="right" ? $buttonHTML : "") . "
"; return Keep($out); } $HandleActions['newtopic'] = 'HandleNewTopic'; # modified HandleNewPage function from new function HandleNewTopic($pagename) { echo "NEWTOPIC"; #strip any group from name, restricts topic pages to be in the same group $_REQUEST['name'] = preg_replace('/^.*[\\/.]/', '', $_REQUEST['name']); $name = @$_REQUEST['name']; if (!$name) Redirect($pagename); if (@$_REQUEST['focus'] && $name==$_REQUEST['value']) Redirect($pagename); $base = MakePageName($pagename, $_REQUEST['base']); $basegroup = PageVar($base, '$Group'); if (@$_REQUEST['base']=='') $newpage = MakePageName($pagename, $name); else $newpage = MakePageName($base, "$basegroup.$name"); $urlfmt = '$PageUrl?action=browse'; if (@$_REQUEST['template']) $urlfmt .= '&template=' . MakePageName($base, $_REQUEST['template']); Redirect($newpage, $urlfmt); } /* The format of the pagelist displaying the topics on the forum homepage can be defined either by (:pagelist ... fmt=forum :) using the FPLFormatOpt function below, or by using a pagelist format template from a wiki page. For instance by adding the following to Site.PageListTemplate, and using (:pagelist ... fmt=#forum :). Note the # !! Sample format template, which may be easier to modify than the function below: !!!fmt=#forum forum topics in table format [@ [[#forum]] (:if equal {<$Group}:) (:table class=forum width=100% cellpadding=0 cellspacing=0:) (:cell class=messagehead :)'''Topic''' (:cell class=messagehead :)'''Posts''' (:cell class=messagehead :)'''Last Posted''' (:cell class=messagehead :)'''By''' (:if:) (:cellnr class=messageitem :)[[{=$FullName}|+]] (:cell class=messageitem :){=$PostCount} (:cell class=messageitem :){=$LastModified} (:cell class=messageitem :){=$LastModifiedBy} (:if equal {>$Group}:) (:tableend:)(:if:) [[#forumend]] @] */ # adds fmt=forum to pagelist options. # FPLForum provides table listing Page Titles, PostCount, LastModified time # and LastModifiedBy author # usage: (:pagelist group={$Group} list=normal fmt=forum:) $FPLFormatOpt['forum']['fn'] = 'FPLForum'; $FPLFunctions['forum'] = 'FPLForum'; # for pmwiki pre 2.1.beta15 function FPLForum($pagename, &$matches, $opt) { global $FPLForumStartFmt, $FPLForumEndFmt, $FPLForumGFmt, $FPLForumIFmt, $FPLForumOpt; SDV($FPLForumStartFmt,"
"); SDV($FPLForumEndFmt,'
'); SDV($FPLForumGFmt,"\n

Topic Index

\n"); SDV($FPLForumIFmt,"\n"); SDVA($FPLForumOpt, array('readf' => 0, 'order' => '-time')); $matches = MakePageList($pagename, array_merge($FPLForumOpt, $opt)); if (@$opt['count']) array_splice($matches, $opt['count']); $out = array(); foreach($matches as $pc) { $pgroup = FmtPageName($FPLForumGFmt, $pc['pagename']); if ($pgroup != @$lgroup) { $out[] = $pgroup; $lgroup = $pgroup; } $out[] = FmtPageName($FPLForumIFmt, $pc['pagename']); } return FmtPageName($FPLForumStartFmt, $pagename) . implode('', $out) . FmtPageName($FPLForumEndFmt, $pagename); }
topicposts last postedby
\$Titlespaced \$PostCount   \$LastModified \$LastModifiedBy