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

Status
Not open for further replies.
Okay for anyone who doesn't want their avatar block to be used for the first posted media (i mean seriously why is there no option to disable that - am i the only one it annoys as it messes up the articles you post).

I actually figured it out, on RecentNews.php block, comment out the code inside the bottom function called
public function getDefault($post)


To make it look like this;
PHP:
    public function getDefault($post)
    {/*
        if (preg_match('#\[medio\](\d+)\[/medio\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['medio'] = $this->getMedio($post);
            return $post;
        }
       
        if (!empty($post['attachments']))
        {
            foreach ($post['attachments'] AS $attach)
            {
                if ($attach['thumbnailUrl'])
                {
                    $post['promote_data'] = $attach['attachment_id'];
                    $post['attach'] = $this->getAttach($post);
                    return $post;
                }
            }
        }
 
        if (preg_match('#\[img\](.+?)\[/img\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['image'] = $this->getImage($post);
            return $post;
        }
        */
        return $post;
    }
 
Hmmm, I copied and pasted your code, buy my avatar is still showing up.

This is exactly what I have now:

Code:
 public function getDefault($post)
    {
    /*
        if (preg_match('#\[medio\](\d+)\[/medio\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['medio'] = $this->getMedio($post);
            return $post;
        }
     
        if (!empty($post['attachments']))
        {
            foreach ($post['attachments'] AS $attach)
            {
                if ($attach['thumbnailUrl'])
                {
                    $post['promote_data'] = $attach['attachment_id'];
                    $post['attach'] = $this->getAttach($post);
                    return $post;
                }
            }
        }
 
        if (preg_match('#\[img\](.+?)\[/img\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['image'] = $this->getImage($post);
            return $post;
        }
        */
        return $post;
    }
}
 
When I try to install XenPorta I get the following error:
Code:
provided_file_is_not_a_block_xml_file
What is causing this? This is the only mod I can't install.

@Jaxel @Liam Dawe
 
Maybe I'm not understanding then. I thought if you didn't have any media, your avatar would show as the "preview" image. Because when a news post does have a picture in it, the image shows (which I think is correct) but no image = avatar.
 
I converted to XenForo from vBulletin and I installed XenPorta.
vBulletin was installed in domain.com/forum, xenforo is installed on domain.com/
I redirected all the url with Kier's script from /forum/ to /

Now I want to use , all the content of the forum moves to /forum/ and get redirected to the root from the Kier's script so only the homepage is visible.

someone got the same problem?

Delete or rename folder /forum/

Upload Redirection Scripts in /vb/ folder

Edit $fileDir in 301config.php to provide the path to the XenForo directory

Add to your .htaccess file:

#Redirect url /forum/ to /vb/ fix for friendly url
RewriteCond %{REQUEST_URI} ^/forum/showthread\.php$
RewriteRule ^(.*)$ /vb/showthread.php [R=301,L]
RewriteCond %{REQUEST_URI} ^/forum/forumdisplay\.php$
RewriteRule ^(.*)$ /vb/forumdisplay.php [R=301,L]
RewriteCond %{REQUEST_URI} ^/forum/showpost\.php$
RewriteRule ^(.*)$ /vb/showpost.php [R=301,L]
RewriteCond %{REQUEST_URI} ^/forum/printthread\.php$
RewriteRule ^(.*)$ /vb/printthread.php [R=301,L]
RewriteCond %{REQUEST_URI} ^/forum/member\.php$
RewriteRule ^(.*)$ /vb/member.php [R=301,L]
RewriteCond %{REQUEST_URI} ^/forum/attachment\.php$
RewriteRule ^(.*)$ /vb/attachment.php [R=301,L]
#end


htaccess file:



Code:
#    Mod_security can interfere with uploading of content such as attachments. If you
#    cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#    SecFilterEngine Off
#    SecFilterScanPOST Off
#</IfModule>
 
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default
 
