boban
Well-known member
Boban, is there a simple way to include the content of a specific post in a block? It seems like it should be able to hook in but I'm not sure quite how.
I guess it's not that hard
Boban, is there a simple way to include the content of a specific post in a block? It seems like it should be able to hook in but I'm not sure quite how.
<?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.
<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>
I guess it's not that hard
Thanks for your help but that doesn't seem to work. It doesn't display any content in the block.
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?
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?
this is funny.. i unchecked "sync with UTC" box and it did it Thanks for your help adgsteveYou 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.
<?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>
<?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
class EWRporta_Block_ImgBlock extends XenForo_Model
{
public function getModule()
{
$sampledata = "i am in php";
return $sampledata;
}
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.