|
|
user block modules - here is the first one
|
|
|
Posted under Development by justme on Saturday July 01 2000 @ 03:16AM EDT
With the new unstable php block feature, it would be pretty
easy to add functionality to phpweblog. I originally asked for the
feature to integrate Kalle's news scripts:
http://swamp.chl.chalmers.se/backends/
but then I wanted even MORE features so I made this Top 5 stories script.
///////////////////////////////////////////////
///////////////////////////////////////
|
jason writes on Monday June 26 2000 @ 12:22AM EDT: [ reply | parent ]
the latest unstable has 3 type of blocks now:
HTML - the obvious
PHP - runs whatever you enter as the content through eval().
INCLUDE - point content to a local php file it will include() it.
With these 3 options, I think anything you want to do in the blocks is now possible. Suggestions welcome here.. (as usual)
|
jason writes on Saturday July 01 2000 @ 03:20AM EDT: [ reply | parent ]
I'm considering removing this functionality. (block types). This can be
a hazardous security concern if abused. Having to just edit inc.d/blocks.inc and inserting your code is the alternative to the web based front-end to this? What do you think?
|
philip writes on Saturday July 01 2000 @ 03:55AM EDT: [ reply | parent ]
if it's documented howto add blocks (and some tricks, examples) i think this would work just fine. we don't add/modify blocks enough to warrent the extra risks/work involved, perhaps at a later date. besides, being one with the code is good.
also, as justme has expressed desire to take part in, a "block exchange" might be useful.
|
justme writes on Saturday July 01 2000 @ 12:52PM EDT: [ reply | parent ]
originally, I was just thinking that you could have a
userBlockVar in common.inc.php, the userBlockVar
could point to some place outside of the phpweblog tree.
Then in blocks.inc, have it scan that directory for blocks to include.
Just a rough idea, but it will work. Maybe by filename like prepend a
on_myblock.php or off_myblock.php to control whether to include the blocks or not. You could always just sort by rid and tweak the rid
for block placement.
Having to include your blocks in blocks.inc gets troublesome with upgrades.
|
justme writes on Sunday July 02 2000 @ 07:10PM EDT: [ reply | parent ]
Just wrestled with this some more in the latest release:
Bug:
/* show blocks */
----Snip-----
if ($A["Type"]==0) {
# html
print nl2br($A["Content"]);
} elseif ($A["Type"]==1) {
-------------------------------
Type should be "Type"
Here is some documentation for writing blocks.
First, in the lastest release PHP type block has been removed, so
all blocks should be in the form of an include.
Using Block Manager:
just insert a path to the PHP file you want to include.
just the full path.. no quotes, parens includes .. etc.
to test you php include file:
add
#!/
as your first line
chmod +x the file.
then run the include file from the command line.
Additional hints..
in my phpfile, I include common.inc.php in it, saves you from having to
rewrite a lot of the common functions in phpweblog.
|
|
|
|