vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Sidebar Block CMS Article - Image instead of avatar (https://vborg.vbsupport.ru/showthread.php?t=273444)

Lynne 05-16-2012 04:00 PM

The stuff in the first post is specific to the block of type "CMS Articles". If you are doing this for a different block type, then you need to apply similar changes to the appropriate template and file for the block you are trying to modify. So, if that is what you are doing, then post your block type and the exact files and templates you are changing along with what you changed.

kh99 05-16-2012 04:05 PM

Quote:

Originally Posted by Lynne (Post 2329906)
The stuff in the first post is specific to the block of type "CMS Articles".

Oops...I was wrong. Sorry about that.

afcbob 05-16-2012 05:40 PM

It was a forum thread block, its just the default template and changed the same files thats on the first page.

Lynne 05-16-2012 08:52 PM

Quote:

Originally Posted by afcbob (Post 2329962)
It was a forum thread block, its just the default template and changed the same files thats on the first page.

And, as I already said, you CANNOT change the same files as in the first page because that is for a different block. You need to edit the appropriate file (/includes/block/threads.php) and the appropriate template (block_threads) for what you are doing.

johnnymc7 06-17-2012 05:50 PM

I followed all instructions and Im getting no joy :-/

--------------- Added [DATE]1339960543[/DATE] at [TIME]1339960543[/TIME] ---------------

In my recent articles block on the front page all that is happening is the avatar has disappeared


block_cmsarticles
Code:

<li>
        <div class="block smaller">
                <div class="blocksubhead">
                        <a class="collapse" id="collapse_block_cmsarticles_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_cmsarticles_{vb:raw blockinfo.blockid}"/></a>
                        <img src="{vb:stylevar imgdir_cms}/widget-article.png" alt="" />
                        <span class="blocktitle">{vb:raw blockinfo.title}</span>
                </div>
                <div class="widget_content blockbody floatcontainer">
                <ul id="block_cmsarticles_{vb:raw blockinfo.blockid}" class="blockrow">
                        <vb:each from="articles" key="articleid" value="article">
                        <li class="noavatarcontent floatcontainer widget_post_bit">
                                <div class="widget_post_userinfo"></div>
<vb:if condition="$article['previewimage']">
<img alt="previewimage" src="{vb:raw article.previewimage}"  with="250" height="250" />
</vb:if>
                                <div class="smallavatartext widget_post_comment_noavatar">
                                        <h5 class="widget_post_header"><a href="{vb:raw article.url}" class="title">{vb:raw article.title}</a></h5>
                                        <p class="widget_post_content">{vb:raw article.message}</p>
                                        <div class="meta">
                                                <vb:if condition="$articlestype == 0">
                                                {vb:stylevar dirmark}(1{vb:rawphrase x_comments, {vb:raw article.replycount}})
                                                </vb:if>
                                        </div>
                                </div>
                        </li>
                        </vb:each>
                </ul>
                </div>
        </div>
        <div class="underblock"></div>
</li>

and in includes/block/cmsarticles.php

Code:

$results = $this->registry->db->query_read_slave("
                        SELECT cms_article.contentid, cms_article.pagetext as message,
                                cms_article.previewimage, cms_article.previewvideo,
                                cms_node.nodeid, cms_node.url, cms_node.publishdate,
                                cms_nodeinfo.title,
                                thread.replycount, thread.lastpost as lastpostarticle, thread.lastposter, thread.lastpostid, thread.lastposterid,
                                user.*
                                " . ($this->registry->options['avatarenabled'] ? ",avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width AS avwidth,customavatar.height AS avheight" : "") . "
                        FROM " . TABLE_PREFIX . "cms_article AS cms_article


Lynne 06-17-2012 11:55 PM

Can we get a link to see the problem?

johnnymc7 06-24-2012 08:20 PM

Sorry Lynne in my delaying in replying to you. Heres my site http://www.irishdrumandbass.com/content.php as you can see the article block is at the bottom with no images for any of the articles

Thanks

John

Lynne 06-25-2012 02:36 AM

I don't think you have edited the correct template (or else I am not looking at the correct style). This is in the page source where the image should be:

HTML Code:

                        <div class="cms_widget_post_bit widget_post_bit">
                                <div class="cms_widget_post_userinfo widget_post_userinfo">
                                        <div class="cms_widget_post_useravatar widget_post_useravatar">
                                               
                                                        <img alt="" src="images/misc/unknown.gif" />
                                               
                                        </div>
                                </div>
                                <div class="cms_widget_post_comment widget_post_comment">

None of that is in the template code you posted above.

johnnymc7 06-25-2012 07:22 AM

Hi Lynne, thanks for the reply.

I only have one style its the default style with some changes. Ive edited block_cmsarticles in vbulletin and then I edited /includes/block/cmsarticles.php in my text editor. I can see all edits when I look there so Im really confused :(

Lynne 06-25-2012 03:12 PM

Do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around that part of the code. What is the template name that surrounds that widget?

Then


All times are GMT. The time now is 02:43 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01345 seconds
  • Memory Usage 1,754KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete