• 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)

So I've run into a frustrating happening. I know there are ad code templates built in, but I decided to upload an html block, rename it and use it for a sidebar advertisement. Worked like a charm, no problem. So I uploaded a second html block, renamed it 'Leaderboard' and place the ad code for a leaderboard inside of it. I then placed the leaderboard below the top breadcrumb in the portal layout. Only to my surprise, placing the html block there messed up all of my padding and margins and made the portal look all screwy. I then placed the same ad code in the ad template for the same spot and no issues. Can anyone explain to me why the custom code for the page gets all messed up when I use the html block but not when I place the ad code right into the ad template? I'd like to somehow create a template to use right under the recentslider in the portal but I don't want it to mess up the custom coding for the page.
 
I have a forum with many threads with the first post containing just one image tag. When I add this forum id in the recentnews block, the image contained in the first post gets squished into a small square at the right instead of getting displayed in full. How do I correct this?

If the promoted thread doesn't have an image, the poster's avatar is used but if there is an image in the promoted post, that image is used in place of the avatar.
 
You can call php file without any problem. Just use any existing blocks or make your own.

Here is a simple example that shows one way how to include php file.

I can't figure out how to use the php block properly :(

I am trying to make a php block that will grab rows from a mysql table and just print them out each on a new line, very simple stuff in php but seems impossible to figure out how to make a xenporta block do it?
 
The ads when clicked directs the page to the corresponding websites. Instead of this is there any way we can open a new browser or tab for all these clicks so that we can prevent the users from going out of our forums.

I am using Adsense block. When we click on ads it doesn't open up the ads in a new browser or tabs. The purpose is to keep our users on our forums even if they want to check some ads listed.

Is there any way?
 
The ads when clicked directs the page to the corresponding websites. Instead of this is there any way we can open a new browser or tab for all these clicks so that we can prevent the users from going out of our forums.

I am using Adsense block. When we click on ads it doesn't open up the ads in a new browser or tabs. The purpose is to keep our users on our forums even if they want to check some ads listed.

Is there any way?

It's not an option using Google Adsense, it's hard coded in their script. Here is their FAQ on the subject -

Can I open the ads in a new window?

Generally, it is our policy to not allow Google ads to open in a new window. However, in a few markets, including China, we've found that opening ads in a new window better aligns with expected internet behavior and provides a more consistent, intuitive user experience.

Keeping in mind the importance of the user experience, we've enabled Google ads to open in new windows in locations where this is expected browsing behavior. This functionality is determined by the IP of the user, and is not an option you can select your AdSense account.

We also ask that you don't modify the AdSense ad code or alter the result of clicking on an ad on your website, as such behavior violates our program policies.
 
I am trying to make a php block that will grab rows from a mysql table and just print them out each on a new line

Make "MyphpBlock" block and MyphpBlock.php Use any name you want but make sure you use exactly the same name when you name the files (red mark).

<?php

class EWRporta_Block_MyphpBlock extends XenForo_Model
{

public function getModule()
{
//Your sql query

$mystuff = $this->_getDb()->fetchAll('
SELECT .....
FROM .....
WHERE .....
AND .....
LIMIT...

');

foreach ($mystuff as &$stuff)
{

$stuff = array(
'one' =>$stuff['one'],
'two' => $stuff['two'],
'three' => $stuff['three'],
'four' => $stuff['four']
);

}

return $mystuff;
}




}


Use template syntax <xen:foreach> to get the data from MyphpBlock.php and print them out.

Template EWRblock_MyphpBlock

<xen:if hascontent="true">
<div>
<xen:contentcheck>
<xen:foreach loop="MyphpBlock" value="$mystuff;">

<div>
<div>
<p>{$mystuff.one}</p>
<p>{$mystuff.two}</p>
<p>{$mystuff.three}</p>
<p>{$mystuff.four}</p>

</div>
</div>
</xen:foreach>
</xen:contentcheck>
</div>
</xen:if>
 
It's not an option using Google Adsense, it's hard coded in their script. Here is their FAQ on the subject -
Thanks for you help Agsteve. Would you be super kind enough to help me fix this?
[8wayRun.Com]

I have been trying all kinds of settings in RecentSlider block but in vain. The thumbanils even though they are out still leaves some space... and secondly there's one line (grey color) extended towards the description..
 
Make "MyphpBlock" block and MyphpBlock.php Use any name you want but make sure you use exactly the same name when you name the files (red mark).

<?php

class EWRporta_Block_MyphpBlock extends XenForo_Model
{

public function getModule()
{
//Your sql query

$mystuff = $this->_getDb()->fetchAll('
SELECT .....
FROM .....
WHERE .....
AND .....
LIMIT...

');

foreach ($mystuff as &$stuff)
{

$stuff = array(
'one' =>$stuff['one'],
'two' => $stuff['two'],
'three' => $stuff['three'],
'four' => $stuff['four']
);

}

return $mystuff;
}




}


Use template syntax <xen:foreach> to get the data from MyphpBlock.php and print them out.

Template EWRblock_MyphpBlock

<xen:if hascontent="true">
<div>
<xen:contentcheck>
<xen:foreach loop="MyphpBlock" value="$mystuff;">

<div>
<div>
<p>{$mystuff.one}</p>
<p>{$mystuff.two}</p>
<p>{$mystuff.three}</p>
<p>{$mystuff.four}</p>

</div>
</div>
</xen:foreach>
</xen:contentcheck>
</div>
</xen:if>


Thank you I will see how I get on with this code, do I really have to do .one, .two, .three etc? Can I not just build an array and have the template loop through it?

Also when adding the template info i get this error;
The following templates contained errors and were not saved: EWRblock_Articles: 1) Line 8: Invalid variable reference

Which is this line;
<p>{$mystuff.one}</p>

Here's my code;
Block code;
Code:
<?php
 
class EWRporta_Block_Articles extends XenForo_Model
{
    public function getModule()
    {
        $mystuff = $this->_getDb()->fetchAll('SELECT * FROM `articles_category` ORDER BY `category_name` ASC');
 
        foreach ($mystuff as &$stuff)
        {
 
            $stuff = array(
            'one' => $stuff['category_name']
            );
 
        }
 
        return $mystuff;
    }
}

Template;
Code:
<xen:if hascontent="true">
<div>
<xen:contentcheck>
<xen:foreach loop="Articles" value="$mystuff;">
 
<div>
<div>
<p>{$mystuff.one}</p>
 
</div>
</div>
</xen:foreach>
</xen:contentcheck>
</div>
</xen:if>
 
17l0m.png


how can ı do that ?
 
Hi!

Im a little late in the game - installed your portal - looks good! However I have only the basic blocks that it comes with. I see in this thread you list a whole lot of blocks to add-in
but I can't seem to find them? Your base portal posts has over 189 pages of posts, and this one 38 - this is a bit overwhelming :(

I like the recent media block - any idea where to get it, or any others?
 
What have I done wrong here? Apparently it's not an xml block :/

Code:
<?xml version="1.0" encoding="utf-8"?>
<module>
  <module_name>Homepage</module_name>
  <module_cache>+1 day</module_cache>
  <module_settings/>
  <module_template><![CDATA[
<div class="sectionMain baseHtml">
    <div class="sectionFooter">
        <span class="custom-h1">Welcome to escopride</span>
    </div>
    <div class="primaryContent" style="border-bottom:none;">
        <div class="messageContent">
            <p>My test goes here, will be added soon</p>
        </div>
    </div>
</div>
 
<div class="sectionMain baseHtml">
    <div class="sectionFooter">
        <span class="custom-h1">Our News</span>
    </div>
    <div class="primaryContent" style="border-bottom:none;">
        <div class="messageContent">
        <img src="http://www.ptsdforum.org/c/images/article.jpg" alt="" style="float:left;padding-right:10px;" />
            <p>Welcome.</p>
        </div>
        <div style="clear:left"></div>
    </div>
</div>
    ]]></module_template>
</module>

FIXED THIS
 
Back
Top Bottom