• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[8wayRun.Com] XenPorta (Module Add-Ons)


What would cause all the blocks in the sidebar position to move down below the Mid Right Position when this block is used in the Mid-Right position? The effects are even worse when used in the Mid Left position.



Code:
<?xml version="1.0" encoding="utf-8"?>
<block block_id="gameservers2" title="Game Servers" version_string="1.0.0" version_id="1" url="" install_callback_class="" install_callback_method="" uninstall_callback_class="" uninstall_callback_method="" cache="now">
  <admin_templates/>
  <listeners/>
  <options/>
  <phrases/>
  <route_prefixes/>
  <templates>
    <template title="EWRblock_gameservers2"><![CDATA[<div class="section">
    <div class="secondaryContent" id="gameservers">
    <h3>Game Servers</h3>
 
    <div><a href="http://www.gametracker.com/server_info/74.91.113.142:16567/" target="_blank"><img src="http://cache.www.gametracker.com/server_info/74.91.113.142:16567/b_560_95_1.png" border="0" width="560" height="95" alt=""/></a></div></br>   
   
    <div><a href="http://www.gametracker.com/server_info/216.52.143.158:19567/" target="_blank"><img src="http://cache.www.gametracker.com/server_info/216.52.143.158:19567/b_560_95_1.png" border="0" width="560" height="95" alt=""/></a></div>
 
    </div>]]></template>
  </templates>
</block>
 
What would cause all the blocks in the sidebar position to move down below the Mid Right Position when this block is used in the Mid-Right position? The effects are even worse when used in the Mid Left position.
Code:
<div class="section">
    <div class="secondaryContent" id="gameservers">
    <h3>Game Servers</h3>
 
    <div><a href="http://www.gametracker.com/server_info/74.91.113.142:16567/" target="_blank"><img src="http://cache.www.gametracker.com/server_info/74.91.113.142:16567/b_560_95_1.png" border="0" width="260" height="95" alt=""/></a><br />
 
    <a href="http://www.gametracker.com/server_info/216.52.143.158:19567/" target="_blank"><img src="http://cache.www.gametracker.com/server_info/216.52.143.158:19567/b_560_95_1.png" border="0" width="260" height="96" alt=""/></a></div>
 
    </div>
</div>


missing </div>
 
Ah, I left source forum as unspecified as assumed that would default to all. Once I set that it worked fine :-)

Thanks again
 
i updated xenforo and xenporta final version and my medio, media cloud and event bloks disappaeared. How can i add this to my xenporta again?
 
Guys I need your help creating custom block.

1. I want to add a poll

2. I have a box which displays different images every time user refreshes the page. It is coded in PHP. You can see demo here. How shall I add this to addon & make it display ?

3. Latest registered members add on

4. Add on which displays top 5 posters.

Thank you :D
 
The CountDown timer doesn't sync with UTC which i set in the Xenforo options.. i had to manually adjust it.. what could be wrong?
 
The CountDown timer doesn't sync with UTC which i set in the Xenforo options.. i had to manually adjust it.. what could be wrong?

You can un-check the cache time checkbox and see if it syncs then, otherwise someone more knowledgeable than me will have to answer that one. I unchecked the box and mine synced with UTC right away.
 
You can un-check the cache time checkbox and see if it syncs then, otherwise someone more knowledgeable than me will have to answer that one. I unchecked the box and mine synced with UTC right away.
this is funny.. i unchecked "sync with UTC" box and it did it :) Thanks for your help adgsteve
 
One of my friend created this addon. Basically it displays images stored at http://sitename/library/EWRporta/Block/images randomly whenever user refreshes the page.

but it is not showing the images. It is the same code used here also

Here is the full xml file which can be uploaded via Install Block.

PHP:
<?xml version="1.0" encoding="utf-8"?>
<block block_id="ImageBlock" title="Image Block" version_string="1.0.0" version_id="1" url="" install_callback_class="" install_callback_method="" uninstall_callback_class="" uninstall_callback_method="" cache="now">
<admin_templates/>
<listeners/>
<options/>
<phrases/>
<route_prefixes/>
<templates>
<template title="EWRblock_ImageBlock"><![CDATA[<div class="messageText ugc baseHtml">
<div class="secondaryContent">
<?php 
function getRandomFromArray($ar) { 
    mt_srand( (double)microtime() * 1000000 ); 
    $num = array_rand($ar); 
    return $ar[$num]; 
} 
 
function getImagesFromDir($path) { 
    $images = array(); 
    if ( $img_dir = @opendir($path) ) { 
        while ( false !== ($img_file = readdir($img_dir)) ) { 
            // checks for gif, jpg, png 
            if ( preg_match("/(\.gif|\.jpg|\.png)$/", $img_file) ) { 
                $images[] = $img_file; 
            } 
        } 
        closedir($img_dir); 
    } 
    return $images; 
} 
 
$root = ''; 
// If images not in sub directory of current directory specify root  
//$root = $_SERVER['DOCUMENT_ROOT']; 
 
$path = 'images/'; 
 
// Obtain list of images from directory  
$imgList = getImagesFromDir(http://sitename/library/EWRporta/Block/images); 
 
$img = getRandomFromArray($imgList); 
 
?>
<img src="<?php echo $path . $img ?>" style="border:1px solid #83b2e4; border-radius:5px; padding:3px; margin:0px auto;" width="230" height="230" />
</div>]]></template>
  </templates>
</block>

He is very new to Xenforo, Xenporta & Add on block development. Any help appreciated. Thanks in advance :D
 
Hi all. following the code is written one of my friend who is very new to xenforo development.

This is a very simple program which should return data from sample function, but it is not. It is made to work on one of add on for xenporta.

xml file content :

HTML:
<?xml version="1.0" encoding="utf-8"?>
<block block_id="ImgBlock" title="Img Block" version_string="1.0.0" version_id="1" url="" install_callback_class="" install_callback_method="" uninstall_callback_class="" uninstall_callback_method="" cache="now">
  <admin_templates/>
  <listeners/>
  <options/>
  <phrases/>
  <route_prefixes/>
  <templates>
    <template title="EWRblock_ImgBlock"><![CDATA[<xen:if hascontent="true"><div class="messageText ugc baseHtml">
    <div class="secondaryContent">
<h3>test</h3>
<p>{$sampledata}</p>
 
</div></xen:if>]]></template>
  </templates>
</block>
PHP / block file content :
PHP:
<?php
class EWRporta_Block_ImgBlock extends XenForo_Model
{
public function getModule()
{
$sampledata = "i am in php";
return $sampledata;
}
}
We are very new to this & any help would be appreciated.
 
You have to upload the php file to /library/EWRporta/Block. After doing this you have to import the xml into the block via the acp.
 
^thanks for replying :)

Done that already ! otherwise how I would be knowing that I am not getting any output ? :P

In sidebar, it just displays header, test , but data from function is not returning. i.e. below it should show i am in php
 
Top Bottom