=====David Fullard===== ====WikkaForum Modifications==== See the WikkaForum page for details on how to set-up the forum. **wikkaforum.php** Place this file in the actions directory %%(php) config["base_url"].$this->MiniHref($method, $tag); $username=$this->GetUserName(); $prefix=$this->config["table_prefix"]; if (empty($page)) { $tag=$this->getPageTag(); $pageX=$tag; } else { $tag=$page; } // code to determine who can contribute to the threads if(empty($share)){$share = 'ALL';} $tok = strtok($share, " \n\t"); while ($tok) { if($tok == $this->GetUserName() || $tok == "ALL") { $use = 'true';} $tok = strtok(" \n\t"); } if (strtoupper($this->GetUserName())==strtoupper($this->GetPageOwner())){$use = 'true';} // check so that when there are multiple instances of the action one cannot "add" to the database // in response to having a thread from another page open (trust me, this code is necessary) $tablepgname = $this->LoadSingle("SELECT tag FROM ".$this->config['table_prefix']."wikkaforum WHERE wid='".$_GET['wid']."' LIMIT 0,1"); $shouldwrite = $tablepgname[tag]; if (($shouldwrite==$this->getPageTag()) || (empty($shouldwrite))) {$use2 = 'true';} // CLASS STATEMENT STARTS HERE. Using include_once prevents function conflicts & allows multiple instances on the same page include_once("./scripts/wikkaforumfunctions.php"); // CLASS STATEMENT ENDS HERE. if ($this->IsAdmin($this->GetUser())) { $isadmin=true; } if (!isset($forum)) { $forum = new SForum; } ?>
Show_SFname($topic);
if ($main==""){
if (!empty($_GET['wid'])) {
echo " Return to Thread List\n";
print(" \n"); } else { echo " \n"; print(" \n"); } } else { if ($this->IsWikiName($main)) {$link2 = "config["base_url"].$main."\">".$main."";} else { echo $main; } if (!empty($_GET['wid'])) {$joiner=">>";} if (empty($topic) && ($page!=$this->getPageTag())) {$topic=$tag;} else{ $topic=$this->MiniHref($method, $tag); } echo $link2.">>".$topic." $adminfunc".$joiner; $forum->Show_SForum_Thread_Name($_GET['wid'], $tag, $prefix); } if (isset($_POST['submit'])) { if (!empty($_POST['frm_ptitle'])) { if(empty($page)) { $forum->Add_new_post($_POST['frm_ptitle'],$_POST['frm_text'],$tag,$_POST['frm_ip'],$username,$_POST['frm_wid'],$link,$prefix); } } } if (isset($_GET['wid'])) { #phpinfo(); $forum->Show_SForum_Threads($_GET['wid'], $tag, $prefix, $link, $isadmin); $forum->pansw = $_GET['wid']; } else { $forum->Show_SForum($link, $tag, $prefix, $isadmin); $forum->pansw = 0; } if (isset($_GET['deletethread'])) { $forum->delete_thread($_GET['deletethread'], $prefix, $link, $isadmin); } if (isset($_GET['deletepost'])) { $forum->delete_post($_GET['deletepost'], $prefix, $link, $_GET['wid'], $isadmin); } print("\n"); if ($main==""){ if (!empty($_GET['wid'])) { echo " Return to Thread List\n"; print(" \n"); } else { echo " \n"; print(" \n"); } } else { if ($this->IsWikiName($main)) {$link2 = "config["base_url"].$main."\">".$main."";} else { echo $main; } if (!empty($_GET['wid'])) {$joiner=">>";} if (empty($topic) && ($page!=$this->getPageTag())) {$topic=$tag;} else{ $topic=$this->MiniHref($method, $tag); } echo $link2.">>".$topic."".$joiner; $forum->Show_SForum_Thread_Name($_GET['wid'], $tag, $prefix); } if ($user = $this->GetUser()) { if ($pageX==$this->getPageTag()) { if ($use == 'true') { if(empty($page)) { if ($use2 == 'true') { $forum->Show_frm($forum->ptitle, $link, $_GET['wid']); } } } } else { echo " This forum originates from ".$page.". "; } } else { print("Sorry, you need to be a registered & logged-in user to contribute to the forums."); if ($pageX!=$this->getPageTag()){print(" This forum originates from ".$pageX.". ");} } ?> |
Topic | Replies | Posted by | Timestamp | "); while ($row = mysql_fetch_array($sql)) { $sql1 = "SELECT COUNT(wid)-1 AS num FROM ".$prefix."wikkaforum WHERE wid=".$row['id']." AND tag='$tag' GROUP BY wid"; #print $sql1."delete | "; } print("
$link2".$this->ptitle." | ".$this->react." | ".$row['for_name']." | ".$row['for_dataw']." | ".$adminfunc."
".$this->ptitle." $pmail".$row['for_name']."$kmail ".$row['for_data']."".$adminfunc." \n\n");
print("".$printtext." |