EzPortal - Portal Software for Forums
EzPortal Forums => ezBlock Coding Forums => Topic started by: EzPortal on October 12, 2008, 07:52:03 pm
-
ezBlock Format - Creating Custom ezBlocks
Inside every EzPortal download is sample custom ezBlock file
Found in
ezportal\blocks\exampleBlockPackage\block-info.xml
Example ezBlock
<?xml version="1.0"?>
<!DOCTYPE block-info SYSTEM "http://www.ezportal.com/xml/block-info">
<block-info xmlns="http://www.ezportal.com/xml/block-info" xmlns:ezportal="http://www.ezportal.com/">
<id>vbgamer45:exampleblock</id>
<title>Example Block</title>
<version>1.1</version>
<blocktype>php</blocktype>
<forumversion>SMF 1.1.x</forumversion>
<author>vbgamer45</author>
<website>http://www.ezportal.com</website>
<editable>1</editable>
<can_cache>1</can_cache>
<parameter1>
<type>string</type>
<required>1</required>
<default>John</default>
<title>First Name</title>
<order>3</order>
</parameter1>
<parameter2>
<type>string</type>
<required>0</required>
<default>Smith</default>
<title>Last Name</title>
<order>2</order>
</parameter2>
<parameter3>
<type>checkbox</type>
<required>0</required>
<default>1</default>
<title>This is a checkbox</title>
<order>1</order>
</parameter3>
<parameter4>
<type>select</type>
<required>0</required>
<title>Select Test</title>
<selectvalues>Each,Value,Seperate,By,Comma,Example,Red,Green,Blue</selectvalues>
<order>4</order>
</parameter4>
<blockdata><![CDATA[echo '<b>My Awesome EzPortal ezBlock</b> My Name is ' . $parameter1 . ' ' . $parameter2;]]></blockdata>
</block-info>
Breaking down each ezBlock xml tag
<id> - Should contain the author followed by a : followed by the ezBlock name without any spaces
Example:
<id>vbgamer45:exampleblock</id>
<title> - Contains the name of the ezBlock
Example:
<title>Example Block</title>
<version> - Current version of your ezBlock
Example:
<version>1.0</version>
<blocktype> - Type of block can either by html or php
Example:
<blocktype>php</blocktype>
<blocktype> - Type of block can either by html or php
Example:
<blocktype>php</blocktype>
<forumversion> - You can support more than one version by separating them with a comma
x is considered wild and will match any version.
Examples:
<forumversion>SMF 1.1.x</forumversion>
<forumversion>SMF 1.1.4</forumversion>
<forumversion>SMF 2.0.x</forumversion>
<forumversion>SMF 1.1.x,SMF 2.0.x</forumversion>
<author> - Author or Company Name
Examples:
<author>vbgamer45</author>
<author> - Author or Company Website
Examples:
<website>http://www.ezportal.com</website>
<editable> - Allows the user to edit ezBlock html or php code. Used mostly for html blocks
Examples:
<editable>1</editable>
<can_cache> - If the ezBlock can be cached such as html output.
Examples:
<can_cache>1</can_cache>
<blockdata> - Contains the ezBlock html or php code. For ezBlock's that have parameters you would references them inside your php code as $parameter# where # is the parameter number
Examples:
<blockdata><![CDATA[<b>My ezBlock</b>]]></blockdata>
<blockdata><![CDATA[echo '<b>My Awesome EzPortal ezBlock</b>';]]></blockdata>
EzBlock Parameters
ezBlock parameters are a powerful tool to expand the power of your ezBlocks
Examples:
<parameter1>
<type>string</type>
<required>1</required>
<default>John</rdefault>
<title>First Name</title>
<order>1</order>
</parameter1>
<parameter2>
<type>string</type>
<required>0</required>
<default>Smith</default>
<title>Last Name</title>
<order>2</order>
</parameter2>
-
i'm having trouble with one of the ezportal features. i thought i would post it here as i may have to do some code editing. the problem is this. my home page is by default the forums. however when i click admin/ezportal/settings there is an option to "enable portal homepage". after enabling this feature, it does EXACTLY what i want it to do. it moves the forums one tab over, labels it forums instead of home, and then makes a blank homepage and adds a new home tab. perfect. now, how do i add stuff to that homepage. i cannot for the life of me figure out how to edit it. also, there is an option below that that says "Custom Homepage Title", and i was wondering what that was for. other than that i love ezportal. any ideas?
-
You need to add an ezBlock now on your homepage. Either a built in ezBlock or a custom created html page. Next you would set the permissions so everyone can see the ezBlock. Then last set the visible options in your case you want just "Portal Homepage" checked
Custom Homepage Title is the title of your HomePage what it says in your webbrowser. Overrides the default title.
-
if you wanna see your ezblocks in use check out www.digital-demonz.com
As for the shoutbox though, i want to edit it so that it doesn't display the date or the time. only the name and shout.
-
Hi all. For some reason my webpage editor has gone missing. When I try to create a new page it just shows the title block then a blank content block. Don't know what happened!
-
Hi, me again.
I'm trying to add an Adster ad to my forum. However, the javascript is causing strange errors when people edit posts (not sure if it's EZB or something else), so I'm trying to add it to an EZblock.
The same strange error happens if I use a Javascript EZblock, so I'm trying to use a PHP one instead.
The PHP code from Adster is:
<!-- ADster Text Ads Code START -->
<?php include("http://adserve.adster.com/sserve.php?pid=29156"); ?>
<!-- ADster Text Ads Code END -->
However, if I just stick that in a (PHP) block it comes up with a syntax error. I've tried sticking the code in between the <blockdata> tags, as shown on your example, but it still doesn't work.
I'm doing something stupid aren't I?
-
Just add the following to the block
include("http://adserve.adster.com/sserve.php?pid=29156");
-
Thanks EZ!
-
Mmm, it didn't work. If I just put that in the block, it displays nothing. If I put it between the code, it errors again. ?
Sorry, I really don't know what I'm doing with PHP.
-
thx for share
-
In the custom block I am looking to create, I want to have a selection box and/or a check box.
I tried changing the value of the <type> but I was unsure of what are the valid options. I tried "selection box" but it did not display any differently then a string.
Would it be possible to post an example of how to make a selection box and check box, or point me in the right direction.
Thank you
This was the test code I used:
<?xml version="1.0"?>
<!DOCTYPE block-info SYSTEM "http://www.ezportal.com/xml/block-info">
<block-info xmlns="http://www.ezportal.com/xml/block-info" xmlns:ezportal="http://www.ezportal.com/">
<id>test:Test Block</id>
<title>Test Block</title>
<version>1.0</version>
<blocktype>php</blocktype>
<forumversion>SMF 2.0.RC2.1</forumversion>
<author>test</author>
<website>http://www.test.com</website>
<editable>1</editable>
<can_cache>1</can_cache>
<parameter1>
<type>selection box</type>
<required>0</required>
<default>A,B,C,D</required>
<title>Status</title>
</parameter1>
<blockdata><![CDATA[echo '<b>My Awesome EzPortal ezBlock</b> My Name is ' . $parameter1 . ' ' . $parameter2;]]></blockdata>
</block-info>[code]
[/code]
-
I posted a quick reference to the current supported types
http://www.ezportal.com/ezblock-coding-forums/supported-parameter-types-as-of-ezportal-0-2-9/
-
Thank you very much, much appreciated
-
Will work on select box values for xml format and get better documenation on it for 0.3.0
-
Updated the ezBlock format example. Fixed a couple bugs with ezBlocks.
Now supports checkboxes parameter types and loading of select values for custom ezBlocks
-
I have a few questions.
1, I am kinda confused what tags to start with.
2, Do I put it in an EzPortal HTML block?
-
What type of custom ezBlock are you trying to create?
-
How exactly do I install a block that I've made? Do I upload it to the ezportal/blocks dir in its own sub dir? I tried this but ezportal doesn't seem to know its there. The ezportal block upload page doesn't seem to work either.
-
Please follow this link to see if it helps the understand of creating a custom block:
http://www.ezportal.com/ezblock-coding-forums/ezblock-format-creating-custom-ezblocks/
(http://www.ezportal.com/ezblock-coding-forums/ezblock-format-creating-custom-ezblocks/)
regards,
Maxx
-
yes yes yes, I know how to create a block but it doesn't say how to install a block using ftp. And the inbuilt block installer doesn't want to update the list of available blocks after it uploads...
I'll update my ezportal build but I'd like to know this, its oddly not mentioned.
-
Ok this is only a guess, but have you tried to compress the block using Win Zip, not war, then upload it, most everything in the SMF system needs this format to work in the upload functions.
Then upload through the EzPortal manager upload system.
If you do not have the win zip you can get the Zipgenious totally free here:
http://www.zipgenius.it/
Make certain when compressing you don't compress it into 2 folders, right click when zipgeious menu appears click on add to " your folder name or block name" it will compress it!
try to do this from you desktop so you can find it right off!
regards,
Maxx
-
Hi i have attempted to create a block using the sample code above and when i try ad run it through my text editor i get the following message:
Unspecified error Error processing resource 'http://www.ezportal.com/xml/block-info'.
can anyone tell me what i am doing wrong my code is below
<?xml version="1.0"?>
<!DOCTYPE block-info SYSTEM "http://www.ezportal.com/xml/block-info">
<block-info xmlns="http://www.ezportal.com/xml/block-info" xmlns:ezportal="http://www.ezportal.com/">
<id>kevin1961:Meets&Events</id>
<title>Meets Block</title>
<version>3.0.3</version>
<blocktype>php</blocktype>
<forumversion>SMF 2.0.9</forumversion>
<author>Kevin1961</author>
<website></website>
<editable>1</editable>
<can_cache>1</can_cache>
<parameter1>
<type>select</type>
<required>1</required>
<title>Meet Type</title>
<selectvalues>Choose meet type...,Meet at your place,Social meetup,Meet at our place,Dogging meet,Gangbang,Night out,Anything anywhere,Hotel meet,Club meet</selectvalues>
<order>1</order>
</parameter1>
<parameter2>
<type>select</type>
<required>1</required>
<title>Meet Date</title>
<selectvalues>24 April 2015,25 April 2015,26 April 2015,27 April 2015,28 April 2015,29 April 2015,30 April 2015,01 May 2015,02 May 2015,03 May 2015,04 May 2015,05 May 2015,06 May 2015,07 May 2015,08 May 2015,09 May 2015,10 May 2015,11 May 2015,12 May 2015,13 May 2015,14 May 2015,15 May 2015,16 May 2015,17 May 2015,18 May 2015,19 May 2015,20 May 2015,21 May 2015,22 May 2015,23 May 2015,24 May 2015,25 May 2015,26 May 2015,27 May 2015,28 May 2015,29 May 2015,30 May 2015,31 May 2015,01 June 2015,02 June 2015,03 June 2015,04 June 2015,05 June 2015,06 June 2015,07 June 2015,08 June 2015,09 June 2015,10 June 2015,11 June 2015,12 June 2015,13 June 2015,14 June 2015,15 June 2015,16 June 2015,17 June 2015,18 June 2015,19 June 2015,20 June 2015,21 June 2015,22 June 2015,23 June 2015,24 June 2015,25 June 2015,26 June 2015,27 June 2015,28 June 2015,29 June 2015,30 June 2015</selectvalues>
<order>2</order>
</parameter2>
<parameter3>
<type>select</type>
<required>1</required>
<title>Meet Region</title>
<selectvalues>Any,Channel Islands,East Midlands,Greater London,Isle of Man,North East,North West,Northern Ireland,Scotland,South East,South West,Wales,West Midlands</selectvalues>
<order>3</order>
</parameter3>
<parameter4>
<type>string</type>
<required>1</required>
<default>Meet Postcode</default>
<title>Your Postcode</title>
<order>4</order>
</parameter4>
<parameter5>
<type>string</type>
<required>1</required>
<default>Meet Town</default>
<title>Your Town</title>
<order>5</order>
</parameter5>
<parameter6>
<type>string</type>
<required>1</required>
<default>Meet Title</default>
<title>Your Title</title>
<order>6</order>
</parameter6>
<parameter7>
<type>textarea</type>
<required>1</required>
<default>Meet Advert</default>
<title>Your Advert</title>
<order>7</order>
</parameter7>
<parameter8>
<type>checkbox</type>
<required>1</required>
<default>8</default>
<title>This is a checkbox</title>
<checkboxvalues>Females,Males,Couples mf,Couples mm,Couples ff,Tvtscds</checkboxvalues>
<order>8</order>
</parameter8>
<blockdata><![CDATA[echo '<b>Meets Block</b> My Meet Details Are ' . $parameter1 . ' ' . $parameter2 . ' ' . $parameter3 . ' ' . $parameter4 . ' ' . $parameter5 . ' ' . $parameter6 . ' ' . $parameter7 . ' ' . $parameter8;]]></blockdata>
</block-info>
-
Try taking out these two lines
<!DOCTYPE block-info SYSTEM "http://www.ezportal.com/xml/block-info">
<block-info xmlns="http://www.ezportal.com/xml/block-info" xmlns:ezportal="http://www.ezportal.com/">