Aries Posted August 7, 2010 Posted August 7, 2010 Hi Guys, This is my first modification and its not perfect, some of you guys are gona say "its nothing special its just tables added" but this is important for me as its my first ever modification, there is nothing added its just a visual update :). Modification for Mccodes v2.x Updated: You can now choose a display picture if the user has none Special thanks to paddytm for helping me with the code for putting a default profile pic if there is none! Instructions: 1# Replace index.php with this index.php 2# Replace: 'NO DISPLAY PIC URL HERE' with 'http://site.com/path/to/image.png' (your default image url) Screenshot: Here it goes: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
NarutoPRG.com Posted August 7, 2010 Posted August 7, 2010 Haven't seen nothin' like that mate. Good work. :) Quote
Zero-Affect Posted August 7, 2010 Posted August 7, 2010 Nice improvement (at first i thought it was viewuser) but it's index.php nice work. Quote
rulerofzu Posted August 7, 2010 Posted August 7, 2010 Well done for creating this its different which is always good. You do need to address your html/css though. Using center tags and then using style when you could just use css to center it. I also prefer to check the players image is valid or return a blank image. Quote
Aries Posted August 7, 2010 Author Posted August 7, 2010 could someone give me an example of the code that would check if a user has a image and if they dont it will show another image? Thanks for the positive feedback guys :) trying to make viewuser.php look nice also :) Quote
NarutoPRG.com Posted August 7, 2010 Posted August 7, 2010 DJK made something Similar to that Roz. Aries, look through DJK post. It should be there mate. If so, try and put the code in. :) EDIT: I'm not cretin' if it will work. Haven't looked at the code for a while. But worth a try. Quote
Paddy Posted August 7, 2010 Posted August 7, 2010 Good job mate, now that you did this make a back up and try to make it even better by adding 1 thing at a time don't do multiple things at once so if it errors you know where the error came from.. for the image you can use/edit You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. then in the echo " do You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. or You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. depending if you have double or single quotes in your echo/print.. post back with your result Also you have an extra bracket here You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
rulerofzu Posted August 7, 2010 Posted August 7, 2010 See this post by DjK [mccode v2.x] Different way of going about 'User Display Pictures'. Quote
Aries Posted August 7, 2010 Author Posted August 7, 2010 Updated! There is now a default profile picture if there is none (thanks to paddytm) Unneeded bracket was removed. Quote
Zero-Affect Posted August 7, 2010 Posted August 7, 2010 You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. try a little Ternary You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Jordan Palmer Posted August 7, 2010 Posted August 7, 2010 I like this but I noticed a few things which could be better & A few css mistake's and so forth so I decided I'd recode it :); Nothing really has changed; I've just changed alot around and spaced out the code You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I haven't coded in about 5months so chances are they're quite alot off mistakes but blah; It took me 15minuets maximum :) Quote
Equinox Posted August 7, 2010 Posted August 7, 2010 Why are you re-formatting the numbers? And you could probably check if 'pn_update' a bit more. if(isset($_POST['pn_update']) && is_string($_POST['pn_update'])) { Quote
Jordan Palmer Posted August 7, 2010 Posted August 7, 2010 thats how much attention I paid too it while doing it :L oh well idc :L Quote
Djkanna Posted August 7, 2010 Posted August 7, 2010 See this post by DjK [mccode v2.x] Different way of going about 'User Display Pictures'. It's not that usefull as there is only one thing that checks that doesn't only apply to uploads. Simple check would be to check the extension: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. However if you check everything on input no reason to check anything on output. Doing uploads then using fread()/fopen() etc to check and serve the images would be another alternative. Quote
Danny696 Posted August 7, 2010 Posted August 7, 2010 DJK, what if a person used .htaccess to modifiy the url, so myimage.png would go to myimage.php ;) Quote
Djkanna Posted August 7, 2010 Posted August 7, 2010 Again take note of 'simple check' also take note of the last bit of advice, I'm well aware of using .htaccess to modify urls. However what people fail to realise is if you actually solve problems within your site that can be exploited via display pictures you've got nothing to worry about when it comes to the display pictures, some of the most used open source scripts don't bother with securing the image tags in bbcode as it doesn't pose an imediate threat towards the script itself, sure you can log someone out, that's not life threating it's just a pain. Quote
Zero-Affect Posted August 7, 2010 Posted August 7, 2010 Actually you can do alot more than logging them out DJK. Quote
Djkanna Posted August 7, 2010 Posted August 7, 2010 Oh I know, I was using the most common as an example. Quote
Wickidnezz Posted August 8, 2010 Posted August 8, 2010 if i may point out that jordans recode will give users this error here Parse error: syntax error, unexpected $end in /home/content/c/o/n/convicte/html/destroyed-country/index.php on line 55 however if you use this code below You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. the error above i mentioned will not occur reason being is on line 44 of the recode jordan posted he had put a extra { which in resulted in the following error Parse error: syntax error, unexpected $end in /home/content/c/o/n/convicte/html/destroyed-country/index.php on line 55 Quote
Jordan Palmer Posted August 8, 2010 Posted August 8, 2010 Code updated; Guess I should really not try and multitask :L Quote
NarutoPRG.com Posted August 8, 2010 Posted August 8, 2010 @ Wickidnezz: Wouldn't it be just easier just too post the Error? Not the full code. -_- Quote
Jordan Palmer Posted August 8, 2010 Posted August 8, 2010 @ Wickidnezz: Wouldn't it be just easier just too post the Error? Not the full code. -_- He's never liked me so he take's all the chances he can get too prove me wrong; Shame really; Quote
Aries Posted August 8, 2010 Author Posted August 8, 2010 Thanks for the good feedback guys, im working on a nice usersonline update also :) just trying to work things out on how to make it work :P Quote
Paddy Posted August 8, 2010 Posted August 8, 2010 looking forward to see what you come up with mate.. try using a stripey css table Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.