Sigrotor + Coding Help + Mini Project

@visibleman is that you doing the coding on github? :)

tenor.gif


Will do a PR once i get chance to test some bits. But it's worth mentioning that what i'm submitting is ropey at best :D and whilst it "works", i'm not entirely sure how well it'll stand up with load plus i suspect it's open to abuse (to some degree).
 
Will do a PR once i get chance to test some bits. But it's worth mentioning that what i'm submitting is ropey at best :D and whilst it "works", i'm not entirely sure how well it'll stand up with load plus i suspect it's open to abuse (to some degree).

We can just see how it goes and see how it handles things. I don't think it will be too bad initially.

Not much more to do to get it to a working site. I noticed you got the url link working!

I tested the 10 sig limit and that works too. Error on upload on 11th image.

Good stuff!
 
@visibleman

it looks like in the URL we get a ? before the users name, checked the code not sure where that's coming from.

EDIT: never mind fixed it. :)


We could do a file copy once an image has been uploaded with but would need to do a check if exist statement first;

copy('foo/test.php', 'bar/test.php');
 
Last edited:
@Bouton Aide - Yup, it was a quick 'n' dirty hack using query strings to parse username to the PHP script. As you say, could duplicate it to users directories but future updates would be a bit of a chore.
Another solution would to simply prefix users directories (ie - 'sig-{username}') and then use a rewrite rule on the signature directory to parse the username, so '/signatures/{username}/' rewrites to '/signatures/index.php?u={username}'. At least then the code is in one place.

On another note, what are you like UI work? :D

Edit - Re. IP address, note GDPR.
 
It's nice the way it works. I have tested it and it functions even with spaces.

My UI work is pants but I do know someone who might be able to help with UI CSS! He does the UserStyles, which I also host on GitHub and maintain with few others.

@wiiija :D

We literally need one more thing and that's to copy the file into the folder that does the URL rendering and it's a working site!

I can't believe how fast you managed to code this. I'm going to mention the contributors somewhere as well.
 
We literally need one more thing and that's to copy the file into the folder that does the URL rendering and it's a working site!

In which case expand the if statement (line 77) and add a copy() function, after the directory is created, to copy across the script - after that, i think you're all good to go :)

Worth pointing out that I would add caching control headers if you're binary reading the image as i suspect a browser will attempt to cache it and you might not end up with the signature "rotating". Oh and the content-type needs to be updated to gif rather than jpeg.

Edit - GDPR; true true, i think you're right but it's worth mentioning that PII is stored either way (which you've done, so no biggie).
 
In which case expand the if statement (line 77) and add a copy() function, after the directory is created, to copy across the script - after that, i think you're all good to go :)

Worth pointing out that I would add caching control headers if you're binary reading the image as i suspect a browser will attempt to cache it and you might not end up with the signature "rotating". Oh and the content-type needs to be updated to gif rather than jpeg.

Edit - GDPR; true true, i think you're right but it's worth mentioning that PII is stored either way (which you've done, so no biggie).

When your available would you mind doing part A and B for me on GitHub? I don't know where to start with that part. Thanks :p

Oh and the content-type needs to be updated to gif rather than jpeg.

Yeh I noticed this it's corrected now. :)

Good work! Credits where due to you sir - hats off!
 
When your available would you mind doing part A and B for me on GitHub? I don't know where to start with that part. Thanks :p

Done (on fork) - it's scruffy but works.
Maybe one for a future update but switching (from binary) to using a rewrite rule and a simple redirect for signature images would allow you to leverage browser caching and, possibly, reduce server load but it's a ten minute change.
 
Just added the code to live site and it doesn't appear to copy the index.php file. :confused:

Currently, it'll only copy across when the /signatures/{username}/ directory is being created. But i've pushed another version that will continuously check (on upload) to see if the script exists within the users directory and copy across accordingly.
 
Just added the code to live site and it doesn't appear to copy the index.php file. :confused:

Wouldn't it be easier to have that file once in the signature root directory and have the urls given to the users a path to that file with their username as a parameter, then you can search for files in the user's folder using the passed username parameter. Then if you need to change the file you don't need to go through every directory and update them all.
 
Wouldn't it be easier to have that file once in the signature root directory and have the urls given to the users a path to that file with their username as a parameter, then you can search for files in the user's folder using the passed username parameter. Then if you need to change the file you don't need to go through every directory and update them all.

hey touch, I noticed you forked the site too. If you think you can assist feel free to edit the code on your fork and I'll check it out see. :)

I have no idea what will be easier or not. I'm just going with the flow till something works.
 
Sorry, just delete anything I've added. Didn't think I've committed anything. I've never used git before so I was just trying it out to see how it all works. I only use VisualStudio so I could get it all connected up and download the files but it doesn't run PHP so I couldn't test anything and didn't want to break stuff.
 
Sorry, just delete anything I've added. Didn't think I've committed anything. I've never used git before so I was just trying it out to see how it all works. I only use VisualStudio so I could get it all connected up and download the files but it doesn't run PHP so I couldn't test anything and didn't want to break stuff.

You won't break it because if you fork on Github the code is edited on a "copy" then I would need to pull/merge the requested code change.

Don't worry you haven't broken anything. :p

No seriously if you think of a better way please do commit. I'm all up for helpers as I don't code myself I just mess about with things till it works.
 
Back
Top Bottom