EzPortal - Portal Software for Forums

EzPortal - Made to Fit Your SMF Forum - Glad You Found Us!
+- +-

UserBox

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Recent Posts

Re: Converting to HTTPS by EzPortal
September 24, 2017, 07:11:26 pm

Converting to HTTPS by Padisha
September 24, 2017, 12:22:45 pm

Re: Mobile Only Blocks by EzPortal
September 23, 2017, 03:15:10 pm

Re: Mobile Only Blocks by morenos
September 23, 2017, 12:04:30 pm

Re: Members online block not displaying. by EzPortal
September 19, 2017, 12:02:55 pm

Re: Members online block not displaying. by Kocsis
September 19, 2017, 12:29:13 am

Re: EZPoll block by Julian
August 17, 2017, 03:43:31 am

Re: EZPoll block by EzPortal
August 16, 2017, 12:37:26 pm

+- HTML Menu


Sample HTML Block Usage - You May Custom Code it, as needed!

Author Topic: ezBlock Format - Creating Custom ezBlocks  (Read 46847 times)

0 Members and 1 Guest are viewing this topic.

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1159
  • Karma: 63
ezBlock Format - Creating Custom ezBlocks
« 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

Code: [Select]
<?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:
Code: [Select]
<id>vbgamer45:exampleblock</id>


<title> - Contains the name of the ezBlock
Example:
Code: [Select]
<title>Example Block</title>

<version> - Current version of your ezBlock
Example:
Code: [Select]
<version>1.0</version>

<blocktype> - Type of block can either by html or php
Example:
Code: [Select]
<blocktype>php</blocktype>


<blocktype> - Type of block can either by html or php
Example:
Code: [Select]
<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:
Code: [Select]
<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:
Code: [Select]
<author>vbgamer45</author>

<author> - Author or Company Website
Examples:
Code: [Select]
<website>http://www.ezportal.com</website>

<editable> - Allows the user to edit ezBlock html or php code. Used mostly for html blocks
Examples:
Code: [Select]
<editable>1</editable>


<can_cache> - If the ezBlock can be cached such as html output.
Examples:
Code: [Select]
<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:
Code: [Select]
<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:
Code: [Select]
<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>




Offline Skarychinezeguie

  • Posts: 2
  • Karma: 0
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #1 on: December 07, 2008, 10:33:37 pm »
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?

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1159
  • Karma: 63
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #2 on: December 07, 2008, 10:37:32 pm »
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.

Offline Skarychinezeguie

  • Posts: 2
  • Karma: 0
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #3 on: December 19, 2008, 01:30:48 am »
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.

Offline Fobnation

  • Posts: 7
  • Karma: 0
  • Gender: Male
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #4 on: February 08, 2009, 11:14:18 am »

 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!

Offline chinaren

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 4
  • www.TomeCity.com
    • Read Tired of Death for free!
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #5 on: February 18, 2009, 07:47:29 am »
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:

Quote
<!-- 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?

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1159
  • Karma: 63
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #6 on: February 18, 2009, 08:03:54 am »
Just add the following to the block
Code: [Select]
include("http://adserve.adster.com/sserve.php?pid=29156");

Offline chinaren

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 4
  • www.TomeCity.com
    • Read Tired of Death for free!
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #7 on: February 18, 2009, 04:45:55 pm »
Thanks EZ!

Offline chinaren

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 4
  • www.TomeCity.com
    • Read Tired of Death for free!
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #8 on: February 18, 2009, 10:25:31 pm »
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.


Offline ressevil

  • Posts: 5
  • Karma: 0
  • Gender: Male
    • Indonesian Motorola-SE Community
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #9 on: July 28, 2009, 04:13:21 am »
thx for share

Offline kinin

  • Posts: 6
  • Karma: 0
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #10 on: August 12, 2009, 06:47:43 pm »
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:
Code: [Select]
<?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]

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1159
  • Karma: 63
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #11 on: August 12, 2009, 07:54:21 pm »

Offline kinin

  • Posts: 6
  • Karma: 0
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #12 on: August 12, 2009, 11:23:00 pm »
Thank you very much, much appreciated

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1159
  • Karma: 63
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #13 on: August 12, 2009, 11:38:34 pm »
Will work on select box values for xml format and get better documenation on it for 0.3.0

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1159
  • Karma: 63
Re: ezBlock Format - Creating Custom ezBlocks
« Reply #14 on: August 25, 2009, 06:43:09 pm »
Updated the ezBlock format example. Fixed a couple bugs with ezBlocks.
Now supports checkboxes parameter types and loading of select values for custom ezBlocks

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
2996 Views
Last post September 16, 2010, 03:25:59 pm
by _pi
2 Replies
6087 Views
Last post September 21, 2012, 07:20:14 pm
by Xehara
1 Replies
2765 Views
Last post September 05, 2013, 07:10:12 pm
by EzPortal
1 Replies
3063 Views
Last post July 27, 2014, 05:24:20 am
by Maxx
2 Replies
2869 Views
Last post September 30, 2014, 11:29:24 pm
by fobnicat

+-SMF Gallery

Quick Menu








Members Online

18 Guests, 0 Users
Powered by EzPortal