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

Hi Salud,

Im liking the look of your edited Recent News module. Would it be easy enough to remove the avatar and have everything starting from the left hadn side where the avatar should be in yours?
Search in template EWRporta_Block_RecentNews
Code:
                        <div class="lmsMessageUserBlock avatarHolder" style="max-height: 150px; max-width: 150px; float: left;">
                            <xen:avatar user="$news" size="m" itemprop="photo" />
                        </div>
And change by
Code:
        <div class="lmsMessageUserBlock messageInfo">
            {xen:helper username, $thread}
        </div>
If so, which template or CSS would need to be edited to achieve this.

Hope that makes sense?

All the best :)
In template EWRporta_Block_RecentNews.css

Salud2
 
Ah thanks for that. I'm at work at the mo, but will give that a try in the morning! I don't suppose you know about the conditionals for days of the week do you?
Thanks again
 
Can anyone gimmie a hand with the Adsense block?

Ive put in my Pub-ID and i did "Adsense for Content" and got the ad-ID. But when i put those into my adsense block i get a blank block.

Ive searched for what i need to do but couldnt find the right answers.

So can anyone help me get Adsense working for this portal?

Ide just like to know how to get the right ad code for it to work.
 
Navigate to your portal page and look for the "Modules" link ( yoursite.com/portal/modules). If you don't see it, check your permissions (at the very bottom)
If you do see it, click it and select to upload the various modules from the XML directory in the downloaded package.
Once installed and positions, click on the module name to setup various settings.
Kindly refer to the attached. Is this what it should look like?
If yes, how do we move the individual modules (after setting each up) to appear in the desired positions (left, center, right, etc)?
My forum is in a folder, not root, and I use Cpanel to redirect to Portal, just in case it is relevant.
Thanks for the time.
 

Attachments

  • cap.webp
    cap.webp
    30.3 KB · Views: 60
Hmm...Probably a good idea to consider moving my installation to the root and do away with these issues altogether.
 
Kindly refer to the attached. Is this what it should look like?
If yes, how do we move the individual modules (after setting each up) to appear in the desired positions (left, center, right, etc)?
My forum is in a folder, not root, and I use Cpanel to redirect to Portal, just in case it is relevant.
Thanks for the time.
click and drag the modules on that screen. then click 'update module order'

this all works fine in a subdirectory. i use a subdirectory
 
click and drag the modules on that screen. then click 'update module order'
Thanks for responding. Yes, that would be the obvious way to do it - drag and drop, but it isn't working. Nothing's moving. Driven me to distraction the last two days trying to figure it out. Reinstalled multiple times. Individual settings open and save fine. Just will not drag...IE, FF...
 
Ah, just in case anyone else gets this problem, the problem was checking the "Lock module position from customization" box before dragging the module. Drag to position first, then lock module.
 
So i duplicated the Recent news module but when i goto the posts they still look like forum posts.

Is there a way to make them also look like articles like the current main RecentNews module?

If anyone can help that would be great.
 
Here is the code for my recentnews2 to see if i messed up somewhere.

RecentNews2.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<module>
  <module_name>RecentNews2</module_name>
  <module_cache>+1 hours</module_cache>
  <module_settings>
    <forum desc="News Source Forums" format="forums" options="">78</forum>
    <limit desc="News Posts Per Page" format="number" options="min=1|max=20">6</limit>
    <truncate desc="Max Summary Length" format="number" options="step=100">800</truncate>
    <social desc="Show Social Media Options" format="check" options="">1</social>
    <pagenav desc="Show History Navigation" format="check" options="">1</pagenav>
  </module_settings>
  <module_template><![CDATA[<xen:require css="message_user_info.css" />
<xen:require css="bb_code.css" />
<xen:require css="EWRporta_Block_RecentNews.css" />

<div id="recentNews2">
    <xen:foreach loop="$RecentNews2" value="$news">
        <div class="section sectionMain recentNews" id="{$news.thread_id}">

            <div class="primaryContent {xen:if '{$position} != "center" AND {$position} != "right"', 'leftDate'}">
                <div class="subHeading">
                    <div style="float: right; white-space: nowrap;">
                        <a href="{xen:link threads, $news}"><xen:datetime time="$news.promote_date" /></a>
                        <xen:if is="{$visitor.permissions.EWRporta.canPromote}">
                            &nbsp; (<a href="{xen:link 'threads/edit', $news}" class="OverlayTrigger">{xen:phrase edit}</a>)
                        </xen:if>
                    </div>

                    <a href="{xen:link threads, $news}">{$news.title}</a>
                </div>

                <div class="newsDate secondaryContent">
                    <div class="newsMonth heading">{$news.month}</div>
                    <div class="newsDay">{$news.day}</div>
                </div>

                <div class="messageUserBlock">
                    <div class="avatarHolder">
                        <xen:if is="{$news.attach}">
                            <a href="{xen:link threads, $news}"><img src="{$news.attach.thumbnailUrl}" alt="{$news.attach.filename}" /></a>
                        <xen:elseif is="{$news.medio}" />
                            <div style="background: url('data/media/{$news.medio.media_id}.jpg') no-repeat;">
                                <a href="{xen:link 'full:media/popout', $news.medio}" class="OverlayTrigger"><img src="js/8wayrun/EWRmedio_play.png" width="160" height="90" /></a>
                            </div>
                        <xen:elseif is="{$news.image}" />
                            <a href="{xen:link threads, $news}"><img src="{$news.image}" alt="{$news.image}" style="max-height: 150px; max-width: 150px;" /></a>
                        <xen:else />
                            <xen:avatar user="$news" size="m" itemprop="photo" />
                        </xen:if>
                    </div>
                </div>
 
                <div class="messageContent baseHtml">
                    <div class="postedBy">
                        <span class="posted">{xen:phrase by} <a href="{xen:link members, $news}" class="username">{$news.username}</a>
                        {xen:phrase at} <a href="{xen:link threads, $news}">{xen:time $news.post_date, 'absolute'}</a></span>
                        <span class="views">({$news.view_count} {xen:phrase views})</span>
                        <span class="comments"><a href="{xen:link threads, $news}">{$news.reply_count} {xen:phrase comments}</a></span>
                    </div>

                    <div class="newsText">{xen:raw $news.messageHtml}</div>
                    <div class="clearFix"></div>
                </div>

                <div class="sectionFooter {xen:if '{$option.social}', 'social'}">
                    <xen:if is="{$option.social}">
                        <xen:if hascontent="true">
                            <div class="sharePage">
                                <xen:require css="share_page.css" />

                                <xen:contentcheck>
                                    <xen:if is="{$xenOptions.tweet.enabled}">
                                        <div class="tweet shareControl">
                                            <a href="http://twitter.com/share" class="twitter-share-button"
                                                data-count="horizontal"
                                                data-lang="{xen:helper twitterLang, $visitorLanguage.language_code}"
                                                data-url="{xen:link canonical:threads, $news}"
                                                {xen:if {$news.title}, 'data-text="{$news.title}"'}
                                                {xen:if {$xenOptions.tweet.via}, 'data-via="{$xenOptions.tweet.via}"'}
                                                {xen:if {$xenOptions.tweet.related}, 'data-related="{$xenOptions.tweet.related}"'}>{xen:phrase tweet}</a>
                                        </div>
                                    </xen:if>
                                    <xen:if is="{$xenOptions.plusone}">
                                        <div class="plusone shareControl">
                                            <div class="g-plusone" data-size="medium" data-count="true" data-href="{xen:link canonical:threads, $news}" data-lang="{$visitorLanguage.language_code}"></div>
                                        </div>
                                    </xen:if>
                                    <xen:if is="{$xenOptions.facebookLike}">
                                        <div class="facebookLike shareControl">
                                            <xen:container var="$facebookSdk">1</xen:container>
                                            <fb:like href="{xen:link canonical:threads, $news}" layout="button_count" action="{$xenOptions.facebookLikeAction}" font="trebuchet ms" colorscheme="{xen:property fbColorScheme}"></fb:like>
                                        </div>
                                    </xen:if>
                                </xen:contentcheck>
                            </div>
                        </xen:if>
                    <xen:else />
                        {xen:phrase discussion_in_x_started_by_y_date_z, 'forum=<a href="{xen:link forums, $news}">{$news.node_title}</a>', 'name=<a href="{xen:link members, $news}" class="username">{$news.username}</a>', 'date=<a href="{xen:link threads, $news}">{xen:datetime $news.post_date, html}</a>'}
                    </xen:if>

                    <div class="continue">
                        <a href="{xen:link threads, $news}" style="background: transparent url('{xen:property imagePath}/xenforo/icons/redirect.png') no-repeat left bottom; padding-left: 20px;">
                            {xen:phrase continue_reading}
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </xen:foreach>

    <xen:if hascontent="true">
    <div class="section sectionMain">
        <xen:contentcheck>
        <xen:if is="{$xenOptions.EWRporta_breakout}">
            <div style="margin: -5px 0px; {xen:if '{$option.pagenav} && {$option.count} > {$option.limit}', 'float: right;'}">
                <xen:include template="EWRporta_Footer" />
            </div>
        </xen:if>
        <xen:if is="{$option.pagenav} && {$option.count} > {$option.limit}">
            <div style="margin-left: 5px;">
                <xen:pagenav link="portal" page="{$page}" perpage="{$option.limit}" total="{$option.count}" />
            </div>
        </xen:if>
        </xen:contentcheck>
    </div>
    </xen:if>
</div>]]></module_template>
  <module_stylesheet><![CDATA[.recentNews .subHeading { margin: -10px -10px 10px; }
.recentNews .subHeading a { color: {xen:property subHeading.color}; }
.recentNews .messageUserBlock { float: right; margin-left: 10px; }

.recentNews .newsDate { float: left; margin: 0px 10px 10px 0px; padding: 0px 10px 5px; width: 35px; font-weight: bold; text-align: center; }
.recentNews .newsDate .newsMonth { padding: 10px 0px 5px !important; margin: 0px -10px 5px !important; text-transform: uppercase; }
.recentNews .newsDate .newsDay { font-size: 26px; }

.recentNews .leftDate .newsDate { margin-left: -45px; }
.recentNews .leftDate .newsText { margin-left: 25px; }

.recentNews .messageContent { font-size: 13px; }
.recentNews .messageContent .postedBy { margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px dashed {xen:property primaryLighterStill}; }
.recentNews .messageContent .username { font-weight: bold; }
.recentNews .messageContent .posted { background: transparent url('{xen:property imagePath}/xenforo/icons/sticky.png') no-repeat left bottom; padding-left: 20px; }
.recentNews .messageContent .comments { float: right; background: transparent url('{xen:property imagePath}/xenforo/widgets/discussion-new.png') no-repeat left bottom; padding-left: 20px; font-weight: bold; }
.recentNews .messageContent .clearFix { clear: right; }

.recentNews .sectionFooter { margin: 10px -10px -10px; text-align: right; }
.recentNews .sectionFooter .continue { font-size: 12px; }
.recentNews .sectionFooter .continue a { background: transparent url('{xen:property imagePath}/xenforo/icons/redirect.png') no-repeat left bottom; padding-left: 20px; }
.recentNews .sectionFooter .continue a:hover { text-decoration: none; }
.recentNews .sectionFooter.social .continue { padding: 6px; }
.recentNews .sectionFooter .shareControl { float: left; margin-top: 4px !important; }
.recentNews .sectionFooter .sharePage::after { clear: none; }]]></module_stylesheet>
</module>
 
RecentNews2.php
Code:
<?php

class EWRporta_Block_RecentNews2 extends XenForo_Model
{
    public function getModule(&$options, $page)
    {
        $page = ($page - 1) * $options['limit'];

        $news = $this->_getDb()->fetchAll("
            SELECT xf_thread.*, xf_user.*, xf_post.message, xf_post.attach_count, xf_node.title AS node_title,
                IF(xf_user.username IS NULL, xf_thread.username, xf_user.username) AS username,
                IF(EWRporta_promotes.promote_date IS NULL, xf_thread.post_date, EWRporta_promotes.promote_date) AS promote_date
            FROM xf_thread
                LEFT JOIN xf_user ON (xf_user.user_id = xf_thread.user_id)
                INNER JOIN xf_post ON (xf_post.post_id = xf_thread.first_post_id)
                INNER JOIN xf_node ON (xf_node.node_id = xf_thread.node_id)
                LEFT JOIN EWRporta_promotes ON (EWRporta_promotes.thread_id = xf_thread.thread_id)
            WHERE (xf_thread.node_id IN (".$options['forum'].") OR EWRporta_promotes.promote_date < ?)
                AND xf_thread.discussion_state = 'visible'
                AND IF(EWRporta_promotes.promote_date IS NULL, xf_thread.post_date, EWRporta_promotes.promote_date) < ?
            ORDER BY promote_date DESC
            LIMIT ?, ?
        ", array(XenForo_Application::$time, XenForo_Application::$time, $page, $options['limit']));

        foreach ($news AS &$post)
        {
            $strtime = new DateTime(date('r', $post['promote_date']));
            $strtime->setTimezone(new DateTimeZone(XenForo_Application::get('options')->guestTimeZone));
            list($post['month'], $post['day']) = explode('.', $strtime->format('M.d'));

            if ($post['attach_count'])
            {
                $post['attachments'] = $this->getModelFromCache('XenForo_Model_Attachment')->getAttachmentsByContentId('post', $post['first_post_id']);
                $post['attachments'] = $this->getModelFromCache('XenForo_Model_Attachment')->prepareAttachments($post['attachments']);
            }

            $post = $this->getThumb($post);
            $post['message'] = str_ireplace('prbreak]', 'prebreak]', $post['message']);
            $post['message'] = preg_replace('#\n{3,}#', "\n\n", trim($post['message']));

            if ($trimLoc = stripos($post['message'], '[prebreak]'))
            {
                $prbreak = '';

                if (($breakLoc = stripos($post['message'], '[/prebreak]', $trimLoc+10)) && ($length = $breakLoc - $trimLoc-10))
                {
                    $link = XenForo_Link::buildPublicLink('full:threads', $post);
                    $prbreak = " [url='".$link."']".substr($post['message'], $trimLoc+10, $length).'[/url]...';
                }

                $post['message'] = substr($post['message'], 0, $trimLoc).$prbreak;
            }
            else
            {
                $post['message'] = XenForo_Helper_String::wholeWordTrim($post['message'], $options['truncate']);
            }
        }

        $options['parseBB'] = true;
        $options['count'] = $this->getCount($options);

        return $news;
    }

    public function getCount($options)
    {
        $count = $this->_getDb()->fetchRow("
            SELECT COUNT(*) AS total
                FROM xf_thread
                LEFT JOIN EWRporta_promotes ON (EWRporta_promotes.thread_id = xf_thread.thread_id)
            WHERE (xf_thread.node_id IN (".$options['forum'].") OR EWRporta_promotes.promote_date < ?)
                AND xf_thread.discussion_state = 'visible'
                AND IF(EWRporta_promotes.promote_date IS NULL, xf_thread.post_date, EWRporta_promotes.promote_date) < ?
        ", array(XenForo_Application::$time, XenForo_Application::$time));

        return $count['total'];
    }

    public function getThumb($post)
    {
        if (preg_match('#\[medio\](\d+)\[/medio\]#i', $post['message'], $matches))
        {
            if ($post['medio'] = $this->getModelFromCache('EWRmedio_Model_Media')->getMediaByID($matches[1]))
            {
                $post['message'] = str_ireplace('[medio]'.$matches[1].'[/medio]', '', $post['message']);
                $post['message'] = str_ireplace('[medio=full]'.$matches[1].'[/medio]', '', $post['message']);
                return $post;
            }
        }

        if (!empty($post['attachments']))
        {
            foreach ($post['attachments'] AS $attach)
            {
                if ($attach['thumbnailUrl'])
                {
                    $post['attach'] = $attach;
                    $post['message'] = str_ireplace('[attach]'.$attach['attachment_id'].'[/attach]', '', $post['message']);
                    $post['message'] = str_ireplace('[attach=full]'.$attach['attachment_id'].'[/attach]', '', $post['message']);
                    return $post;
                }
            }
        }

        if (preg_match('#\[img\](.+?)\[/img\]#i', $post['message'], $matches))
        {
            $post['image'] = $matches[1];
            $post['message'] = str_ireplace('[img]'.$matches[1].'[/img]', '', $post['message']);
            return $post;
        }

        return $post;
    }
}
 

Hello Everyone

Where can I see all (Module Add-Ons) for finding XenPorta

If you want a module added to the list, just attach it to a post on this thread and then send me a private message...
Module makers are supposed to PM Jaxel and he is supposed to add their module to the list in the first post.
Maybe someone could make a list of all the modules not in the first post and Jaxel can add them at once ?
Maybe they are all there ?
 
Anyone interested in making a Tabbed Module that can display different news posts with-in each tab? Willing to PAY :)
 
Hi,

I faced a strange issue,
when I go to : /portal/modules/ it redirects to the website home (the portal). so I am not able to enable or edit the modules.

Any help is appreciated
 
Hi,

I faced a strange issue,
when I go to : /portal/modules/ it redirects to the website home (the portal). so I am not able to enable or edit the modules.

Any help is appreciated
Permissions.
You need to give yourself permission to... "Can Administrate Portal".
 
TwitterProfile addon module ... tracks tweets by username

Code:
<?xml version="1.0" encoding="utf-8"?>
<module>
  <module_name>TwitterProfile</module_name>
  <module_cache>now</module_cache>
  <module_settings>
    <tw_user desc="Twitter user" format="string" options="">twitter</tw_user>
    <tw_tweets desc="Number of tweets" format="string" options="">4</tw_tweets>
    <tw_scrollbar desc="Scrollbar?" format="string" options="">false</tw_scrollbar>
    <tw_hashtags desc="Hashtags?" format="string" options="">true</tw_hashtags>
    <tw_avatars desc="Avatars?" format="string" options="">true</tw_avatars>
  </module_settings>
  <module_template><![CDATA[<div class="messageText ugc baseHtml">

      <div class="secondaryContent">

        <div style="text-align: center">

<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: {$option.tw_tweets},
  interval: 30000,
  width: 250,
  height: 300,
  theme: {
    shell: {
      background: '#333333',
      color: '#ffffff'
    },
    tweets: {
      background: '#000000',
      color: '#ffffff',
      links: '#4aed05'
    }
  },
  features: {
    scrollbar: {$option.tw_scrollbar},
    loop: false,
    live: false,
    hashtags: {$option.tw_hashtags},
    timestamp: true,
    avatars: {$option.tw_avatars},
    behavior: 'all'
  }
}).render().setUser('{$option.tw_user}').start();
</script>

        </div>
    </div>

    </div>
    ]]></module_template>
</module>
 
TwitterSearch addon module

Code:
<?xml version="1.0" encoding="utf-8"?>
<module>
  <module_name>TwitterSearch</module_name>
  <module_cache>now</module_cache>
  <module_settings/>
  <module_template><![CDATA[<div class="messageText ugc baseHtml">

      <div class="secondaryContent">

        <div style="text-align: center">

<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'search',
  search: 'comics webcomics cartoons',
  interval: 30000,
  title: '',
  subject: 'Comics Webcomics Cartoons',
  width: 250,
  height: 300,
  theme: {
    shell: {
      background: '#8ec1da',
      color: '#ffffff'
    },
    tweets: {
      background: '#ffffff',
      color: '#444444',
      links: '#1985b5'
    }
  },
  features: {
    scrollbar: false,
    loop: true,
    live: true,
    hashtags: true,
    timestamp: true,
    avatars: true,
    toptweets: true,
    behavior: 'default'
  }
}).render().start();
</script>

        </div>
    </div>

    </div>
    ]]></module_template>
</module>
 
  • Like
Reactions: Lqd
Top Bottom