PDA

View Full Version : A question about header images/gallery


mreyes
10-22-2008, 09:22 PM
I currently have GARS setup in such a way that members can upload new header images and add them to the gallery.

However as time goes by this gallery is getting very large as most members upload a unique image every time they post. So the question is can I disable gallery selections and still allow image uploads? Also, if the user decides to not upload it uses a default image.

Alternatively, is there any way to display an uploaded thumbnail (from a "Thumbnail to original image upload" custom field) agaisnt the item entry on the GARS forumdisplay page (i.e. where the normal gallery pic would be displayed)

Morgan
10-23-2008, 03:43 PM
Untested but look for the following in the gars_class_edit.php file and add the bold red bit to be rid of the gallery bits:

if (1==2 && $this->settings['ugs_allow_gallery'] && !$typeinfo['noheader'])

If that doesn't do what you want, again untested, but in the gars_class_edit.php file find the second occurrence of the following and add the bold red bit:

if (1==2 && is_dir($path))

Also untested but you could instead add a template conditional to the GARS_gallery_bit template to be rid of some bits:

<if condition="in_array($gallery_image, array('LINK1', 'LINK2', 'LINK3'))">
template content here
</if>

For default images go to the ACP -> GARS -> Types -> click a type -> Header image info. More information about this section can be found here (http://www.thevbgeek.com/geeki/index.php/Types#Header_Image_info).

mreyes
10-23-2008, 08:43 PM
Hi Morgan,

thanks for the reply, oddly enough between posting and seeing your reply I had tried similar ish hacks and got it to work, however....

After messing around for a while it just wasn't quite was I looking for so I reverted the code back to default and I have disable the header gallery and image uploads. Now members can optionally upload an image via a ""Thumbnail to original image upload" custom field.

All of which leads me to a question I asked badly before, is there anyway to display this uploaded thumbnail against the listing title/summary on GARS forumdisplay pages?

mreyes
10-27-2008, 12:32 PM
Problem Solved :)

It turns out that the select statement that populates the forumdisplay page already includes any custom fields the entry might have.

So it was then just a question of creating a custom template set that used a custom template for forum display. In this template where it would normally show the header/gallery image this now displays the thumbnail if the user uploaded one and a default if they didn't. If they click the image the user is taken to the showthread page. Job done.

The only gotcha for this was that the value of the thumbnail image custom fields is in the following format:

url to thumbnail,url to full image

So I had to hack the "GARS - Threadbit Display | threadbit_display" plugin to parse out the path to the thumbnail with a simple split command and put it into a "$thread['ForumDisplayThumb']" variable so it can be used in the template. If on template parse this value isn't set the template (via a conditional) displays a default placeholder image.