Blocks and Arguments
- Wednesday, July 10 2002 @ 06:54 PM EDT
-
- Contributed by:
- krove
-
- Views:
- 2,854
Can blocks accepts arguments? For example, I have a block with elements that can be editted (using a link like $PHP_SELF?amode=edit&app_id=45), yet when clicked, I attempt to read $amode or $app_id and they are shown as empty. Is there something that I'm not doing right?
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Actually, I don\'t quite see the point of it. Blocks are called by Geeklog without any arguments anyway, so why do you want to add some?
Maybe you can give an exmaple of what you\'re trying to accomplish?
bye, Dirk
For example:
function phpblock_downloads () {
global $_CONF, $PHP_SELF, $HTTP_POST_VARS;
$sortby = $HTTP_POST_VARS[\'sortby\'];
$path = $_CONF[\'path_html\'] . \"pafiledb3/includes\";
include_once($path . \"/display_dls.php\");
$display = getdls($sortby);
return $display;
}
The include file display_dls.php does all the work.
I made a block that allows someone on our Intranet to enter information pertaining to certain applications our customers send us (i.e. credit apps and new account applications). The block is very similar to the ShoutBox, but I needed to be able to edit and delete, so an image of a small pencil next to each app (with a short blurb) is provided. Click and the arguments are sent and only that app is presented in the block and in the proper form fields for either editting or deletion.
The block provides too little information (we really don\'t need anything more than the customer name, app type, app status and a short note) to qualify for me putting in the time to create a plugin.
My plug-in efforts have stalled on other fronts due to the rather complex setup (writing of admin side and public side), etc. The block works great in this manner, and because the block uses $PHP_SELF to define the edit link, a user can be on just about any page to edit an entry.
My next step will be to auto-archive entries that have reached an end-stage status of rejected or approved after about a week or two to another table.
Pretty sweet!