Special Offers
Live Help
Skype us
Our Facebook page
Follow Us On Twitter
Our Youtube Channel
Blog


 Client Area

Email Address:

Password:

 Remember Me

Forgotten Your Password?





Subscribe now in Dimofinf Mobile and enjoy the wide range of premium services. At a very small price, you will receive our SMS text messages wherever you are! More



  Add to Favourites Print this Article
Calling a Programming Block

You can call a file and display it inside a block in the magazine by following these steps:

  1. Create a file for the block with php extension, the contents of the file should have the form:
  • This example uses only one value called “YOUR  DATA HERE” this to show that it must be in the variable “content

PHP :
<?php
$content 
="YOUR DATA HERE";
?>

All the contents you want to show must be in the variable “content”

  • Another example

PHP :
<?php
$content
"hello";
for(
$i=0;$i<10;$i++){
$content .=$i."";
if (
$i==5){
$content .="This is number 5";
}
}
?>

  1. Upload the php file to “blocks” directory, make sure to change its name to block-xxxx.php, replace xxxx with the file name you wish
  2. After that add a block to the control panel from the path:

Styles & Blocks > Blocks > Add

  • Type a name for the block to be used in the control panel.
  • Title: Appear in the block head when displayed in the site interface, leave it empty to hide the block head.
  • Block Place: Choose where to display the block (Left of the home page, Right of the home page, Center of the home page).
  • Order: Choose the order of displaying the block in the site.
  • Content: leave it empty
  • Block File: Choose the file that you previously uploaded for example: block-xxxx.php

Then press “Submit

Was this answer helpful?

Also Read
Add a New File Extension (Views: 2655)