Revision [1348]

This is an old revision of GmBowen made by GmBowen on 2004-09-21 03:38:02.

 

This code is now compatible with 1.1.5.1 - I've replicated the "* indicated pages that you own" behaviour and hopefully it'll convince the authorities :) to include this useful mod in the next Wikka version. What needs to be done is increased use of caching (I haven't looked at the wikka.php in detail, I'm afriad) and to format the syntax better. You can see a working version here (albeit, heavily under construction).

Mike, thanks for letting us look at the upload script. Your site has many mods that I aim to take a look at soon :) Sorry about messing your User page up, just clean it up when you feel like it!
--Sam ...I think the two coolest mods are the "chat" that as an embedded flash chat (vchat modded from flatfile to database)....altho' it's difficult to pass to someone else cuz the fla file needs to be edited.....and the interactive table mod (kinda a mini-spreadsheet). If you want to log in to use the wiki the regular login won't work, you have to go to the "front end" for the site at the base IP address. Have fun snooping. -- Mike

This code is now compatible with 1.1.5.0 - I changed the self-ownership label to "*". All that needs to be done is to remove the display of Ownership when a page is Public, and to generally make it more sexier. Waiting for your file-upload utility.--Sam

Hi Sam. Geez, thanks for the mods. My programmer is now teaching math at an Indian reserve on an island in the middle of a lake in the far North of Ontario near Hudson's Bay and is kinda outta touch. Meanwhile, I've changed universities (from Thunder Bay (above Minnesota) to Fredericton (beside Maine)) and haven't been able to find a new guy to work on my stuff yet. Hence some of the delays. The "upload" script is a mod of one of the ones at wakka or wikka (can't remember which)....I've made it available for you at http://131.202.167.33/wiki/actions/uploadimage.phps .... to use it you will of course have to change phps to php. This script only allows 10 uploaded files with the users prefix in the upload directory (although you can change that easily), and checks the wikka_users database to see (a) how many files are allowed in total and (b) what number the user is at. Currently, the changes in wikka_users is

+-----------------------------------------------------------------------------------------------------------+
| wikka_users                                                                                               |
+-----------------------------------------------------------------------------------------------------------+
+-----------------+------------------+------+-----+-------------------------------------------------+-------+
| Field           | Type             | Null | Key | Default                                         | Extra |
+-----------------+------------------+------+-----+-------------------------------------------------+-------+
+ images_allowed  + smallint(4)      +      +     + 30                                              +       +
+ images_uploaded + int(6)           +      + PRI + 0                                               +       +
+-----------------+------------------+------+-----+-------------------------------------------------+-------+


As you'll note, the current max allowed upload is "30"...which is set at the database level. When the images are uploaded to the directory the username is concatonated to the front of the filename. I have a modified version of OTF Gallery that allows you to preview and "approve" each image and will then copy the files to a directory that exists for each individual user and strip the user name from the front of the file (this is from a modification of a registration script extraneous to Wikka that makes a directory for each registrant). Or, if you're not interested in doing that, I have a modified version of the "gallery" action available for wikka that you could change so it would just shows thumbnails of images of the logged in user and allows erasing images...currently it just goes to the users personal directory, but you could change that (my programming guy modded this so it generates thumbnails using GD....the original version of the gallery required you to generate the thumbnails yourself). Hope this helps. If you're interested in the gallery software for wikka let me know....you'd be on your own for modifying it to only show files with the username prefix cuz my php skills aren't good enough to do those changes. cheers, Mike B

I'm a university prof who is modifying parts of wikka so that it can be used by high school kids to collaborate on school project work and writing. I chose wakka/wikka because it seemed to be the wiki with the most flexibility for doing the sorts of things I was interested in. I'm not a programmer myself, although I do understand lots about programming, and so I've hired a recent grad from my university to implement some features for me that I think my target audience for using the wiki will need. The wiki is only one of the central tools they'll be using, and has to coordinate with numerous other tools (such as a graph drawing and an on-line drawing tool).

My programming guy (Mark Kasper) has completed a modification of the pageindex.php code that should make it more useable for high-use wakka/wikka sites (such as can now be seen at the original wakka site). It can either be used as usual, {{pageindex}}, or using a parameter indicating which letter you would like to see a listing for (for example, {{pageindex start="a"}}...or whatever letter you wish to show a listing for). If you enter a letter that there is not yet a listing for, then it defaults to "all".

<?php /*dotmg modifications : contact m.randimbisoa@dotmg.net*/ ?>
<?php
$a = array(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z);
$start = strtoupper($start);

