Revision [12385]

This is an old revision of ChrisH made by CyneBeald on 2005-12-22 17:32:56.

 

Chris Heismann


22 Dec 05
CyneBeald - thanks for the feedback. I reset the write ACL to registered users, I didn't think about anyone wanting to comment on the code in the page when I restricted it.

Thanks for the tip on the quotes. I wish I would have known that last night - I struggled for 45 minutes or so trying to get it right - I kept getting some sort of "unexpected string error" or no output at all. But the important part is it was a learning experience.

The reason I hardcoded the URL is because I wanted a "slim" action - one that is easy to use. As it is written now, a user can place a preset image file on every page, by only having to remember one command - {{logo}} I named it logo, because I figured that would be the most likely use of it - to place a company or product logo somewhere. I didn't see a point in trying to parse a URL, because that would duplicate the Image action to some extent.

That was the first iteration. I do want to learn to handle parameters, so the next (and probably final) iteration will have two parameters - size and class - so that the same image can be somewhat resized, and placed to the left, right or center. So that when all is said and done, a Wikki user will be able to place a logo on their page by remembering {{logo}} and whether it is small, medium or large, and placed to the left, right or center. So the final action would look something like this:

{{logo small center}}



My thinking behind this is that the Wikka administrator can preload a logo, and, if desired, manipulate the settings in the logo.php file for the desired sizes. If desired, they could then "clone" the php file for different logos - IE, a wikka that compared Coke and Pepsi to each other could have two logo actions - {{cokelogo}} and {{pepsilogo}}, and that is all the end user would have to remember to use them, rather than having to remember all the parameters in the ImageAction, and the file name as well.

That's the use I'll be putting it to, although not for coke and pepsi, but the different game systems I play.

21 Dec 05
Hurray! I wrote my first "real" action and php program tonight. Ok, it's actually my second, but since my first one was nothing more than figuring out the simple "Hello World" example php program and using it as an action, I don't think that counts. Now this one isn't much more sophisticated,a nd in fact, I think it can actually be simplified even further, but I may expand on it later. Besides, that's not my intention - my intention is to learn some php, and how to use it for actions in Wikka.

So, anyway, here's the code:

Logo action:
This action can be used to place a preloaded image on any wikka page. In order for it to work, you must have an image named "logo.gif" in the images folder. Usage is {{logo}}.

<?php
/*
        "logo" action
    Parameters:
        there are no parameters for this action
    created by Chris Heismann, December 2005, for use with Wikka Wiki, ver 1.1.6.0
    released under the GPL
    WARNING: This action was created as a programming exercise by a beginning programmer. Use at your own risk
*/

$output = "<img alt=\"logo\" src=\"images/logo.gif\" />";
print($output);
?>

Place this code in your actions folder as a file named logo.php.

Feedback on this would be much appreciated!

20 Dec 05
So I went and picked up a book on php. Wow. I had been looking at it as if it were some sort of alien language. But its actually not that bad - different syntax than BASIC, and probably far more flexible and extendable, but I got enough of a grasp that I think I write few things in it.

I wrote my first action, a little snippet that just prints a greeting on the page. Next up is a Logo action - one that will take a predetermined image file and display it. Yeah, I know I can do that with the image action, but this is a programming exercise.

When I've got it done, I'll post it here for review.

15 Dec 05
I've just recently began to use Wikka as a central website for my Dungeons & Dragons campaign. This was my second attempt at trying to install a Wiki - the first one was well over a year ago, and I got majorly frustrated trying to figure out everything that I needed to do on my web hosts computers, and related to the wiki itself.

But recently, my web host began providing Instant Installers for a variety open source tools like shopping carts, wikis etc. They offered four different Wiki's and I chose Wikka because of the four it seemed to have the best blend of power combined with ease of use.

I've got my Wiki up and running, and even some decent content. If you want to look, it's here: yrazul.heismann.net/wiki/ Yrazul Wiki. I have some issues that are more mine than Wikka's - that is, I know enough about programming and style sheets to be dangerous - very dangerous. I know how to modify the php and css files, but I have no clue as to what I'm modifying.

I hope to change that - I've done some lite programming before - I used to program quite a bit in Amiga Basic (ah, those were the days), but since that computer went away, my programming has been limited to Excel and a proprietary menu driven language specific to my company's car wash controllers. If it's not too hard to learn, I'm hoping to learn a bit of php - at least enough to write an action or two for my wiki. Unless there are some other D&D players out there who happen to know php and use Wikka who want to write them for me?


CategoryUsers
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki