Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged c



1 ... 17 18 19 20 21 ... 147
This function, when placed in a theme's 'functions.php' file will insert a custom id attribute into the '<li>' elements generated by a 'wp_nav_menu' function based on the title of the element. It will make a WordPress page or category into a hyphen s...
0 1892 posted 13 years ago by SFLWebDev
These two snippets together, the first in the .htaccess file, and the second in your PHP create an elegantly simple solution to arbitrary URLs with php. For a breakdown and example check out the link. Don't want to follow the link, how about the q...
0 2521 posted 13 years ago by FatFolderDesigner
Basic template for Joomla 2.5 with 3 columns
1 2533 posted 13 years ago by gradamedia
Function to get wordpress post/page slug to be used on for custom class etc
0 2469 posted 13 years ago by Farhan
Show html on homepage and different html on other pages
0 1615 posted 13 years ago by morktron
Created by Quirol to avoid TOTAL errors
0 2273 posted 13 years ago by mrtonix
- Mage 1.7* flag storeswitcher - images/flags/flag_[storeview_name].png
0 1040 posted 13 years ago by WGenie
Create variable named PHP variables. Having dynamically named variables can be helpful when dealing with loops and arrays. For example instead of having seven if () statements for handling seven individual days of the week, you could reduce it to one...
0 1203 posted 13 years ago by dialeleven
This class is used to store global information for general access throughout the application.
0 1376 posted 13 years ago by ryantxr
Function to prevent sql injection in Like queries, where the characters '_' and '%' can be dangerous.
0 2839 posted 13 years ago by TimoZachi
This is a callback example that can be used to conditionally display blocks on specific pages. In this example, I load all nodes with a specific field and return false if the value of that field is equal to the user id of the logged in user. The sni...
0 1441 posted 13 years ago by chasecrawford
Sometimes it’s helpful to ONLY get numeric characters. Phone numbers, age — whatever your little PHP heart desires.
0 2730 posted 13 years ago by satie83
replace /app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php
0 1497 posted 13 years ago by bogdandev
Adds an excerpt field to pages when editing. Goes in functions.php
1 1312 posted 13 years ago by klagraff
Once in a while we need to check whether a string contains substring, some other string or characters or a value. Checking for existence of a string (or substring) inside another string is easier than it might seem. The following article describes ho...
0 1581 posted 13 years ago by satie83
This function removes a directory and its contents. Use with careful, no undo!
1 1711 posted 13 years ago by fackz
This function allow you ti have multiple parameters in your query string. Ex : id=12&name=Doe&id=42&nickname=Monster
0 2405 posted 13 years ago by MonsterDev
Search recursively some value in array with the key name
0 1498 posted 13 years ago by MonsterDev
Takes your table name and key=>value array of values and returns the text for inserting into a MySQL database. Automatically surrounds strings with single quotes.
1 1706 posted 13 years ago by lemcoe9
A simple function for converting a php timestamp (integer) to a user frindly format. Examples: 10 Seconds ago, 4 Days ago. The function converts timestamp to U.F. format only if the timestamp is earlyer than one week. Otherwise it uses $dateFormat ar...
0 1988 posted 13 years ago by TimoZachi
Nice implementation of Blowfish for storing user passwords to prevent decryption when for example the user database is compromised. Origin: Burak Guzel@Nettuts
2 2894 posted 13 years ago by ptodorov
Gets the constants from a class using reflection.
0 2720 posted 13 years ago by ryantxr
Adds a method to the jQuery Validation plugin (http://bassistance.de/jquery-plugins/jquery-plugin-validation/) to return false if the field equals a specified string
0 2587 posted 13 years ago by StevenW721
list all files in directory and subdirectory
1 2036 posted 13 years ago by ne7son
Auto language selection based on site languages and user preferences.
0 1241 posted 13 years ago by Narayon
Insert this in functions.php to remove WordPress version from being output in the header source code
0 2356 posted 13 years ago by klagraff
A regular expression for removing <br> and <br> (case insensitive) between HTML elements if there is no content between the HTML elements. It was written for fixing extra line spaces created in a WordPress visual editor after the content of the visu...
0 2365 posted 13 years ago by pumpkinthehead
Useful for adding Custom Post types to navigation this will list all custom post type posts
1 2513 posted 13 years ago by i-am-andy
Manually print out a category-navigation in a magento frontend template. within "stristr" you can enter an array of category-ids that should be hidden from display.
0 2489 posted 13 years ago by luxmedia
1 ... 17 18 19 20 21 ... 147