if ($pages = $this->LoadAllPages())
{    
     $owns_pages = false;
     $link = $this->config["base_url"].$this->MiniHref($method, $tag);
     print("<strong><a href='$link&var=ALL'>ALL</a> &nbsp;</strong> \n");
     
     foreach ($pages as $page){
         if (!preg_match("/^Comment[0-9]+$/", $page["tag"])) {
            $firstChar = strtoupper($page["tag"][0]);
            if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
                $firstChar = "#";
            }

            if ($firstChar != $curChar) {
                if ($curChar) print("\n");
                       print("<strong><a href='$link&var=$firstChar'>$firstChar</a>&nbsp;</strong> \n");
                $curChar = $firstChar;
            }
        }
    }
    print("<br><br>");
    $curChar = "";
   
    foreach ($pages as $page)
    {
     
        //#dotmg [1 line modified]: added [0-9]+$ to regular expression
        if (!preg_match("/^Comment[0-9]+$/", $page["tag"])) {
            $firstChar = strtoupper($page["tag"][0]);
           
                    $st = htmlspecialchars(urldecode($_GET['var']));
           
          if($st == ''){    
            if($start == 'ALL')
            {$st='';}
            elseif($start != '')
            {
               for($i=0; $i<27; $i++)
               {
                 if($start == $a[$i])
                 {
                   $st = $a[$i];
                 }
               }            
            }
          }
                       
         if($firstChar == $st)
         {    
            if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
                $firstChar = "#";
            }

            if ($firstChar != $curChar) {
                if ($curChar) print("<br />\n");
                print("<strong>$firstChar</strong><br />\n");
                $curChar = $firstChar;
            }

            if ($this->HasAccess("read", $page["tag"])) {
                print($this->Link($page["tag"]));
                 }
            else {
                print($page["tag"]);
            }
            if ($page['owner'] != '' && $page['owner'] != '(Public)')
                 {                      
                   if ($this->GetUserName() == $page['owner'])
                     {
                       print("*");
                      $owns_pages = true;
                     }
                     else {
                    if ($this->HasAccess("read", $page["owner"])) {
                             print(" . . . . Owner: ".$this->Format($page['owner']));
                         }
                    else {
                           print(" . . . . Owner: ".$page['owner']);
                    }
                }
                 }

                 print("<br />\n");    
               
        }
        elseif ('' == $st || $st == 'ALL')
        {
            if ($firstChar != $curChar) {
                if ($curChar) print("<br />\n");
                print("<strong>$firstChar</strong><br />\n");
                $curChar = $firstChar;
            }

            if ($this->HasAccess("read", $page["tag"])) {
                print($this->Link($page["tag"]));
                 }
            else {
                print($page["tag"]);
            }
            if ($page['owner'] != '' && $page['owner'] != '(Public)')
                 {                      
                   if ($this->GetUserName() == $page['owner'])
                     {
                       print("*");
                      $owns_pages = true;
                     }
                     else {
                    if ($this->HasAccess("read", $page["owner"])) {
                             print(" . . . . Owner: ".$this->Format($page['owner']));
                         }
                    else {
                           print(" . . . . Owner: ".$page['owner']);
                    }
                }
                 }

                 print("<br />\n");          
        }
      }
    }
if ($owns_pages) print("<br />\n* Indicates a page that you own.<br />\n");  
}
else
{
    print("<em>No pages found.</em>");
}

?>  


If anybody has any suggestions, or sees any security issues, for this script please let me know. Mark is working on some other issues for me right now (other mods for wakka.....a *very* simple spreadsheet-like interactive table tool actually, and a file upload tool so kids can upload pix.....but the pix will go to a central area for approval first after which they'll be sent to each kids personal file area so they can be embedded in wikka pages. I'm going to integrate a modified version of the wikka-based gallery tool into this so that kids can have on-line presentations of their pictures (it'll only come from their personal file areas, not on a per-page basis)) but if there are useful suggestions for the pageindex action then he might be able to look at them before his contract ends. I'll post the other things he's working on here when he's done. -- Mike Bowen

The edit of 17 June was to force the script to accept upper or lower case letters when designating a letter to start with. -- Mike Bowen


A useful little action is found at GmBowenCalendar....it's a calendar that you can embed in a wikipage.

We've "mostly" finished another action for "pagewatches".....so that you can keep a list of pages that you're looking to see if changes have been made on. The code for the action and the table info for it will be posted on Monday/Tuesday next.....
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki