vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=253)
-   -   CMS Articles Forum Block (https://vborg.vbsupport.ru/showthread.php?t=288051)

Thr33 09-20-2012 12:36 AM

CMS Articles Forum Block
 
My current code.
Code:

<vb:each from="articles" key="articleid" value="article">
<div class="article-block">
&bull; <a href="{vb:raw article.url}"><b>{vb:raw article.title}</b></a> by {vb:raw article.lastposter}
<div style="padding: 0px 0px 2px 14px;"><img src='images/literecords/misc/view-icon.png' alt='' class='inlineimg' /> {vb:raw article.replycount} comments</div></div>
</vb:each>

Ive been looking round to try and find the variable to show the view count, with no luck. Ive tried:
{vb:raw article.viewcount}
{vb:raw viewcount}
{vb:rawphrase article.viewcount}

Any help?

Lynne 09-20-2012 01:09 AM

This is template code for a forum block? What is the PHP code you are adding to the php block?

Thr33 09-20-2012 03:16 PM

Yeah this is the template code that is now the CMS forum block. I can get it to show the article.title and article.replycount but I can't find how to display the article.viewcount.

Lynne 09-20-2012 03:49 PM

I am still unclear on the php code you are using, but whatever it is, you need to make sure the variable is defined in there and then pre-registered for use in that template.

Thr33 09-20-2012 08:11 PM

This being said, how come the {vb:raw article.replycount}, {vb:raw article.url} and {vb:raw article.title} are working?

In the new forum block (cms_block) I am able to call the 3 above variables but not {vb:raw article.viewcount}. This is problem. I've not added any php code within the basic forum block form, I have edited the template itself and just enabled the new edited CMS forum block.

Lynne 09-20-2012 10:05 PM

It's not defined in /includes/block/cmsarticles.php to be used in the template. You need to modify that code to be able to use that variable.

Thr33 09-20-2012 10:18 PM

Could you suggest how i could modify my code to be able to call that function from the articles template?

Lynne 09-21-2012 01:04 AM

Your code? So you do have some code you added?

If you are asking about the default vbulletin code, you just need to add a new variable for it around lines 188-200. If you use $row['something'] as your variable, you shouldn't have to register it.


All times are GMT. The time now is 11: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.01042 seconds
  • Memory Usage 1,718KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete