Replace one image with another instead of uploadin

Million Dollar Script Forums Modifications Replace one image with another instead of uploadin

This topic contains 4 replies, has 2 voices, and was last updated by  Caroline 4 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #915

    Caroline
    Participant

    Hi there
    I did a mod to gpix here http://burningblue.co.za/pixelwall/ as follows: instead of allowing users to upload their own advert, when they buy pixels, a piece of the background image is replaced with a piece of a specified image at the same location (this is a charity fundraiser based on “selling” pixels in an image of a historic RAF log book). They don’t get to set a link.

    So as the fundraiser progresses, more and more of the specified image becomes visible.

    The php to do the pixel replacement is a doddle (built-in function). The biggest headache I had was integration with JustGiving SDI and the API. I got it working (sort of) although Paypal payments are still misbehaving, but now have a real issue trying to integrate with a South African charity engine which is completely different and which I have to do in an asynchronous queue (I have to parse an email and call an API as they’re not really built for this kind of integrated payment handling). Have decided to give up on Gpix because I’ve probably mangled it out of all recognition and everything seemed unduly complicated. It doesn’t persist the selected region beyond the session (or I can’t get it to).

    I’m busy setting up a local site with your script, which looks as though it might be simpler, and am going to try using the admin approval setting to force approval and then write something to process the queue, match the transactions and then invoke the approval functionality.

    Can anyone point me to the relevant places in the code and any metadata I have to build to make this configurable? It would save me some time. To sum I’m going to:

    [ul]
    [li]kill upload and image map functionality (and disable user pixel maintenance) – might allow big purchasers to add links.[/li]
    [li]add an image which will be the source for the user’s pixels and copy corresponding locations across to the user’s pixel selection[/li]
    [li]process a queue of emails asynchronously – prolly a web service – and where relevant invoke approver functionality (so may need to login programmatically depending on how the back end security is handled).[/li]

    [/ul]

    If I can get it all to work I’ll post the mods when it’s done. I think it’s quite a nice idea for a fundraiser.

    Many thanks

    Caroline

    #943

    Caroline
    Participant

    Hi all, have basically got test code working for this – what a pleasure after gpix!!!!

    I’ve written an extremely simple script called autoprocess which is something of a hack but is doing exactly what I want to the wall image – replacing bought pixels with pixels at the same location in another image, so the second image gradually becomes visible as the pixels are sold. I am basically taking the order, finding the blocks and whacking the image data with the image data from the same location block by block (see attached).

    Next steps:
    1. add another payment method (I will clone cheque/money order or hack it as all it needs to do is take the user offsite to a charity engine where they can make their payment)
    2. send the user and order to the charity engine (givengain) which has an API – I think it allows me to supply tx data and will return an email which includes a donation ID
    3. parse the donation email in a web service – that will probably come in at the top of autoprocess or in a wrapper. That will enable me to use the API to retrieve the user, order and paid amount.
    4. If paid amount >= order amount, run autoprocess for that order. I’m not providing outbound links (maybe to the charity).
    5. Remove Manage Pixels from the menu.

    Looks like this is going to be extremely easy so I’m a very happy camper!! :laugh:

    #954

    Ryan
    Keymaster

    Awesome, thanks =)

    #955

    Ryan
    Keymaster

    I don’t see any attachment… maybe it didn’t get uploaded or something. Or maybe it’s time to upgrade the website.

    #960

    Caroline
    Participant

    Well I’ve done a bit more work on it including adding some constants to generate user name and charity supported on the links – screenshot attached too. (All currently hardcoded, I rotated the charities pro-rata in the previous incarnation and nearly drove myself spare trying to work out which charity was supposed to get the next donation….).

    I might not have clicked insert – but the board might restrict some file extensions (joomla/kunena? we’ve had some fun in the past…)

    Where would be the easiest place to switch off the Manage My Pixels item in the user menu? I think that’s about the only place I have to fiddle with the actual script and the rest just gets hacked in the autoprocess file. It’s vastly simpler without needing to manage a user ad.

    Many thanks
    Caroline

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.