vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   need help on widget (https://vborg.vbsupport.ru/showthread.php?t=286407)

Kavada 08-07-2012 06:28 AM

need help on widget
 
I'm trying to figure out how to have a recent thread widget pull an img instead of text. for example: something on the lines of the Active Member Journals on the right hand side of this forum.
http://www.iwsti.com/
any advice would be great

Lynne 08-07-2012 04:23 PM

Try a search because I helped someone do this a couple of months ago. I can't remember if it was a forum block or a widget, but you need to modify the query and then modify the template.

Kavada 08-07-2012 06:53 PM

I have searched for a good 30 minutes but it seems everyone has the same question as mw but it never gets answered.I'm sure it's just a small line of code im missing and its killing me. any help Lynne would be great

Lynne 08-07-2012 10:25 PM

It is for the forum blocks, but it is the same basic changes that need to be made. https://vborg.vbsupport.ru/showthread.php?t=273444

If you get stuck, do not just say "it didn't work". Post *exactly* what it is you want to do (images help) and tell us *exactly* what templates you modified (with before/after code in code tags) and *exactly* what file you modified (with before/after code in code tags). We cannot help you if you do not provide those things.

Kavada 08-08-2012 01:04 AM

1 Attachment(s)
Hi Lynne. So basically, I have been trying to understand how to substitute this line of code:

Code:

<p class="cms_widget_post_content widget_post_content">{vb:raw thread.previewtext}</p>
and switch it out with an image from the forum thread. What I'm trying to achieve is an image thumbnail. If you would like to get an idea of what I'm talking about, check out this forum http://www.iwsti.com and then scroll down to "Active Member Journals". This is exactly what I want to do!!!

None of the code in vbcms_widget_recentthreads_page has been changed. HELP

Lynne 08-08-2012 01:07 AM

I just linked you to a thread that talks about how to do that. You need to modify the widget query first and then use that new variable in the template. Did you read the thread I linked you to? Did you find the query code?

Kavada 08-08-2012 01:16 AM

Can you navigate me to where i can modify the widget query and show me where to find that query code ? Been trying to figure this out for the past 2 days

Lynne 08-08-2012 05:30 PM

The widget code is in /vb/vbcms/widgets/ So, find the appropriate script for the widget you are trying to modify there. I would guess it is the recentthreads.php script and the query is near the bottom of the file.

Kavada 08-08-2012 08:31 PM

Okay so i just located the recentthreads.php file in /packages/vbcms/widgets/recentthreads.php

what exactly do i need to change to get an image/attachment rather than text in the recent threads widget.

Lynne 08-08-2012 10:21 PM

Did you read that thread I linked you to before? You need to modify the query to join with the attachment table and grab an attachment also. Since it isn't a cms article you are trying to just get a preview image for, it's going to be a bit tricky since you will also have to write some code to resize the image. Do you code at all because you will definitely have to write some code for this. If you don't know how to code at all, then you probably want to post in either the Unpaid or Paid Requests area to have someone else code it for you.


All times are GMT. The time now is 10:27 PM.

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.01051 seconds
  • Memory Usage 1,728KB
  • 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)pagenav
  • (1)pagenav_curpage
  • (1)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