redbullmarky
Staff Alumni-
Posts
2,863 -
Joined
-
Last visited
Never
Everything posted by redbullmarky
-
one here for me too. i used to use a few others, but i think it was AndyB that pointed out TinyMCE and I havent looked back since.
-
it might be better to explain what you're trying to achieve - simply uncommenting something generally just makes things available for you to use rather than changing things automatically. mod_rewrite is about rewriting URL's. if you've seen wikipedia's URLS, or URL's without lists of parameters after the filename, then mod_rewrite is possibly at work. as it's generally done on a site by site basis, the best way is to create a text file in your webroot called .htaccess (notice the fullstop before the name). as for the rest - you need to decide what you want to achieve with the URL, get a grasp of regular expressions and go from there. Here's the main doc for it: http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html assuming you've already got that far, and it's not doing anything, do you have a: RewriteEngine On in your htaccess file? hope that helps Cheers Mark
-
it is worth noting that (depending on the situation) it's actually better not to include variables inside strings in this way. if you do, the way daniel suggested is better - as he stated, it's easier to read. so whilst this is valid (and i use it from time to time): [code] <?php $animal = "cat"; $mystring = "the $animal sat on the mat"; $mystring = "the {$animal} sat on the mat"; ?> [/code] it's much quicker performance wise and (IMO) easier to debug if you use: [code] <?php $animal = 'cat'; $mystring = 'the ' . $animal . ' sat on the mat'; $mystring = 'the ' . $animal . ' sat on the mat'; ?> [/code] note the use of single quotes instead of double. double quotes will have PHP do extra parsing. sure, the performance hit is nothing to cry about - but worth noting, nonetheless. as for HEREDOC, i personally find it a bit clumsy for keeping things tidy and organised - but again, that is my own preference, not the norm. Cheers Mark
-
once it's installed the DW extension, you have a new menu at the top of DW (which i believe applies to the file currently open) and a context menu when you right click any of your files in the files list. once you've got the basics of TortoiseSVN, the dreamweaver extension will make perfect sense as it uses same terminology. Read the Tortoise manual first. It took me a bit of playing around with it and patience for me to get it to work, but then again I jumped into the deep end and didnt do the extensive research bit.
-
what's confusing me is why you're trying to install it onto Linux, as it's ultimately for your own benefit. I sent you a link that has a plugin for Dreamweaver as well as easy install instructions for TortoiseSVN. These can be installed quite easily on your local Windows computer - this is the way i currently have it set up.
-
as for integrating directly with an email client, i'm not totally sure - i'm sure that mailto can take more parameters, but cant for the life of me remember as i dont use it much. however - have a look at pspell functions (http://uk2.php.net/pspell, tinymce (http://tinymce.moxiecode.com/) and phpmailer (http://phpmailer.sourceforge.net/) are all relatively straightforward to set up if you wish to create something fairly simple.
-
you could try the FTP functions: http://uk.php.net/ftp_chmod I had to use these when i made an auto-installer for one of my packages.
-
[SOLVED] arrays/references - a quickie
redbullmarky replied to redbullmarky's topic in PHP Coding Help
ok cool, thanks! -
Hi all On PHP5 here - not sure if it makes a difference to the answer at all. If a function/class method returns an array, is it best to pick it up by reference? [code] function myfunction() { return $reallybigarray; } $thearray = myfunction(); [/code] or [code] function myfunction() { return $reallybigarray; } $thearray = &myfunction(); [/code] cheers Mark
-
there arent too many sites that i look at and dont have anything to offer in terms of improvements, and IMO this is one of them. its nothing short of excellent. i didnt actually see the old one. my only gripe is the adverts on certain pages - not the fact that they're there, but the choice of ads in particular. most of the advertisers are of the 'misleadling' variety - ie, "your computer is infected, click here for a free scan" with a fake button. i'd probably keep eyes open for an ad provider that's a bit more picky with the sort of ads they feed to your site. at least its not gooooooogle ads, i guess. anyway... great job! Mark
-
and for dreamweaver users: http://www.nearlygeek.com/tools/subversion-for-dreamweaver/introduction/ which actually works with TortoiseSVN
-
no i dont mean install wikipedia (although it'd prob do the job with some mods...) its just the concept of CVS/SVN and Wiki's are similar. anyway. dreamweaver. also my weapon of choice so i've got this set up: http://www.nearlygeek.com/tools/subversion-for-dreamweaver/introduction/ seriously though, dont be coming back after 10 minutes saying you dont get it :D it does take a while to get used to when you first use these sort of version control systems ;D
-
seriously, you cant expect to learn 3 entire new systems in just a few hours. Subversion is definitely something to pick up if you intend to work in a collaborative team environment in the future. The easiest explaination i was given (before i knew what it was) was "Wikipedia for code" - that is to say, it stores the changes between files rather than a whole new file. Getting used to its terminology is tricky at first but when you get the hang of it, it's priceless.
-
yeah it was actually Barand that suggested it to me when I asked a similar question not so long back: http://www.phpfreaks.com/forums/index.php/topic,107028.0.html and something steviewdr showed me (Trac - http://trac.edgewall.org/) that made me think more about how i was organising things. It still doesnt solve my problem of when i update "reusable code" during a project and then remembering to update the main ones for the next project, but it sure helps in many other ways.
-
CVS/Subversion is a good idea, even for a lone developer, just to keep things organised and up to date. The hardest thing I personally find is making sure that if i'm using my scripts or framework for a project, and update these scripts or the framework itself, that I update the main store of my files for use in the next project. I'm not actually sure there is an easy way to achieve this but I'd be keen to find out...
-
Hi Glen If you have 5 blog entries, all with a title and body, you need a loop to run through them. Sure, you can do the loop in the code that drives the engine, but this would be dragging alot of presentation code into where it should not be - ie, stuff for formatting headings, etc. if there was only one entry, sure - this could be done directly in the template. but how do you plan handling more than one result, and formatting it from the template and not from the main code? For me, it's about nothing apart from ease of development. I'm possibly the most unorganised, forgetful person I know, and the thought of trawling through pages of PHP to sort out a new layout for my site doesnt really do it for me. I actually made my own template engine, based very heavily on the one in the link I sent you. here's what it does, so hence what i always look for: 1, filters. i dont use these lots, but i put the functionality in there. for example, I have a 'swearies' filter which will run through the page starring out swear words, and one that turns the page into not much more than basic text (ideal for use on PDA's/mobile browsers). and other weird, wonderful and otherwise useless ones. 2, gzip compression 3, caching 4, uses PHP as its native language for tags. see above link as well as phpSavant (www.phpsavant.com) other than that, there's not much else i look for. as long as it does its job and is fast, thats it really. Cheers Mark
-
without wanting to sound negative, all i can see is that its a class that replaces stuff with stuff which apart from replacing stuff serves little other use. what i've always noticed with database data is generally there's always a need for more than one row, which is where loops come in. so until it has this sort of functionality, i'd probably give it a thumbs down for the time being, but having said that i'd be keep to see it when it's cranked up a few notches and does more. Sure, it's simple to use - but with simplicity comes a lack of functionality. It's possibly not helped by the fact that I have a bit of a dislike for most template engines in general anyway, as ultimately they require learning a whole new bunch of syntax to replace a perfectly good set (PHP). See here as my reasons stem from this: http://www.massassi.com/php/articles/template_engines/ Cheers Mark
-
compared to many here, i'm relatively new to much of this stuff in terms of design patterns/MVC/IPO, but have managed to implement it quite well and the benefits are amazing. vastly oversimplifying some of my own practices and what i've learned from some frameworks, one point of output generally means building up your HTML in a variable/object/etc and outputting it with a single 'echo' at the end. all HTML/content that you'd normally throw out with an echo, you add it to this variable instead. as for the one point of input, this is generally a case of using the URL params to decide which files to include or which objects to use. you'll probably have seen something like: [code] <?php $module = $_GET['module']; switch ($module) { case 'home': include('inc/home.php'; break; case 'signup': include('inc/signup.php'); break; } ?> [/code] the above example, put into a single index.php file, could feed the user the homepage or the signup page just with a different URL. The best part about single points of entry/exit (for me, anyway) is just the level of control and scalability it gives me. as all requests come through one page, i have one central place to deal with making sure the $_POST and $_GET arrays are 'clean', and one place to remember when it comes to putting links in my pages - in the event of, for example, me restructuring the entire site and moving things around. Of course, like I say, this is vastly over simplifying it, but on the other hand, it doesnt really need to be that complex. I actually learnt a hell of alot from the Code Igniter framework (www.codeigniter.com) and its online manual, as it gave me some excellent ideas for structuring things as well as a bit of an OOP crash course, as it's one of the easier ones to get your head around. Cheers Mark
-
the problem with that is that the script needs to be run for it to work - but if there's certain types of error, the script wont run at all and neither will those lines. what i always do during development is to set up a .htaccess file in my webroot with these four lines: [code] php_flag display_errors on php_flag display_startup_errors on php_flag log_errors off php_value error_reporting E_ALL [/code] and when i'm done, i just delete the file hope that helps cheers Mark
-
[quote author=neylitalo link=topic=110909.msg449646#msg449646 date=1160456864] Let's just hope Microsoft doesn't get smart and start using the Gecko engine or something else, and then change their UA... then we'd be really screwed. Although, if IE were using the Gecko engine, then we wouldn't have to worry, would we? Dang. I thought I had a point. [/quote] they'll find some way of "customising" (breaking) it, so your point still holds ;) thing is with Internet Explorer - whilst I agree that it's a bit rubbish, it's not my job as a developer to FORCE people not to use it - just to educate. Putting these measures in place to force people to do things a particular way reminds me of the governments, and look how it backfires on them... Sure, it takes a little time and maybe a bit of hacking around to get IE to cooperate sometimes, but I'd rather not be the 'no traffic website' due to playing part of Developer AND Browser Police.
-
[code] <?php $show1 = "3232sad4.32342"; list($before, $after) = explode('.', $show1); ?> [/code] or [code] <?php $show1 = "3232sad4.32342"; $parts = explode('.', $show1); $before = $parts[0]; $after = $parts[1]; ?> [/code] or [code] <?php $show1 = "3232sad4.32342"; $dotposition = strpos($show1, '.'); $after = substr($show1, $dotposition + 1); ?> [/code] there are plenty more ways but these should get you going hope it helps Cheers Mark
-
@hostfreak - considering the nature of a site like phpfreaks, where the aim is to come for help and hopefully walk away with an answer (be it a script, web critique or an idea), i dont think that sort of response goes down well. i see what you're saying but still... @alias - before you post, have a good look around the rest of phpfreaks forums as there are better places to post. 'PHP Help' is for specific help with certain PHP scripts you already have. anyway - wherever this thread ends up - Alias, as the OP, why dont you go first and tell us? I'd personally love a website that's dedicated to banning Comic Sans (yes, i know there's one already...), Flash, Animated GIF's and the term "Web 2.0" (or any other "bandwagonbuzzwords") all rolled into one. Cheers Mark
-
Just can't figure out why this doesn't work
redbullmarky replied to Cannibal_Monkey's topic in PHP Coding Help
i'm not sure what youre trying to do here: [code] or else if ($b !=, <> $c) [/code] as you're using two 'not equal' operators. you only need one. try: [code] or else if ($b <> $c) [/code] [b]edit:[/b] in fact, you've got a few errors (sorry, i missed them first time looking...) [code] <?php $b = 1; $c = 1; if ($b == $c) { $a = "They are equal"; } else { $a = "They are not equal"; } echo $a; ?> [/code] you dont even need the second check. the first one, if $b == $c will check if $b is equal to $c. an else statement is enough to deal with the event that they're not equal, without the need to check if $b <> $c -
hmm its actually not bad (first impressions). the only things i'd say: 1) the links (nav) on the left look a bit 'text' ish. maybe you could do a little more with this - even if it just means getting rid of the '-' before each item 2) not sure whether its the screen i'm on as on a different computer today, but i can see it being a problem being able to read the white text properly towards the bottom of the page, as the gradient gets lighter.
-
the {} when use with a variable means that the variable's name can be dynamic/set on the fly. so: [code] <?php $first = 'dog'; $second = 'cat'; $animal{$first} = 'woof'; $animal{$second} = 'miaw'; echo $animaldog; echo $animalcat; ?> [/code]