<IfModule mod_rewrite.c>
    RewriteEngine On
 
    #    If you are having problems with the rewrite rules, remove the "#" from the
    #    line that begins "RewriteBase" below. You will also have to change the path
    #    of the rewrite to reflect the path to your XenForo installation.
    #RewriteBase /xenforo
 
    #    This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
 
      #Redirect url /forum/ to /vb/ fix for friendly url
      RewriteCond %{REQUEST_URI}  ^/forum/showthread\.php$
      RewriteRule ^(.*)$ /vb/showthread.php [R=301,L]
      RewriteCond %{REQUEST_URI}  ^/forum/forumdisplay\.php$
      RewriteRule ^(.*)$ /vb/forumdisplay.php [R=301,L]
      RewriteCond %{REQUEST_URI}  ^/forum/showpost\.php$
      RewriteRule ^(.*)$ /vb/showpost.php [R=301,L]
      RewriteCond %{REQUEST_URI}  ^/forum/printthread\.php$
      RewriteRule ^(.*)$ /vb/printthread.php [R=301,L]
      RewriteCond %{REQUEST_URI}  ^/forum/member\.php$
      RewriteRule ^(.*)$ /vb/member.php [R=301,L]
      RewriteCond %{REQUEST_URI}  ^/forum/attachment\.php$
      RewriteRule ^(.*)$ /vb/attachment.php [R=301,L]
      #end
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
              </IfModule>
 
Maybe I'm not understanding then. I thought if you didn't have any media, your avatar would show as the "preview" image. Because when a news post does have a picture in it, the image shows (which I think is correct) but no image = avatar.

While I try not to get annoyed easily I reallly dislike repeating myself but then it may be me not being clear enough, truth is in my quote of myself;

Okay for anyone who doesn't want their avatar block to be used for the first posted media
It can't be any more simple than that, cutting out this php code from the recent news block stops the media being used in the avatar or "preview" area, for people who don't want it happening as it can mess with their formatting or for people like me who remove that avatar bit altogether.

As for someone like me who has removed the avatar bit, when i include media in my post it still would of course auto-grab the first bit of available media (as there is no option to turn it off).

Hope that is clearer.
 
While I try not to get annoyed easily I reallly dislike repeating myself but then it may be me not being clear enough, truth is in my quote of myself;


It can't be any more simple than that, cutting out this php code from the recent news block stops the media being used in the avatar or "preview" area, for people who don't want it happening as it can mess with their formatting or for people like me who remove that avatar bit altogether.

As for someone like me who has removed the avatar bit, when i include media in my post it still would of course auto-grab the first bit of available media (as there is no option to turn it off).

Hope that is clearer.


Thank you for the detailed explanation, because I never knew you removed the avatar bit. I suppose that's what I would like to do, if I have media there, I'd like it to show in the preview, but never my avatar. So I think we both want or like the same layout. Could you show me how to remove the avatar part so my media images will re-appear ?
 
Okay for anyone who doesn't want their avatar block to be used for the first posted media (i mean seriously why is there no option to disable that - am i the only one it annoys as it messes up the articles you post).

I actually figured it out, on RecentNews.php block, comment out the code inside the bottom function called



To make it look like this;
PHP:
    public function getDefault($post)
    {/*
        if (preg_match('#\[medio\](\d+)\[/medio\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['medio'] = $this->getMedio($post);
            return $post;
        }
   
        if (!empty($post['attachments']))
        {
            foreach ($post['attachments'] AS $attach)
            {
                if ($attach['thumbnailUrl'])
                {
                    $post['promote_data'] = $attach['attachment_id'];
                    $post['attach'] = $this->getAttach($post);
                    return $post;
                }
            }
        }
 
        if (preg_match('#\[img\](.+?)\[/img\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['image'] = $this->getImage($post);
            return $post;
        }
        */
        return $post;
    }


Why you call other function that do nothing?

Just comment out the code:

PHP:
if (empty($post['showIcon']))
                {
                    $post = $this->getDefault($post);
                }
 
Thanks, I'm not a coder, just learning this so something that might be that simple to you, looks like a foreign language to me. But, I'm trying :)

I did exactly what you said, but still the only showing is my avatar, not the preview image. I could be missing something really simple. Thanks for all this help!

Here is a couple snippets of the code I edited to show your suggestion:

Code:
if ($post['promote_icon'] != 'disabled')
            {
                switch ($post['promote_icon'])
                {
                    case 'avatar':        $post['showIcon'] = true;                                                        break;
                    case 'attach':        if ($post['attach'] = $this->getAttach($post)) { $post['showIcon'] = true; }    break;
                    case 'image':        if ($post['image'] = $this->getImage($post)) { $post['showIcon'] = true; }        break;
                    case 'medio':        if ($post['medio'] = $this->getMedio($post)) { $post['showIcon'] = true; }        break;
                }
/*
                if (empty($post['showIcon']))
                {
                    $post = $this->getDefault($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 = '';
 
Okay for anyone who doesn't want their avatar block to be used for the first posted media (i mean seriously why is there no option to disable that - am i the only one it annoys as it messes up the articles you post).

I actually figured it out, on RecentNews.php block, comment out the code inside the bottom function called


To make it look like this;
PHP:
    public function getDefault($post)
    {/*
        if (preg_match('#\[medio\](\d+)\[/medio\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['medio'] = $this->getMedio($post);
            return $post;
        }
     
        if (!empty($post['attachments']))
        {
            foreach ($post['attachments'] AS $attach)
            {
                if ($attach['thumbnailUrl'])
                {
                    $post['promote_data'] = $attach['attachment_id'];
                    $post['attach'] = $this->getAttach($post);
                    return $post;
                }
            }
        }
 
        if (preg_match('#\[img\](.+?)\[/img\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['image'] = $this->getImage($post);
            return $post;
        }
        */
        return $post;
    }
If only is for medio purposes, try with
PHP:
    public function getDefault($post)
    {
/*        if (preg_match('#\[medio\](\d+)\[/medio\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['medio'] = $this->getMedio($post);
            return $post;
        }*/
     
        if (!empty($post['attachments']))
        {
            foreach ($post['attachments'] AS $attach)
            {
                if ($attach['thumbnailUrl'])
                {
                    $post['promote_data'] = $attach['attachment_id'];
                    $post['attach'] = $this->getAttach($post);
                    return $post;
                }
            }
        }
 
        if (preg_match('#\[img\](.+?)\[/img\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['image'] = $this->getImage($post);
            return $post;
        }
       
        return $post;
    }
So will images img and Attach.

Salud2
 
... if I have media there, I'd like it to show in the preview, but never my avatar.

Empty block chacke.
Your media has to be inserted inside the depth of the "Max Summary Length" setting.

If You have media in the post (img, medio, attach) your avatar won't show up otherwise it will appear in the avatar holder.

Comment out commented lines as seen in the example below in your RecentNews.php:


PHP:
 public function getAttach(&$post)
    {
        if (!empty($post['attachments'][$post['promote_data']]))
        {
            if ($post['attachments'][$post['promote_data']]['thumbnailUrl'])
            {
                $post['message'] = str_ireplace('[attach]'.$post['promote_data'].'[/attach]', '', $post['message']);
                //$post['message'] = str_ireplace('[attach=full]'.$post['promote_data'].'[/attach]', '', $post['message']);
                return $post['attachments'][$post['promote_data']];
            }
        }

        return false;
    }

PHP:
    public function getImage(&$post)
    {
        //$post['message'] = str_ireplace('[img]'.$post['promote_data'].'[/img]', '', $post['message']);
        return $post['promote_data'];
    }

PHP:
    public function getMedio(&$post)
    {
        if (XenForo_Application::autoload('EWRmedio_Model_Media'))
        {
            if ($medio = $this->getModelFromCache('EWRmedio_Model_Media')->getMediaByID($post['promote_data']))
            {
                //$post['message'] = str_ireplace('[medio]'.$post['promote_data'].'[/medio]', '', $post['message']);
                $post['message'] = str_ireplace('[medio=full]'.$post['promote_data'].'[/medio]', '', $post['message']);
                return $medio;
            }
        }

        return false;
    }

Edit EWRblock_RecentNews template:

PHP:
<xen:if is="{$news.promote_icon} != 'disabled'">
                <xen:if hascontent="true">
                    <div class="messageUserBlock">
                        <div class="avatarHolder">
                            <xen:contentcheck>
                            <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>
                            </xen:contentcheck>
                        </div>
                    </div>
                </xen:if>
                </xen:if>
Replace with:

PHP:
<xen:if is="{$news.promote_icon} != 'disabled'">
                <xen:if hascontent="true">
                            <xen:contentcheck>
                            <xen:if is="{$news.attach}">          
                            <xen:elseif is="{$news.medio}" />                       
                            <xen:elseif is="{$news.image}" />                                
                            <xen:else />
                            <div class="messageUserBlock">
                                 <div class="avatarHolder">
                                    <xen:avatar user="$news" size="m" itemprop="photo" />
                                 </div>
                            </div>
                            </xen:if>
                            </xen:contentcheck>
                       
                </xen:if>
                </xen:if>
 
Again, thanks a ton for the help ... avatar is not showing, which is great, but the full sized image is. In the 1.4.4 version of EWRPorta, it used to be an image preview (about the size of an avatar) that was showing and when the reader clicked "continue reading" It would be the full image and rest of the article.
 
I am using the RecentNews module on my site to one specific forum. The problem is every post in that one forum has some text and then a block of html between parsehtml tags. What I want to do is either stop displaying anything after and including the opening parsehtml tag or strip the tags and everything between them from the message.

This would need to be done I believe in the php module with a code block being applied to the message component.

Can anyone please help in providing what that code would be...thanks greatly if you can
 
Again, thanks a ton for the help ... avatar is not showing, which is great, but the full sized image is. In the 1.4.4 version of EWRPorta, it used to be an image preview (about the size of an avatar) that was showing and when the reader clicked "continue reading" It would be the full image and rest of the article.

Use default RecentNews.php // best possible options

Replace your EWRblock_RecentNews template with:


Code:
<xen:require css="message_user_info.css" />
<xen:require css="bb_code.css" />
<xen:require css="EWRblock_RecentNews.css" />
 
<div id="recentNews">
    <xen:foreach loop="$RecentNews" value="$news">
        <div class="section sectionMain recentNews" id="{$news.thread_id}">
 
            <div class="primaryContent {xen:if {$option.leftdate}, '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}" class="newsTitle">{$news.title}</a>
                </div>
 
                <div class="newsDate secondaryContent">
                    <div class="newsMonth heading">{$news.month}</div>
                    <div class="newsDay">{$news.day}</div>
                </div>
 
                <xen:if is="{$news.promote_icon} != 'disabled'">
                <xen:if hascontent="true">
                            <xen:contentcheck>
                            <xen:if is="{$news.attach}">         
                            <xen:elseif is="{$news.medio}" />                     
                            <xen:elseif is="{$news.image}" />                               
                            <xen:else />
                            <div class="messageUserBlock">
                                <div class="avatarHolder">
                                    <xen:avatar user="$news" size="m" itemprop="photo" />
                                </div>
                            </div>
                            </xen:if>
                            </xen:contentcheck>
                     
                </xen:if>
                </xen:if>
 
                <div class="messageContent baseHtml">
                    <div class="postedBy">
                        <span class="posted">{xen:phrase by_x_at_y,
                            'user=<a href="{xen:link members, $news}" class="username">{$news.username}</a>',
                            'date=<a href="{xen:link threads, $news}">{xen:time $news.post_date, 'absolute'}</a>'}</span>
                        <span class="views">({$news.view_count} {xen:phrase views} / {$news.first_post_likes} {xen:phrase likes})</span>
                        <span class="comments"><a href="{xen:link threads, $news}">{$news.reply_count} {xen:phrase comments}</a></span>
                    </div>
 
                    <div class="newsText">
                                        <xen:if is="{$news.promote_icon} != 'disabled'">
                <xen:if hascontent="true">
                    <div class="messageUserBlock">
                        <div class="avatarHolder">
                            <xen:contentcheck>
                            <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:if>
                            </xen:contentcheck>
                        </div>
                    </div>
                </xen:if>
                </xen:if>
 
                                        {xen:raw $news.messageHtml}</div>
                    <div class="clearFix"></div>
                </div>
 
                <div class="sectionFooter">
                    <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="@fbColorScheme"></fb:like>
                                        </div>
                                    </xen:if>
                                </xen:contentcheck>
                            </div>
                        </xen:if>
                    <xen:else />
                        <div class="source">
                            {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>'}
                        </div>
                    </xen:if>
 
                    <div class="continue">
                        <a href="{xen:link threads, $news}" style="background: transparent url('@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="{$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>
 
Sweet !! Thanks working a lot better. If there's an image in the post, then it shows the preview, if no image, avatar still shows. Is it possible to get that or am I just stuck with it this way?

THANKS A TON for the help!
 
Hey. I added the two pieces of code in the Thread_View and Forum_View and i have set the settings but nothing to have changed. I can do the widgets in the sidebar but i dont see the split up between sticky threads and the normal threads. What do i need to do?
 
Status
Not open for further replies.
Top Bottom