NoPic eZine
  
Home
Impressum/Imprint
Datenschutz/Policies
 
1.Issue 2006.06/1
 1.1.phpWebSite 1.0.0RC1 released
 1.2.Installing pWS 1.0.0rc1
 1.3.Running thru install
   Install screen 1 (welcome)
   Install screen 2 (source,pear)
   Install screen 3 (db)
   Install screen 4 (config file done)
   Install screen 5 (core done)
   Install screen 6 (admin account)
   Install screen 7 (mod users)
   Install screen 8 (control panel)
   Install screen 9 (theme select)
   Install screen 10 (mod layout)
   Install screen 11 (mod boost)
   Install screen 12 (mod related)
    Readme Related content
   Install screen 13 (category)
   Install screen 14 (filecabinet)
   Install screen 15 (version)
   Install screen 16 (mod clipboard)
   Install screen 17 (mod notes)
   Install screen 18 (demographics)
   Install screen 19 (comments)
   Install screen 20 (search)
   Install screen 21 (MiniAdmin)
 1.4.First anonymous touch
 1.5.Exploring fallout surface inside
 1.6.Module substitution
 1.7.Directory Tree
 1.8.Database Tables
 1.9.ReadMe summary
 1.10.Using module WebPages
 1.11.Using module MenuManager
 1.12.Using webPages Editor
 1.13.Styling and Themes

    en

Install screen 12 (mod related)

Module related (former phatcat) has installed.

Readme Related content

Source: docs/Related.txt

Use the Related Module
by Matthew McNaney

The Related module allows administrators to link information. Once one
or more items are linked, they will reference one another when either
is viewed.

Making your module work with the Related module is simple and
straightforward.

You should access the Related module when an individual item (an
article, an image, an event, etc.) is being viewed.

For example, we will access Related in a function named 'View';


if ($_REQUEST['action'] == 'view' && isset($_REQUEST['id']))
   view($_REQUEST['id']);

function view($id){

  $content = MyModule::viewItem($id);
  Layout::add($content);

}

First we create our related object:

$related = & new Related;

Next we need to plug-in imformation about our module:

/*-------------------------------------------------------------*/

$id = 5;
$title = "My module rules all!";
$url = "index.php?module=MyModule&action=view&id=$id";

$related->setMainId($id); // This is the id of our module's item
$related->setModule("MyModule"); // The name of your module

/**
 * You may have more than one item type in your module. If so, you can
 * name them separately. If you only have one item type, you don't need
 * to call this function.
 */
$related->setItemName("MyModule");

$related->setTitle($title); // This is the title to your item
$related->setUrl($url); // The relative address to the view function

/*-------------------------------------------------------------*/

After setting everything up, you can then call:

$related->show();

The Related module will take care of the rest.

There is one parameter you can add to the show function.
This paramter lets you restrict edit access. For example:

$allow = Current_User::allow("MyModule");
$related->show($allow);

If the user had permission to administrate your module, a TRUE value
would get passed to the show function and they would be able to create
related links. If it was FALSE, then they would be stuck with the
default view.
    en

Copyright © 2006, VbID Verlagsbüro GmbH
pWS modules dcP, dcT, dc4db, Copyright © 2006, VbID Verlagsbüro GmbH
This Site is powered by phpWebSite © The Web Technology Group, Appalachian State University