Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-07-2012, 06:28 AM
Kavada Kavada is offline
 
Join Date: Jul 2012
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 08-07-2012, 04:23 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 08-07-2012, 06:53 PM
Kavada Kavada is offline
 
Join Date: Jul 2012
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 08-07-2012, 10:25 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 08-08-2012, 01:04 AM
Kavada Kavada is offline
 
Join Date: Jul 2012
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Attached Images
File Type: png HELPHP.png (507.2 KB, 0 views)
Reply With Quote
  #6  
Old 08-08-2012, 01:07 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 08-08-2012, 01:16 AM
Kavada Kavada is offline
 
Join Date: Jul 2012
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 08-08-2012, 05:30 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 08-08-2012, 08:31 PM
Kavada Kavada is offline
 
Join Date: Jul 2012
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 08-08-2012, 10:21 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:56 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.04344 seconds
  • Memory Usage 2,268KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete