WikkaBlog

Last edited by JavaWoman:
Modified links pointing to docs server
Mon, 28 Jan 2008 00:15 UTC [diff]

Blogs (or web-logs) are currently immensely popular and there are countless web programs to run both individual and collections of blogs. This action is designed to provide blog-functionality (pagination and commenting) to wikka users...essentially allowing wikka to be used as a blog farm if so desired. Use requires two mysql tables, an action script, and an included class (to drive the pagination). Blog submissions have limited wikka formatting (listed under the submit window). This action complements the free-form editing in wikka and the structured thread discussions in WikkaForum.

The two mysql tables are structured as follows.....(replace "wakka_" with whatever your database prefix is)
CREATE TABLE `wakka_blogcomments` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `blogid` tinyint(4) NOT NULL DEFAULT '0',
  `time` datetime DEFAULT NULL,
  `commentowner` text NOT NULL,
  `comment` text NOT NULL,
  UNIQUE KEY `id` (`id`)
) TYPE=MyISAM;

CREATE TABLE `wakka_blogs` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `pagename` text NOT NULL,
  `time` datetime DEFAULT NULL,
  `name` text NOT NULL,
  `blogname` text,
  `ownername` text,
  `topic` text NOT NULL,
  `message` text NOT NULL,
  UNIQUE KEY `id` (`id`)
) TYPE=MyISAM;


The following file should be saved in the actions directory as blog.php....
<?php
    /*  VERSION 1.0e (adding permissions feature to comments)
        @filename:      blog.php
        @author:        GMBowen (with contributions by Mark Kasper & Joel Goguen) for a SSHRC research project
        @email:         gmbowen@yahoo.com
        @date:          12 May 2005
        @license:       GPL

            @description:   this file requires you are running wikka wiki
                        and that you've inserted 2 tables into the wikka MYSQL database.
                        AND **REQUIRES** a pagination class file (page.inc.php) in the wikka root directory "scripts"
                            // config vars //
                            numrec= : how many pages are going to be displayed in the list. (optional, default=5)
                            share= : list of users who can contribute to blog (optional, default = owner)
                            caption= : Header text for blog (optional, default is null)
                        NOTE: Comments feature use ACLS permissions to determine who can contribute
        @usage:         insert {{blog}} anywhere in a wikka wiki page.
    */

//Set BadWordFilter="true" if you want cuss words filtered out (requires edit of wakka.php to add BadWord function), else set "false"
$badwordfilter="true"; // code below compensates if set at true & function doesn't exist, so default is "true"

// establishing number of records to show at once
if (empty($numrec)) {$record_per_page=5;} else {$record_per_page=$numrec;}

// includes functions for doing pagination
include_once("scripts/page.inc.php");

// determining variable values
$link = $this->config["base_url"].$this->MiniHref($method, $tag);
$username = $this->GetUserName();
$blogowner = $this->GetPageOwner();
$pagename = $this->MiniHref($method, $tag);
if($blogname == ''){ $blogname = $pagename; }// if no blog name specified, sets to pagename (but made to lower case)
$username = $this->GetUserName();
$action = $_POST['action'];
$whichblog = $_POST[whichblog];
$blogcmnt = $_GET[blogcmnt];
$blogpage= $_GET[page];

// breaks apart the share string for each userto determine a restricted list of users to add to the blog
$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';}

?>
<script>
       <!--
function clearTextbox(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = "";
}
//-->
</script>

