SmartFAQ is developed by The SmartFactory (https://www.smartfactory.ca), a division of InBox Solutions (https://www.inboxsolutions.net)

How do I make a custom block?
Custom Blocks are created in Blocks Administration found in System Admin -> Blocks.

From here, it is possible to create blocks with one of four types:

HTML
Regular HTML code can be put in this block

PHP
Regular PHP code can be used in this block as if it was a block in a module. Note that you are in a function scope, when creating this block, so any global variables such as $xoopsUser (User object) and $xoopsDB (Database object) must be declared global before use

Autoformat (Smilies enabled)
Normal Xoops code format with linebreaks and XoopsCode tags such as [img ] and [url ] (without spaces)
Smilies are interpreted and converted to the corresponding image

Autoformat (Smilies disabled)
Similar to the other Autoformat, but smilies are not converted, but will be displayed as e.g. : -) (without spaces)

Please also see This flash tutorial for more details.


The comments are owned by the author. We aren't responsible for their content.
user

 More info needed


This seems more a description of the custom block area than an answer to the question, "How do I create a custom block?" Posting random text is one thing, but my question is: how do I make a useful block element. I am familiar with HTML and CSS, but don't have a clue about PHP. A practical illustration would be: how do I make a custom block that would display a single forum? Or how do I create a block that would display the title and a teaser of all of the articles in a single category.

 
user

 Re: More info needed


Look at the category of this faq - it is supposed to be explaning the administration interface, so this is an entirely appropriate amount of information.

If you are interested in creating custom blocks which use information from modules... your best option would be to look at the php code of the blocks that the module already supplies, adapt that to suit your needs and put your adapted code into a php custom block as outlined in this faq.

 
user

 and Javascript?


Can i put Javascript in the blocks? like paypal code or google adsense code, etc?

 
user

 Re: and Javascript?


Yes, you can put js directly in the blocks, but be careful how you call it if its remote.

If you are calling a remote .js file make sure you get the path rigt or give a full URL.

 
user

 Thanks!


Ahh, thanks for your help...
That certinley make things easier!

 
user

 Creating blocks


I can't use javascript in Auto-Format neither HTML blocks. I have to use PHP Script instead. Is this right?

Thanks a lot.

 


Login

Who's Online

246 user(s) are online (4 user(s) are browsing XOOPS FAQ)


Members: 0


Guests: 246


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Did you know ?

You can remove 'www' from your URL ?

Random question

Can users upload viruses to my site?