PDA

View Full Version : need help on widget


Kavada
08-07-2012, 06:28 AM
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
Hi Lynne. So basically, I have been trying to understand how to substitute this line of 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.

Kavada
08-08-2012, 11:31 PM
I would rather have someone else do it, since i'm not too confident on my coding skills.
Would be very thankful if you helped code it ;)

Lynne
08-09-2012, 02:58 PM
Sorry, but if I had time to do that, then I would help out, but I'm quite busy between here and home life.

Kavada
08-09-2012, 07:17 PM
can we pay you lynne?

Lynne
08-09-2012, 08:13 PM
Sorry, but no. I don't take on any modification jobs from here. You could post in the Request for Paid Services forum if you wish to pay someone to do it.