<?php
// to do commenting on a blog entry
if (!empty($blogcmnt)){
    if ($action == "sendcmnt") {
            if (!($_POST['comment'] == "enter comment here")) {
          $comment_timestamp = date("Y-m-d H:i:s",mktime());

        // Bad Word Filter For Comments - parameter set at top....
   if ($badwordfilter=="true") {
    if (function_exists(BadWordFunc)) {$_POST[comment] = BadWordFunc($_POST[comment]);}
   }           
        $comment = ($_POST[comment]);
        $comment = addslashes($comment);
        $query = "INSERT INTO ".$this->config['table_prefix']."blogcomments (`id`,`blogid`,`time`,`commentowner`,`comment`) VALUES ('', '$blogcmnt', '$comment_timestamp', '$username', '$comment');";
           mysql_query($query);
         }
      }

$blogpage = $_GET[pg];

$query = "SELECT name,message,topic,time,id FROM ".$this->config['table_prefix']."blogs WHERE id = '$blogcmnt'";
$result = mysql_query($query);
$blogrow = mysql_fetch_array($result,MYSQL_ASSOC);
echo "<div align='center'>";
              $blogrow['topic'] = stripslashes($blogrow['topic']);
              $printtext = (stripslashes($blogrow['message']));
        //to remove formatting not desired in blog submissions
        $brackets = Array ('/{{/i', '/}}/i');
        $changeto = '|.|';
        $printtext = preg_replace($brackets, $changeto, $printtext);
        $remove = array('#%', '======', '=====', '====', '===', '==', '[[', ']]', '||', '%| %', '&lt;&lt;', '&gt;&gt;', '::c::', '&quot;&quot;');
        $printtext = str_replace($remove, '', $printtext);
        $printtext = $this->format($printtext);

            echo "<br /><TABLE class='box' width='500' border='1' CELLSPACING='0' BGCOLOR='#DDccbb' CELLPADDING='0'>";
        echo "<TR BGCOLOR='#DDDDDD'><TD valign='top' ALIGN='left'><em><strong><font size='-1'>&nbsp;".$blogrow['topic']."&nbsp;</font></strong></em></TD></TR>";
        echo "<TR BGCOLOR='#FFFFFF'><TD valign='top' ALIGN='left'>&nbsp;".$printtext."&nbsp;</TD></TR>";
        echo "<TR BGCOLOR='#DDDDDD'><td valign='top' align='left'><TABLE width='100%' border='0'><TR><TD ALIGN='left'><small><strong>&nbsp;&nbsp;&nbsp;".$blogrow['time']."&nbsp;by&nbsp;".$blogrow['name']."</strong></small></TD><TD><small><a href=".$link."&page=".$blogpage.">Return</a></small></TD></TR></TABLE></TD></TR>";
        echo "</table>";
echo "<center><B>Comments by readers...</B></center>";
// output of comments
$query = "SELECT * FROM ".$this->config['table_prefix']."blogcomments WHERE blogid = ".$blogcmnt;
$result = mysql_query($query);
if (mysql_num_rows($result)==0) {echo "<em>There are no comments on this blog entry yet.</em>";}
while($row=mysql_fetch_array($result)) {
              $row['comment'] = stripslashes($row['comment']);
            echo "<TABLE class='box' width='495' border='0' CELLSPACING='0' BGCOLOR='#DDccbb' CELLPADDING='0'>";
        echo "<TR BGCOLOR='#FFFFFF'><TD valign='top' ALIGN='left'>&nbsp;".$row['comment']."&nbsp;</TD></TR>";
        echo "<TR BGCOLOR='#DDDDDD'><td valign='top' align='left'><small><strong>&nbsp;&nbsp;&nbsp;".$row['time']."&nbsp;by&nbsp;".$row['commentowner']."</strong></small></TD></TR>";
        echo "</table>";
    }
// Comment entry form, for registered & logged-in users & those designated in the Comment ACLS list as being able to leave comments
if ($user = $this->GetUser() && $this->HasAccess('comment'))
    {
echo "<TABLE BORDER='0' CELLSPACING='2'>";
echo "   <TR>";
echo "      <TD><FORM ACTION=\"\" METHOD=POST name=\"\">";
echo "      <INPUT TYPE=hidden NAME=action VALUE=sendcmnt>";
echo "      <INPUT TYPE=hidden NAME=blogid VALUE=$id>";
echo "   <P><TEXTAREA NAME=comment ROWS=5 COLS=67 WRAP=virtual onfocus=\"clearTextbox(this)\" class=box>enter comment here</TEXTAREA><br />";
echo "  <INPUT TYPE=submit NAME=Submit VALUE='Submit Comment' class=box>";
echo "</form>";
echo "      </TD>";
echo "   </TR><TR><TD><small>There is <strong>no</strong> formatting for the comments.</small></TD></TR>";
echo "</TABLE>";
    }
    else
    {
        if ($this->HasAccess('comment')){
        print("<br /><em>You need to be registered and logged-in to submit a comment to a blog.</em></p>");
        } else {
        print("<br /><em>The blog owner has not given you permission to leave comments.</em></p>");
        }
    }

        echo "</div>";
    }
    else
    {
      if ($action == "send" && $whichblog == $blogname) {
       if (!($_POST['topic'] == "topic")) {
          if (!($_POST['message'] == "blog entry")) {
        $blog_timestamp = date("Y-m-d H:i:s",mktime());          

       // Bad Word Filter For Messages & Topics - parameter set at top....
    if ($badwordfilter=="true") {
        if (function_exists(BadWordFunc)) {$_POST[message] = BadWordFunc($_POST[message]);}
        }          
        $_POST[message] = addslashes($_POST[message]);
    if ($badwordfilter=="true") {
        if (function_exists(BadWordFunc)) {$_POST[topic] = BadWordFunc($_POST[topic]);}
        }
        $_POST[topic] = addslashes($_POST[topic]);
    if ($_POST[topic]  != '')
        {      
        $query = "INSERT INTO ".$this->config['table_prefix']."blogs (`id`,`pagename`,`time`,`name`,`blogname`,`ownername`,`topic`,`message`) VALUES ('', '$pagename', '$blog_timestamp', '$username', '$blogname', '$blogowner', '$_POST[topic]', '$_POST[message]');";
           mysql_query($query);
        }
         }
      }
  }
$query = "SELECT name,message,topic,time,id FROM ".$this->config['table_prefix']."blogs WHERE pagename = '$pagename' AND blogname='$blogname' ORDER BY id DESC";
$result = mysql_query($query);
    $total_records=@mysql_num_rows($result);
if ($numrec<=3) {$scroll=3;} else {$scroll=$numrec;}
    $page=new Page(); ///creating new instance of Class Page
    $page->set_page_data($link,$total_records,$record_per_page,$scroll,true,true,true);
    $result=@mysql_query($page->get_limit_query($query));

echo "<div align='center'>";
// show the caption
echo "<Font size='+1'><center><strong>".$caption."</strong></center></font>";
// to paginate the blog entries
echo $page->get_page_nav();
// to output blog entries
while($row=mysql_fetch_array($result)) {
    $query2 = "SELECT * FROM ".$this->config['table_prefix']."blogcomments WHERE blogid = ".$row['id'];
    $result2 = mysql_query($query2);
    $cmntcount=mysql_num_rows($result2);
              $row['topic'] = stripslashes($row['topic']);
              $printtext = (stripslashes($row['message']));
        $brackets = Array ('/{{/i', '/}}/i');
        $changeto = '|.|';
        $printtext = preg_replace($brackets, $changeto, $printtext);
        $remove = array('#%', '======', '=====', '====', '===', '==', '[[', ']]', '||', '%|%', '&lt;&lt;', '&gt;&gt;', '::c::', '&quot;&quot;');
        $printtext = str_replace($remove, '', $printtext);
        $printtext = $this->format($printtext);
            echo "<br /><TABLE class='box' width='500' border='1' CELLSPACING='0' BGCOLOR='#DDccbb' CELLPADDING='0'>";
        echo "<TR BGCOLOR='#DDDDDD'><TD valign='top' ALIGN='left'><em><strong><font size='-1'>&nbsp;".$row['topic']."&nbsp;</font></strong></em></TD></TR>";
        echo "<TR BGCOLOR='#FFFFFF'><TD valign='top' ALIGN='left'>&nbsp;".$printtext."&nbsp;</TD></TR>";
        echo "<TR BGCOLOR='#DDDDDD'><td valign='top' align='left'><TABLE width='100%' border='0'><TR><TD ALIGN='left'><small><strong>&nbsp;&nbsp;&nbsp;".$row['time']."&nbsp;by&nbsp;".$row['name']."</strong></small></TD>";
        echo "<TD><small><a href=".$link."&blogcmnt=".$row['id']."&pg=".$blogpage.">Comments</a>&nbsp;(".$cmntcount.")</small></TD></TR></TABLE></TD></TR>";
        echo "</table>";
    }
// to paginate the blog entries
    echo $page->get_page_nav();
// if it is the front page of the blog then show entry box
if ($_GET[page]==0){
// if user is registered and logged in
if ($user = $this->GetUser())
    {
// if user has permission to write to the blog then the following form will be shown.
    if ($use == 'true')
        {
echo "<TABLE BORDER='1' CELLSPACING='2'>";
echo "   <TR>";
echo "      <TD><FORM ACTION=\"\" METHOD=POST name=\"\">";
echo "      <INPUT TYPE=hidden NAME=action VALUE=send>";
echo "      <INPUT TYPE=hidden NAME=whichblog VALUE=$blogname>";
echo "  <b>Topic: </b>   <INPUT TYPE=text NAME=topic SIZE=30 MAXLENGTH=40 class=box title=topic><INPUT TYPE=submit NAME=Submit VALUE='Send' class=box>";
echo "   <P><TEXTAREA NAME=message ROWS=5 COLS=67 WRAP=virtual onfocus=\"clearTextbox(this)\" class=box>blog entry</TEXTAREA></P>";
echo "</form>";
echo "      </TD>";
echo "   </TR><TR><TD><small>In the body text several wiki formatting codes (bold(<bold>**</bold>), italics(<strong>//</strong>), underline(<strong>__</strong>),<br /> strikethrough(<strong>++</strong>),  highlight (two single quotes...<strong>''</strong>), centering (<strong>@@</strong>) and bulleted lists(<strong>~-</strong>) <br />(and other lists)) are active. Headings, actions, tables, and external linking are not activated. </small></TD></TR>";
echo "</TABLE>";
        echo "</div>";
        }
    }
    else
    {
    print("<br /><em>You need to be registered and logged-in to contribute to the blogs.</em></p>");
    }
    }
    else
    {
    print("<br /><em>New blog entries are made on the first page of the blog.</em></p>");
    }
}
?>

(without the | between the double percents of course....which is necessary for placing the code on the page....so you must replace the %|% with double percent signs in two places)

The following file should be saved as page.inc.php in a directory called scripts in the wikka root....
<?php


     /*
     ###############################################
     ####                                       ####
     ####    Author : Harish Chauhan            ####
     ####    Date   : 27 Sep,2004               ####
     ####    Updated:                           ####
     ####                                       ####
     ###############################################

     */

// Original class script obtained from http://www.phpclasses.org/browse/package/2012.html distributed as "Freeware"
// Modifications (Ver 1.0b) by GmBowen so that script useable with wikka wiki to support a "blog" action developed for the wiki.
// Throughout this class "?page" was changed to "&amp;page" as well as other minor modifications throughout the script.

     class Page
     {
      var $total_records=1;   ///Total Records returned by sql query
      var $records_per_page=1;    ///how many records would be displayed at a time
      var $page_name=""; ///page name on which the class is called
      var $start=0;
      var $page=0;
      var $total_page=0;
      var $current_page;
      var $remain_page;
      var $show_prev_next=true;
      var $show_scroll_prev_next=false;
      var $show_first_last=false;
      var $show_disabled_links=true;
      var $scroll_page=0;
      var $qry_str="";
      var $link_para="&";

      /* returns boolean value if it is last page or not*/ 
      function is_last_page()
      {
       return $this->page>=$this->total_page-1?true:false;
      }
      /* param : Void
         returns boolean value if it is first page or not*/

      function is_first_page()
      {
       return $this->page==0?true:false;
      }
      function current_page()
      {
       return $this->page+1;
      }
      function total_page()
      {
       return $this->total_page==0?1:$this->total_page;
      }
     
      //@param : $show = if you want to show disabled links on navigation links.
      //
      function show_disabled_links($show=TRUE) 
      {
        $this->show_disabled_links=$show;
      }
      //@param : $link_para = if you want to pass any parameter to link
      //
      function set_link_parameter($link_para)
      {
        $this->link_para=$link_para;
      }
      function set_page_name($page_name)
      {
       $this->page_name=$page_name;
      }
      //@param : str= query string you want to pass to links.
      function set_qry_string($str="")
      {
       $this->qry_str="&".$str;
      }
      function set_scroll_page($scroll_num=0)
      {
        if($scroll_num!=0)
            $this->scroll_page=$scroll_num;
        else
            $this->scroll_page=$this->total_records;

      }
      function set_total_records($total_records)
      {
       if($total_records<0)
          $total_records=0;
       $this->total_records=$total_records;
      }
      function set_records_per_page($records_per_page)
      {
         if($records_per_page<=0)
              $records_per_page=$this->total_records;
         $this->records_per_page=$records_per_page;
      }
      /* @params
      *     $page_name = Page name on which class is integrated. i.e. $_SERVER['PHP_SELF']
      *     $total_records=Total records returnd by sql query.
      *     $records_per_page=How many projects would be displayed at a time
      *     $scroll_num= How many pages scrolled if we click on scroll page link.
      *                 i.e if we want to scroll 6 pages at a time then pass argument 6.
      *     $show_prev_next= boolean(true/false) to show prev Next Link
      *     $show_scroll_prev_next= boolean(true/false) to show scrolled prev Next Link
      *     $show_first_last= boolean(true/false) to show first last Link to move first and last page.
      */

     
      function set_page_data($page_name,$total_records,$records_per_page=1,$scroll_num=0,$show_prev_next=true,$show_scroll_prev_next=false,$show_first_last=false)
      {
       $this->set_total_records($total_records);
       $this->set_records_per_page($records_per_page);
       $this->set_scroll_page($scroll_num);
       $this->set_page_name($page_name);
       $this->show_prev_next=$show_prev_next;
       $this->show_scroll_prev_next=$show_scroll_prev_next;
       $this->show_first_last=$show_first_last;
      }
      /* @params
      *  $user_link= if you want to display your link i.e if you want to user '>>' instead of [first] link then use
         Page::get_first_page_nav(">>") OR for image
         Page::get_first_page_nav("<img src='' alt='first'>")
         $link_para: link parameters i.e if you want ot use another parameters such as class.
         Page::get_first_page_nav(">>","class=myStyleSheetClass")
      */
       
      function get_first_page_nav($user_link="",$link_para="")
      {
        if($this->total_page<=1)
            return;
        if(trim($user_link)=="")
            $user_link="««&nbsp;&nbsp;";
        if(!$this->is_first_page()&& $this->show_first_last)
            echo ' <a href="'.$this->page_name.'&amp;page=0'.$this->qry_str.'" '.$link_para.'>'.$user_link.'</a> ';
        elseif($this->show_first_last && $this->show_disabled_links)
            echo $user_link;
      }
      function get_last_page_nav($user_link="",$link_para="")
      {
        if($this->total_page<=1)
            return;
        if(trim($user_link)=="")
            $user_link="&nbsp;&nbsp;»»";
        if(!$this->is_last_page()&& $this->show_first_last)
            echo ' <a href="'.$this->page_name.'&amp;page='.($this->total_page-1).$this->qry_str.'" '.$link_para.'>'.$user_link.'</a> ';
        elseif($this->show_first_last && $this->show_disabled_links)
            echo $user_link;
      }
      function get_next_page_nav($user_link="",$link_para="")
      {
        if($this->total_page<=1)
            return;
        if(trim($user_link)=="")
            $user_link=" »";
        if(!$this->is_last_page()&& $this->show_prev_next)
            echo ' <a href="'.$this->page_name.'&amp;page='.($this->page+1).$this->qry_str.'" '.$link_para.'>'.$user_link.'</a> ';
        elseif($this->show_prev_next && $this->show_disabled_links)
            echo $user_link."&nbsp;";
      }
      function get_prev_page_nav($user_link="",$link_para="")
      {
        if($this->total_page<=1)
            return;
        if(trim($user_link)=="")
            $user_link="« ";
        if(!$this->is_first_page()&& $this->show_prev_next)
            echo ' <a href="'.$this->page_name.'&amp;page='.($this->page-1).$this->qry_str.'" '.$link_para.'>'.$user_link.'</a> ';
        elseif($this->show_prev_next && $this->show_disabled_links)
            echo "&nbsp;".$user_link;
      }
      function get_scroll_prev_page_nav($user_link="",$link_para="")
      {
       
        if($this->scroll_page>=$this->total_page)
            return;
        if(trim($user_link)=="")
            $user_link="[-$this->scroll_page]";
        if($this->page>$this->scroll_page &&$this->show_scroll_prev_next)
            echo ' <a href="'.$this->page_name.'&amp;page='.($this->page-$this->scroll_page).$this->qry_str.'" '.$link_para.'>'.$user_link.'</a> ';
        elseif($this->show_scroll_prev_next && $this->show_disabled_links)
            echo $user_link;
      }
      function get_scroll_next_page_nav($user_link="",$link_para="")
      {
        if($this->scroll_page>=$this->total_page)
            return;
        if(trim($user_link)=="")
            $user_link="[+$this->scroll_page]";
        if($this->total_page>$this->page+$this->scroll_page &&$this->show_scroll_prev_next)
            echo ' <a href="'.$this->page_name.'&amp;page='.($this->page+$this->scroll_page).$this->qry_str.'" '.$link_para.'>'.$user_link.'</a> ';
        elseif($this->show_scroll_prev_next && $this->show_disabled_links)
            echo $user_link;
      }

      function get_number_page_nav($link_para="")
      {
        $j=0;
        $scroll_page=$this->scroll_page;
        if($this->page>($scroll_page/2))
          $j=$this->page-intval($scroll_page/2);
        if($j+$scroll_page>$this->total_page)
          $j=$this->total_page-$scroll_page;

        if($j<0)
            $i=0;
        else
            $i=$j;
       
        for(;$i<$j+$scroll_page && $i<$this->total_records;$i++)
        {
         if($i==$this->page)
            echo ($i+1);
         else
            echo ' <a href="'.$this->page_name.'&amp;page='.$i.$this->qry_str.'" '.$link_para.'>'.($i+1).'</a> ';
        }
      }

      function get_page_nav()
      {
        if($this->total_records<=0)
        {
            //echo "No Records Found";
//          return false;
        }  
      $this->calculate();
      $this->get_first_page_nav("",$this->link_para);
      $this->get_scroll_prev_page_nav("",$this->link_para);
      $this->get_prev_page_nav("",$this->link_para);
      $this->get_number_page_nav($this->link_para);
      $this->get_next_page_nav("",$this->link_para);
      $this->get_scroll_next_page_nav("",$this->link_para);
      $this->get_last_page_nav("",$this->link_para);
//      return true;
      }
      function calculate()
      {
        $this->page=$_REQUEST['page'];
        if(!is_numeric($this->page))
          $this->page=0;
        $this->start=$this->page*$this->records_per_page;
        $this->total_page=@intval($this->total_records/$this->records_per_page);
        if($this->total_records%$this->records_per_page!=0)
          $this->total_page++;
      }
      function get_limit_query($qry="")
      {
        $this->calculate();
        return $qry." LIMIT $this->start,$this->records_per_page";
      }
     }
?>



The blog.php action on this page can use a "bad word function" that should be placed in the wikka.php file in the wiki root directory. The following code needs to be placed in the wikka.php file (just after the microtime function which starts "function getmicrotime" and ends with a "}". This code is placed immediately after the "}".

//GMB remove bad word filter
function BadWordFunc($RemoveBadWordText) {
    $RemoveBadWordText = eregi_replace("fuc?k|[kc]unt|motherfucker|cocksucker|bitch|son of a bitch|asshole|shit|fag|wank|dick|pu[zs]?[zs][yi]|bastard|s[kc]rew|mole[zs]ter|mole[sz]t|coc?k", "", $RemoveBadWordText);
return $RemoveBadWordText;

The main entry page looks like this....
http://gmbtst.msvu.ca/wikitest/wikkablog1.jpg
and the comment page, which shows one blog entry box and then the listed comments, looks like.....
http://gmbtst.msvu.ca/wikitest/wikkablog2.jpg




CategoryUserContributions
Comments
Comment by NilsLindenberg
2005-01-21 15:06:21
two little things form looking at the code:
- http://www.htmlhelp.com/tools/validator/problems.html#amp is a nice text to read (really! you can trust me on this issue :)

- i am not sure if xhtml likes TABLE, BR or things like this, but i am afraid that it's not the case.
Comment by GmBowen
2005-01-21 17:11:39
- replaced the ampersand & updated the page....just forgot that one.
- uh, how to deal with the TABLE, BR problem?? one is <BR /> I think (I've changed those), but TABLE??
Comment by 81-208-74-186.fastres.net
2005-01-21 17:15:10
You do having a running version of it, do you? Use the html-validator and look if it complains about anything
Comment by GmBowen
2005-01-21 17:46:27
uh, ya, of course (doing that is a new one on me)....lottsa things it didn't like.....I used the link at the bottom of this page with it...you're right, it doesn't like tables...or things IN them. I addressed the formatting issues I could, but several are beyond me.
Comment by NilsLindenberg
2005-01-21 17:58:00
Just moving TABLE BR etc. to lowercase should claer some of the errors.

And better remove the @ before the mysql querys (somewhere in the blog.php). Better to have errors handeld than supressed.

" addressed the formatting issues I could, but several are beyond me." Perhaps ask the Head of the Standards Department here? ;)
Comment by IanHayhurst
2005-01-31 14:00:18
Thankyou , trying this out on an intranet (wikka 1.1.5.3) at users request.... of course now they want rss feeds on the headlines... I can have a play but of course if there's handler already...
Comment by GmBowen
2005-01-31 14:54:50
Hmmm....I don't have a clue how to accomplish that. If you have any suggestions let me know. I can work on an action that could track changes on a wiki homepage. Like { {blogchanges page="WikkaBlog2" number="3" date="yes" title="Headlines in Example Blog"} }
with output.....
Headlines in Example Blog: To-Do List, Programming Help, Minor Changes (Last change: Jan 31, 2005 14:15)
Then you could have several blogs listed on your home page and see changes in one place. Would that be useful??
mike
Comment by IanHayhurst
2005-01-31 16:16:04
Mike, I was thinking of something like the /handlers/page/revisions.xml.php lets say blog.xml.php that when appended to the page WikaBlog2/blog.xml shows the topic field & time , so the headlines would work in a {{rss url="http://wiki.domain/wikka/WikkaBlog2/blog.xml}} Does that make sense mike? Cheers Ian
Comment by GmBowen
2005-01-31 19:35:56
Sure does, in principle. I'll have to take a look. Basically, I've *never*used rss feeds, but I'm sure I can learn 'em. I'll add it to my todo list.
Comment by CatIvan
2005-07-05 17:51:41
I wonder, why are both pagename and blogname required? how would they be different?
Comment by DarTar
2005-07-05 18:08:48
Hi CatIvan, if you modify pages of this server, please add your signature so we know who wrote what ;)
Comment by FrankK
2006-08-02 14:39:28
I've installed this on my server, and it appears to behave properly -- I can add entries, comments, etc. However, I'm having a few problems. It only displays the first 3 entries (with the 3rd entry at the top of the page) even though $records_per_page=5. Also, there are no navigation links at the bottom of the page even though I've configured $show_prev_next=true and $show_scroll_prev_next=true.

I'm relatively new at PHP, and admit that I'm a little confused on just what needs to be configured for this action, so perhaps I'm just missing something in the config. Any suggestions on where to start looking?
Comment by NilsLindenberg
2006-08-02 18:01:14
From a look at the code:
Find in blog.php
if ($numrec<=3) {$scroll=3;} else {$scroll=$numrec;}
and replace it with
if ($record_per_page<=3) {$scroll=3;} else {$scroll=$record_per_page}
and please tell if that solves the entry issue.
Comment by FrankK
2006-08-04 14:49:58
Thanks for the suggestion. That line looked suspicious to me too. But I tried your change, and it had no effect.

I'm a little short on time right now -- the day job is getting in the way -- but I'll dig into the code in more detail when my time frees up a bit. It probably will take me longer than someone with more PHP experience, but it's certainly a good way to learn.

Once I get it figured out, I'll post my findings here.
Comment by KairoMiami
2007-11-22 10:14:54
Hi folks

How do I adress the blog-script :-???)

{{blog}} doesn't actually work for me... :-( ?

This is what I get:

Warning: include_once(scripts/page.inc.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/web283/html/ww/actions/blog.php on line 26

Warning: include_once() [function.include]: Failed opening 'scripts/page.inc.php' for inclusion (include_path='.:/var/www/confixx/html/include:/var/www/confixx/html:/var/www/confixx/html/PEAR') in /var/www/web283/html/ww/actions/blog.php on line 26

Fatal error: Class 'Page' not found in /var/www/web283/html/ww/actions/blog.php on line 163


Thanks again :-)

Tobias Aellig
genfusion.info
Comment by NilsLindenberg
2007-11-22 12:21:32
Reads like you have done something wrong with -> "The following file should be saved as page.inc.php in a directory called scripts in the wikka root...." because it isn't found.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki