Competitions for XenForo [Deleted]

Yeah. I had Attachment Store compatibility in mind while developing it :)

Unless you have any more suggestions @xfrocks, then I'm more than happy for @MattW to send you a copy of the add-on in case you wish to review anything.

I really ought to buy a copy of Attachment Store myself and get a CDN service set up but I haven't had time yet :)
 
Yeah. I had Attachment Store compatibility in mind while developing it :)

Unless you have any more suggestions @xfrocks, then I'm more than happy for @MattW to send you a copy of the add-on in case you wish to review anything.

I really ought to buy a copy of Attachment Store myself and get a CDN service set up but I haven't had time yet :)
Hi @Chris Deeming,

I took a look and it looks like you generated the thumbnail URL (haven't checked for other images) using AVForums_Competitions_Model_Competition::getCompetitionImageUrl, I also noticed the method getCompetitionImagePath which is very similar to XenForo_Model_Attachment::getAttachmentDataFilePath. I have modified them like this

PHP:
public function getCompetitionImageUrl(array $data, $type)
{
return XenForo_Link::buildPublicLink('attachments', $data);
}

Which seems to work but I'm not sure it will work well when you resize the image and thumbnail in AVForums_Competitions_DataWriter_Competition...
 
Any thoughts on the above Chris? Would like if possible to get the competition started this weekend ;)
 
Hi @Chris Deeming,

I took a look and it looks like you generated the thumbnail URL (haven't checked for other images) using AVForums_Competitions_Model_Competition::getCompetitionImageUrl, I also noticed the method getCompetitionImagePath which is very similar to XenForo_Model_Attachment::getAttachmentDataFilePath. I have modified them like this

PHP:
public function getCompetitionImageUrl(array $data, $type)
{
return XenForo_Link::buildPublicLink('attachments', $data);
}

Which seems to work but I'm not sure it will work well when you resize the image and thumbnail in AVForums_Competitions_DataWriter_Competition...
Just made that change:

upload_2013-11-9_21-6-58.webp

upload_2013-11-9_21-7-17.webp


and tested a new competition

upload_2013-11-9_21-7-45.webp
 
I wasn't sure if it would work or not.

Is that working as expected now, @MattW?
Yep, seems to be working with just a single edit:

PHP:
public function getCompetitionImageUrl(array $data, $type)
        {
                /*
                return sprintf("%s/attachments/%d/%d-%s_$type.jpg",
                        XenForo_Application::$externalDataUrl,
                        floor($data['data_id'] / 1000),
                        $data['data_id'],
                        $data['file_hash']
                );
                */
                return XenForo_Link::buildPublicLink('attachments', $data);
        }

http://z22se.co.uk/competitions/britemax-sealants.1/
 
@xfrocks - was there anything else you changed to make this work? I'm happy to make the same changes on my live install to test it out if there were.
 
I'm having trouble when uploading PNG files, the left image is the source image, the middle image is after uploading as a competition image, the right image is the middle image saved as a normal JPG

The middle image is 360k and has an alpha channel

dog.webp
 
XenForo gives all image attachments the .jpg extension. So despite the extension, the middle one is still a PNG.

Not sure why the file size has increased so much, though.
 
We ran our first competition with this. Working pretty good for what it does. Though I think having a question and answer makes it fun I don't think locking people out for the wrong answer is fun. It seems people get embarrassed and just go away. lol It would be nice if there was an option to allow them to try again in 24 hours or something like that.
 
I make the questions fairly obvious and easy to research. For example in the last question related to an actresses name mentioned in a recent thread by a particular member. The question made it easy to locate the thread and the answer.

100% correct answers for all but one of the competitions I've run. There has only been one wrong answer, and I know who it was and that they deliberately answered incorrectly - gotta love some members!
 
Well, I did put a link to the answer. Either way, I don't think it's productive to permanently lock people out. A 24 hour retry would be good.
 
I had one contest completed so far and have a second one running. I like the question. I make it a question that they have to find on the sponsors website. This gives them traffic which is good. I put the page the answer is on as a hint. I don't want to make it too hard but I do want them to spend at least a few seconds on the sponsors page to find the answer.

If they can't do that then I don't feel they deserve the prize. I picked the one for the first contest and didn't make it impossible. Everyone got that right. On the second one I let the sponsor pick it. I searched for the answer myself and it wasn't clear. So a new questing was picked to correct that. Most got it right so far.

James
 
Top Bottom