1. Post #1481
    jung3o's Avatar
    October 2011
    2,166 Posts
    Thanks Stinkyjoe i've created a very nice structure now, based of your snippet. There were a few things in the script that didn't work right but it gave me a clear idea what to do :)
    that's probably because your PHP probably isn't 5.4 yet
    Reply With Quote Edit / Delete Windows 7 United States Show Events Useful Useful x 1 (list)

  2. Post #1482
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,692 Posts
    no that's deprecated
    Why?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  3. Post #1483
    Gold Member
    StinkyJoe's Avatar
    June 2006
    2,196 Posts
    As of php-5.3.3 IIRC it's treated as a regular method in namespaced classes, that's why.
    Reply With Quote Edit / Delete Linux Portugal Show Events Informative Informative x 3 (list)

  4. Post #1484
    RAPISTS ARE OPPRESSED
    mobrockers2's Avatar
    April 2011
    12,403 Posts
    -snip-
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  5. Post #1485
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,692 Posts
    As of php-5.3.3 IIRC it's treated as a regular method in namespaced classes, that's why.
    I was using php 5.3.8 up until 10 minutes ago and it was definitely treated as __construct rather than a regular method..
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  6. Post #1486
    RAPISTS ARE OPPRESSED
    mobrockers2's Avatar
    April 2011
    12,403 Posts
    I was using php 5.3.8 up until 10 minutes ago and it was definitely treated as __construct rather than a regular method..
    In the process of authoring computer software, its standards or documentation, or other technical standards, deprecation is a status applied to features, characteristics, or practices to indicate that they should be avoided, typically because they have been superseded.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  7. Post #1487
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    I was using php 5.3.8 up until 10 minutes ago and it was definitely treated as __construct rather than a regular method..
    <?php
    
    namespace a;
    
    class b {
            public function b() {
                    echo 'a\b::b() called!\n';
            }
    }
    
    namespace main;
    
    $b = new \a\b;
    

    nothing gets printed out on 5.3.6
    Reply With Quote Edit / Delete Mac Australia Show Events

  8. Post #1488

    December 2008
    557 Posts
    $stickers = $db->query('stickers', [20, 50], ['quantity>' => 6, 'price<=' => 20]);
    // etc..
    When was array notations like this introduced in PHP?

    Nevermind, 5.4.0 apparently.. Funny though, this request has been declined numerous times in the past.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events

  9. Post #1489
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,692 Posts
    <?php
    
    namespace a;
    
    class b {
            public function b() {
                    echo 'a\b::b() called!\n';
            }
    }
    
    namespace main;
    
    $b = new \a\b;
    

    nothing gets printed out on 5.3.6
    Oh, I never use namespaces so obviously I've never encountered such problems.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  10. Post #1490
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Oh, I never use namespaces so obviously I've never encountered such problems.
    you should still try to avoid deprecated features
    Reply With Quote Edit / Delete Australia Show Events Agree Agree x 1 (list)

  11. Post #1491
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,692 Posts
    Yes, I agree, right after your comment I actually change it in all of my classes. Thanks.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  12. Post #1492
    secretly a furry
    Jelly's Avatar
    April 2011
    2,023 Posts
    Unless you have error reporting off or set to a very low level you should have gotten a warning from PHP about it.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  13. Post #1493
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,692 Posts
    I got error reporting set to whatever maximum level is possible, it reports everything.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  14. Post #1494
    -Kesil-'s Avatar
    February 2012
    87 Posts
    I want to make a site where users can create their own page. Said page could be accessed with <profile-name>.mysite.com

    What host allows for me to do this with subdomains?
    What's the downside to this? (as opposed to mysite.com/<profile-name>)
    I know that cookies can't be passed from each subdomain.
    Reply With Quote Edit / Delete Mac United States Show Events

  15. Post #1495
    RAPISTS ARE OPPRESSED
    mobrockers2's Avatar
    April 2011
    12,403 Posts
    I want to make a site where users can create their own page. Said page could be accessed with <profile-name>.mysite.com

    What host allows for me to do this with subdomains?
    What's the downside to this? (as opposed to mysite.com/<profile-name>)
    I know that cookies can't be passed from each subdomain.
    All the webhosts Ive seen so far allowed subdomains.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  16. Post #1496
    -Kesil-'s Avatar
    February 2012
    87 Posts
    All the webhosts Ive seen so far allowed subdomains.
    1and1 is limited and they must be created manually.
    With lenode I'm sure I'll have unlimited subs, I'll have to learn how to make them dynamically though.
    Reply With Quote Edit / Delete Mac United States Show Events

  17. Post #1497
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    1and1 is limited and they must be created manually.
    With lenode I'm sure I'll have unlimited subs, I'll have to learn how to make them dynamically though.
    you don't 'make them dynamically'.

    you have a wildcard subdomain so that all user subdomains get routed to the same app. then you inspect $_SERVER["HTTP_HOST"] and dispatch the request accordingly
    Reply With Quote Edit / Delete Mac Australia Show Events

  18. Post #1498
    Has anyone here used CakePHP?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  19. Post #1499
    Has anyone here used CakePHP?
    if you're going to do that just use Rails.
    Reply With Quote Edit / Delete Mac United States Show Events Agree Agree x 3 (list)

  20. Post #1500
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Has anyone here used CakePHP?
    what kmart said
    Reply With Quote Edit / Delete Australia Show Events

  21. Post #1501
    -Kesil-'s Avatar
    February 2012
    87 Posts
    You see those long dashes on the sides of "it costs nothing"
    How get?
    Reply With Quote Edit / Delete Mac United States Show Events Dumb Dumb x 4 (list)

  22. Post #1502
    Gold Member
    Sanya_Zol's Avatar
    August 2010
    157 Posts
    You see those long dashes on the sides of "it costs nothing"
    How get?


    Edited:


    WinKey + R --> charmap
    Reply With Quote Edit / Delete Windows 7 Russian Federation Show Events Friendly Friendly x 1 (list)

  23. Post #1503
    -Kesil-'s Avatar
    February 2012
    87 Posts
    How can I get my site to work with Mobile devices?
    When I get on k8r from my phone it insists on zooming out so far that I can't see the text.
    I want the width of my phone to dictate the width of the screen.
    How does that begin to happen?

    (User was permabanned for this post ("Alt of permabanned user Haley" - Gran PC))
    Reply With Quote Edit / Delete Mac United States Show Events Dumb Dumb x 3 (list)

  24. Post #1504
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    791 Posts
    How can I get my site to work with Mobile devices?
    When I get on k8r from my phone it insists on zooming out so far that I can't see the text.
    I want the width of my phone to dictate the width of the screen.
    How does that begin to happen?
    Make a separate mobile site?
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Disagree Disagree x 2 (list)

  25. Post #1505
    Gold Member
    StinkyJoe's Avatar
    June 2006
    2,196 Posts
    How can I get my site to work with Mobile devices?
    When I get on k8r from my phone it insists on zooming out so far that I can't see the text.
    I want the width of my phone to dictate the width of the screen.
    How does that begin to happen?
    Nice to see you got rated dumb for a pretty innocuous question.

    It's fairly simple in theory - don't use fixed widths, or at least strongly avoid them, use CSS Media Queries when you need to adjust the page style depending on the device (but be wary of needless repetition), and make use of the Viewport meta tag:


    https://developer.mozilla.org/en/CSS/Media_queries
    https://developer.mozilla.org/en/Mob...wport_meta_tag
    Reply With Quote Edit / Delete Linux Portugal Show Events Winner Winner x 1Friendly Friendly x 1 (list)

  26. Post #1506
    Gold Member
    toaster468's Avatar
    January 2010
    3,260 Posts
    How can I get my site to work with Mobile devices?
    When I get on k8r from my phone it insists on zooming out so far that I can't see the text.
    I want the width of my phone to dictate the width of the screen.
    How does that begin to happen?
    Apple has also implemented meta tags to control how the page is displayed and how it reacts to events like zooming out.

    http://mobile.tutsplus.com/tutorials...app-meta-tags/

    Good resource for that. I lost the link to the Apple developer documentation for it, sorry.

    Edited:

    Oh damn it Stinky!
    (Mine has other meta tag uses though)
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 1 (list)

  27. Post #1507
    Gold Member
    Alcapwne's Avatar
    May 2010
    3,519 Posts
    How can I get my site to work with Mobile devices?
    When I get on k8r from my phone it insists on zooming out so far that I can't see the text.
    I want the width of my phone to dictate the width of the screen.
    How does that begin to happen?
    it's called 'responsive web design' and is quite a hot topic at the moment, look it up
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Friendly Friendly x 1 (list)

  28. Post #1508
    garry's Avatar
    September 2001
    12,435 Posts
    Anyone know of any PHP math libraries. I'm looking for Vector3D and Vector2D classes - and I want to check before I write them myself.
    Reply With Quote Edit / Delete Windows 7 Show Events

  29. Post #1509
    Gold Member
    toaster468's Avatar
    January 2010
    3,260 Posts
    it's called 'responsive web design' and is quite a hot topic at the moment, look it up
    Tip for -Kesil-: Some people think it's smart to use user agents, don't.

    Edited:

    Anyone know of any PHP math libraries. I'm looking for Vector3D and Vector2D classes - and I want to check before I write them myself.
    Just curious, what's this for?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  30. Post #1510
    -Kesil-'s Avatar
    February 2012
    87 Posts
    Are browser extensions written in javascript?
    or...
    I notice that the Silver Bird (twitter extension) works in Mac's Google Chrome and Windows7's Google Chrome. So I doubt that it's written in C or C++.
    But I also highly doubt it's written in "Chrome Code" simply because I've never heard of it.

    I wish to make a browser plugin for Chrome and FireFox. Depending on exactly how it is done [[ which I'm thinking there are simply just special javascript handles that each browser has and that's the only difference ]] I might be able to do both.

    Edited:

    extension* (changed from "plugin")

    ---------AND SO I WAS GIVEN THIS-----------

    http://code.google.com/chrome/extens...etstarted.html
    Reply With Quote Edit / Delete Mac United States Show Events Dumb Dumb x 5 (list)

  31. Post #1511
    Gold Member
    toaster468's Avatar
    January 2010
    3,260 Posts
    Are browser extensions written in javascript?
    or...
    I notice that the Silver Bird (twitter extension) works in Mac's Google Chrome and Windows7's Google Chrome. So I doubt that it's written in C or C++.
    But I also highly doubt it's written in "Chrome Code" simply because I've never heard of it.

    I wish to make a browser plugin for Chrome and FireFox. Depending on exactly how it is done [[ which I'm thinking there are simply just special javascript handles that each browser has and that's the only difference ]] I might be able to do both.

    Edited:

    extension* (changed from "plugin")

    ---------AND SO I WAS GIVEN THIS-----------

    http://code.google.com/chrome/extens...etstarted.html
    Firefox extensions are written in Javascript. Don't know about the other ones though.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 1 (list)

  32. Post #1512
    garry's Avatar
    September 2001
    12,435 Posts
    never mind.. already made one now :x
    Reply With Quote Edit / Delete Windows 7 Show Events Programming King Programming King x 3 (list)

  33. Post #1513
    Gold Member
    StinkyJoe's Avatar
    June 2006
    2,196 Posts
    never mind.. already made one now :x

    There's not a whole lot of exciting options going on in PHP when it comes to Math-centric development.


    There's the very basic fNumber: http://flourishlib.com/docs/fNumber and friends.

    There's the archaic PHP/Math library: http://www.phpmath.com/

    And then there's all the icky miscellaneous user-released code mashes. Doing it yourself was probably the fastest and cleanest option, really.

    Want to share what you came up with?
    Reply With Quote Edit / Delete Linux Portugal Show Events

  34. Post #1514
    garry's Avatar
    September 2001
    12,435 Posts
    What I did isn't that great - but it works for now. I never realised you couldn't so operator overloads in PHP, that just seems crazy. They really seem militant towards the idea too.

    I added static functions to replace it, so that

    $a = $b - $c

    becomes

    $a = Vector2D::GetSub( $b, $c )

    It's incomplete because I've only filled in what I needed.

    <?php
    
    class Vector2D
    {
    	public $x;
    	public $y;
    
    	public static function GetSub( $a, $b ) { $o = new Vector2D( $a ); $o->Sub( $b ); return $o; }
    	public static function GetMul( $a, $b ) { $o = new Vector2D( $a ); $o->Mul( $b ); return $o; }
    
    	public function __construct( $x = 0, $y = 0 ) 
    	{
    		$this->Set( $x, $y );
    	}
    
    	public function Set( $x, $y = 0 )
    	{
    		if ( is_object( $x ) )
    			return $this->Set( $x->x, $x->y );
    
    		$this->x = $x;
    		$this->y = $y;
    	}
    
    	public function Sub( $v )
    	{
    		$this->x -= $v->x;
    		$this->y -= $v->y;
    	}
    
    	public function Add( $v )
    	{
    		$this->x += $v->x;
    		$this->y += $v->y;
    	}
    
    	public function Mul( $v )
    	{
    		$this->x *= $v;
    		$this->y *= $v;
    	}
    
    	public function ToString()
    	{
    		return "$this->x $this->y";
    	}
    };
    Reply With Quote Edit / Delete Windows 7 Show Events

  35. Post #1515
    Meow :3
    Ac!dL3ak's Avatar
    July 2005
    6,090 Posts
    I didn't think that operators were considered methods in php
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  36. Post #1516
    Gold Member
    Silentfood's Avatar
    November 2009
    918 Posts
    Some good, free icon packs?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  37. Post #1517
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Are browser extensions written in javascript?
    or...
    I notice that the Silver Bird (twitter extension) works in Mac's Google Chrome and Windows7's Google Chrome. So I doubt that it's written in C or C++.
    But I also highly doubt it's written in "Chrome Code" simply because I've never heard of it.

    I wish to make a browser plugin for Chrome and FireFox. Depending on exactly how it is done [[ which I'm thinking there are simply just special javascript handles that each browser has and that's the only difference ]] I might be able to do both.

    Edited:

    extension* (changed from "plugin")

    ---------AND SO I WAS GIVEN THIS-----------

    http://code.google.com/chrome/extens...etstarted.html
    do you even fucking google before posting
    Reply With Quote Edit / Delete Mac Australia Show Events Agree Agree x 2 (list)

  38. Post #1518
    Gold Member
    Dennab
    January 2012
    1,137 Posts
    Some good, free icon packs?
    I posted some packs a couple weeks ago in this thread, there are some really nice ones there.
    Reply With Quote Edit / Delete Mac United States Show Events Friendly Friendly x 1 (list)

  39. Post #1519
    Gold Member
    Adzter's Avatar
    September 2009
    2,035 Posts
    I'm having a bit of trouble with Apache and virtual hosting, I've got 2 domains and 1 web server (VPS). I've got both domains with an A record pointing to the IP of my VPS and I've setup the apache2.conf correctly (as far as I know). One domain works fine (adam-wilson.me) yet the other (xenforge.co.uk) only seems to work when I put www infront of it.

    Here's an image to describe it easier:


    Anyone have any idea what's going on?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  40. Post #1520
    Gold Member
    Sc00by22's Avatar
    August 2007
    1,253 Posts
    I'm having a bit of trouble with Apache and virtual hosting, I've got 2 domains and 1 web server (VPS). I've got both domains with an A record pointing to the IP of my VPS and I've setup the apache2.conf correctly (as far as I know). One domain works fine (adam-wilson.me) yet the other (xenforge.co.uk) only seems to work when I put www infront of it.

    Here's an image to describe it easier:


    Anyone have any idea what's going on?
    It's been a while since I used Apache.

    I assume you have the same A records for each domain (@ and www). This is what I used to do IIRC:

    ServerName domain.co.uk
    ServerAlias www.domain.co.uk

    You might want to split the first domain into it's own document root like you did with the second domain as well.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Friendly Friendly x 1Agree Agree x 1 (list)