I'm a pastor, designer, husband.
Great look at how/why @cameronstrang and the folks at @relevant started and have continued to move forward…be inspired! (via RELEVANT Magazine - The RELEVANT Story)
This video is HILARIOUS! Stuff nobody says, “Wow, this bazooka gum still has flavor” (by dontbethatguyfilms)
This is something that Pedro and I have been discussing lately… especially concerning our roles as execs at Camino De Vida.
Here area a few thoughts on Tension and the perspective we as leaders should have in mind while managing it:
1. Tension is a powerful platform to…
One of the best, most creative sites I’ve seen in a long, long time. Do yourself a favor…click the link.
Yes, monotony and routine can be truly wearisome. They transform our colorful, over-stimulated existence into black and white. But a task left undone SHOULD be a burden. If you make your system for productivity too productive, you will become anesthetized to your responsibilities.
Move mouse from top left to bottom left and travel through a still photo. Very cool! FocusMe by havve.net
AMAZING pics of dogs faces as they shake off water! Didn’t know they looked so strange. (via Portraits of Dogs as They Shake Off Water)
Thanks @john_white_jr for the link
Some of the very best and coolest space saving furniture I’ve seen…genius. (via Matroshka Furniture // Shoebox Dwelling)
“Romo has nine fourth quarter comebacks and 10 game-winning drives since becoming the full-time starter in 2006. He also has thrown 34 fourth quarter touchdowns, tied for third among NFL quarterbacks since 2006. And his 49 completed passes of 25 or more yards is tops among NFL quarterbacks since 2006.” - ESPN Dallas
Great animation video for ‘Is That a Fish In Your Ear?’ Also pretty informative. Check it. (via ChurchMediaDesign.tv)
It’s not whether you fall that counts, it’s whether you get back up! FUNNIEST ILLUSTRATION OF THAT EVER!!! (by benjaminbreit)
#1 – It is spiritual injustice and abuse when a leader cares more about WHAT his staff does than WHO they are becoming.
#2 – The best way to GET loyalty from your staff is to BE LOYAL to them. (And please understand that loyalty does not mean that everyone always agrees with everything you do and say! Loyal people will often ask great questions in the context of the right environment in order to better understand the decision and the heart behind it.)
#3 – The thought that “you cannot be friends with the people on your staff” is inconsistant with Scripture. It seems the Apostles were friends. And I could make a good case that the Apostle Paul was great friends with the people he did ministry with.
#4 – If the Bible is living and active, if Jesus is alive and if the Holy Spirit is as powerful as Scripture says He is then it is inconsistant for us to expect nothing to happen in our church services!
#5 – If a leader knows everything that is going on in his church…then there isn’t much going on in his church!
#6 – The biggest barrier that some church leaders face is that they spend so much time loving the Bride of Christ that they neglect their own bride and kids at home! (This month’s leadership podcast which will be out on Monday is on this subject!)
#7 – I cannot preach confession and repentance of sin if I am not practicing it!
#8 – Integrity is essential for success in life and ministry.
#9 – If you are making decisions that impact people on your staff without their input OR their ability to ask legitimate questions regarding the decisions that were made then it is eventually going to go bad for you.
#10 – It is insanity to assume that people can read your mind…expectations must be clearly defined and accurate feedback must be given often.
BONUS: Leadership is as easy as listening to God and then doing what He says!
I recently had a friend give me a copy of a paragraph titled "Easy-Running is an Oxymoron". I found the parallels to American Christianity frighteningly similar. So I modified the essay switching out the word 'runner' for 'Christian'. Do you think it is true?
"What is it about being a Christian that scares people so much? Why do people feel they have to put friendly modifiers next to being a Christian so everyone can feel good about it? Well, here's the ugly truth; Everyone shouldn't feel good about being a Christian. it's hard. It hurts; being a Christian requires sacrifice and heart and guts. Any attempt to water it down with feel-good adjectives is a slap in the face to those of us who still hold being a Christian sacred. In fact, if being a Christian is easy, odds are you're not a Christian at all."
These amazing images were made using an iPad, long-exposure photography and some clever programming. A collaboration between UK-based design consultancy Berg and Dentsu London yielded a brilliant way to "extrude" light into visual forms:
First we create software models of three-dimensional typography, objects and animations. We render cross sections of these models, like a virtual CAT scan, making a series of outlines of slices of each form. We play these back on the surface of the iPad as movies, and drag the iPad through the air to extrude shapes captured in long exposure photographs. Each 3D form is itself a single frame of a 3D animation, so each long exposure still is only a single image in a composite stop frame animation.
Still don't get it? Hit the jump for a demonstrative video.
(more...)Web applications have come a long way. They used to be amateur imitations of their desktop counterparts, with only one or two functions and not at all practical. But my, have these web apps grown. Web apps these days have become so powerful and useful that in some cases, they’ve begun to replace desktop software.
Desktop programs are great and all, but they don’t provide the same benefits as web apps that make use of cloud computing. With most web apps, you only need a browser and an internet connection to access all your data online. That beats having to install annoying programs any day. To give you a better sense of how useful web apps have become, I’ve compiled a list of web tools and apps that can very well replace some desktop programs. I hope you take the time to try them all out. You’ll be surprised how well they work.
Without further ado, here are some great web alternatives to the popular desktop programs we all love.
Replaces: Microsoft PowerPoint
Sliderocket is a fully functional presentation web app that allows you to create, manage, edit, and share presentations on the fly. It offers many of the same features present in PowerPoint and then some. Sliderocket is an awesome tool and if you want to read more about it, take a look at our in-depth review of Sliderocket.
Replaces: Microsoft Office, Adobe Acrobat
Acrobat.com is a suite of web applications by Adobe that replaces your office suite. The online suite includes services like Buzzword, Tables, and Presentation which replace Microsoft Word, Excel, and Powerpoint respectively. Acrobat.com also offers other features, allowing users to convert files into PDFs, hold online meetings, and collaborate with one another. All of its services are free (with some limitations), but users can subscribe to different plans for more features. Check out the pricing section for more details.
Replaces: Adobe Photoshop, Illustrator, Soundbooth
We have already covered a list of online image editors, and of that list, my favorite would have to be Aviary. The Aviary web suite offers powerful tools that allow you to edit images, vectors, and even audio! Take a look at the huge list of the tools included in their suite:
• Phoenix: Image Editor
• Toucan: Color Editor
• Myna: Audio Editor
• Peacock: Effects Editor
• Raven: Vector Editor
• Falcon: Image Markup
• Roc: Music Creator. Check out our in-depth review of Roc.
Replaces: Quicken
If you’re still using Quicken to manage your money, it’s time to toss it out and move on to the better solution: Mint.com. Mint is a very popular personal-finance tool that allows you to keep track your credit card transactions, balance your budget, and create charts or graphs to help you visualize your spending. Mint is the free and secure way to manage your money online. In fact, Mint has been so successful that the makers of Quicken and TurboTax purchased it in 2009. What are you waiting for? Hurry up and sign up!
Replaces: Desktop Gaming
Forget about your desktop gaming – why waste space when you can play awesome games online? Kongregate is an online gaming community with a library of over 30,000 flash games. Not only do you have access to a variety of games, but you can also gain points, chat, and unlock achievements for the games you play. Developers can upload their own games and even make money off ad revenue for their games! If you’re looking for more online games to replace desktop games, take a look at our game roundups.
Replaces: Video Editing Software
JayCut is a very easy to use and powerful online video editor. With Jaycut, you can create videos with the same tools used in desktop programs. Add clips, transitions, audio, effects, and more with their simple UI. When you finish editing a video, you can choose to download it or export it directly to YouTube. Export up to 20 videos a month with 2GB of storage under a free plan, or pay monthly for a better plan.
Replaces: Unzipping Software
Have you ever tried to open a compressed file only to find out you don’t have the right unzipping software to do the job? In comes WobZip, an online tool that helps you uncompress your files. It supports a variety of compression formats, including the popular ZIP, RAR, and 7z formats. You can upload a zipped file from your computer or direct WobZip to a URL. The best part? WobZip will scan the files using BitDefender to make sure there isn’t a nasty virus lurking around.
Replaces: File Conversion Software
Instead of downloading dozens of different programs to convert a file, you can always use the Zamzar, the free online file conversion tool. Can’t open a crucial .docx or .pptx file and your boss is screaming in your ear? No problem, just upload and convert your files using Zamzar. Zamzar supports dozens of image, document, video, and music formats and is the only tool you will ever need to convert files.
Replaces: TV Tuner Software
I’m a cheap guy who spends all his time on the computer. How could I watch my favorite TV shows without leaving my computer? Well, I could purchase a TV tuner and install their lame software or I could head to Hulu.com and watch my favorite shows for free. Hulu is a website that offers streaming video of popular TV shows and movies in the US. It is ad supported, but allows you to watch your favorite shows from the comfort of your computer. Although Hulu is a U.S. only website, there are ways to access Hulu from outside the U.S.
Replaces: Desktop Chat Clients
With Meebo, you can chat with your friends from anywhere as long as you have a browser and an internet connection. Meebo is an online tool that allows you to login to any major IM network, including AIM, MSN, GTalk, and Facebook. You don’t even need to create an account, just input your IM information and you’re ready to go. If you take the 20 seconds to set up a Meebo account, you can login to multiple accounts at once. This sure beats downloading and managing three IM programs at once, doesn’t it?
Replaces: Video Chat
TokBox is an online video chatting app that enables you to chat with up to 20 people for free. There are no downloads required, just sign up and start a video chat! Invite your friends via social networks or IM and set up a chat in just minutes. TokBox is free to use, but if you’d like more options, you can sign up for monthly plans. TokBox may be free, but you’re going to need your own microphone and webcam.
Replaces: iTunes
You may have a huge iTunes library, but what happens when you go out and forget to bring your iPod along? Moof is the solution. Moof is another web app that streams music online, but I think of it as an iTunes alternative. You can export your entire iTunes library as an .xml file and upload that to Moof, so you can have a full backup of your music online. Where does Moof get all its music from? Youtube. Yeah, I know, it’s a little disappointing, but the quality isn’t that bad. Don’t like Moof? Check out our roundup of the top apps for music streaming.
Replaces: Anti-Virus Software
While the ESET Online Virus scanner is a great alternative to Anti-Virus programs, you shouldn’t literally replace your Anti-Virus program. Think of this tool as a backup tool, in case your Anti-Virus software malfunctions. Made by the folks that brought you NOD32, the ESET online scanner uses the same threat signatures as NOD32 and allows you to scan your computer from your browser. It may take a while, but after the scan, suspicious files will be quarantined for you to restore or permanently delete. A great tool for your security toolbox.
Replaces: BitTorrent Client
When you don’t have access to a BitTorrent client on your computer, you can use the BitLet app to download your torrents. BitLet is a Java based file sharing protocol that allows you to download torrent files from your browser. Just upload a .torrent file from your computer or direct BitLet to the torrent URL and it’ll do the rest for you.
Replaces: Operating System
We’ve already covered dozens of web alternatives to desktop software, but why not go a bit further and include a web app that replaces your entire operating system? Meet iCloud, the future of operating systems. iCloud is a very slick web operating system that gives you access to hundreds of built in applications, including an office suite, a media player, a chat client, nifty games, and much more. You have 3 GB of free storage and can opt to buy more if needed. You can get everything you need in this web OS. For those of you interested in Web OSes, be sure to read our article about other operating systems that utilize cloud computing.
As the world turns to cloud computing, we’re only going to see more and more web apps that function like their desktop counterparts. I’ve only listed a few of the web alternatives to desktop software, and I’m sure there are many more out there. As these web applications become more powerful and appeal to the masses in terms of functionality, we may soon see a decline in desktop programs as we all move towards the web and the cloud. Is this the end of desktop software? Who knows, we’ll have to wait and see.
Do you use any web apps in place of desktop programs? What do you think is going to be the future for desktop programs? Share your comments below!
Like the intro. image? Get the high resolution vector at GraphicRiver.net by author iqbalbaskara.
5) CRAZY LOVE By: Francis Chan
“The God of the universe—the Creator of nitrogen and pine needles, galaxies and E-minor—loves us with a radical, unconditional, self-sacrificing love. And what is our typical response? We go to church, sing songs, and try not to cuss. Whether you’ve verbalized it yet or not…we all know somethings wrong. Does something deep inside your heart long to break free from the status quo?”
- Francis Chan
4) IT CAME FROM WITHIN By: Andy Stanley
“The heart. Not the organ that pumps blood through our veins, but that invisible, intangible place where we experience love, compassion, contempt, and jealousy. Like the physical heart, this other heart is highly susceptible to attack–by four nightmarish foes, in particular. Four malevolent forces that, left unchallenged, have the power to lay waste our homes, trample our careers, and leave our relationships in fiery ruins.”
- Andy Stanley
3) RADICAL By: David Platt
“It’s easy for American Christians to forget how Jesus said his followers would actually live, what their new lifestyle would actually look like. They would, he said, leave behind security, money, convenience, even family for him. They would abandon everything for the gospel. They would take up their crosses daily…
BUT WHO DO YOU KNOW WHO LIVES LIKE THAT? DO YOU?”
- David Platt
2) I AM NOT BUT I KNOW I AM By: Louie Giglio
“If you see life as your own one-act play and history as your story, you could be in for a rude awakening when the curtain finally closes on your tiny tale—and you discover that life wasn’t all about you after all.”
- Louie Giglio
1) DON’T WASTE YOUR LIFE By: John Piper
“It was not always plain to me that pursuing God’s glory would be virtually the same as pursuing my joy. Now I see that millions of people waste their lives because they think these paths are two and not one.”
- John Piper
*****I have read and loved each of these books. I highly recommend them to EVERY student/parent/volunteer in & around the Fuse* ministry. I also want to emphasize that each of these books point to the CROSS OF CHRIST & GOD’S WORD as the foundations that they are built upon. Additionally, ONLY TAKE THE TIME TO READ THESE BOOKS AS A SUPPLEMENT TO REGULAR TIME IN THE BIBLE. I CANNOT EMPHASIZE THIS STRONGLY ENOUGH.
I was recently introduced to an organization called One Day’s Wages, and I have to say I love what they’re doing. If you’re not familiar with One Day’s Wages, the organization describes itself as “an international grassroots movement dedicated to ending extreme global poverty” — a worthy cause if ever there was one. ODW’s name comes from the idea that even though the global poverty statistics, donating one day’s wages (about 0.4% of your yearly income) really can make a difference. For example:
Isn’t that great? I think so. Here’s ODW co-founder Eugene Cho talking about the movement:
The Movement of One Day’s Wage from One Day’s Wages on Vimeo.
One Day’s Wages recently partnered with one of my favorite musicians, Rocky Votolato, so I have to include that video too:
Rocky Votolato Joins One Day’s Wages from One Day’s Wages on Vimeo.
There are several ways you can get involved with One Day’s Wages and I invite you to check out the website to find out more. ODW is telling a great story about our generous God and his heart for the poor, and that’s a story worth being a part of. Check it out, get involved, spread the word, and download the iPhone app. Oh, and you can find ODW on Facebook, too.
Quote, “They can’t print what we paint. They print in pixels.” Up There is a gorgeously shot (and told) short documentary on the dying industry of big city, big scale, hand painted “out of home” advertising. I especially love the bits about apprenticeship and the passing on knowledge.
“Greet all the brethren with a holy kiss.” 1 Thess 5:2
We should greet everyone we meet with a ‘kiss’. Maybe not necessarily with our lips but definately with our attitude!
When we first meet someone we have the opportunity to bless them or leave them feeling ordinary.
We ‘kiss’ people when we enjoy them, are interested in them, smile at them, welcome them, introduce them to others, remember their name & interesting things about them, congratulate them & give to them rather than take from them.
Greet people with a ‘kiss’ today!
#1 – They come to you with problems…AND the solutions as to how to solve them.
Any fool can see a problem…but it takes a leader to examine WHY the problem is there and then WHAT to do about it. One of the greatest things about the team of people I serve with is most of the time when someone presents a problem they already know how to solve it. (AND…when they do not then they admit it instead of trying to fake their way through it!)
I’ve said this on this site before…but one of the best questions a leader can ask to the people he serves with when presented a problem is, “what do you think should be done about it?”
#2 – They are more upset about a mess up than you are.
When someone on staff here at NewSpring Church drops the ball I rarely have to get upset because they OWN what they do…and so they are as bothered about the mess up than I am on most cases.
Passion for what a person does is essential if they are going to be an excellent leader. AND…you can’t PAY someone to be passionate…either they are or they’re not!
#3 – Being around them actually fires you up.
People are contagious…attitudes and all.
One of the things I love about the team I serve with is that being around them and discussing church, ministry and life in general STIRS my passion for what I do.
People WILL contribute to the fire inside of you…they either throw water or gasoline on it…and one of the most common traits about leaders is that they are always throwing gas on other people’s fire.
I know some people think they always need to be “the devil’s advocate” in a meeting…which basically presents two problems…
Now…the truth SHOULD be told when a bad idea is brought up…which leads to the next one…
#4 – They don’t retreat inside their shell when conflict arises but rather embrace the tension in the room and will speak the truth in love until a resolution is reached.
One of the BIGGEST problems in church would today is UNRESOLVED CONFLICT among staff! A disagreement will take place…and because a person would rather just “make nice” rather than work towards a solution they will lie and say that things are fine and agree to an idea or philosophy that they do not completely buy into.
But…a leader will speak their minds…even if they know it is not going to be popular…and even if they know that in the end they will probably lose the argument…they would MUCH rather than have a clear conscience than be a coward.
When conflict arises in a room then I believe a GREAT solution is right around the corner. All people need to do is realize they are on the same team, working for the same goals and be willing to speak truthfully in respectful ways so that the best idea can be presented and be adopted.
#1 – Throwing money at a problem doesn’t always fix it; in fact, it may actually just cause it to be a more expensive problem!
#2 – A leader should care way more about HOW people are doing rather than HOW they are doing their work. (The leader that doesn’t care about the people he serves with is most likely using them for his glory, not God’s!)
#3 – Loyalty cannot be demanded…it must be earned.
#4 – If there isn’t a system to see what you want to see happen on a consistant basis…then it probably isn’t going to happen on a consistant basis.
#5 – If we don’t make integrity an issue then it WILL become an issue.
#6 – Getting a clearer vision of JESUS is essential to having a clearer vision for our church…we can’t be like Him if we don’t know Him.
#7 – People do not naturally drift into making radical commitments…they must be challenged to go there.
#8 – The risks don’t get easier…they become more intense.
#9 – If God has called you to do “it,” then you are empowered and gifted to do “it” as well!
#10 – The people God has placed to lead with you should be listened to and valued; after all, God speaks to them too!
Yes, as a matter of fact I am excited/pumped/stoked out of my mind…
About the NEXT sermon…
About the NEXT Sunday…
About the NEXT series…
I really don’t believe our church has achieved a fraction of all that God wants us to achieve…
AND that has me excited!
I talk about my excitement a lot…which seems to confuse some pastors. They ask, “why are you always talking about how pumped you are?”
The answer is simple…I AM PUMPED!
Hey pastor…if you want there to be excitement in the seats it has got to begin with some excitement in YOU!
You can’t expect the people you lead to be somewhere that you haven’t already been!
AND…let me be clear about this, the “excitement” can’t be fake…it can’t be manufactured…it’s got to be real, it’s got to come from a WHITE HOT vision from God that absolutely sets your soul on fire!
The way I see it we all have a choice…we can be excited about what God USED to do in our church…OR we can be excited about what we feel like He is ABOUT to do!
And while we should be THANKFUL for all He has done in the past we should not live there!
My advice in regards to how to create excitement…
#1 – Get alone with God
#2 – Ask Him to reveal Himself to you in ways you’ve never seen/experienced before
#3 – Read the book of Acts over and over
#4 – Read the Gospels over and over
#5 – Hang out with people who are on fire (NOT the ones who have fire extinguishers)
#6 – DO NOT APOLOGIZE for your passion…EVER!!! (I would MUCH rather be accused of being too passionate than being apathetic!!!)
The first step to an ON FIRE CHURCH is an ON FIRE LEADER…and with ALL of the power and resources of the Holy Spirit, God’s Word…AND the amazing technology He has given us in today’s world…there is NO EXCUSE why we should not be PUMPED UP about the potential of HIS CHURCH accomplishing SO MUCH MORE than we could EVER imagine!
If, like us you are a fan of soft & subtle brushes then you’re going to love this new set. The focus on this set is to give you the tools to build up realistic textures in your designs, by using multiple brushes on multiple layers.
This set is completely free, you can use them anyway without the need of giving credit. The brushes are best used on projects meant for web use. They can be used elsewhere, but the way we made them, and the size of them make them ideal for use in web design rather than print.
The brushes all fade out around the edges, just so you don’t get any messy looking edges or straight lines in your grunge work. There’s a massive variety of textures & surfaces, 42 of them in total, all at different sizes and shapes. This set is a follow up to our popular first set.
The sort of thing you can expect from this set is really soft; Chalk, Concrete, Denim, Fabric, and Paper textures. All fixed up nicely and ready to use.
The set also contains some “harsher” brushes, such as some chalk strokes and some paint roller brushes. These kind of brushes are perfect for borders or masking layers.
Obviously you can use these however you want, but our best advice is to build up layers of texture in a subtle way. Play around with the various brushes – and build up the realistic textures by varying colours, opacity and placement. What you should aim for is something that looks natural and organic.
If you find this set useful we’d like you to pass them on to other who you think might appreciate it. You can do this easily using the share links below the post, or share the short URL below, as well as using the full URL in the address bar.
The URL to share is: http://bit.ly/dn4K4J
Important, you must link to this article when sharing the set, you must not upload these files to your own server when sharing.
Download Free Brushes | .zip Format | 9.3 mb
In this article, I’ll introduce you to the fundamentals of PHP. We’ll focus on using PHP to access Web services and on turning static HTML pages into dynamic ones by retrieving data from the Web and by showing different content depending on what the user has entered in a form or requested in the URL.
You won’t come out a professional PHP developer, but you’ll be well on your way to building a small page that uses Web services. You can find a lot of great PHP info on the Web, and most of the time you will end up on PHP.net itself. But I was asked repeatedly on several hack days and competitions to write this quick introduction article, so here it is.
[By the way, did you know we have a brand new free Smashing Email Newsletter? Subscribe now and get fresh short tips and tricks on Tuesdays!]
PHP is a server-side language that has become a massive success for three reasons:
To run PHP locally on your computer, you’ll need a local server with PHP enabled. The easiest way to do this is to download and install MAMP for OS X or XAMPP for Windows. Once you’ve installed any of these packages, you can start using PHP. Simply create a file named index.php in the htdocs folder of your MAMP or XAMPP installation.
In this file, type (or copy and paste) the following:
<?php $myname = 'Chris'; echo '<p>This is PHP</p>'; echo "<p>My name is $myname</p>" echo '<p>My name in another notation is still '.$myname.'</p>'; ?>
If you open this file in a browser by accessing your XAMPP or MAMP installation (via http://localhost/index.php or http://localhost:8888/index.php), you should see the following:
This is PHP My name is Chris My name in another notation is still Chris
But you won’t see that. The problem is that the third line does not end in a semicolon (;). This is an error. Depending on your PHP installation, you’ll get either an error message or simply nothing. If you get nothing, then find the file named php_error.log on your hard drive, and open it. It will tell you what went wrong.
The first thing to remember, then, is that every line of PHP has to end in a semicolon. If we fix this problem, we get this result:
<?php $myname = 'Chris'; echo '<p>This is PHP</p>'; echo "<p>My name is $myname</p>"; echo '<p>My name in another notation is still '.$myname.'</p>'; ?>
We can see here the first few important features of PHP:
<?php and end with ?>. Anything between these two commands is interpreted as being PHP and returned to the document as HTML.;), or else it is an error.$, not with the var keyword as you do in JavaScript (this is where it gets confusing with jQuery and Prototype).echo command. There is also a print command, which does almost the same, so you can use that, too.myname as “Chris”. To print it with the echo command surrounded by other text, you need to either embed the variable name in a text with quotation marks or concatenate the string with a full stop when you use single quotation marks. This is line 3 and 4: they do the same thing but demonstrate the different syntax. Concatenation is always achieved with a full stop, never with a + as you do in JavaScript.You can jump in and out of PHP anywhere in the document. Thus, interspersing PHP with HTML blocks is totally fine. For example:
<?php $origin = 'Outer Space'; $planet = 'Earth'; $plan = 9; $sceneryType = "awful"; ?> <h1>Synopsis</h1> <p>It was a peaceful time on planet <?php echo $planet;?> and people in the <?php echo $sceneryType;?> scenery were unaware of the diabolical plan <?php echo $plan;?> from <?php echo $origin;?> that was about to take their senses to the edge of what could be endured.</p>
This outputs the following:
Are you with me so far? To show something on the screen, particularly numbers or a string, we use echo. To show more complex structures, we need loops or specialized debugging methods.
You can define arrays in PHP using the array() method:
$lampstack = array('Linux','Apache','MySQL','PHP');If you simply want to display a complex data type like this in PHP for debugging, you can use the print_r() command:
$lampstack = array('Linux','Apache','MySQL','PHP');
print_r($lampstack);This gives you all the information, but it doesn’t help you structure it as HTML:
For this, you need to access the elements with the array counter. In PHP this is done with the [] brackets:
<ul>
<?php
$lampstack = array('Linux','Apache','MySQL','PHP');
echo '<li>Operating System:'.$lampstack[0] . '</li>';
echo '<li>Server:' . $lampstack[1] . '</li>';
echo '<li>Database:' . $lampstack[2] . '</li>';
echo '<li>Language:' . $lampstack[3] . '</li>';
?>
</ul>See this demo in action.
This is, of course, stupid programming because it is not flexible. If a computer is able to the dirty work for you, make it do it. In this case, we can define two arrays and use a loop:
<ul>
<?php
$lampstack = array('Linux','Apache','MySQL','PHP');
$labels = array('Operating System','Server','Database','Language');
$length = sizeof($lampstack);
for( $i = 0;$i < $length;$i++ ){
echo '<li>' . $labels[$i] . ':' . $lampstack[$i] . '</li>';
}
?>
</ul>The for loop works the same as it does in JavaScript. The only difference is that you read the size of an array not with array.length but with sizeof($array).
Again, this example is not very clever because it assumes that both the $lampstack and the $labels array are of the same length and in the same order. Instead of using this, I’d use an associated array:
<ul>
<?php
$lampstack = array(
'Operating System' => 'Linux',
'Server' => 'Apache',
'Database' => 'MySQL',
'Language' => 'PHP'
);
$length = sizeof($lampstack);
$keys = array_keys($lampstack);
for( $i = 0;$i < $length;$i++ ){
echo '<li>' . $keys[$i] . ':' . $lampstack[$keys[$i]] . '</li>';
}
?>
</ul>
The function array_keys() gives you back all the keys of an array as an array itself. This way, we can display the keys and the values at the same time.
A shorter way to achieve the same principle, and which works with both arrays and objects, is to use the foreach() loop construct:
<ul>
<?php
$lampstack = array(
'Operating System' => 'Linux',
'Server' => 'Apache',
'Database' => 'MySQL',
'Language' => 'PHP'
);
foreach( $lampstack as $key => $stackelm ){
echo '<li>' . $key . ':' . $stackelm . '</li>';
}
?>
</ul>This is the shortest way to display a complex construct. But it will fail when $lampstack is not an array. So, checking for sizeof() is still a good plan. You can do this with a conditional.
Conditionals are “if” statements, both in the English language and in almost any programming language I know. So, to test whether an array is safe to loop over, we could use the sizeof() test:
<ul>
<?php
$lampstack = array(
'Operating System' => 'Linux',
'Server' => 'Apache',
'Database' => 'MySQL',
'Language' => 'PHP'
);
if( sizeof($lampstack) > 0 ){
foreach( $lampstack as $key => $stackelm ){
echo '<li>' . $key . ':' . $stackelm . '</li>';
}
}
?>
</ul>Common conditionals are:
if($x > 10 and $x < 20)$x bigger than 10 and less than 20?if(isset($name))$name been defined?if($name == 'Chris')$name have the value of "Chris"?if($name == 'Chris' or $name == 'Vitaly')$name have the value of "Chris" or "Vitaly"?Cool, but what if we want to make this reusable?
To make a task even more generic, we can write a function. In this case, we put the loop and the testing in a function and simply call it with different arrays:
<?php
function renderList($array){
if( sizeof($array) > 0 ){
echo '<ul>';
foreach( $array as $key => $item ){
echo '<li>' . $key . ':' . $item . '</li>';
}
echo '</ul>';
}
}
$lampstack = array(
'Operating System' => 'Linux',
'Server' => 'Apache',
'Database' => 'MySQL',
'Language' => 'PHP'
);
renderList($lampstack);
$awfulacting = array(
'Natalie Portman' => 'Star Wars',
'Arnold Schwarzenegger' => 'Batman and Robin',
'Keanu Reaves' => '*'
);
renderList($awfulacting);
?>Note that functions do not begin with a dollar sign.
We've already seen most of the magic of PHP. The rest is all about building functions to do all kinds of things: converting strings, sorting arrays, finding things in other things, accessing the file system, setting cookies and much more, each of which does one and only one thing right. I keep catching myself writing complex functions in PHP, only to realize from looking at the documentation that a native function already exists for it.
Let's start playing with the Web in PHP… or, more precisely, playing with information that comes from the browser's address bar or with forms that we can re-use. To get parameters from the current URL, we use the global $_GET array. So, if you call the index.php script with http://localhost/index.php?language=fr&font=large, you can change the display and locale by checking for these settings. The language parameter will be available as $_GET['language'], and the font parameter as $_GET['font']:
<?php
$name = 'Chris';
// if there is no language defined, switch to English
if( !isset($_GET['language']) ){
$welcome = 'Oh, hello there, ';
}
if( $_GET['language'] == 'fr' ){
$welcome = 'Salut, ';
}
switch($_GET['font']){
case 'small':
$size = 80;
break;
case 'medium':
$size = 100;
break;
case 'large':
$size = 120;
break;
default:
$size = 100;
break;
}
echo '<style>body{font-size:' . $size . '%;}</style>';
echo '<h1>'.$welcome.$name.'</h1>';
?>This means we can now send URL parameters to change the behavior of this document:
http://localhost:8888/index.phphttp://localhost:8888/index.php?language=frhttp://localhost:8888/index.php?language=fr&font=largeNotice that predefining a set of values that are acceptable for a certain parameter is always best. In the earlier example, we may as well have set the font size in pixels as a parameter and then written that to the document—but then we would have needed a good validation script to prevent end users from sending bad values or even malicious code through the parameter.
Sending malicious code via a parameter without filtering is called cross-site scripting (XSS), and it is one of the big security problems of the Web. You can prevent it by not printing out the values of parameters, and instead using them in comparisons, and by using the filters provided by PHP.
Say you want to allow users to enter data in a form that you will display later on. Make sure to filter out the results:
<?php
$search_html = filter_input(INPUT_GET, 's',
FILTER_SANITIZE_SPECIAL_CHARS);
$search_url = filter_input(INPUT_GET, 's',
FILTER_SANITIZE_ENCODED);
?>
<form action="index.php" method="get">
<div>
<label for="search">Search:</label>
<input type="text" name="s" id="search"
value="<?php echo $search_html;?>">
</div>
<div class="bar"><input type="submit" value="Make it so"></div>
</form>
<?php
if(isset($_GET['s'])){
echo '<h2>You searched for '.$search_html.'</h2>';
echo '<p><a href="index.php?search='.$search_url.'">Search again.</a></p>';
}
?>See this filtering example in action. Without the filters, attackers could send parameters like index.php?s="<script>, which would execute third-party code on your website. With filtering, this malicious code is converted to HTML entities.
If you want to use POST as the method to send the data in your form, then the PHP variables will change accordingly to $_POST for the array and INPUT_POST for the filter.
PHP comes with a lot of file functions that allow you to read and write files from the hard drive or to load content from the Web. I've found, however, that for security reasons a lot of hosting companies disable them, especially when you try to read content from a third-party resource. The workaround is to use cURL to load information from the Web. cURL is a tool that allows you to make HTTP requests to retrieve information—a kind of browser in command-line form. I've written a detailed post about cURL and how to use it. Here, then, is a simple use case to illustrate:
<?php // define the URL to load $url = 'http://www.smashingmagazine.com'; // start cURL $ch = curl_init(); // tell cURL what the URL is curl_setopt($ch, CURLOPT_URL, $url); // tell cURL that you want the data back from that URL curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // run cURL $output = curl_exec($ch); // end the cURL call (this also cleans up memory so it is // important) curl_close($ch); // display the output echo $output; ?>
If you run this in the browser, you'll see Smashing Magazine's home page.
You could also strip out content from the data:
<?php
// define the URL to load
$url = 'http://www.smashingmagazine.com';
// start cURL
$ch = curl_init();
// tell cURL what the URL is
curl_setopt($ch, CURLOPT_URL, $url);
// tell cURL that you want the data back from that URL
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// run cURL
$output = curl_exec($ch);
// end the cURL call (this also cleans up memory so it is
// important)
curl_close($ch);
// if a filter parameter with the value links was sent
if($_GET['filter'] == 'links'){
// get all the links from the document and show them
echo '<ul>';
preg_match_all('/<a[^>]+>[^<\/a>]+<\/a>/msi',$output,$links);
foreach($links[0] as $l){
echo '<li>' . $l . '</li>';
}
echo'</ul>';
// otherwise just show the page
} else {
echo $output;
}
?>If you open this in your browser, you'll get all of the links from Smashing Magazine and no other content.
Nowadays, though, we are more likely to use APIs than to load websites this way, which is why we need a way to convert the XML and JSON that are returned from Web services into PHP-friendly data.
The easiest way to deal with XML content in PHP is to use the SimpleXML functions of PHP. Using these, we can turn a bunch of XML into a PHP object and loop over it. To show Smashing Magazine's RSS feed, we can do the following:
<?php
$url = 'http://rss1.smashingmagazine.com/feed/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
$data = simplexml_load_string($output);
echo '<ul>';
foreach($data->entry as $e){
echo '<li><a href="' . $e->link[0]['href'] .
'">'.$e->title.'</a></li>';
}
echo '</ul>';
?>The simplexml_load_string() function turns the XML document into a PHP object with arrays. How did I figure out to loop over data->entry and get the href via link[0]['href']? Simple. I did a print_r($output) and checked the source of the document by hitting Cmd + U in Firefox on my Mac. That showed me that this entry is an array. I then did a print_r($e) in the loop to see all the properties of every entry. If it is part of the @attributes array, then you need to use the [] notation.
That's all. The only stumbling block you will encounter is CDATA blocks and namespaces in SimpleXML. Stuart Herbert has a good introduction to these two issues in this article.
The data format JSON is the low-fat alternative to XML. It is far less complex (e.g. no namespaces), and if you work in a JavaScript environment, it is native to the browser. This makes it very fast and easy to use, and for this reason it has started to become a popular data format for APIs. In essence, JSON is a JavaScript object. For example, I could write the LAMP stack example as follows:
{"lampstack":
{
"operatingsystem" : "Linux",
"server" : "Apache",
"database" : "MySQL",
"language" : "PHP"
}
}You can convert this to PHP using the json_decode() method, and get it back as a PHP object:
<?php
$json = '{
"lampstack":
{
"operatingsystem":"Linux",
"server":"Apache",
"database":"MySQL",
"language":"PHP"
}
}';
print_r(json_decode($json));
?>One API that returns JSON is the Twitter trends API. If you load the API's URL with cURL and do a print_r() after json_decode(), you get the following back:
<?php $url = 'http://search.twitter.com/trends.json'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); $data = json_decode($output); print_r($data); ?>
stdClass Object
(
[trends] => Array
(
[0] => stdClass Object
(
[name] => #nowplaying
[url] => http://search.twitter.com/search?q=%23nowplaying
)
[1] => stdClass Object
(
[name] => #Didntwannatellyou
[url] => http://search.twitter.com/search?q=%23Didntwannatellyou
)
[2] => stdClass Object
(
[name] => #HappyBirthdayGagaBR
[url] => http://search.twitter.com/search?q=%23HappyBirthdayGagaBR
)
[3] => stdClass Object
(
[name] => Justin Bieber
[url] => http://search.twitter.com/search?q=%22Justin+Bieber%22
)
[4] => stdClass Object
(
[name] => #FreakyFactSays
[url] => http://search.twitter.com/search?q=%23FreakyFactSays
)
[5] => stdClass Object
(
[name] => #YouSoGangsta
[url] => http://search.twitter.com/search?q=%23YouSoGangsta
)
[6] => stdClass Object
(
[name] => I ?
[url] => http://search.twitter.com/search?q=%22I+%E2%99%A5%22
)
[7] => stdClass Object
(
[name] => #MeMyselfandTime
[url] => http://search.twitter.com/search?q=%23MeMyselfandTime
)
[8] => stdClass Object
(
[name] => #2010yearofJonas
[url] => http://search.twitter.com/search?q=%232010yearofJonas
)
[9] => stdClass Object
(
[name] => Easter
[url] => http://search.twitter.com/search?q=Easter
)
)
[as_of] => Sun, 28 Mar 2010 19:31:30 +0000
)
You can then use a simple loop to render the current trends as an unordered list:
<?php
$url = 'http://search.twitter.com/trends.json';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
$data = json_decode($output);
echo '<h2>Twitter trending topics ('.$data->as_of.')</h2>';
echo '<ul>';
foreach ($data->trends as $t){
echo '<li><a href="'.$t->url.'">'.$t->name.'</a></li>';
}
echo '</ul>';
?>Let's do a quick example using all of the things we've learned so far: a simple search interface for the Web.
Using Yahoo's YQL, it is pretty easy to do a Web search for "cat" with the command select * from search.web where query="cat" sent to the YQL endpoint. You can define JSON as the return format, and the rest means you simply enhance the earlier form example:
<?php
$search_html = filter_input(INPUT_GET, 's', FILTER_SANITIZE_SPECIAL_CHARS);
$search_url = filter_input(INPUT_GET, 's', FILTER_SANITIZE_ENCODED);
?>
<form action="index.php" method="get">
<div>
<label for="search">Search:</label>
<input type="text" name="s" id="search"
value="<?php echo $search_html;?>">
<input type="hidden" name="demo" value="17">
<input type="submit" value="Make it so">
</div>
</form>
<?php
if(isset($_GET['s'])){
echo '<h2>You searched for '.$search_html.'</h2>';
$yql = 'select * from search.web where query="'.$search_url.'"';
$url = 'http://query.yahooapis.com/v1/public/yql?q='.
urlencode($yql).'&format=json&diagnostics=false';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
$data = json_decode($output);
echo '<ul>';
foreach ($data->query->results->result as $r){
echo '<li><h3><a href="'.$r->clickurl.'">'.$r->title.'</a></h3>'.
'<p>'.$r->abstract.' <span>('.$r->dispurl.')</span></p></li>';
}
echo '</ul>';
echo '<p><a href="index.php?search='.$search_url.'&demo=17">Search again.</a></p>';
}
?>One thing people keep asking about is how to send information from PHP to JavaScript and back. This can be done in a few ways.
href of a link or populate a hidden form field. The other solution of course is to use AJAX.echo statement.header() function and json_encode(), you can send data back to the browser as JavaScript, which allows us to use it as a src attribute of a script node.For example, to get Smashing Magazine's RSS feed as a JavaScript object, you could do the following:
<?php
header('Content-type: text/javascript');
$url = 'http://rss1.smashingmagazine.com/feed/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
$data = simplexml_load_string($output);
$data = json_encode($data);
echo 'var smashingrss='.$data;
?>You could then use this in a JavaScript block:
<script src="http://icant.co.uk/articles/phpforhacks/index.php?demo=18"></script> <script>alert(smashingrss.title);</script>
Using header() and json_encode(), you could do any complex conversion and filtering in PHP and re-use it in JavaScript.
I hope this gives you an idea of what PHP is and how you can use it to access Web services and to build your own APIs to re-use in JavaScript. Using PHP for the Web boils down to a few tricks:
simplexml_load_string() and json_decode();print_r();foreach();$_GET[] and $_POST[] arrays to re-use form data and URL parameters;A lot of documentation is out there, and your best bet is to go directly to the PHP home page to read or download the documentation. Check out the user comments in particular, because that is where the real gems and examples of implementation appear.
(al)
© Christian Heilmann for Smashing Magazine, 2010. | Permalink | 167 comments | Add to del.icio.us | Digg this | Stumble on StumbleUpon! | Tweet it! | Submit to Reddit | Forum Smashing Magazine
Post tags: PHP
Brad Cooper is our student pastor here at NewSpring Church…and is one of the most gifted/anointed leaders on the planet. Since he has been with us our student ministry has grown from about 125 to over 1,000 kids every weekend…and the number of committed, sold out volunteers has multiplied dramatically.
Anytime people hear about what is going on in our student ministry they always ask me, “So, what did you do?” It’s pretty simple…
#1 – I hired a leader, someone I could trust, someone I would not have to stand beside and make decisions for. (Some pastors won’t do this because they need to be needed!) AND…I made sure he was able to assemble the team he wanted around him…I did not hire for him!
#2 – I made sure he was resourced. We don’t do car washes or bake sales…and we never have. I’ve read that over 85% of the decisions to follow Christ happen before the age of 18…if THAT ISN’T a ripe mission field then I don’t know what is. Churches don’t make the senior adults do a bake sale if they want to go somewhere…why in the heck do they make the students do it? (By the way…it’s ALWAYS been this way, so please don’t email me with, “What did you guys do when you were small?” We took care of our students…period!)
#3 – I make sure he understands the vision of our church. I spend time with him…we go to lunch, he sends me texts that encourage the heck out of me. If he ever has a question about vision…he asks me.
#4 – I spend time with the students. Every year I am our “camp speaker” for The Gauntlet…and it is SO refreshing for me to get to spend that time with the students…it is literally one of my favorite weeks EVERY YEAR!
#5 – I don’t try to do youth ministry! When I did youth ministry it was SO cool to play DC Talk, Carman and Degarmo & Key…for those that may not have figured this out yet…those days are GONE! I am NOT the expert in youth ministry…and I don’t try to be!!!
#6 – I ask our student ministry staff lots of questions! BECAUSE, like it or not…what they are doing right now is going to be what the church is doing in the next 10 to 15 years!
#7 – I give him permission to fail…as long as he fails by trying great things then I don’t have a problem with it!
Those are just a few things that “I’ve” done…which hopefully you see isn’t much!!! Hope that helps!
Nowhere in the New Testament are we told to "build the Kingdom of God" or to "expand it". Such talk is a failure to understand what the Kingdom is. And such a misunderstanding is likely what leads us to build empires in the name of God. From the examples of the first disciples, we are to:
- announce the Kingdom's arrival in Jesus (Acts 1, 8, 19, 20, 28)
- help people receive it, i.e. enter it (1 Cor. 6, Gal. 5, Heb 12, James 2)
- teach people to live in it (Matt. 5-7, Eph. 2, Col. 1)
- call them participate in God's rule by making their places of domain reflect God's dominion-- by loving and serving instead of dominating, by acting to end injustice, etc (1 Thess. 2, Rev. 5)
- look for the culmination of the Kingdom when Christ returns. (1 Cor. 15)
Until we understand it, all that we do "for the Kingdom" will degenerate into human Babel-building towers.
We spend an awful lot of time discussing applications and software on Mac.AppStorm, and today we wanted to take a slight departure to investigate a few physical Mac setups. After all, you need a relaxing and inspiring environment in which to use your computer!
Our roundup will take a look at 50 visually inspiring, gorgeous Mac setups. Some are very minimal, others are wonderfully cluttered. They may not all use the most powerful Mac hardware, but will hopefully give you some great ideas for improving your desk and workspace. Enjoy!
I hope you’ve enjoyed this collection – I always love taking a look at where and how other people work. Here are a few links for further inspiration and some brilliant workspace setups:
We’ll be inviting you all to submit a photo of your own workspace later this week, so stay tuned for more information!
It actually gets funnier if you pay more attention to the men heads in babies bodies and imagine them as real living people. I hope you all enjoy these as much as I did, and if you got yourself a picture of you and a kid, try it and send it over to us, we would love to laugh at you. I mean, with you. Don't forget to visit the source, Manbabies.com for tons of these! Cheers. ;)
Hello, everyone! I'm Paulo Gabriel, a 25 year old designer from Porto Alegre, Brazil. I have worked as a webdesigner since 2006, but websites and blogs have been a hobbie for me since 1999. Here in Abduzeedo, I try to bring only the hot stuff for you... and hope that all of you enjoy my posts! For more cool stuff, you may also follow me on Twitter.
This morning I received an email from the Catalyst Conference that featured an interview with the founder of the Behance Network, which is a huge creative arts community, that i find to be a great resource. The interview peeked my interest because I am always curious who in the design industry has a faith base, or is a follower of Jesus.
That was not very clear in the video, but what I found is some amazing insight it to creative work flow and why our staff team, and many others have great ideas that turn into nothing. This quote struck me:
The most successful teams have and equal amount of big idea dreamers and implementers.
This is so true, and I have seen it happen on my own staff team. As we balance out the dreamers by adding more implementers, I have seen us turn a corner on what is accomplished, but we haven’t had to sacrifice creativity and dreams.
Check out the 2 parts below, it is well worth the listen!
You can also find that Catalyst Podcast interview here.(mp3 link)
“What do you think” is one of the greatest questions any leader can ask.
EVER!
Let me explain…
Someone on your staff comes to you with a problem (and ANYONE can point out a problem, it doesn’t take a genius to do that.) They present the issue to you in detail and then ask you what to do…
The WORSE thing you can do is solve the problem (unless you are an insecure leader…or you are one of those people who just need to be needed!)
The BEST thing you can do is ask, “what do you think?”
BECAUSE…if you have a leader on your team then you need to understand when they present you with a problem they aren’t actually asking you to solve it but rather are merely wanting your permission to do what they already know should be done.
They don’t want your information…they want your permission to handle the problem.
“What do you think” will tell you what type of people you have on your team…because, believe it or not…a leader ALWAYS has an opinion!
“What do you think” will tell you if the person is actually a leader or not…because if a person is always presenting problems but never has a solution then they are probably not a leader.
“What do you think” will tell you if the person has caught on to the vision or not…because if they DO have answers but none of them are in line with where the vision of the church is heading then you have an issue that need to be talked about.
“What do you think” will tell you if the person has innovative ideas…or if they are lazy and are always reverting back to “what we’ve always done.”
“What do you think” will give you an opportunity to coach and cast vision…because they might have an answer, it might be wrong…and taking 30 seconds or so to coach through that and explain things more completely will do nothing but strengthen your church.
“What do you think” is one of the best questions a leader can ask when presented with a problem/opportunity…you church will be more effective and more people will be reached when it is not limited to just your own ideas!
Michael Horton says that “evangelicalism is out-liberaling liberalism.” In this clip, he explains why, and what we should learn from the mistakes and successes of mainline denominations.
In this interview series, Mars Hill PR Director Nick Bogardus interviews Dr. Michael Horton. For more information and resources from Dr. Horton, check out White Horse Inn.